|
楼主 |
发表于 2007-11-19 20:34
|
显示全部楼层
补充
%MELBANKM determine matrix for a mel-spaced filterbank [X,MN,MX]=(P,N,FS,FL,FH,W)
%
% Inputs: p number of filters in filterbank
% n length of fft
% fs sample rate in Hz
% fl low end of the lowest filter as a fraction of fs (default = 0)
% fh high end of highest filter as a fraction of fs (default = 0.5)
% w any sensible combination of the following:
% 't' triangular shaped filters in mel domain (default)
% 'n' hanning shaped filters in mel domain
% 'm' hamming shaped filters in mel domain
%
% 'z' highest and lowest filters taper down to zero (default)
% 'y' lowest filter remains at 1 down to 0 frequency and
% highest filter remains at 1 up to nyquist freqency
%
% If 'ty' or 'ny' is specified, the total power in the fft is preserved.
%
% Outputs: x a sparse matrix containing the filterbank amplitudes
% If x is the only output argument then size(x)=[p,1+floor(n/2)]
% otherwise size(x)=[p,mx-mn+1]
% mn the lowest fft bin with a non-zero coefficient
% mx the highest fft bin with a non-zero coefficient
%
% Usage: f=fft(s); f=fft(s);
% x=melbankm(p,n,fs); [x,na,nb]=melbankm(p,n,fs);
% n2=1+floor(n/2); z=log(x*(f(na:nb)).*conj(f(na:nb)));
% z=log(x*abs(f(1:n2)).^2);
% c=dct(z); c(1)=[];
%
% To plot filterbanks e.g. plot(melbankm(20,256,8000)')
% |
|