0% found this document useful (0 votes)
74 views99 pages

DSP Unit Iv PPT 1

The document discusses the design and specifications of IIR and FIR filters, emphasizing the steps involved in filter design, including specification, approximation, and implementation. It outlines the characteristics of various filter types, such as Butterworth and Chebyshev filters, and explains the conversion from analog to digital filters using methods like the bilinear transformation and impulse invariance. Additionally, it provides practical examples of filter specifications and the importance of maintaining stability during the design process.

Uploaded by

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

DSP Unit Iv PPT 1

The document discusses the design and specifications of IIR and FIR filters, emphasizing the steps involved in filter design, including specification, approximation, and implementation. It outlines the characteristics of various filter types, such as Butterworth and Chebyshev filters, and explains the conversion from analog to digital filters using methods like the bilinear transformation and impulse invariance. Additionally, it provides practical examples of filter specifications and the importance of maintaining stability during the design process.

Uploaded by

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

UNIT-IV

FIR & IIR FILTERS


IIR filters

2
Filter Design Techniques
• Any discrete-time system that modifies certain frequencies
• Frequency-selective filters pass only certain frequencies
• Filter Design Steps
– Specification
• Problem or application specific
– Approximation of specification with a discrete-time system
• Our focus is to go from spec to discrete-time system
– Implementation
• Realization of discrete-time systems depends on target technology
• We already studied the use of discrete-time systems to implement a
continuous-time system
– If our specifications are given in continuous time we can use

xn yn
xc(t) C/D H(e )
j
D/C yr(t)

 
H e j   Hc j  / T   
3
Digital Filter Specifications
• Only the magnitude approximation problem
• Four basic types of ideal filters with magnitude responses
as shown below (Piecewise flat)
H LP (e j ) HHP (e j )

1 1

 
  – c 0 c    – c 0 c 
HBS (e j )
HBP (e j )

–1 1

 
  – c2 – c1  c1  c2    – c2 – c1  c1  c2 
4
Digital Filter Specifications
• These filters are unealisable because (one of the
following is sufficient)
– their impulse responses infinitely long non-
causal
– Their amplitude responses cannot be equal to a
constant over a band of frequencies
Another perspective that provides some
understanding can be obtained by looking at the
ideal amplitude squared.

5
Digital Filter Specifications
• The realisable squared amplitude response transfer
function (and its differential) is continuous in
• Such functions 
– if IIR can be infinite at point but around that
point cannot be zero.
– if FIR cannot be infinite anywhere.
• Hence previous differential of ideal response is
unrealisable

6
Digital Filter Specifications
• For example the magnitude response of a digital
lowpass filter may be given as indicated below

7
Digital Filter Specifications

• In the passband 0   p we require


j
that G ( e ) 1 with a deviation  p

1   p  G (e j ) 1   p ,   p

s
• In the stopband  s   we require
that G (e j ) 0with a deviation
j
G (e )  s ,  s  
8
Digital Filter Specifications
Filter specification parameters
•  p - passband edge frequency
• s - stopband edge frequency
•  p - peak ripple value in the passband
•  s - peak ripple value in the stopband

9
Digital Filter Specifications

• Practical specifications are often given in


terms of loss function (in dB)
j
• G ( )  20 log10 G ( e )
• Peak passband ripple
 p  20 log10 (1   p ) dB
• Minimum stopband attenuation
 s  20 log10 (dB
s)

10
Digital Filter Specifications

• In practice, passband edge frequency Fp and


stopband edge frequency Fs specified in
are
Hz
• For digital filter design, normalized bandedge
frequencies need to be computed from
specifications in Hz using  2 Fp
p
p   2 FpT
FT FT
 s 2 Fs
s   2 Fs T
FT FT 11
Digital Filter Specifications
• Example - Let Fp 7 kHz, Fs 3
kHz, and FT 25 kHz
• Then
2 (7 103 )
p  3
0.56
25 10
2 (3 103 )
s  3
0.24
25 10

12
IIR Digital Filter Design

Standard approach
(1) Convert the digital filter specifications into
an analogue prototype lowpass filter
specifications
(2) Determine the analogue lowpass filter
transfer function H a (s )
(3) Transform H a (s ) by replacing the complex
variable to the digital transfer function
G (z )
13
IIR Digital Filter Design
• This approach has been widely used for the
following reasons:
(1) Analogue approximation techniques are
highly advanced
(2) They usually yield closed-form
solutions
(3) Extensive tables are available for
analogue filter design
(4) Very often applications require digital
simulation of analogue systems
14
IIR Digital Filter Design

• Let an analogue transfer function be


Pa ( s )
H a (s) 
Da ( s )
where the subscript “a” indicates the
analogue domain
• A digital transfer function derived from this
is denoted as
P( z )
G( z) 
D( z )
15
IIR Digital Filter Design
• Basic idea behind the conversion of H a (s ) intoG (z )
is to apply a mapping from the s-domain to
the z-domain so that essential properties of the
analogue frequency response are preserved
• Thus mapping function should be such that
– Imaginary (j ) axis in the s-plane be
mapped onto the unit circle of the z-plane
– A stable analogue transfer function be mapped
into a stable digital transfer function

16
Specification for effective frequency response of a continuous-time lowpass
filter and its corresponding specifications for discrete-time system.

dp or d1 passband ripple
ds or d2 stopband ripple
Wp, wp passband edge frequency
Ws, ws stopband edge frequency
e2 passband ripple parameter

1 – dp = 1/1 + e2

BW bandwidth = wu – wl
wc 3-dB cutoff frequency
wu, wl upper and lower 3-dB cutoff
frequensies
Dw transition band = |wp – ws|
Ap passband ripple in dB
=  20log10(1  dp)
As stopband attenuation in dB
= -20log10(ds) 17
Design of Discrete-Time IIR Filters

• From Analog (Continuous-Time) Filters


– Approximation of Derivatives
– Impulse Invariance
– the Bilinear Transformation

18
Reasons of Design of Discrete-Time IIR Filters from
Continuous-Time Filters

• The art of continuous-time IIR filter design is highly advanced and,


since useful results can be achieved, it is advantageous to use the
design procedures already developed for continuous-time filters.

• Many useful continuous-time IIR design methods have relatively


simple closed-form design formulas. Therefore, discrete-time IIR
filter design methods based on such standard continuous-time design
formulas are rather simple to carry out.

• The standard approximation methods that work well for continuous-


time IIR filters do not lead to simple closed-form design formulas
when these methods are applied directly to the discrete-time IIR case.

19
Characteristics of Commonly Used Analog Filters

• Butterworth Filter
• Chebyshev Filter
– Chebyshev Type I
– Chebyshev Type II of Inverse Chebyshev Filter

20
Butterworth Filter
• Lowpass Butterworth filters are all-pole filters characterized by the magnitude-squared
frequency response

|H(W)|2 = 1/[1 + (W/Wc)2N] = 1/[1 + e2(W/Wp)2N]

where N is the order of the filter, W c is its – 3-dB frequency (cutoff frequency), W p is the
bandpass edge frequency, and 1/(1 + e 2) is the band-edge value of |H(W)|2.

• At W = Ws (where Ws is the stopband edge frequency) we have


1/[1 + e2(Ws/Wp)2N] = d22
and
N = (1/2)log10[(1/d22) – 1]/log10(Ws/Wc) = log10(d/e)/log10(Ws/Wp)
where d2= 1/1 + d22.

• Thus the Butterworth filter is completely characterized by the parameters N, d 2, e, and the ratio
Ws/Wp.

21
Butterworth Lowpass Filters
• Passband is designed to be maximally flat
• The magnitude-squared function is of the form
1 1
Hc j     
2 2
H s 
1  j  / j  c  1  s / j  c 
2N c 2N

sk   1 j c   cej / 2N2k N 1


1 / 2N
for k  0,1,...,2N - 1

22
Frequency response of lowpass Butterworth filters

23
Chebyshev Filters
• The magnitude squared response of the analog lowpass Type I Chebyshev
filter of Nth order is given by:

|H(W)|2 = 1/[1 + e2TN2(W/Wp)].


where TN(W) is the Chebyshev polynomial of order N:
TN(W) = cos(Ncos-1 W), |W|  1,
= cosh(Ncosh-1 W), |W| > 1.

The polynomial can be derived via a recurrence relation given by


Tr(W) = 2WTr-1(W) – Tr-2(W), r  2,
with T0(W) = 1 and T1(W) = W.

• The magnitude squared response of the analog lowpass Type II or inverse


Chebyshev filter of Nth order is given by:
|H(W)|2 = 1/[1 + e2{TN(Ws/Wp)/ TN(Ws/W)}2].

24
Chebyshev Filters
• Equiripple in the passband and monotonic in the stopband
• Or equiripple in the stopband and monotonic in the passband
1
Hc j   
2

1   VN  /  c 
2 2
VN x   cosN cos1
x

25
Frequency response of
lowpass Type I Chebyshev filter

|H(W)|2 = 1/[1 + e2TN2(W/Wp)]

Frequency response of
lowpass Type II Chebyshev filter

|H(W)|2 = 1/[1 + e2{TN2(Ws/Wp)/TN2(Ws/W)}]

26
N = log10[( 1 - d22 +  1 – d22(1 + e2))/ed2]/log10[(Ws/Wp) +  (Ws/Wp)2 – 1 ]
= [cosh-1(d/e)]/[cosh-1(Ws/Wp)]

for both Type I and II Chebyshev filters, and where


d2 = 1/  1 + d2.

• The poles of a Type I Chebyshev filter lie on an ellipse in the s-plane with major
axis r1 = Wp{(b2 + 1)/2b] and minor axis r1 = Wp{(b2 - 1)/2b] where b is related to
e according to
b = {[ 1 + e2 + 1]/e}1/N
• The zeros of a Type II Chebyshev filter are located on the imaginary axis.

27
Type I: pole positions are
xk = r2cosfk
yk = r1sinfk
fk = [p/2] + [(2k + 1)p/2N]
r1 = Wp[b2 + 1]/2b
r2 = Wp[b2 – 1]/2b

b = {[ 1 + e2 + 1]/e}1/N

Type II: zero positions are


sk = jWs/sinfk
and pole positions are

vk = Wsxk/ xk2 + yk2

wk = Wsyk/ xk2 + yk2

b = {[1 +  1 – d22 ]/d2}1/N


Determination of the pole locations
for a Chebyshev filter.
k = 0, 1, …, N-1. 28
Approximation of Derivative Method

• Approximation of derivative method is the simplest one for converting an


analog filter into a digital filter by approximating the differential equation by
an equivalent difference equation.
– For the derivative dy(t)/dt at time t = nT, we substitute the backward difference
[y(nT) – y(nT – T)]/T. Thus
dy (t ) y ( nT )  y ( nT  T ) y[n ]  y[n  1]
 
dt t nT T T
where T represents the sampling period. Then, s = (1 – z -1)/T
– The second derivative d2y(t)/dt2 is derived into second difference as follow:

dy (t ) y[n ]  2 y[n  1]  y[n  2]


 2
dt t nT T
which s2 = [(1 – z-1)/T]2. So, for the kth derivative of y(t), sk = [(1 – z-1)/T]k.

29
Approximation of Derivative Method
• Hence, the system function for the digital IIR filter obtained as a result of the
approximation of the derivatives by finite difference is
H(z) = Ha(s)|s=(z-1)/Tz

• It is clear that points in the LHP of the s-plane are mapped into the
corresponding points inside the unit circle in the z-plane and points in the
RHP of the s-plane are mapped into points outside this circle.
– Consequently, a stable analog filter is transformed into a stable digital filter due
to this mapping property.

jW
Unit circle

s-plane
z-plane
30
Example: Approximation of derivative method

Convert the analog bandpass filter with system function


Ha(s) = 1/[(s + 0.1)2 + 9]
Into a digital IIR filter by use of the backward difference for the derivative.

Substitute for s = (1 – z-1)/T into Ha(s) yields


H(z) = 1/[((1 – z-1)/T) + 0.1)2 + 9]

T2
10.2 T 9.01T 2
H ( z)  1
1 2 (10.1T )
10.2 T 9.01T 2 z  1
10.2 T 9.01T 2
z 2
T can be selected to satisfied specification of designed filter. For example, if T = 0.1,
the poles are located at
p1,2 = 0.91  j0.27 = 0.949exp[ j16.5o]

31
Filter Design by Impulse Invariance
• Remember impulse invariance
– Mapping a continuous-time impulse response to discrete-time
– Mapping a continuous-time frequency response to discrete-time

hn  Tdhc nTd 



  2 
 
H e   Hc  j
j
 j k 
• k 
If the continuous-time filter is bandlimited to Td Td 

Hc j    0    / Td
 

H  
e j
 H  
c  j T cancels
If we start from discrete-time specifications
out

 Td 
d
– Start with discrete-time spec in terms of 
– Go to continuous-time =  /T and design continuous-time filter
– Use impulse invariance to map it back to discrete-time = T
• Works best for bandlimited filters due to possible aliasing

32
Impulse Invariance of System Functions
• Develop impulse invariance relation between system functions
• Partial fraction expansion of transfer function
N
Ak
Hc s  
k 1 s  sk
• Corresponding impulse response
N
 Ak esk t t 0
hc t   k 1
 0 t0
• Impulse response of discrete-time filter

 
N N
hn  Tdhc nTd    TdAk e un  TdAk esk Td un
sknTd n

• System function k 1 k 1

N
TdAk
Hz    sk Td  1
k 1 1  e z
• Pole s=sk in s-domain transform into pole at
esk Td

33
Impulse Invariant Algorithm

• Step 1: define specifications of filter


– Ripple in frequency bands
– Critical frequencies: passband edge, stopband edge, and/or cutoff frequencies.
– Filter band type: lowpass, highpass, bandpass, bandstop.
• Step 2: linear transform critical frequencies as follow
W = w/Td
• Step 3: select filter structure type and its order: Bessel, Butterworth, Chebyshev
type I, Chebyshev type II or inverse Chebyshev, elliptic.
• Step 4: convert Ha(s) to H(z) using linear transform in step 2.
• Step 5: verify the result. If it does not meet requirement, return to step 3.

34
Example: Impulse invariant method

Convert the analog filter with system function


Ha(s) = [s + 0.1]/[(s + 0.1)2 + 9]
into a digital IIR filter by means of the impulse invariance method.

The analog filter has a zero at s = - 0.1 and a pair of complex conjugate poles at p k = - 0.1  j3.
Thus, 1 1
H a s   2

2
s  0.1  j 3 s  0 .1  j 3

1 1
H z  
Then 2
 0.1T 1
 2
 0.1T  j 3T
1 e e j 3T
z 1 e e z 1

35
Frequency response
of digital filter.

Frequency response
of analog filter.

36
Disadvantage of previous
techniques: frequency
warping  aliasing effect
and error in specifications
of designed filter (frequencies)
So, prewarping of frequency
is considered.

37
Example
• Impulse invariance applied to Butterworth
 
0. 89125  H e j  1 0    0. 2
He   0.17783
j
0. 3    
• Since sampling rate Td cancels out we can assume T d=1
• Map spec to continuous time

0. 89125  Hj   1 0    0. 2
Hj    0.17783 0. 3    

• Butterworth filter is monotonic so spec will be satisfied if


Hc j0. 2 0. 89125 and Hc j0. 3 0.17783
1
Hc j   
2

1  j  / j  c 
2N

• Determine N and c to satisfy these conditions

38
Example Cont’d
• Satisfy both2Nconstrains 2 2N 2
 0. 2   1   0. 3   1 
1      and 1     
 c   0. 89125   c   0. 17783 

• Solve these equations to get


N  5. 8858  6 and  c  0. 70474

• N must be an integer so we round it up to meet the spec


  1function
• Poles ofsktransfer j c   cej / 12 2k 11 for k  0,1,...,11
1 / 12

0. 12093
Hs•  The transfer function
  
s2  0. 364s  0. 4945 s2  0. 9945s  0. 4945 s2  1. 3585s  0. 4945 

• Mapping to0.z-domain
2871  0. 4466z  1  2. 1428  1. 1455z  1

Hz  
1  1. 2971z  1  0. 6949z  2 1  1. 0691z  1  0. 3699z  2
1. 8557  0. 6303z  1

1  0. 9972z  1  0. 257z  2
39
Example Cont’d

40
Filter Design by Bilinear Transformation
• Get around the aliasing problem of impulse invariance
• Map the entire s-plane onto the unit-circle in the z-plane
– Nonlinear transformation
– Frequency response subject to warping
• Bilinear transformation
2  1  z 1 
s  1 

• Transformed system function Td 1  z 

2  1  z 1  
Hz   Hc   
 1 
• Again Td cancels out so we can ignore it  Td  1  z  
• We can solve the transformation for z as

1  Td / 2s 1  Td / 2  j Td / 2 s    j


• z  the inside of the unit-circle in z
Maps the left-half s-plane into
– Stable in  domain
1 one s stay1 in theTother
Td / 2would d / 2  j Td / 2

41
Bilinear Transformation
• On the unit circle the transform becomes
1  j Td / 2
z  ej
1  j Td / 2

• To derive the relation between  and 


2  1  e j   2  2e j  / 2 j sin / 2 2 j  
s   j 
    j     j / 2   tan 
Td 1  e  Td  2e cos / 2 Td 2

• Which yields
2    Td 
 tan  or   2 arctan 
Td 2  2 

42
Bilinear Transformation

43
Example
• Bilinear transform applied to Butterworth
j
0. 89125  H e   1 0    0. 2
He   0.17783
j
0. 3    

• Apply bilinear transformation to specifications 2


 0. 2 
0. 89125  Hj   1 0   tan 
Td  2 
2  0. 3 
Hj    0.17783 tan    
Td  2 

• We can assume Td=1 and apply the specifications to


1
Hc j   
2

1   /  c 
2N

• Toget
2 tan 0. 1 
2N
1
2
 2 tan 0. 15 
2N
1
2
   
1    and 1     
 c   0. 89125   c   0. 17783 

44
Example Cont’d
• Solve N and c
  1 
2
   1 
2

log     1      1 
   0. 17783     0. 89125 
 


N  5. 305  6  c  0. 766
   
2 log tan 0. 15 tan 0. 1 
• The resulting
sk   1 transfer
1 / 12
j c  function
 cej  / 12 2has
k 11  the following poles
for k  0,1,...,11

0. 20238
Hc s• Resulting in
  
s2  0. 3996 s  0. 5871 s2  1. 0836 s  0. 5871 s2  1. 4802 s  0. 5871 

• Applying
Hz   the bilinear transform
0. 0007378yields
1  z 1  
6

 
1  1. 2686 z  1  0. 7051z  2 1  1. 0106z  1  0. 3583z  2 
1

1  0.9044z 1
 0. 2155z  2 
45
Example Cont’d

46
IIR Digital Filter: The bilinear
transformation

• To obtain G(z) replace s by f(z) in H(s)


• Start with requirements on G(z)

G(z) Available H(s)

Stable Stable
Real and Rational in Real and
z Rational in s
Order n Order n
 c L.P. cutoff cT
L.P. (lowpass) cutoff
47
Bilinear Transformation
• Mapping of s-plane into the z-plane

48
Bilinear Transformation
• For z e j with unity scalar we have
 j
j  1  e  j tan( / 2)
 j
1 e
or  tan( / 2)

49
Bilinear Transformation
• Mapping is highly nonlinear
• Complete negative imaginary axis in the s-
plane from   to  0 is mapped
into the lower half of the unit circle in the z-
 1 z 1to
plane zfrom
• Complete positive imaginary axis in the s-
plane from  0 to   is mapped into
the upper half of the unit circle in the z-plane
from z 1 toz  1
50
Bilinear Transformation
• Nonlinear mapping introduces a distortion
in the frequency axis called frequency
warping
• Effect of warping shown below

51
Spectral Transformations
• To transform GL (z ) a given lowpass transfer
function to another transfer function GD (zˆ )
that may be a lowpass, highpass, bandpass or
bandstop filter (solutions given by
Constantinides)
• z  1 has been used to denote the unit delay in
1
the prototype lowpass filter GL (z ) and zˆ
to denote the unit delay in the transformed
filter GD (zˆ ) to avoid confusion
52
Spectral Transformations
• Unit circles in z- and ẑ -planes defined by
z e j zˆ e j̂
,
• Transformation
ẑ from z-domain to
-domain given by

• Then z F (zˆ )
GD ( zˆ ) GL {F ( zˆ )}
53
Spectral Transformations
• From z F (zˆ ) , thusz  F (zˆ ) , hence
 1, if z  1

F ( zˆ ) 1, if z 1
 1, if z  1

• Therefore 1 / F ( zˆ ) must be a stable allpass function

1 L  1  * zˆ 
   ,   1
 
F ( zˆ ) 1 zˆ    

54
Lowpass-to-Lowpass
Spectral Transformation
• To transform a lowpass filterGL (z ) with a cutoff
frequency  c to another lowpass filter GD (zˆ )
with a cutoff frequency ̂ c , the transformation is
1 1   zˆ
z 1
 
F ( zˆ ) zˆ  
• On the unit circle we have
 jˆ
e  e  jˆ
 j
1  e
which yields
tan( / 2)  1    tan(ˆ / 2)
1   55
Lowpass-to-Lowpass
Spectral Transformation
• Solving we get sin ( c  ˆ c ) / 2 

sin ( c  ˆ c ) / 2 
• Example - Consider the lowpass digital filter
0.0662(1  z  1 )3
GL ( z )  1 1 2
(1  0.2593 z )(1  0.6763 z  0.3917 z )
which has a passband from dc to 0.25 with
a 0.5 dB ripple
• Redesign the above filter to move the
passband edge to
0.35 56
Lowpass-to-Lowpass
Spectral Transformation
• Here sin(0.05 )
   0.1934
sin(0.3 )
• Hence, the desired lowpass transfer function is
GD ( zˆ ) GL ( z ) z  zˆ  0.1934 1
1

1 0.1934 zˆ  1

-10
Gain, dB

G (z) G (z)
L D
-20

-30

-40
0 0.2 0.4 0.6 0.8 1
w/p
57
Lowpass-to-Lowpass
Spectral Transformation
• The lowpass-to-lowpass transformation
 1 1 1   zˆ
z  
F ( zˆ ) zˆ  
can also be used as highpass-to-highpass,
bandpass-to-bandpass and bandstop-to-
bandstop transformations

58
Lowpass-to-Highpass
Spectral Transformation
• Desired transformation
1
1 zˆ  
z 
1   zˆ  1
• The transformation parameter  is given by
cos( c  ˆ c ) / 2 
 
cos( c  ˆ c ) / 2 
where  c is the cutoff frequency of the lowpass filter
and is̂the
c cutoff frequency of the desired
highpass filter
59
Lowpass-to-Highpass
Spectral Transformation
• Example - Transform the lowpass filter
1 3
0.0662(1  z )
GL ( z ) 
(1  0.2593 z  1 )(1  0.6763 z  1  0.3917 z  2 )
• with a passband edge at 0.25 to a highpass
filter with a passband edge at 0.55
• Here   cos(0.4 ) / cos(0.15 )  0.3468
• The desired transformation is
1
1 ˆ  0.3468
z
z  1
1  0.3468 zˆ 60
Lowpass-to-Highpass
Spectral Transformation

• The desired highpass filter is


GD ( zˆ ) G ( z ) z 1

zˆ  1  0.3468
1 0.3468 zˆ  1
0

- 20
Gain, dB

- 40

- 60

- 80
0 0.2p 0.4p 0.6p 0.8p p
Normalized frequency
61
Lowpass-to-Highpass
Spectral Transformation
• The lowpass-to-highpass transformation can
also be used to transform a highpass filter with
a cutoff at  c to a lowpass filter with a cutoff
at ̂ c
• and transform a bandpass filter with a center
frequency at  o to a bandstop filter with a
center frequency at ̂ o

62
Lowpass-to-Bandpass
Spectral Transformation
• Desired transformation

2 2  1   1
zˆ  zˆ 
1  1  1
z 
  1  2 2  1
zˆ  zˆ  1
 1  1

63
Lowpass-to-Bandpass
Spectral Transformation
• The parameters  and  are given by

cos(ˆ c 2  ˆ c1 ) / 2 

cos(ˆ c 2  ˆ c1 ) / 2 
 cot (ˆ c 2  ˆ c1 ) / 2tan( c / 2)
where  c is the cutoff frequency of the lowpass
filter, and ˆ c1 and ˆ c 2 are the desired upper and
lower cutoff frequencies of the bandpass filter

64
Lowpass-to-Bandpass
Spectral Transformation
• Special Case - The transformation can be
simplified if  c ˆ c 2  ˆ c1
• Then the transformation reduces to
1
1 1 ˆ  
z
z  zˆ 1
1   zˆ
where  cos ˆ o with ̂ o denoting the
desired center frequency of the bandpass filter

65
Lowpass-to-Bandstop
Spectral Transformation
• Desired transformation

2 2  1 1  
zˆ  zˆ 
1 1  1 
z 
1    2 2  1
zˆ  zˆ  1
1  1 

66
Lowpass-to-Bandstop
Spectral Transformation
• The parameters  and  are given by
cos(ˆ c 2  ˆ c1 ) / 2 

cos(ˆ c 2  ˆ c1 ) / 2 
 tan (ˆ c 2  ˆ c1 ) / 2 tan( c / 2)
where  c is the cutoff frequency of the
lowpass filter, and ˆ c1 and ˆ c 2 are the desired
upper and lower cutoff frequencies of the
bandstop filter

67
UNIT-4
FIR Filters

68
Selection of Filter Type

• The transfer function H(z) meeting the


specifications must be a causal transfer
function
• For IIR real digital filter the transfer function
1
is a real rational function of z
p0  p1 z  1  p2 z  2    pM z  M
H ( z) 
d 0  d1 z  1  d 2 z  2    d N z  N
• H(z) must be stable and of lowest order N or
M for reduced computational complexity 69
Selection of Filter Type

• FIR real digital filter transfer function is a


polynomial in z  1 (order N) with real
coefficients N
n
H ( z )   h[n] z
n 0
• For reduced computational complexity, degree N
of H(z) must be as small as possible
• If a linear phase is desired then we must have:

h[n] h[ N  n]
70
Selection of Filter Type
• Advantages in using an FIR filter -
(1) Can be designed with exact linear phase
(2) Filter structure always stable with quantised
coefficients
• Disadvantages in using an FIR filter - Order of an
FIR filter is considerably higher than that of an
equivalent IIR filter meeting the same
specifications; this leads to higher computational
complexity for FIR

71
FIR Filter Design
Digital filters with finite-duration impulse response (all-zero, or FIR filters)
have both advantages and disadvantages compared to infinite-duration
impulse response (IIR) filters.
FIR filters have the following primary advantages:

•They can have exactly linear phase.


•They are always stable.
•The design methods are generally linear.
•They can be realized efficiently in hardware.
•The filter startup transients have finite duration.

The primary disadvantage of FIR filters is that they often require a much
higher filter order than IIR filters to achieve a given level of performance.
Correspondingly, the delay of these filters is often much greater than for an
equal performance IIR filter.
FIR Design
FIR Digital Filter Design
Three commonly used approaches to FIR
filter design -
(1) Windowed Fourier series approach
(2) Frequency sampling approach
(3) Computer-based optimization methods

73
Finite Impulse Response Filters
• The transfer function is given by
N1
n
H ( z )   h(n).z
n 0

• The length of Impulse Response is N


• All poles are at z 0.
• Zeros can be placed anywhere on the z-
plane

74
FIR: Linear phase

For phase linearity the FIR transfer


function must have zeros outside the
unit circle

75
Linear Phase
• What is linear phase?
• Ans: The phase is a straight line in the passband of
the system.
• Example: linear phase (all pass system)
• I Group delay is given by the negative of the slope
of the line

76
Linear phase
• linear phase (low pass system)
• Linear characteristics only need to pertain to
the passband frequencies only.

77
FIR: Linear phase
• For Linear Phase t.f. (order N-1)
• h(n) h( N  1  n)
• so that for N even:
N 1
2 N1
n
H ( z )   h( n).z   h( n).z  n
n 0 n N
2
N 1 N 1
2 2
  h( n).z  n   h( N  1  n).z  ( N  1 n )
n 0 n 0
N 1
2

  h( n) z  n z  m
n 0
 m N  1  n
78
FIR: Linear phase
• for N odd:
N1 N  1
1
 
2
H ( z )   h(n). z
n 0
 n
z m
 
 h
N  1
 2 
z  2 

• I) On C : z 1 we have for N even, and


+ve sign
N  1 N  1
 jT  N  1 
j T  2 
 2  
H (e ) e .  2h(n). cos T  n  
n 0   2 
79
FIR: Linear phase
• II) While for –ve sign
N  1 N  1
 jT  N  1 

.  j 2h( n).sin  T  n 
 2
H (e jT ) e  2 

n 0   2 
• [Note: antisymmetric case adds  / 2 rads to
phase, with discontinuity at  0 ]
• III) For N odd with +ve sign
N  1
 jT 
j T  2    N  1
H (e ) e  h 
  2 
N 3

 N  1  
  2h( n). cos  T  n 
2
 
n 0   2  
 80
FIR: Linear phase
• IV) While with a –ve sign
 jT 
N  1 N  3 
 2   2   N 1  
H (e jT ) e   2 j.h( n).sin  T  n   
 n 0   2  
 
• [Notice that for the antisymmetric case to have
linear phase we require
N  1
h  0.
 2 

The phase discontinuity is as for N even]


81
FIR: Linear phase
• The cases most commonly used in filter
design are (I) and (III), for which the
amplitude characteristic can be written as a
polynomial in
T
cos
2

82
Summary of Properties
K
H   e j0 e  jN / 2 F   ak cosk 
k 0

Type I II III IV
Order N even odd even odd
Symmetry symmetric symmetric anti-symmetric anti-symmetric
Period 2p 4p 2p 4p
w0 0 0 p/2 p/2
F(w) 1 cos(w/2) sin(w) sin(w/2)
K N/2 (N-1)/2 (N-2)/2 (N-1)/2
H(0) arbitrary arbitrary 0 0
H(p) arbitrary 0 0 arbitrary
Design of FIR filters: Windows
(i) Start with ideal infinite duration h(n)
(ii) Truncate to finite length. (This produces
unwanted ripples increasing in height near
discontinuity.)
(iii) Modify to ~
h (n) h(n).w(n)
Weight w(n) is the window

84
Design of FIR filters: Windows
• Simplest way of designing FIR filters
• Method is all discrete-time no continuous-time involved
• Start with ideal frequency
 response
   h ne

1
Hd e j  
n 
d
 j n
hd n 
2 
Hd  
e j
e j n
d

• Choose ideal frequency response as desired response


• Most ideal impulse responses are of infinite length
• The easiest way to obtain a causal FIR filter from ideal is
hd n 0  n  M
hn  
 0 else

• More generally 1 0  n  M
hn  hd nwn where wn  
0 else

85
Properties of Windows
• Prefer windows that concentrate around DC in frequency
– Less smearing, closer approximation
• Prefer window that has minimal span in time
– Less coefficient in designed filter, computationally efficient
• So we want concentration in time and in frequency
– Contradictory requirements
• Example: Rectangular window
1  e j M1  j M / 2 sinM  1 / 2
M
We  e
j  j n

1  e j 
 e
sin / 2
n 0

86
Windowing distortion
• increasing window length generally reduces the
width of the main lobe
• peak of sidelobes is generally independent of M

87
Windows
Commonly used windows
•Rectangular 1 N1
2n n 
•Bartlett 1  2
N
2n 
•Hanning 1  cos 
 N  2n 
•Hamming 0.54  0.46 cos 

•  N 
• Blackman  2n   4n 
0.42  0.5 cos   0.08 cos 
 N   N 

• Kaiser  2 n
2
J 0   1   
  J 0 ( )
  N  1  

88
Rectangular Window
• Narrowest main lob
– 4/(M+1)
– Sharpest transitions at
discontinuities in frequency

• Large side lobs


– -13 dB
– Large oscillation around
discontinuities

• Simplest window possible

1 0 n M
 
w n 
0 else

89
Bartlett (Triangular) Window
• Medium main lob
– 8/M

• Side lobs
– -25 dB

• Hamming window
performs better
• Simple equation

 2n / M 0 n M / 2

wn  2  2n / M M / 2  n  M
 0 else

90
Hanning Window
• Medium main lob
– 8/M

• Side lobs
– -31 dB

• Hamming window performs


better

• Same complexity as
Hamming

1   2n  
 1  cos  0 n M
wn  2   M 
 0 else

91
Hamming Window
• Medium main lob
– 8/M

• Good side lobs


– -41 dB

• Simpler than Blackman

  2n 
0. 54  0. 46 cos  0 n M
wn    M 
 0 else

92
Blackman Window
• Large main lob
– 12/M

• Very good side lobs


– -57 dB

• Complex equation

  2n   4n 
0. 42  0. 5 cos   0. 08 cos  0 n M
wn    M   M 
 0 else

93
Kaiser Window Filter Design Method
• Parameterized equation
forming a set of windows
– Parameter to change main-lob
width and side-lob area trade-off

  2

I 0   1   n  M / 2 
 
  M/ 2  
wn     0 n M
 I 0  

 0 else

– I0(.) represents zeroth-order


modified Bessel function of 1st
kind

94
Comparison of windows

95
Kaiser window
• Kaiser window
β Transition Min. stop
width attn dB
(Hz)
2.12 1.5/N 30
4.54 2.9/N 50
6.76 4.3/N 70
8.96 5.7/N 90
96
Example
• Lowpass filter of length 51 and  c  / 2
Lowpass Filter Designed Using Hann window Lowpass Filter Designed Using Hamming window
0 0

Gain, dB
Gain, dB

-50 -50

-100 -100

0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1


w/p w/p
Lowpass Filter Designed Using Blackman window
0
Gain, dB

-50

-100

0 0.2 0.4 0.6 0.8 1 97


w/p
Frequency Sampling Method
• In this approach we are given H (k ) and
need to find H (z )
• This is an interpolation problem and the
solution is given in the DFT part of the
course N
1 N1 1 z
H ( z )   H (k ). 2
N k 0 j k
1  e N .z  1
• It has similar problems to the windowing
approach 98
FIR Digital Filter Order Estimation

Kaiser’s Formula:
 20 log10 (  p s )  13
N 1
14.6(s   p ) / 2
• ie N is inversely proportional to transition
band width and not on transition band
location

99

You might also like