# dsp.FIRInterpolator

Perform polyphase FIR interpolation

## Description

The `dsp.FIRInterpolator`

System object™ performs an efficient polyphase interpolation using an integer upsampling factor
*L* along the first dimension.

Conceptually, the FIR interpolator (as shown in the schematic) consists of an upsampler
followed by an FIR anti-imaging filter, which is usually an approximation of an ideal
band-limited interpolation filter. The coefficients of the anti-imaging filter can be
specified through the `Numerator`

property, or can be automatically
designed by the object using 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 discrete-time signal has a sample rate that is
*L* times the original sample rate.

Note that the actual object algorithm implements a direct-form FIR polyphase structure, an efficient equivalent of the combined system depicted in the diagram. For more details, see Algorithms.

To upsample an input:

Create the

`dsp.FIRInterpolator`

object and set its properties.Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

This object supports C/C++ code generation and SIMD code generation under certain conditions. For more information, see Code Generation.

## Creation

### Syntax

### Description

returns an
FIR interpolator with an interpolation factor of 3. The object designs the FIR filter
coefficients using the `firinterp`

= dsp.FIRInterpolator`designMultirateFIR(3,1)`

function.

returns an FIR interpolator with the integer-valued
`firinterp`

= dsp.FIRInterpolator(`L`

)`InterpolationFactor`

property set to `L`

. The
object designs its filter coefficients based on the interpolation factor
`L`

that you specify while creating the object using the
`designMultirateFIR(L,1)`

function. The designed filter corresponds
to a lowpass with a cutoff at π/`L`

in radial frequency units.

returns an FIR interpolator with the `firinterp`

= dsp.FIRInterpolator(`L`

,`'Auto'`

)`NumeratorSource`

property set to
`'Auto'`

. In this mode, every time there is an update in the
interpolation factor, the object redesigns the filter using the design method specified in
`DesignMethod`

.

returns an FIR interpolator with the `firinterp`

= dsp.FIRInterpolator(`L`

,`num`

)`InterpolationFactor`

property set
to `L`

and the `Numerator`

property set to
`num`

.

returns an FIR interpolator with the `firinterp`

= dsp.FIRInterpolator(`L`

,`method`

)`InterpolationFactor`

property set
to `L`

and the `DesignMethod`

property set to
`method`

. When you pass the design method as an input, the
`NumeratorSource`

property is automatically set to
`'Auto'`

.

returns an FIR interpolator object with each specified property set to the specified
value. Enclose each property name in quotes. You can use this syntax with any previous
input argument combinations.`firinterp`

= dsp.FIRInterpolator(___,`Name,Value`

)

returns an FIR interpolator where the filter coefficients are designed using
`firinterp`

= dsp.FIRInterpolator(`L`

,'legacy')`fir1(15,0.25)`

. The designed filter has a cutoff frequency of 0.25π
radians/sample.

## Properties

## Usage

### Description

### Input Arguments

### Output Arguments

## Object Functions

To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named `obj`

, use
this syntax:

release(obj)

## Examples

## 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}{z}^{-L}+{b}_{2L}{z}^{-2L}+\mathrm{..}+{b}_{N-L+1}{z}^{-(N-L+1)}\right)+\\ {z}^{-1}\left({b}_{1}+{b}_{L+1}{z}^{-L}+{b}_{2L+1}{z}^{-2L}+\mathrm{..}+{b}_{N-L+2}{z}^{-(N-L+1)}\right)+\\ \begin{array}{c}\vdots \\ {z}^{-(L-1)}\left({b}_{L-1}+{b}_{2L-1}{z}^{-L}+{b}_{3L-1}{z}^{-2L}+\mathrm{..}+{b}_{N}{z}^{-(N-L+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}^{-(L-1)}{E}_{L-1}({z}^{L})$$

*E _{0}(z^{L})*,

*E*, ...,

_{1}(z^{L})*E*are polyphase components of the FIR filter

_{L-1}(z^{L})*H*(z).

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*.

## Extended Capabilities

## Version History

**Introduced in R2012a**

## See Also

### Functions

`freqz`

|`fvtool`

|`info`

|`cost`

|`polyphase`

|`generatehdl`

|`impz`

|`coeffs`

|`outputDelay`