mfilt
(To be removed) Multirate filter
Compatibility
mfilt
will be removed in a future release.
See dsp.CICDecimator
, dsp.CICInterpolator
, dsp.FIRDecimator
, dsp.FIRInterpolator
, dsp.FilterCascade
, dsp.FarrowRateConverter
, dsp.FIRRateConverter
, dsp.IIRHalfbandDecimator
,
or dsp.IIRHalfbandInterpolator
instead.
Syntax
hm = mfilt.
structure
(input1,input2,...)
Description
hm = mfilt.
returns the object structure
(input1,input2,...)hm
of type structure
.
As with dfilt
objects, you must include the
structure
to construct a multirate filter object. You
can, however, construct a default multirate filter object of a given structure by not
including input arguments in your calling syntax.
Multirate filters include decimators and interpolators, and fractional decimators and fractional interpolators where the resulting interpolation or decimation factor is not an integer.
Structures
Each of the following multirate filter structures has a reference page of its own.
Filter Structure | Description of Resulting Multirate Filter | Coefficient Mapping Support in |
---|---|---|
Cascade multirate filters to form another filter | Supported | |
Cascaded integrator-comb decimator | Not supported | |
Cascaded integrator-comb interpolator | Not supported | |
Multirate Farrow filter | Supported. | |
Overlap-add FIR polyphase interpolator | Not supported | |
Direct-form FIR polyphase decimator | Supported | |
Direct-form FIR polyphase interpolator | Supported | |
Direct-form FIR polyphase sample rate converter | Supported | |
Direct-form transposed FIR polyphase decimator | Supported | |
FIR hold interpolator | Not supported | |
IIR decimator | Supported | |
IIR interpolator | Supported | |
FIR Linear interpolator | Supported | |
IIR wave digital filter decimator | Supported | |
IIR wave digital filter interpolator | Supported |
Copying mfilt Objects
To create a copy of an mfilt
object, use
the copy
method.
h2 = copy(hd)
Note
The syntax hd2 = hd
copies only the object
handle. It does not create a new object. hd2
and hd
are
not independent. If you change the property value for one of the two,
such as hd2
, you are changing the property for
both.
Examples
Decimation by a factor of two. Convert input sampled at 48 kHz to 24 kHz:
Fs = 4.8e4; t =0:1/Fs:1-(1/Fs); x = cos(2*pi*4000*t); Hm=mfilt.firdecim(2); % Note cutoff frequency of 1/2 normalized frequency fvtool(Hm); % Note the group delay of 34 samples fvtool(Hm,'analysis','grpdelay'); y = filter(Hm,x); % Note delay in output is consistent with 36/2 stem(y(1:48),'markerfacecolor',[0 0 1]);
Using existing coefficients to decimate a signal by a factor of two:
M = 2; % Decimation factor b = firhalfband('minorder',.45,0.0001); Hm = mfilt.firdecim(M,b); % Decimate a signal which consists of the sum of 2 sinusoids. N = 160; x = sin(2*pi*.05*[0:N-1]+pi/3)+cos(2*pi*.03*[0:N-1]+pi/3); y = filter(Hm,x);
Note
Multirate filters can also have complex coefficients. For example,
you can specify complex coefficients in the argument num
passed
to the filter structure. This works for all multirate filter structures.
m = 2; num = [0.5 0.5+1j*0.2]; Hm = mfilt.firdecim(m, num); y = filter(Hm, [1:10]);
Version History
Introduced in R2011a