function M=melbanka(p,Fvz,NFFT)


NFFT=fix(NFFT/2);

mel_max=hz2mel(Fvz/2);

vzdalenost_filtru=mel_max/(p+1);

m=zeros(1,p);

m(1)=vzdalenost_filtru;

for i=2:p
   m(i)=m(i-1)+vzdalenost_filtru;
end

m=[0 m mel_max];

b=mel2hz(m);

fftscale=Fvz/NFFT/2;

meze_nfft=b/fftscale;

M=zeros(p,NFFT);


for i=2:p+1
   h1=round(meze_nfft(i-1))+1 ;
   h2=round(meze_nfft(i)) ;
   h3=round(meze_nfft(i+1)) ;
   f=h1:h2;
   M(i-1,f)=(f-h1)/(h2-h1);
   f=h2:h3;
   M(i-1,f)=(f-h3)/(h2-h3);   
end