Interpolating FIR filters: Difference between revisions
No edit summary |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
==Example== |
==Example== |
||
Assume we start with the sample <math> \ [1 2 3 4 3 2 1] </math>. Padding with zeros gives: <math> \ [1 0 2 0 3 0 4 0 3 0 2 0 1] </math>. Let's apply 2 filters. |
Assume we start with the sample <math> \ [1 \ 2 \ 3 \ 4 \ 3 \ 2 \ 1] </math>. Padding with zeros gives: <math> \ [1 \ 0 \ 2 \ 0 \ 3 \ 0 \ 4 \ 0 \ 5 \ 0 \ 3 \ 0 \ 2 \ 0 \ 1] </math>. Let's apply 2 filters. |
||
⚫ | |||
Filter |
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> \ [ |
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> \ [.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. |
|||
==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: <math> \ (L_h L_x-pL_x)/q </math> where <math> \ L_h </math> and <math> \ L_x </math> are the lengths of <math> \ h[n] </math>(the impulse response of the FIR filter) and <math> \ x[n] </math>(the original signal), respectively. |
|||
==Related Topics== |
|||
Check out my article on [[Decimating FIR filters]]. |
|||
===Author=== |
|||
[[Christopher Garrison Lau I]] |
Latest revision as of 17:26, 16 November 2010
This page offers a brief explanation of interpolation FIR filters.
Example
Assume we start with the sample . Padding with zeros gives: . Let's apply 2 filters.
Filter 1: (also written as ).
This filter gives: . This is a hold function.
Filter 2: (also written as
This filter gives: . 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: where and are the lengths of (the impulse response of the FIR filter) and (the original signal), respectively.
Related Topics
Check out my article on Decimating FIR filters.