📄 windowedlinearphasefirdigital.m
字号:
%fir1 implements the classical method of windowed linear-phase FIR digital
%filter design [1]. It designs filters in standard lowpass,highpass,
%bandpass, and bandstop configurations. By default the filter is normalized
%so that the magnitude response of the filter at the center frequency
%of the passband is 0 dB.
%%fir2 is used for windowed filters with arbitrary frequency response
%%The Remez FIR Filter Design block implements the Parks-McClellan algorithm
%%to design and apply a linear-phase filter with an arbitrary multiband magnitude
%%response.
%%This is a design a band-pass filter at frecuencies of 30Hz and 3500Hz
%%using both methods and same order of filters , and compares the
%%frecuencies response
N=44;Fs=11020;Fny=Fs/2;
Bfir1= fir1(N,[30 3500]/Fny);
Bfir2 = fir2(N,[0 10 30 3500 3600 Fny]/Fny,[0 0 1 1 0 0]);
Bremez = remez(N,[0 10 30 3500 3600 Fny]/Fny,[0 0 1 1 0 0]);
F=0:10:5000;
Hfir1=abs(freqz(Bfir1,1,F,Fs));
Hfir2=abs(freqz(Bfir2,1,F,Fs));
Bremez=abs(freqz(Bremez,1,F,Fs));
semilogy(F,Hfir1,'r',F,Hfir2,'g',F,Hremez,'m');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -