firgr语法:
b = firgr(n,f,a,w)
b = firgr(n,f,a,'hilbert')
b = firgr(m,f,a,r),
b = firgr({m,ni},f,a,r)
b = firgr(n,f,a,w,e)
b = firgr(n,f,a,s)
b = firgr(n,f,a,s,w,e)
b = firgr(...,'1')
b = firgr(...,'minphase')
b = firgr(..., 'check')
b = firgr(...,{lgrid}),
[b,err] = firgr(...)
[b,err,res] = firgr(...)
b = firgr(n,f,fresp,w)
b = firgr(n,f,{fresp,p1,p2,...},w)
b = firgr(n,f,a,w)
Types 1-4 linear phase:
Type 1 is even order, symmetric
Type 2 is odd order, symmetric
Type 3 is even order, antisymmetric
Type 4 is odd order, antisymmetric
Minimum phase
Maximum phase
Minimum order (even or odd)
Extra ripple
Maximal ripple
Constrained ripple
Single-point band (notching and peaking)
Forced gain
Arbitrary shape frequency response curve filters
设计一个带通滤波器
示例:
Fs = 96000;
Fn = Fs/2;
f = [0 17000 20000 28000 31000 Fn]/Fn;
a = [0 0 1 1 0 0];
w = [5 1 5];
b = firgr(44, f, a, w, 'minphase');
hfvt = fvtool(b,'Fs', Fs,...
'MagnitudeDisplay', 'Magnitude (dB)',...
'legend','on');
legend(hfvt,'Min Phase');
设计一低通滤波器 脉冲响应为最小相位
Fs = 88200;
Fn = Fs/2;
f = [0 20065 22050 Fn]/Fn;
a = [1 1 0 0];
w = [800000 80];
b = firgr(88, f, a, w, 'minphase');
hfvt = fvtool(b,'Fs', Fs,...
'MagnitudeDisplay', 'Magnitude (dB)',...
'legend','on');
legend(hfvt,'Min Phase');