Filter Design Toolbox    
mfilt.firsrc

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.

Input Argument
Description
l
Interpolation factor for the filter. l specifies the amount to increase the input sampling rate. It must be an integer. When you do not specify a value for l it defaults to 2.
num
Vector containing the coefficients of the FIR lowpass filter used for interpolation. When num is not provided as an input, mfilt.firsrc uses a lowpass Nyquist filter with gain equal to l and cutoff frequency equal to /max(l,m) by default.
m
Decimation factor for the filter. m specifies the amount to reduce the sampling rate of the input signal. It must be an integer. When you do not specify a value for m it defaults to 1. When l is unspecified as well, m defaults to 3.

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.

Name
Values
Description
FilterStructure

Reports the type of filter object, such as a decimator or fractional integrator. You cannot set this property--it is always read only and results from your choice of mfilt object.
Numerator

Vector containing the coefficients of the FIR lowpass filter used for interpolation.
RateChangeFactors
[l,m]
Reports the decimation (m) and interpolation (l) factors for the filter object. Combining these factors results in the final rate change for the signal.
NonProcessedSamples
0
Shows the values of the samples that were not processed during the filtering operation. Note that this is not the number of samples that were not processed.
ResetBeforeFiltering
'off' or 'on'
Determine whether the filter states get 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. Note that the starting values are always zero thus are reset to zero when ResetBeforeFiltering is on. ResetBeforeFiltering returns to zero any state that the filter changes during processing. States that the filter does not change are not affected.
States

Stored conditions for the filter, including values for the interpolator and comb states.
NumSamplesProcessed

Returns the number of samples processed during filtering. As a check, the number of samples reported processed plus the number of nonprocessed samples should be the total number of input samples.

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.

See Also

mfilt.firfracinterp, mfilt.firfracdecim, mfilt.firinterp,

mfilt.firdecim


  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