| Filter Design Toolbox | ![]() |
Construct a direct form FIR polyphase sample rate converter mfilt object
Syntax
Description
hm = mfilt.firsrc(l,m,num)
constructs a direct-form FIR polyphase sample rate converter. l specifies the interpolation factor. It must be an integer and when omitted in the calling syntax it defaults to 2.
m is the decimation factor. It must be an integer. If not specified, m defaults to 1. If l is also not specified, m defaults to 3 and the overall rate change factor is 2/3.
You specify the coefficients of the FIR lowpass filter used for sample rate conversion in num. If omitted, a lowpass Nyquist filter with gain l and cutoff frequency of
/max(l,m) is used by default.
Combining an interpolation factor and a decimation factor lets you use mfilt.firsrc to perform fractional interpolation or decimation on an input signal. Using an mfilt.firsrc object applies a rate change factor defined by l/m to the input signal. For proper rate changing to occur, l and m must be relatively prime--the ratio l/m cannot be reduced to a ratio of smaller integers.
Input Arguments
The following table describes the input arguments for creating hm.
mfilt.firsrc 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.firsrc objects. The next table describes each property for an mfilt.firsrc filter object.
Examples
An example of common audio rate change processing--change the sample rate of high end audio (48 KHz) to compact disc sample rate (44.1 KHz). Making this conversion requires a rate change factor of 0.91875, or l = 147 and m = 160.
l = 147; m = 160; % Interpolation/decimation factors. hm = mfilt.firsrc(l,m); % We use the default FIR filter fs = 48e3; % Original sampling frequency: 48 KHz n = 0:10239; % 10240 samples, 0.213 seconds long 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)) % Plot original sampled at 48 KHz hold on % Plot fractionally decimated signal (44.1 KHz) in red stem(n(1:45)/(fs*l/m),y(13:57),'r','filled') xlabel('Time (sec)');ylabel('Signal Value')
See Also
mfilt.firfracinterp, mfilt.firfracdecim, mfilt.firinterp,
| mfilt.firinterp | mfilt.firtdecim | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |