Introduction
Finite impulse response filters are the most basic types of filters. They simply weigh different delayed inputs in order to calculate the output. Because of this simplicity, this filter structure allows for a thorough analysis.
Module overview
This module will cover the following topics:
- Difference equation [⯈] - The difference equation is the mathematical description of an FIR filter. It describes the relationship between the input and output samples.
- Convolution [⯈] - The output of an FIR filter can be calculated using the convolution operation.
- Linear time invariant [⯈] - The FIR filter, as described in the previous sections, belongs to a general class of systems that is used very often in practice.
Exercises
In this section several exercises are available, including their answers. The exercises marked in blue are explained by means of more extensive pencast videos.
Video quiz
$x[n] = \begin{cases}0 & \text{for } n \text{ even} \\ 1 &\text{for } n \text{odd}\end{cases}$
The Difference Equation (DE) is given as:
$y[n] = x[n] + x[n-1] + x[n-2]$
Calculate $y[n]$ for $n$ even and $n$ odd.
$h_1[n] = \delta [n] + \delta[n-1] - \delta[n-2]$
Let the input of this system be the unit step function:
$x[n] = u[n] = \begin{cases} 1 & \text{for } n \geq 0 \\ 0 & \text{elsewhere}\end{cases}$
$y[n] = x[n] \ast h[n]$
Calculate the output of this system for the given input.
$h_1 [n] = \delta[n] + 2\delta[n-1]$
$h_2 [n] = \delta[n] - \delta[n-1]$
Whta is the total impulse response $h[n]$ of the LTI system?
$x_2[n] = \delta[n] - \delta[n-1] \quad \rightarrow \quad y_2[n] = \delta[n] - \delta[n-1] - \delta[n-2] + \delta[n-3]$
What is the impulse response $h[n]$ of this LTI system?
Exercise bundle
Answers
Download the answers here.
Pencast videos [⯈]
MATLAB lab
Accompanied to this modules are some exercises in MATLAB, which will test your knowledge of the module and will help improve your MATLAB skills.
Lab assignment
MATLAB demo [⯈]
Summary
$$ \boxed{\text{Unit delta pulse: }\qquad \delta[n] = \begin{cases} 1 & n=0 \newline 0 & \text{elsewhere} \end{cases}} $$
$$ \boxed{\text{Unit step function: }\qquad u[n] = \begin{cases} 1 & n \geq 0 \newline 0 & \text{elsewhere} \end{cases}} $$
$$ \boxed{\text{Difference Equation FIR: } \qquad y[n] = \sum_{k=0}^{M-1} b_k x[n-k] } $$
$$ \boxed{\text{Impulse response FIR: } \qquad h[n] = \sum_{k=0}^{M-1} b_k \delta[n-k]} $$
$$ \boxed{\text{Convolution sum FIR: }\qquad y[n] = \sum_{k=0}^{M-1} h[k] x[n-k]= \sum_{k=n-(M-1)}^{n} x[k] h[n-k] } $$
- Plot the impulse response weights $h[k]$ as a function of index $k$.
- Plot the input signal samples $x[k]$ also as a function of index $k$.
- Mirror (reverse) the input signal samples. That is replace $x[k]$ into $x[-k]$.
- For each new index $n$, shift the mirrored signal samples $x[-k]$ to index $n$, resulting in $x[n-k]$.
- For each new index $n$, the output signal sample $y[n]$ is equal to the sum of the element by element multiplication of the sequence $h[k]$ and the sequence $x[n-k]$ in the range $k=0,1, \cdots , M-1$, since $h[k]=0$ outside this range of indices.
$$ \boxed{\text{Linearity: }\qquad x[n]= \alpha x_1[n] + \beta x_2[n] \mapsto y[n]= \alpha y_1[n] + \beta y_2[n]} $$
$$ \boxed{\text{Time Invariance: }\qquad x[n] \mapsto y[n] \hspace{3mm} \Rightarrow \hspace{3mm} x[n-n_0] \mapsto y[n-n_0]} $$
$$ \boxed{ y[n]=h[n] \star x[n] = x[n] \star h[n]} $$