[Matlab]FIR濾波器係數,脈衝響應,頻率響應的關係
阿新 • • 發佈:2019-01-29
%傅立葉變換,時域卷積等效於頻域乘積 %濾波操作在時域表現為輸入訊號餘濾波器脈衝響應的卷積 %從頻域上看濾波器操作表現為,輸入訊號的傅立葉變換和脈衝響應的傅立葉變換做乘積 %對於FIR濾波器,濾波器係數即為脈衝響應 %因此,對於FIR濾波器,係數的FFT變換即為濾波器的頻率響應曲線 close all clear Fpass = 0.45; % Passband Frequency Fstop = 0.55; % Stopband Frequency Apass = 1; % Passband Ripple (dB) Astop = 60; % Stopband Attenuation (dB) h = fdesign.lowpass('fp,fst,ap,ast', Fpass, Fstop, Apass, Astop); Hd = design(h, 'equiripple', ... 'MinOrder', 'any', ... 'StopbandShape', 'flat'); Hlp = Hd.Numerator; fvtool(Hlp); HLP=fft(Hlp); HLP=abs(HLP); F=linspace(0,2,length(Hlp)); N=ceil(length(F)/2); plot(F(1:N),20*log10(HLP(1:N))); grid on;