0% found this document useful (0 votes)
9 views

DSP CH-10a (Basics)

Uploaded by

chaudhrylaiba12
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

DSP CH-10a (Basics)

Uploaded by

chaudhrylaiba12
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

DESIGN OF DIGITAL FILTERS

Contents:
➢ General considerations
o Causality and its Implications
o Characteristics of Practical Frequency-Selective Filters
➢ Design of fir filters
o Symmetric and Antisymmetric Filters
o Design of Linear-Phase FIR Filters using Windows
o Design of Linear-Phase FIR Filters by the Frequency-Sampling Method
o Design of Optimum Equiripple Linear-Phase FIR Filters
o Design of FIR Differentiators
o Design of Hilbert Transformers
o Comparison of Design Methods for Linear-Phase FIR Filters
2
Contents:
➢ Design of IIR filters from analog filters
o IIR Filter Design by Approximation of Derivatives
o IIR Filter Design by Impulse Invariance
o IIR Filter Design by the Bilinear Transformation
o Characteristics of Commonly Used Analog Filters
o Some Examples of Digital Filter Designs Based on the Bilinear
Transformation
➢ Frequency transformations
o Frequency Transformations in the Analog Domain
o Frequency Transformations in the Digital Domain

3
Introduction :
o With the background that we have developed in the
preceding chapters, we are now in a position to treat the
subject of digital filter design.
o We shall describe several methods for designing FIR and
IIR digital filters.
o In the design of frequency-selective filters, the desired filter
characteristics are SPECIFIED in the frequency domain
in terms of the desired magnitude and phase response of
the filter.
4
Introduction :
o In the filter design process, we DETERMINE THE
COEFFICIENTS of a causal FIR or IIR filter that closely
approximates the desired frequency response specifications. [cf.
Eq. (3.3.8) and (33.9)]
o The issue of which type of filter to design, FIR or IIR, depends on
the NATURE OF THE PROBLEM and on the
SPECIFICATIONS OF THE DESIRED FREQUENCY
RESPONSE.
o In practice, FIR filters are employed in filtering problems where
there is a requirement for a LINEAR-PHASE
CHARACTERISTIC within the passband of the filter. 5
Introduction :
o If there is no requirement for a linear-phase characteristic,
either an IIR or an FIR filter may be employed.
o However, as a general rule, an IIR filter has lower side-
lobes in the stopband than an FIR filter having the same
number of parameters.
o For this reason, if some phase distortion is either tolerable or
unimportant, an IIR filter is preferable, primarily because
its implementation involves fewer parameters, requires less
memory and has lower computational complexity.
6
Introduction :
oIn conjunction with our discussion of digital filter
design, we describe frequency transformations in
both the analog and digital domains for transforming a
lowpass prototype filter into:
▪ Another lowpass,
▪ Bandpass,
▪ Bandstop, or
▪ Highpass filter.
7
Introduction :
oToday, FIR and IIR digital filter design is greatly
facilitated by the availability of numerous computer
software programs.
oIn describing the various digital filter design methods
in this chapter, our primary objective is to give the
reader the background necessary to select the
filter that best matches the application and
satisfies the design requirements.
8
§10.1 General Considerations

9
Recall – Frequency Response :

𝐷𝑇𝐹𝑇
ℎ 𝑛 𝐻 𝜔 =𝐻 𝑧 ቚ 𝑗𝜔
𝑧=𝑒
10
Recall – Frequency Response :
𝐻 𝜔 =𝐻 𝑧 ቚ
𝑧=𝑒 𝑗𝜔

11
Recall – Frequency Response :
𝐻 𝜔 =𝐻 𝑧 ቚ
𝑧=𝑒 𝑗𝜔

12
Recall – Frequency Response : 𝐷𝑇𝐹𝑇
RECALL: 𝑋(𝜔) is periodic with period 2𝜋. ℎ(𝑛) 𝐻(𝜔)
clearvars; close all; clc;
LW = 'LineWidth'; FS = 'FontSize';
%
b = [0.2]; a = [1 -0.8];
% H(z) = 1 / (1-0.8z^-1)
% ==> h(n) = 0.8^n
om = -pi:1e-2:pi;
H = freqz(b,a,om);
subplot(211);
plot(om,abs(H),LW,2); grid;
title('Magnitude Response',FS,20);
subplot(212);
plot(om,angle(H),LW,2); grid;
title('Phase Response',FS,20);

13
Recall – Frequency Response :

Figure 5.1 of [6]: Magnitude and phase


response functions and input–output
signals for the LTI system defined by (5.15).
The higher frequency suffers more
attenuation than the lower frequency
(lowpass filter).

14
Ideal Filters : All ideal filters shown here are Non-Causal
and hence CANNOT be realized in practice.

Figure 5.4.1: Magnitude response for some IDEAL frequency-selective DT filters.


15
General Considerations :
o In Section 5.4, we described the characteristics of ideal
filters and demonstrated that such filters are NOT
CAUSAL and therefore are NOT PHYSICALLY
REALIZABLE.
o In this section, the issue of causality and its implications
is considered in more detail.
o Following this discussion, we present the frequency
response characteristics of CAUSAL FIR and IIR
digital filters.
16
General Considerations : o The output of ideal filter is
simply a delayed and
amplitude-scaled version
of the input signal.
o A pure delay is usually tolerable
and is NOT considered a
distortion of the signal. Neither
is amplitude scaling.

▪ Ideal filters have a


constant magnitude
characteristic and a linear
phase characteristic
within their passband.
▪ In all cases, such filters are
The linear-phase shift does not cause any distortion not physically realizable
because it results in a constant group delay i.e., all but serve as a mathematical
frequency components of the input signal undergo the idealization of practical filters.
same time delay. 17
General Considerations :

Hence for an LTI system to have a distortion-less response:


▪ the magnitude response |𝐻 𝜔 | must be a constant; and
▪ the phase response ∠𝐻(𝜔) must be a linear function of 𝝎
with slope −𝑛0 where 𝑛0 is the delay of the output with
respect to the input.
18
General Considerations : w1 = 0.3*pi; w2 = 0.7*pi;
C = 2; n0 = 5;
clearvars; close all; clc; LW = 'LineWidth'; FS = 'FontSize';
%
dw = 1e-3; w = 0:dw:pi;
w1 = 0.3*pi; w2 = 0.7*pi;
C = 2; n0 = 5;
H = C * exp(-j*w*n0);
H_mag = abs(H);
H_ph = angle(H);
H_ph2 = unwrap(H_ph);
%
H_mag_tr = H_mag;
H_mag_tr(abs(w)<w1) = 0;
H_mag_tr(abs(w)>w2) = 0;
%
H_ph2_tr = H_ph2;
H_ph2_tr(abs(w)<w1) = NaN;
H_ph2_tr(abs(w)>w2) = NaN;
%
subplot(211);
plot(w/pi,H_mag,LW,3); hold on;
plot(w/pi,abs(H_mag_tr),'ro-',LW,3); grid;
title('Magnitude Response of Distortionless (Ideal) Filter',FS,20);
subplot(212);
plot(w/pi,H_ph2,LW,3); grid; hold on;
plot(w/pi,H_ph2_tr,'ro-',LW,3);
title('Phase Response of Distortionless (Ideal) Filter',FS,20); 19
General Considerations :

20
§10.1.1 Causality and Its Implications

21
Causality & Its Implications :

22
Causality & Its Implications : (wc/pi) * sinc(wc*n/pi);

𝜋
ℎ(𝑛) with 𝜔𝑐 =
4

Obvisously, the ideal LPF is Non-Causal and


hence it CANNOT be realized in practice.

23
RECALL :

24
RECALL :

25
Causality & Its Implications :

ℎ 𝑛 − 𝑛0 × 𝑢(𝑛)  Causal & IIR Filter


ℎ 𝑛 − 𝑛0 × 𝑤(𝑛)  Causal & FIR Filter
26
Causality & Its Implications :

Ideal BPF Vs
Practical BPF

27
Paley-Wiener Theorem

28
Causality & Its Implications :

29
Causality & Its Implications :

30
Causality & Its Implications :
One important conclusion we draw from the Paley-Wiener theorem is
that:
The magnitude response |𝑯 𝒆𝒋𝝎 | of a stable
and causal system CANNOT BE ZERO OVER ANY FINITE BAND OF
FREQUENCIES (can ONLY be zero at some frequencies) because, in
this case, the integral becomes infinite.
Hence, any stable ideal frequency-selective filter must be
non-causal.

31
Causality & Its Implications :
Another important conclusion that we draw
from the Paley-Wiener theorem is :
𝒋𝝎
Given the magnitude response |𝑯 𝒆 |
of a causal and stable system, we
CANNOT ASSIGN its phase response
arbitrarily.
32
Causality & Its Implications – SUMMARY :
To summarize, CAUSALITY has very important IMPLICATIONS
in the design of frequency selective filters. These are:
1) Frequency response 𝑯(𝝎) cannot be zero, except at a finite set
of points in frequency;
2) Magnitude response |𝑯 𝝎 | cannot be constant in any finite
range of frequencies and the transition from passband to
stopband cannot be infinitely sharp [this is a consequence of the Gibbs
phenomenon, which results from the truncation of ℎ(𝑛) to achieve causality]; and
3) Real and imaginary parts of 𝑯(𝝎) are INTERDEPENDENT
and are related by the discrete Hilbert transform. As a consequence,
the magnitude |𝐻 𝜔 | and phase Θ(𝜔) of 𝐻(𝜔) cannot be chosen arbitrarily.
33
Causality & Its Implications :

Recall: A system is said to be


causal if the output of the system
at any time n depends only on
present and past inputs, but does
not depend on future inputs.

34
Causality & Its Implications :

35
Causality & Its Implications :
Filter design problem:
Properly selecting the coefficients
{𝑎𝑘 } and {𝑎𝑘 } to approximate the Example: 𝑀 = 𝑁 = 3;
𝑏𝑘 = [1, 1.655, 1.655, 1]
ideal filters. 𝑎𝑘 = [1, −1.57, 1.264, −0.4]

FIR or IIR ???

36
Causality & Its Implications :

37
Causality & Its Implications :

FIR Filter
𝑀−1

𝐻 𝜔 =𝐻 𝑧 ቚ = ෍ 𝑏𝑘 𝑒 −𝑗𝜔𝑘
𝑧=𝑒 𝑗𝜔
𝑘=0

IIR Filter

𝑦 𝑛 = ??? 38
Causality & Its Implications :
FIR Filter design problem:
Properly selecting the coefficients {𝒃𝒌 } to approximate the ideal
filters.
For FIR filters, 𝑏𝑘 = ℎ(𝑘) = Impulse response of the designed filter.
IIR Filter design problem:
Properly selecting the coefficients {𝒃𝒌 } and {𝒂𝒌 } to approximate the
ideal filters.
Plugging {𝑏𝑘 } and {𝑎𝑘 } into Eq. (10.1.15) yields 𝐻(𝜔), the Frequency
Response.
From 𝐻(𝜔), we can compute, ℎ(𝑛) = Impulse response of the
designed filter. 39
§10.1.2 Characteristics of
Practical Frequency-Selective Filters

40
DISCLAIMER
41
These power point slides are NOT
SUBSTITUTE of reading TEXT
BOOK(S).
You’re ALWAYS DIRECTED to
CAREFULLY READ the relevant
book chapter and SOLVE ALL
Examples and End Problems.
42
REFERENCES :
[1] [Proakis-2007] DSP 4th Ed

[2] [Proakis-2007] DSP 4th Ed


(CH 11: Solved Examples and MATLAB Solutions)
[3 [Proakis-2004] A Self-Study Guide for DSP

[4 [Inge-2017] Digital Signal Processing Using Matlab - A Problem Solving Companion


(4th Ed)
[5] [Kronenburger-2008] Analog and Digital Signal Processing

[6] [Manolakis-2011] Applied Digital Signal Processing

[7] [Sierra-2017] Digital Signal Processing with Matlab Examples, Volume 1

43

You might also like