Direct-form FIR polyphase fractional decimator
hm = mfilt.firfracdecim(l,m,num)
mfilt.firfracdecim will be removed in a
future release. Use
hm = mfilt.firfracdecim(l,m,num) returns
a direct-form FIR polyphase fractional decimator. Input argument
the interpolation factor.
l must be an integer.
When you omit
l in the calling syntax, it defaults
m is the decimation factor. It must be an
integer. If not specified, it defaults to l+1.
num is a vector containing the coefficients
of the FIR lowpass filter used for decimation. If you omit
a lowpass Nyquist filter of gain l and cutoff frequency of π/
is used by default.
By specifying both a decimation factor and an interpolation
factor, you can decimate your input signal by noninteger amounts.
The fractional decimator first interpolates the input, then decimates
to result in an output signal whose sample rate is
the input rate. By default, the resulting decimation factor is 2/3
when you do not provide
the calling syntax. Specify
l smaller than
The following table describes the input arguments for creating
Interpolation factor for the filter. It must be an integer.
When you do not specify a value for
Vector containing the coefficients of the FIR lowpass
filter used for decimation. When
Decimation factor for the filter.
Every multirate filter object has properties that govern the
way it behaves when you use it. Note that many of the properties are
also input arguments for creating
The next table describes each property for an
Reports the type of filter object, such as a decimator
or fractional decimator. You cannot set this property — it
is always read only and results from your choice of
|Integers||Contains the number of input data samples processed without generating an output sample. The default value is 0.|
Vector containing the coefficients of the FIR lowpass filter used for interpolation.
Reports the decimation
Determines whether the filter states are restored to
their starting values for each filtering operation. The starting values
are the values in place when you create the filter if you have not
changed the filter since you constructed it.
Stored conditions for the delays between each interpolator phase, the filter states, and the states at the output of each phase in the filter.
The number of states is (
firfracdecim, perform a fractional
decimation by a factor of 2/3. This is one way to downsample a 48
kHz signal to 32 kHz, commonly done in audio processing.
l = 2; m = 3; % Interpolation/decimation factors. hm = mfilt.firfracdecim(l,m); % We use the default fs = 48e3; % Original sample freq: 48 kHz. n = 0:10239; % 10240 samples, 0.213 second long % signal x = sin(2*pi*1e3/fs*n); % Original signal, sinusoid at 1 kHz y = filter(hm,x); % 9408 samples, still 0.213 seconds stem(n(1:49)/fs,x(1:49)); hold on; % Plot original signal sampled % at 48 kHz stem(n(1:32)/(fs*l/m),y(13:44),'r','filled') % Plot decimated % signal at 32 kHz xlabel('Time (sec)');
As shown, the plot clearly demonstrates the reduced sampling frequency of 32 kHz.
Fliege, N.J., Multirate Digital Signal Processing, John Wiley & Sons, Ltd., 1994