Variable FIR Interpolation
Libraries:
DSP System Toolbox /
Filtering /
Multirate Filters
Description
The Variable FIR Interpolation block performs an efficient polyphase FIR interpolation with a tunable interpolation factor. You can update the interpolation factor and the filter coefficients in the block dialog box or through an input port while the simulation is running.
Conceptually, the FIR interpolator (as shown in the schematic) consists of an upsampler
followed by an FIR antiimaging filter, which is usually an approximation of an ideal
bandlimited interpolation filter. To design an FIR antiimaging filter, use the designMultirateFIR
function. The upsampler upsamples each channel of the input
to a higher rate by inserting L–1 zeros between samples. The FIR filter
that follows filters each channel of the upsampled data. The resulting discretetime signal
has a sample rate that is L times the original sample rate.
However, the actual block algorithm implements a directform FIR polyphase structure, an efficient equivalent of the combined system depicted in the diagram. For more details, see Algorithms.
The block supports C and C++ code generation.
Examples
Ports
Input
Output
Parameters
Block Characteristics
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

Algorithms
The FIR interpolation filter is implemented efficiently using a polyphase structure.
To derive the polyphase structure, start with the transfer function of the FIR 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}_{\mathrm{max}}}{z}^{{L}_{\mathrm{max}}}+{b}_{2{L}_{\mathrm{max}}}{z}^{2{L}_{\mathrm{max}}}+\mathrm{...}+{b}_{N{L}_{\mathrm{max}}+1}{z}^{(N{L}_{\mathrm{max}}+1)}\right)+\\ {z}^{1}\left({b}_{1}+{b}_{{L}_{\mathrm{max}}+1}{z}^{{L}_{\mathrm{max}}}+{b}_{2{L}_{\mathrm{max}}+1}{z}^{2{L}_{\mathrm{max}}}+\mathrm{...}+{b}_{N{L}_{\mathrm{max}}+2}{z}^{(N{L}_{\mathrm{max}}+1)}\right)+\\ \begin{array}{c}\vdots \\ {z}^{({L}_{\mathrm{max}}1)}\left({b}_{{L}_{\mathrm{max}}1}+{b}_{2{L}_{\mathrm{max}}1}{z}^{{L}_{\mathrm{max}}}+{b}_{3{L}_{\mathrm{max}}1}{z}^{2{L}_{\mathrm{max}}}+\mathrm{...}+{b}_{N}{z}^{(N{L}_{\mathrm{max}}+1)}\right)\end{array}\end{array}$$
L_{max} is the number of polyphase components, and its value equals the maximum interpolation factor.
You can write H(z) as:
$$H(z)={E}_{0}({z}^{{L}_{\mathrm{max}}})+{z}^{1}{E}_{1}({z}^{{L}_{\mathrm{max}}})+\mathrm{...}+{z}^{({L}_{\mathrm{max}}1)}{E}_{({L}_{\mathrm{max}}1)}({z}^{{L}_{\mathrm{max}}})$$
E_{0}(z^{Lmax}), E_{1}(z^{Lmax}), ..., E_{Lmax1}(z^{Lmax}) are polyphase components of the FIR filter H(z).
During simulation, the algorithm reconstructs the filter H(z) based on the current interpolation factor L.
Rewriting H(z) in terms of the interpolation factor L.
$$H(z)={E}_{0}({z}^{L})+{z}^{1}{E}_{r}({z}^{L})+\mathrm{...}+{z}^{(L1)}{E}_{(L1)r}({z}^{L})$$
where, r = L_{max}/L.
Conceptually, the FIR interpolation filter contains an upsampler followed by an FIR lowpass filter H(z).
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 adder with a commutator switch. The switch starts on the first branch 0 and moves in the counterclockwise direction, each time receiving one sample from each branch. The interpolator effectively outputs L samples for every one input sample it receives. Hence the sample rate at the output of the FIR interpolation filter is Lfs.
References
[1] Orfanidis, Sophocles J. Introduction to Signal Processing. Upper Saddle River, NJ: PrenticeHall, 1996.