mfilt
(To be removed) Multirate filter
Syntax
hm = mfilt.structure(input1,input2,...)
Description
hm = mfilt.structure(input1,input2,...)
returns the object 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 StructureDescription
of Resulting Multirate FilterCoefficient Mapping Support in realizemdlCascade multirate filters to form another filterSupported
Cascaded integrator-comb decimatorNot supported
Cascaded integrator-comb interpolatorNot supported
Multirate Farrow filterSupported.
Overlap-add FIR polyphase interpolatorNot supported
Direct-form FIR polyphase decimatorSupported
Direct-form FIR polyphase interpolatorSupported
Direct-form FIR polyphase sample rate converterSupported
Direct-form transposed FIR polyphase decimatorSupported
FIR hold interpolatorNot supported
IIR decimatorSupported
IIR interpolatorSupported
FIR Linear interpolatorSupported
IIR wave digital filter decimatorSupported
IIR wave digital filter interpolatorSupported
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]);
Introduced in R2011a