Interpolated FIR filter from filter specification
[h,g] = ifir(l,type,f,dev)
[h,g,d] = ifir(l,type,f,dev)
[...] = ifir(...,str)
hd = ifir(d)
hd = design(d,'ifir',designoption1,value1,designoption2,value2,...)
[h,g] = ifir(l,type,f,dev) designs
a periodic filter
l is the interpolation factor. It also finds
an image-suppressor filter
g(z), such that the
cascade of the two filters forms an efficient implementation that
meets the desired response. This response is specified by
with band edge frequencies contained in vector
This is done while not exceeding the maximum deviations or ripples
(linear) specified in vector
type is a string with
lowpass designs or
'high' for highpass designs.
a two-element vector with passband and stopband edge frequency values.
For narrowband lowpass filters and wideband highpass filters,
1. For wideband lowpass filters and narrowband
highpass filters, specify
f so that
dev is a two-element vector that contains
the peak ripple or deviation (linear) allowed for both the passband
and the stopband.
ifir design algorithm achieves an efficient
design in the sense that it reduces the total number of multipliers
required. To do this, the design problem is broken into two stages.
In the first stage, the filter is upsampled to achieve the stringent
specifications without using many multipliers. In the second stage,
the filter removes the images created when upsampling the previous
[h,g,d] = ifir(l,type,f,dev) returns
d that is connected in parallel with the
both wideband lowpass and highpass filters. This is necessary to obtain
the desired response.
[...] = ifir(...,str) uses the string specified
str to choose the algorithm level of optimization
used. Possible values for
for a tradeoff between design speed and filter order optimization.
'advanced' option can result in substantial
filter order reduction, especially for
hd = ifir(d) designs an FIR filter from
d, using the interpolated FIR method.
a cascade of two filters that act together to meet the specifications
d. The resulting filter is particularly efficient,
having a low number of multipliers. However, if
that a single-stage filter is more efficient than the default two-stage
design, it returns
hd as a single-stage filter.
only linear phase filters. Generally,
an advanced optimization algorithm to create highly efficient FIR
hd as a single-rate
or a multirate
mfilt object, based on the filter
specifications you provide.
hd = design(d,'ifir',designoption1,value1,designoption2,value2,...) returns
an interpolated FIR filter using the design options you specify.
To determine the available design options, use
designopts with the specification object
and the design method as input arguments:
This example shows how to use the function
ifir to design a narrowband lowpass filter.
[h,g]=ifir(6,'low',[.12 .14],[.01 .001]); H = dfilt.dffir(h); G = dfilt.dffir(g); hfv = fvtool(H,G); legend(hfv,'Periodic Filter','Image Suppressor Filter'); Hcas = cascade(H,G); hfv2 = fvtool(Hcas); legend(hfv2,'Overall Filter');
This example shows how to use
ifir to design a wideband highpass filter.
[h,g,d]=ifir(6,'high',[.12 .14],[.001 .01]); H = dfilt.dffir(h); G = dfilt.dffir(g); Hb1 = cascade(H,G); % Branch 1 Hb2 = dfilt.dffir(d); % Branch 2 Hoverall = parallel(Hb1,Hb2); % Overall wideband highpass hfv = fvtool(Hoverall); legend(hfv,'Overall Filter');
This example shows how to use
fdesign.highpass to design a lowpass and a wideband highpass filter. After designing the filters, use
FVTool to plot the response curves for both.
fpass = 0.2; fstop = 0.24; d1 = fdesign.lowpass(fpass, fstop); hd1 = design(d1,'ifir'); fstop = 0.2; fpass = 0.25; astop = 40; apass = 1; d2 = fdesign.highpass(fstop,fpass,astop,apass); hd2 = design(d2,'ifir'); fvtool(hd1,hd2)