| Filter Design Toolbox | ![]() |
Construct a direct-form FIR polyphase fractional decimator filter object
Syntax
Description
hm = mfilt.firfracdecim(l,m,num)
returns a direct-form FIR polyphase fractional decimator. Input argument l is the interpolation factor. l must be an integer. When you omit l in the calling syntax, it defaults to 2. 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 omitted, a lowpass Nyquist filter of gain l and cutoff frequency of
/max(l,m) 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 l/m of the input rate. By default, the resulting decimation factor is 2/3 when you do not provide l and m in the calling syntax. Specify l smaller than m for proper decimation.
Input Arguments
The following table describes the input arguments for creating hm.
mfilt.firfracdecim Object Properties
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 mfilt.firfracdecim objects.The next table describes each property for an mfilt.firfracdecim filter object.
Example
To demonstrate 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 sampling frequency: 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)');
See Also
mfilt.firsrc, mfilt.firfracinterp, mfilt.firinterp, mfilt.firdecim
References
Fliege, N.J., Multirate Digital Signal Processing, John Wiley & Sons, Ltd., 1994
| mfilt.firdecim | mfilt.firfracinterp | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |