Upsample, filter, and downsample input signals
DSP System Toolbox / Filtering / Multirate Filters
The FIR Rate Conversion block resamples the discretetime input such that its sample period is M/L times the input sample period (T_{si}). M is the integer value you specify for the Decimation factor parameter, and L is the integer value you specify for the Interpolation factor parameter. The block treats each column of the input as a separate channel and resamples the data in each channel independently over time.
Conceptually, the rate converter combines an FIR interpolator followed by an FIR decimator.
The following schematic contains an upsampler, a combined antiimaging and antialiasing
FIR filter, and a downsampler. To design an FIR filter which acts as a combined
antiimaging and antialiasing FIR filter, use the designMultirateFIR
function.
The rate converter does the following:
Upsamples the input to a higher rate by inserting
L−1
zeros between input
samples.
Passes the upsampled data through an FIR filter.
Downsamples the filtered data to a lower rate by discarding
M1
consecutive samples following each
sample that the block retains.
Note that the actual block algorithm implements a polyphase structure, an efficient equivalent of the combined system depicted in the diagram. For more details, see Algorithms.
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

The FIR rate converter is implemented efficiently using a polyphase structure.
To derive the polyphase structure, start with the transfer function of the FIR filter: This FIR filter is a combined antiimaging and antialiasing filter.
$$H(z)={b}_{0}+{b}_{1}{z}^{1}+\mathrm{...}+{b}_{N}{z}^{N}$$
N+1 is the length of the FIR filter.
You can rearrange this equation as follows:
$$H(z)=\begin{array}{c}\left({b}_{0}+{b}_{L}{z}^{L}+{b}_{2L}{z}^{2L}+\mathrm{..}+{b}_{NL+1}{z}^{(NL+1)}\right)+\\ {z}^{1}\left({b}_{1}+{b}_{L+1}{z}^{L}+{b}_{2L+1}{z}^{2L}+\mathrm{..}+{b}_{NL+2}{z}^{(NL+1)}\right)+\\ \begin{array}{c}\vdots \\ {z}^{(L1)}\left({b}_{L1}+{b}_{2L1}{z}^{L}+{b}_{3L1}{z}^{2L}+\mathrm{..}+{b}_{N}{z}^{(NL+1)}\right)\end{array}\end{array}$$
L is the number of polyphase components, and its value equals the interpolation factor that you specify.
You can write this equation as:
$$H(z)={E}_{0}({z}^{L})+{z}^{1}{E}_{1}({z}^{L})+\mathrm{...}+{z}^{(L1)}{E}_{L1}({z}^{L})$$
E_{0}(z^{L}), E_{1}(z^{L}), ..., E_{L1}(z^{L}) are polyphase components of the FIR filter H(z).
Conceptually, the FIR rate converter contains an upsampler, followed by a combined antiimaging, antialiasing FIR filter H(z), which is followed by a downsampler.
Replace H(z) with its polyphase representation.
Here is the multirate noble identity for interpolation.
Applying the noble identity for interpolation moves the upsampling operation to after the filtering operation. This move enables you to filter the signal at a lower rate.
You can replace the upsampling operator, delay block, and the adder with a commutator switch. To account for the downsampler that follows, the switch moves in steps of size M. The switch receives the first sample from branch 0 and moves in the counter clockwise direction, each time skipping M−1 branches.
As an example, consider a rate converter with L set to 5 and M set to 3. The polyphase components are E_{0}(z), E_{1}(z), E_{2}(z), E_{3}(z), and E_{4}(z). The switch starts on the first branch 0, skips branches 1 and 2, receives the next sample from branch 3, then skips branches 4 and 0, receives the next sample from branch 2, and so on. The sequence of branches from which the switch receives the data sample is [0, 3, 1, 4, 2, 0, 3, 1, ….].
The rate converter implements the L/M conversion by first applying the interpolation factor L to the incoming data, and using the commutator switch at the end to receive only 1 in M samples, effectively accounting for the dowsampling factor M. Hence, the sample rate at the output of the FIR rate converter is Lfs/M.
[1] Orfanidis, Sophocles J. Introduction to Signal Processing. Upper Saddle River, NJ: PrenticeHall, 1996.
firceqrip
 firgr
 firhalfband
 firnyquist
dsp.FIRInterpolator
 dsp.FIRDecimator
 dsp.FIRHalfbandInterpolator
 dsp.FIRHalfbandDecimator
 dsp.CICCompensationInterpolator
 dsp.CICCompensationDecimator