Interpolating FIR filters: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
Cdxskier (talk | contribs)
Cdxskier (talk | contribs)
Line 5: Line 5:




Filter 1: <math> \ [1 \ 1] </math> (also written as <math> \ y(kT)=1.0*x(kT) + 1.0*x(k-1)T  </math>).
Filter 1: <math> \ [1 \ 1] </math> (also written as <math> \ y(kT)=1.0 \cdot x(kT) + 1.0 \cdot x(k-1)T  </math>).


This filter gives: <math> \  [1 \ 1 \ 2 \ 2 \ 3 \ 3 \ 4 \ 4 \ 5 \ 5 \ 4 \ 4 \ 3 \ 3 \ 2 \ 2 \ 1 \ 1] </math>. This is a hold function.
This filter gives: <math> \  [1 \ 1 \ 2 \ 2 \ 3 \ 3 \ 4 \ 4 \ 5 \ 5 \ 4 \ 4 \ 3 \ 3 \ 2 \ 2 \ 1 \ 1] </math>. This is a hold function.




Filter 2: <math> \ [0.5 \ 1 \ 0.5] </math> (also written as <math> \ y(kT)=0.5*x(kT) + 1.0*x(k-1)T + 0.5*x(k-2)T  </math>
Filter 2: <math> \ [0.5 \ 1 \ 0.5] </math> (also written as <math> \ y(kT)=0.5 \cdot x(kT) + 1.0 \cdot x(k-1)T + 0.5 \cdot x(k-2)T  </math>


This filter gives: <math> \ [.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] </math>. This is a linear interpolater.
This filter gives: <math> \ [.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] </math>. This is a linear interpolater.

Revision as of 14:48, 16 November 2010

This page offers a brief explanation of interpolation FIR filters.

Example

Assume we start with the sample [1234321]. Padding with zeros gives: [102030405030201]. Let's apply 2 filters.


Filter 1: [11] (also written as y(kT)=1.0x(kT)+1.0x(k1)T).

This filter gives: [112233445544332211]. This is a hold function.


Filter 2: [0.510.5] (also written as y(kT)=0.5x(kT)+1.0x(k1)T+0.5x(k2)T

This filter gives: [.51.01.52.02.53.03.54.04.55.04.54.03.53.02.52.01.51.00.5]. This is a linear interpolater.

Multiply/add Operations

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: (LhLxpLx)/q where Lh and Lx are the lengths of h[n](the impulse response of the FIR filter) and x[n](the original signal), respectively.