# Interpolating FIR filters

## Example

Assume we start with the sample ${\displaystyle \ [1\ 2\ 3\ 4\ 3\ 2\ 1]}$. Padding with zeros gives: ${\displaystyle \ [1\ 0\ 2\ 0\ 3\ 0\ 4\ 0\ 5\ 0\ 3\ 0\ 2\ 0\ 1]}$. Let's apply 2 filters.

Filter 1: ${\displaystyle \ [1\ 1]}$ (also written as ${\displaystyle \ y(kT)=1.0\cdot x(kT)+1.0\cdot x(k-1)T}$).

This filter gives: ${\displaystyle \ [1\ 1\ 2\ 2\ 3\ 3\ 4\ 4\ 5\ 5\ 4\ 4\ 3\ 3\ 2\ 2\ 1\ 1]}$. This is a hold function.

Filter 2: ${\displaystyle \ [0.5\ 1\ 0.5]}$ (also written as ${\displaystyle \ y(kT)=0.5\cdot x(kT)+1.0\cdot x(k-1)T+0.5\cdot x(k-2)T}$

This filter gives: ${\displaystyle \ [.5\ 1.0\ 1.5\ 2.0\ 2.5\ 3.0\ 3.5\ 4.0\ 4.5\ 5.0\ 4.5\ 4.0\ 3.5\ 3.0\ 2.5\ 2.0\ 1.5\ 1.0\ 0.5]}$. This is a linear interpolater.

I had a lot of trouble finding generic information about the number of multiply/add operations used in an interpolation FIR filter. I did find formula for the number of multiply/add operation used by the MATLAB function upfirdn, which upsamples, applies an FIR filter, and then downsamples. It is: ${\displaystyle \ (L_{h}L_{x}-pL_{x})/q}$ where ${\displaystyle \ L_{h}}$ and ${\displaystyle \ L_{x}}$ are the lengths of ${\displaystyle \ h[n]}$(the impulse response of the FIR filter) and ${\displaystyle \ x[n]}$(the original signal), respectively.