hm = mfilt.structure(input1,input2,...)
hm = mfilt.structure(input1,input2,...) returns the object hm of type structure. As with dfilt and adaptfilt objects, you must include the structure string 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.
Each of the following multirate filter structures has a reference page of its own.
Filter Structure String
Description of Resulting Multirate Filter
Cascade multirate filters to form another filter
Cascaded integrator-comb decimator
Cascaded integrator-comb interpolator
Multirate Farrow filter
Overlap-add FIR polyphase interpolator
Direct-form FIR polyphase decimator
Direct-form FIR polyphase interpolator
Direct-form FIR polyphase sample rate converter
Direct-form transposed FIR polyphase decimator
FIR hold interpolator
FIR Linear interpolator
IIR wave digital filter decimator
IIR wave digital filter interpolator
To create a copy of an mfilt object, use the copy method.
h2 = copy(hd)
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);