You are on page 1of 6

Digital Signal Processing

Semester: 6th (Spring 2022)

Credit Hours: 3

Filter Design:

Filtering is one of the most common applications in digital signal processing. Filters attenuate some of the
undesired aspects of the signal partially or completely or enhance some of the desired aspects of the
signal.

This Complex Engineering Problem (CEP), focus on the design of linear-phase FIR filters. The CEP focuses
on the design of FIR filters using the window design method.

Before you start with the CEP read the Appendix.

The Window Design Method

The basic idea behind the design of linear-phase FIR filters using the window method is to choose a proper
ideal frequency selective filter (which always has a noncausal, infinite duration impulse response) and
then truncate its impulse response 𝒉𝒅 (𝒏) to obtain a linear phase and causal FIR filter 𝒉(𝒏). To truncate
the impulse response of the ideal filter a time window 𝒘(𝒏) is used. Available windows in MATLAB are
rectangular (or boxcar in MATLAB), bartlett, hamming, hanning and blackman.

Preparatory Work

In this preparatory assignment the window design technique is theoretical described. Suppose that we
want to design a symmetric FIR lowpass filter with linear phase based on an ideal lowpass filter given by
the desired frequency response:
(𝑴 𝟏)
𝒋𝝎
𝑯𝒅 (𝝎) = 𝟏𝒆 𝟐 |𝝎| ≤ 𝝎𝒄
𝟎 𝝎𝒄 < |𝝎| ≤ 𝝅
Where 𝜔 is the cut-off frequency. Determine the corresponding impulse response ℎ (𝑛) for the desired
filter 𝐻 (𝜔) by evaluating the integral in
𝝅
𝟏
𝒉𝒅 (𝒏) = 𝑯𝒅 (𝝎)𝒆𝒋𝝎𝒏 𝒅𝝎
𝟐𝝅 𝝅
𝑴 𝟏 𝝎𝒄
𝑯𝒊𝒏𝒕: 𝒉 = . The impulse response 𝒉𝒅 (𝒏) is noncausal and has infinite duration. The phase
𝟐 𝝅
𝑴 𝟏 𝑴 𝟏
function incorporates the factor that correspond to a delay of units, i.e. a shift of the impulse
𝟐 𝟐
response. Plot ℎ (𝑛) for the interval −𝟓𝟎 ≤ 𝒏 ≤ 𝟓𝟎, assume that 𝑴 = 𝟒𝟏. To obtain a causal filter
with finite duration from ℎ (𝑛) we have to truncate 𝒉𝒅 (𝒏) on both sides. This operation is called”
windowing” and can be formed by the product of 𝒉𝒅 (𝒏) and a window 𝒘(𝒏) as follows 𝒉(𝒏) =
𝒉𝒅 (𝒏)𝒘(𝒏). Design a causal FIR filter 𝒉(𝒏) of the length 𝑴 (𝑴 = 𝟒𝟏) by using a rectangular window

𝟏 𝟎≤𝒏≤𝑴−𝟏
𝒘(𝒏) =
𝟎 𝒐𝒕𝒉𝒆𝒓𝒘𝒊𝒔𝒆

Plot 𝒉(𝒏) for the interval −𝟓𝟎 ≤ 𝒏 ≤ 𝟓𝟎.


Note, the window method can be used to design different types of filters. The filter length can be even or
odd, and the impulse response can either be symmetric, 𝒉(𝒏) = 𝒉(𝑴 − 𝟏 − 𝒏), or antisymmetric,
𝒉(𝒏) = −𝒉(𝑴 − 𝟏 − 𝒏).

CEP Statement:

Investigate the following windows both in time domain, 𝒘(𝒏) 𝟎 ≤ 𝒏 ≤ 𝑴 − 𝟏, and in the frequency
domain, 𝑾(𝝎) 𝟎 ≤ 𝝎 ≤ 𝝅: rectangular (or boxcar in Matlab), bartlett, hamming, hanning and
blackman. Plot the magnitude |𝑾(𝝎)| in decibel (dB). Investigate the width of the mainlobe and the
magnitude of the first side lobe compared to the magnitude of the main lobe (0-dB level) for different
lengths of the window 𝒘(𝒏) (𝑴 = 𝟓𝟏, 𝟕𝟏 𝒂𝒏𝒅 𝟗𝟏). Proper commandos in MATLAB to investigate a plot
and obtain the coordinate for a point in a graph are zoom and ginput.

Deliverables:

1. Complete working MATLAB Code, graph


2. Detail discussion report on problem

You might also like