EENG 5610: Digital Signal Processing: Class 10: Design of Digital Filters

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

EENG 5610: Digital Signal Processing

Class 10: Design of Digital Filters


Dr. Xinrong Li
Department of Electrical Engineering
University of North Texas

Outline
General Considerations
Design of FIR Filters
Design of IIR Filters from Analog Filters

Dr. Xinrong Li

General Considerations
The objective of this class:
To provide the background necessary to select the filter that best

matches the application and satisfies the design requirements.


Many software tools are available for the design of digital filters,

including Matlab.

FIR versus IIR


The choice between FIR and IIR depends on the nature of the

problem and on the specifications of the desired frequency response.


FIR filters are employed when there is a requirement for a linearphase characteristics within the passband of the filter.
An IIR filter has lower sidelobes in the stopband than an FIR filter
having the same number of parameters. Thus, relatively IIR filter
requires less memory and has lower computational complexity.
Dr. Xinrong Li

Causality and Its Implications


Ideal filters are not causal and thus are not physically realizable.
Implications of causality:
The frequency response H(w) cannot be zero over any finite band of

frequencies, except at a finite set of points in frequency.


The magnitude |H(w)| cannot be constant in any finite range of
frequencies and the transition from passband to stopband cannot be
infinitely sharp.
The real and imaginary parts of H(w) are interdependent and are related
by the discrete Hilbert transform. Thus, the magnitude |H(w)| cannot be
chosen arbitrarily.
In this class we will focus on the class of linear time-invariant

systems specified by the following difference equation, which are


causal and physically realizable:
M 1
N

M 1

k 1

k 0

y ( n) ak y ( n k ) bk x(n k ),

H ( w)

b e
k 0
N

1 ak e jwk
k 1

Dr. Xinrong Li

jwk

Characteristics of Practical Frequency-Selective Filters


The frequency response characteristics of ideal filters are not

absolutely necessary in most practical applications.


In any filter design problem, we can specify:
The maximum tolerable passband ripple 1 and stopband ripple 2,
The passband edge frequency wp and the stopband edge frequency ws.

Dr. Xinrong Li

Design of FIR Filters


Symmetric and Anti-symmetric FIR Filters
An FIR filter of length M can be described by difference equation,

unit sample response, or system function, bk = h(k), 0 k M 1:


M 1

y ( n) bk x( n k ),
k 0

M 1

y (n) h( k ) x(n k ),
k 0

An FIR filter has linear phase if its unit

sample response is symmetric


or anti-symmetric:
h(n) = h(M 1 n), 0 n M 1.
If an FIR filter is symmetric or
anti-symmetric, the zeros must
occur in reciprocal pair.
If h(n) is real, zeros must occur
in complex-conjugate pair.

Dr. Xinrong Li

M 1

H ( z ) h( k ) z k
k 0

Design of Linear-Phase FIR Filter using Windows


In this method, we begin with the desired frequency response Hd(w)

and determine the corresponding unit sample response hd(n).

H d ( w) hd (n)e jwn ,
n 0

hd (n)

1
2

H d ( w)e jwn dw

In general, hd(n) has infinite length and must be truncated, which is

1
n M 1; hd(n) with Marectangular
1, ifto0multiplying
sin( wM / 2)
equivalent
window
jwn
jw ( M 1) / 2function:

W ( w) w(n)e
0
,
otherwise.
n0

hd (n), if 0 n M 1;
h(n) hd (n) w(n)
0, otherwise.
1
H ( w)
H d ( w)W ( w v)dv

2
w(n)

The width of the main lobe of

W(w) is 4/M. Thus, as M


increases, the main lobe

sin( w / 2)

Alternative window functions


Issues with the rectangular window function:
The convolution of Hd(w) with W(w) has the effect of smoothing Hd(w). As M is

increased, W(w) becomes narrower, and the smoothing effect is then reduced.
The large sidelobes of W(w) results in some undesirable ringing effects in the FIR
filter frequency response H(w) and also in relatively larger sidelobes in H(w).
These issues with the rectangular window function can be alleviated by the

use of windows that do not contain abrupt discontinuities in time domain


and have correspondingly low sidelobes in frequency domain.
All these windows have significantly lower sidelobes than rectangular window.
But, for the same M, the width of the main lobe is wider so that these windows

provide more smoothing and thus the transition region in the FIR filter is wider.
To reduce the width of the transition region, the length of the window M can be
simply increased, which results in a larger filter.

Design of Linear-Phase FIR Filters by the Frequency-

Sampling Method
In the frequency-sampling method, we specify the desired frequency

response H(w) at a set of equally spaced frequencies:


wk

2
(k ),
M

0 k ( M 1) / 2 for M odd
,

M
/
2

1
for
M
even

1
and 0 or ,
2

and solve for the unit sample response h(n):


M 1

H ( w) h(n)e jwn
n 0

M 1
2
j 2 ( k ) n / M
, 0 k M 1
H (k ) H ( M (k )) h( n)e

n 0

M 1
h(n) 1
H (k )e j 2 ( k ) n / M , 0 n M 1

M k 0

When = 0, these will reduce to DFT and IDFT pair.


Symmetry property of the sampled frequency response function can be

utilized to simplify the computations.


For example, reduce the frequency specifications from M points to (M+1)/2 points

for Li
M odd and M/2 points for M even.
Dr. Xinrong
The major advantage of this method lies in the efficient frequency sampling

Design of Optimum Equiripple Linear-Phase FIR Filters


A major problem of the window and frequency-sampling methods is

the lack of precise control of the critical frequencies, e.g. wp and ws.
The new method is based on Chebyshev approximation problem.
The weighted approximation error between the desired and the actual

frequency responses is spread evenly across the passband and stopband


of the filter, minimizing the maximum error.
For example, in the case of lowpass filter:

H ( w) H r ( w)e j ( w)

1 1 H r ( w) 1 1 ,
2 H r ( w) 2 ,

|w| w p

|w| ws

Dr. Xinrong Li

Comparison of Design Methods for Linear-Phase FIR Filter


The major disadvantage of the window method is the lack of precise

control of the critical frequencies such as wp and ws.


The value of wp and ws depends on the window and filter length M.

The frequency-sampling method is particularly attractive when FIR

filter is realized either in the frequency domain by DFT or in any of


the frequency-sampling realizations.
Hr(wk) is either 0 or 1 at all frequencies, except in the transition band.

The Chebyshev approximation method is preferred over the other

two methods since it provides total control of the filter


specifications.
By spreading the approximation error over the passband and stopband,

this method is optimum in the sense that for a given set of specifications,
the maximum sidelobe level is minimized.
In this method, we need to specify M, wp, ws, and the ratio 2/1.
However, it is more natural to specify wp, ws, 1 and 2. and then

determine the required M. Good approximation formulas are available to


determine M (in the book), which are extremely useful in practice.
Dr. Xinrong Li

Design of IIR Filters From


Analog Filters
An analog filter can be described by its system function:
N
N

B( s) M
d k y (t ) M
d k x(t )
k
k
st
H a ( s)
k s k s , H a ( s ) h(t )e dt , k
k
k

A( s ) k 0
dt
dt k
k 0
k 0
k 0
An analog LTI system H(s) is stable if all its poles lie in the left half of

the s-plane. Thus, the conversion of analog filters to digital filters must
possess the following properties:
The j axis in the s-plane should map into the unit circle in the z-plane.
The left-half plane (LHP) of the s-plane should map into the inside of the

unit circle in the z-plane.


Causal and stable IIR filter cannot have linear phase. Thus, FIR filter

should be used when a linear-phase filter is required.


A linear-phase filter must have a system function that satisfies the condition

H(z) = z-NH(z-1), which means the filter would have a mirror-image pole
outside the unit circle for every pole inside the unit circle. Hence the filter
would be unstable.

Dr. Xinrong Li

IIR Filter Design by Approximation of Derivatives


The differential equation describing an analog filter can be

approximated with an equivalent difference equation:


d k y (t ) M
d k x(t )
k
k
,

k
k
dt
dt
k 0
k 0
N

dy (t )
y (n) y (n 1)

dt t nT
T

The analog differentiator dy(t)/dt has a system function H(s) = s.


The digital system [y(n) y(n 1)]/T has the system function

H(z) = (1 z-1)/T.
In frequency domain, s = (1 z1)/T and similarly, sk = [(1 z1)/T]k.
Thus, the system function of digital IIR filter obtained as a result of the
M
Nis:
approximation of the derivatives by B
finite
( s ) differences
k
H ( z ) H a ( s ) s (1 z ) / T ,
H a (s)
k s k s k
A( s ) k 0
k 0
1

Mapping between the s-plane and the z-plane


Transformation between s and z: s (1 z 1 ) / T

z 1 /(1 sT )
A stable analog filter is transformed into a stable digital filter.
But, the possible location of the poles of the digital filter are confined to
relatively small frequencies as shown in the figure.
Thus, the mapping method is restricted to the design of lowpass and
bandpass filters having relatively small resonant frequencies; it is not
possible to transform a highpass analog filter to a corresponding highpass
digital filter using this method.

Dr. Xinrong Li

IIR Filter Design by Impulse Invariance


In this method, our objective is to design an IIR filter having a unit
sample response h(n) that is the sampled version of the impulse
response of the analog filter: h(n) = ha(nT)
H ( f ) Fs

H [( f k ) F ],

H ( w) Fs

H [(w 2k ) F ],

1
2k
H ( T ) H a (
)
T k
T

With this method, the sampling interval T needs to be sufficiently small

to avoid or minimize the aliasing effects.


Such a method is not suitable for designing highpass filters due to the
spectrum aliasing that results from the sampling process.

IIR Filter Design by the Bilinear Transformation


The previous two techniques are appropriate only for lowpass filters
and a limited class of bandpass filters.
The bilinear transformation transforms to j-axis into the unit circle
in the z-plane only once, avoiding aliasing of frequency components.
The bilinear transformation is linked to the trapezoidal formula for

numerical integration
2 1 z 1
,
s
1
T 1 z

H a ( s ) H ( z ),

, and it is defined as:


z re jw

s j

The LHP (RHP) in s-domain maps into the inside (outside) of the unit

circle in z-domain.
When
2r=
sin1,wthen 2 = 0wand

T 1 cos w

T
tan , w 2 tan 1 (
)
T
2
2

The entire range in is mapped only

once into the range w ,


though the mapping is highly
nonlinear.
Dr. Xinrong Li

Frequency Transformations
In general, lowpass analog IIR filters are designed first. Then,

frequency transformations are used to convert the lowpass filter to


highpass, bandpass, or bandstop filter.
Two alternative methods (Table 10.7 and Table 10.8):
Frequency transformation can be performed in the analog domain and then

convert the analog filter to a corresponding digital filter.


Or, analog lowpass filter can be converted into digital lowpass filter first.
Then, frequency transformation is performed in the digital domain.
In general, these two methods yield different results, except for the bilinear
transformation.
For impulse invariance method and the approximation of derivatives method, the

lowpass analog filter should be converted to digital lowpass filter and then
frequency transformation is performed in digital domain because these two
methods are not suitable for designing highpass and many bandpass filters due to
the aliasing problem.
For the bilinear transformation method, where aliasing is not an issue, frequency
transformation can be in either analog or digital domain.

You might also like