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

digital filters (1)

digital filters

Uploaded by

marvelcbe20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

digital filters (1)

digital filters

Uploaded by

marvelcbe20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 121

Linear Time Invariant Systems

as
Frequency-Selective Filters
Filter Design Flow

The desired filter characteristics are specified in the frequency domain -


desired magnitude and phase response of the filter

In the filter design process, we determine the coefficients of a causal


FIR or IIR filter that closely approximates the desired frequency
response specifications.

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.
• In general, a linear time-invariant system modifies the input signal
spectrum X(ω) according to its frequency response H(ω) to yield an
output signal with spectrum
Y(ω) = H(ω)X(ω)
• H(ω) act as a spectral shaping function to the different frequency
components in the input signal
• Any linear time-invariant system can be considered to be a frequency-
shaping filter
• Consequently , the terms “ linear time-invariant system ” and “filter”
are synonymous and are often used interchangeably
The term filter is used to describe a linear time-invariant system that
perform spectral shaping or frequency-selective filtering
• Filtering is used in digital signal processing in a variety of ways,
➢removal of undesirable noise from desired signals,
➢spectral shaping such as equalization of communication channels,
➢signal detection in radar, sonar, and communications,
➢spectral analysis of signals
• Filters are usually classified according to their frequency-domain
characteristics as
➢Low pass
➢Highpass
➢Bandpass
➢Band stop or band -elimination filters.
Ideal filters have a constant-gain (usually taken as unity-gain) passband
characteristic and zero gain in their stopband.
The ideal magnitude response characteristics of these types of filters are
illustrated in Fig
• Ideal filters have
➢a constant-gain passband characteristic
➢zero gain in their stopband
Ideal filters have a constant-gain (usually taken as
unity-gain) passband characteristic and zero gain in
their stopband.
Another characteristic of an ideal filter
is a linear phase response
Assume that a signal sequence x(n) with frequency components confined to the frequency
range ω1 < ω < ω2 is passed through a filter with frequency response, where C and α are
constants

𝑪𝒆−𝒋ωα , ω𝟏 < ω < ω𝟐


H(ω) = ቊ
𝟎, 𝒐𝒕𝒉𝒆𝒓𝒘𝒊𝒔𝒆
The signal at the output of the filter has a spectrum,
𝒀(ω) = X(ω) H(ω)
= X(ω) 𝑪𝒆−𝒋ωα , ω1 < ω < ω2
By applying the scaling and time shifting properties of the fourier transform, the time
domain output
𝒚 𝒏 = 𝑪𝒙(𝒏 − 𝜶)
𝒚 𝒏 = 𝑪𝒙(𝒏 − 𝜶)
In conclusion,

• Ideal filters have a constant magnitude characteristic and a linear


phase characteristic within their passband.
Causal LTI Systems
Review (one slide)
Causal LTI Systems - Review
Ideal filters are not physically realizable but serve as a mathematical
idealization of practical filters.

• Eg. The ideal low pass filter impulse response,

• This filter is not causal


• it is not absolutely summable
• it is also unstable.

• Consequently, this ideal filter is NOT CAUSAL and hence it is


physically unrealizable.
Linear Phase FIR filters (FIR-finite impulse response filters)

• Transfer function of a FIR causal filter H(z)

h(n) is the impulse response of the filter


• The Fourier transform of h[n]

14
𝐻(𝑒 𝑗ω ) 𝑖𝑠 𝑡ℎ𝑒 𝑚𝑎𝑔𝑛𝑖𝑡𝑢𝑑𝑒 𝑟𝑒𝑠𝑝𝑜𝑛𝑠𝑒 𝑜𝑓 𝑡ℎ𝑒 𝑓𝑖𝑙𝑡𝑒𝑟 𝑎𝑛𝑑 Θ(ω) is phase response

Phase delay and group delay of a filter as

For FIR filters with linear phase,


phase delay and group delay will be constant and equal to delay ′𝛼’

15
Separating the real and imaginary part and taking the ratio is given below,

16
Solving the above equation gives,

The above condition satisfies when, and

17
eg. For N =7 (odd) and N = 6 (even)

Implies h(n) is symmetric in nature

In general, considering symmetric and antisymmetric impulse response

FIR filter has linear phase if its unit impulse response satisfies the condition

h(n) = ±ℎ(𝑁 − 1 − 𝑛)
18
Frequency response of Linear phase FIR filters

• Case 1 : Symmetrical impulse response N odd, say N=7


• Frequency response is given by

19
For symmetrical impulse response, h(n) = h(N-1-n), Substituting this relation to the above equation, 20
21
Generalized frequency response Expression for N odd and N even
(Symmetric impulse response)

22
Design of FIR filters using Windows

23
Filter Design by Windowing
• Simplest way of designing FIR filters
• Start with ideal frequency response

( )  h ne
Hd e j =

d
− jn hd n =
1

2 − 
Hd( )
e j
e jn
d
n = −

• Choose ideal frequency response as desired response


• Ideal impulse responses are of infinite length [-∝ ≤ 𝒏 ≤ ∝]

24
• Possible way to obtain a causal FIR filter from ideal is
hd n 0  n  N
hn = 
 0 else

• Disadvantage of abrupt truncation: Oscillations in stopband and


passband, this effect is known as Gibbs phenomenon
• To reduce these oscillations, the filter coefficients are modified by
multiplying the infinite impulse response with a finite weighing w[n]
• i.e., window function
1 0  n  N − 1
hn = hd nwn where wn = 
0 else

25
• After multiplying with the window function, we get a finite duration
sequence h(n)

• It is instructive to consider the effect of the window function on the


desired frequency response

• Recall that multiplication of the window function w(n) with hd(n) is


equivalent to convolution of Hd(ω) with W(ω)

26
Fourier transform of window function W(ω) (Rectangular window)

27
Fourier transform of w[n], W(ω)

w[n] is the rectangular window, with M samples, where M = N

28
29
The width of the main lobe is 4π/N
(𝐶ℎ𝑎𝑟𝑎𝑐𝑡𝑒𝑟𝑖𝑠𝑡𝑖𝑐𝑠 𝑜𝑓 𝑠𝑦𝑛𝑐 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 (W(ω))

• Specifically, the convolution of Hd(ω) with W(ω) has the effect of smoothing

• As N increases, the main lobe of W(ω) becomes narrower.


➢ However, the sidelobes are relatively high and remain unaffected by an increase in N .
➢ Smoothing provided by W(ω) is reduced.

• On the other hand, the large sidelobes of W(ω) result in some undesirable ringing effects in the FIR filter
frequency response H(ω) and also in relatively larger sidelobes in H(ω)

N=M

30
Rectangular window spectrum for N=25 samples

31
Frequency response of Low pass filter at N=25

32
Rectangular window spectrum for N=51 samples

33
Undesirable ringing effect in FIR filter frequency response – Rectangular
window, How it is overcome?

Best alleviated by the use of windows that do not contain abrupt


discontinuities in their time-domain characteristics, and have
correspondingly low sidelobes in their frequency-domain
characteristics.

34
Triangular Window
Triangular window : frequency domain

Triangular window :Time domain

35
Frequency response of Low pass filter using triangular window at N=25

36
Frequency response of Low pass filter using triangular window at N = 51

37
Hanning Window
Hanning window - time
domain

Hanning window -
frequency domain - N=25

38
Hanning window -
frequency domain – N=51

39
Hamming window

Hamming window: Time domain

Hamming window: Frequency domain

40
Hamming window: Frequency domain

41
Frequency response of LPF using Hamming window

42
Other window functions

43
Exercise

44
45
46
Other window functions
(Mathematical expressions)

47
48
• The above filter designed has to be linear phase also.

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Assignment

• Digital Differentiator
• Hilbert Transformer
• Real life applications of Signal Processing (Minimum 2 Scenarios)

69
IIR Filter Design
• 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.
• In the filter design process, we determine the coefficients of a causal
FIR or IIR filter that closely approximates the desired frequency
response specifications.
• 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.

70
• 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.
• If there is no requirement for a linear-phase characteristic, either an IIR or an FIR
filter may be employed. However, as a general rule, an IIR filter has lower
sidelobes in the stopband than an FIR filter having the same number of
parameters.

• 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.

71
• Digital IIR filter design - based on converting an analog filter into a
digital filter
• Analog filter design is a mature and well developed field
• Begin the design of a digital filter in the analog domain and then
convert the design into the digital domain.

72
• An analog filter can be described by its system function.

73
• Analog linear time invariant system is stable if all its poles lie in the
left half of s plane

74
Keywords:
ROC -
Region of Convergence

Re(s) = σ
Im(s) = Ω

75
76
77
Keywords:
ROC -
Region of Convergence,
Unit Circle

78
79
80
81
Design of Digital filters from Analog filters
• For the given specifications of a digital filter,
➢Map the desired digital filter specifications into those for an analog
filter
➢Derive the analog transfer function for the analog protype
➢Transform the transfer function of the analog prototype into an
equivalent digital filter transfer function
➢ Transformation methods:
• Bilinear transformation
• Impulse Invariant Transformation

82
Magnitude response of LPF: Digital filter

Pass band error tolerance

Maximum allowable magnitude in stopband

83
Analog Lowpass filter design
An analog filter can be described by its system function

For a stable analog filter, the poles of H(s) lie in the left half of s- plane
Two types of Analog filter design:
Butterworth filter
Chebyshev filter
84
• Butterworth filter • N is the order of the filter
• is the cut off frequency
• Maximum response at frequency = 0
• Ideal response shown in dash line
• Magnitude response approaches ideal
as N increases
• For frequency less than cut off
frequency, magnitude approximately
equal to 1
• At frequency = cut off frequency, the
curve passes 0.707 or -3dB

85
Low pass Butterworth magnitude response
86
• Magnitude squared function of Normalized Butterworth filter (Cutoff
frequency = 1 rad/sec)

• To derive the transfer function of a stable filter


Omega= s/j
(s/j)^2

87
Implications
• Poles lies in both left half and right half of s plane (H(s) & H(-s))
• If H(s) has roots in one half implies H(-s) in other half of s plane
• Obtain the roots by equating the denominator to zero
• N odd,
• the roots as shown

• N even,
• the roots as shown

88
• N =3, implies

Pole locations in the s plane To ensure stability, only left half poles is
considered.

89
• N=3;
• To ensure stability, only left half poles is considered.
• So, the transfer function of third order Butterworth filter for unity cut
off frequency 1 rad/sec is ,
• i.e.,

Transfer function of unnormalized transfer function is obtained


by substituting ‘s’ as ‘s/cut off frequency ‘

90
List of Butterworth polynomials

91
• How to determine the order, given the filter specifcations

Maximum passband attenuation at passband


edge frequency
Minimum stopband attenuation at stopband
edge frequency

Taking logarithm on both sides,

92
• Similarly, considering stopband attenuation,

After simplification,
93
• Order of filter

Since N does not result in integer, we roundoff to the next


higher integer

Where
94
• Cut off frequency

How to derive the expression for cut off frequency?

Eqn. (1)

Eqn. (2)

Comparing 1 and 2 , we get the expression for cut off frequency


95
Design steps for analog Butterworth Filter

96
therefore, N = 4
=

Normalized Butterworth filter for N = 4


97
98
Transformation (H(s)→ H(z))

• Impulse Invariant Transformation


• Bilinear Transformation

99
Impulse Invariant Transformation
• IIR digital filter is designed such that unit impulse response h(n) of
digital filter is the sampled version of analog filter.
• Let H (s) is the system function (Transfer function) of analog filter.

• The inverse laplace transform

100
Sample this analog signal at t = nT, where T is the sampling perio

101
Steps to design a filter using Impulse
Invariant method

102
Impulse Invariant
Transformation

103
Impulse Invariant Transformation (Underlying
mapping function)
• The mapping is characterized by

• Implies, and

104
Pole on jΩ axis (σ= 0)

105
Pole in the left half of s-plane (σ <0)

106
Pole in the right half of s-plane (σ >0)

107
Disadvantages of Impulse Invariant

• Many to one mapping


• Illustration: Analog poles at

108
S1 pole

109
Transform H(s) to H(z) To remember

110
Bi-Linear Transformation

111
112
113
114
Relation between analog and discrete frequency in Bi-linear Transformation

115
For low frequencies, relationship between analog and discrete
frequencies are linear
For high frequencies, relationship between analog and discrete
frequencies become non linear, due to this distortion is
introduced in the frequency scale of digital filter – WARPING 116
EFFECT
The warping effect can be eliminated by pre-warping the analog filter
-

117
Steps to design using Bilinear transformation
• From the given specifications, find the prewarped frequencies
• Using the analog frequencies, find H(s) of the analog filter
• Select the sampling rate T
• Substitute,

118
Design a digital Butterworth filter with T = 1 sec
(sampling period) using Bilinear transformation

119
120
121

You might also like