iir digital filter
hz=iir(n,ftype,fdesign,frq,delta)
[p,z,g]=iir(n,ftype,fdesign,frq,delta)
:n positive number witn inteher value, the filter order. : :ftype string specifying the filter type, the possible values are:
‘lp’ for low-pass, ‘hp’ for high pass, ‘bp’ for band pass and ‘sb’ for stop band.
: :delta 2-vector of error values for cheb1, cheb2, and ellip filters where only delta(1) is used for cheb1 case, only delta(2) is used for cheb2 case, and delta(1) and delta(2) are both used for ellip case. 0<delta(1),delta(2)<1
- for cheb1 filters 1-delta(1)<ripple<1 in passband
- for cheb2 filters 0<ripple<delta(2) in stopband
- for ellip filters 1-delta(1)<ripple<1 in passband and 0<ripple<delta(2) in stopband
: :p vector of transformed filter zeros. : :z vector of transformed filter poles. : :g a scalar: transformed filter gain. :
function which designs an iir digital filter using `analog filter`_ designs and `bilinear transformation`_ .
hz=iir(3,'bp','ellip',[.15 .25],[.08 .03]);
[hzm,fr]=`frmag`_(hz,256);
`plot2d`_(fr',hzm')
`xtitle`_('Discrete IIR filter band pass 0.15 < fr < 0.25 ',' ',' ');
q=`poly`_(0,'q'); //to express the result in terms of the delay operator q=z^-1
hzd=`horner`_(hz,1/q)
//Poles Zeros Gain filter representation
[p,z,g]=iir(3,'bp','ellip',[.15 .25],[.08 .03]);
g*`poly`_(z,'z')/`poly`_(p,'z')