Main Content

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 Structure

Description of Resulting Multirate Filter

Coefficient Mapping Support in realizemdl

mfilt.cascade

Cascade multirate filters to form another filter

Supported

mfilt.cicdecim

Cascaded integrator-comb decimator

Not supported

mfilt.cicinterp

Cascaded integrator-comb interpolator

Not supported

mfilt.farrowsrc

Multirate Farrow filter

Supported.

mfilt.fftfirinterp

Overlap-add FIR polyphase interpolator

Not supported

mfilt.firdecim

Direct-form FIR polyphase decimator

Supported

mfilt.firinterp

Direct-form FIR polyphase interpolator

Supported

mfilt.firsrc

Direct-form FIR polyphase sample rate converter

Supported

mfilt.firtdecim

Direct-form transposed FIR polyphase decimator

Supported

mfilt.holdinterp

FIR hold interpolator

Not supported

mfilt.iirdecim

IIR decimator

Supported

mfilt.iirinterp

IIR interpolator

Supported

mfilt.linearinterp

FIR Linear interpolator

Supported

mfilt.iirwdfdecim

IIR wave digital filter decimator

Supported

mfilt.iirwdfinterp

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