Вы находитесь на странице: 1из 118

ADSP Lec SH1

Dr. Aditya Abhyankar


Recap of last time
 How Fourier Works!!
 Poles and Zeros
 Conceptual difference ZT and DTFT
 Partial Fraction Expansion
 Causality, Stability and Rationality in z-
sense
 IIR Realization (Form I and II)
 Cascade Decomposition & System
Solutions
Today
 Journey towards building digital filters
 System Responses
 LPF Butterworth Approximation
 Design Parameters
 Pole analysis
 Complete LPF Butterworth Analog
Solution
Causal Rational System
 Rational means IMPLEMENTABLE

( z  1 ).( z   2 )...( z   M )
H (Z )  K
( z  1 ).( z   2 )...( z   N )
 This is also called pole-zero form
 As system is causal M<=N
 Else numerator dominates denominator
and z tending to infinity may not have
convergent H(z) (condition for causality!)
Causal Rational System
 Rational means IMPLEMENTABLE

( z  1 ).( z   2 )...( z   M )
H (Z )  K
( z  1 ).( z   2 )...( z   N )
M

b z l
l

H (Z )  l 0
N
1   ak z  k
k 1
Causal Rational System
 Rational means IMPLEMENTABLE

( z  1 ).( z   2 )...( z   M )
H (Z )  K
( z  1 ).( z   2 )...( z   N )
M

b z l
l

H (Z )  l 0
N
1   ak z  k
Important for k 1
Realization
Causal Rational System
 Rational means IMPLEMENTABLE
M

b z l
l
Y ( z)
H ( z)  l 0
N

X ( z)
1   ak z k

k 1

N M
Y ( z )  Y ( z ) ak z k
 X ( z ) bl z l

k 1 l 0
Causal Rational System
 Rational means IMPLEMENTABLE
N M
Y ( z )  Y ( z ) ak z k
 X ( z ) bl z l

k 1 l 0

N M
y[n]   ak y[n  k ]   bl x[n  l ]
k 1 l 0
Causal Rational System
M

N M
k
b z k

H ( z)  k 0
y[n]   ak y[n  k ]   bk x[n  k ] N

k 1 k 0 1   ak z  k
k 1

Direct Form (I)


b0
x (n ) y (n)
z 1 b1 a1 z 1
x ( n  1) y ( n  1)
z 1 z 1

bM 1 a N 1
x ( n  M  1) y ( n  N  1)
z 1 z 1
bM aN
x(n  M ) y (n  N )
 LTI System : independant of cascading order
x(n) b0
y (n)
a1 z 1 z 1 b1

z 1 z 1

a N 1 bM

z 1 b0
aN
x(n) y (n)
a1 z 1 b1
 Remove unnecessary delays
( duplicated ) z 1

bM

z 1
aN
Causal Rational System
Cascade Form
- Second order factored form
- pole-zero pairing
M M / 2 
 bk z k
 (1   1k z 1
  2k z 2
)
H ( z)  k 0
N
 b0  k 1
N / 2
1   ak z  k  1k
(1   z 1
  2k z 2
)
k 1 k 1

1 1
 1

11 11 12 12 1L 1 L

 21  21  22  22  2L  2L
Causal Rational System
Ak B0 k  B1k z 1
H ( z)      k
C z k

1   k z k 1  1k z 1   2 k z  2
C0
C1
B0 k

1k
B1k

 2k (3) Parallel Form


- Partial fraction
Ak
expansion
k
Causal Rational System
b0 b0
x(n) x(n)
y (n) y (n)
a1 z 1
b1 z 1 b1
a1

z 1 z 1
a2 b2 a2 b2
(4) Transposed Form a1
-Reverse the flow of a structure,
-then you will get the identical
transfer function

Question : Why is it true?  Mason' s formula


Causal Rational System
 Rational means IMPLEMENTABLE
N M
Y ( z )  Y ( z ) ak z k
 X ( z ) bl z l

k 1 l 0

DIFFERENCE EQUATION !!!!!

N M
y[n]   ak y[n  k ]   bl x[n  l ]
k 1 l 0
System Function
 Can be decomposed into product terms

H ( z )  H1 ( z ).H z ( z ).....H q ( z )
 Several possibilities of such
decomposition!
 Realization through cascading
 Cascade Decomposition!
Cascade Decomposition

(Numerator of degree in z 1 )<P


H ( z) 
(1- z -1 ) P
 Real pole at alpha of multiplicity P
1
(Numerator of degree in z )<2P
H ( z) 
{(1- z )(1- z )}
-1 -1 P

 ß are complex conjugate pole pairs.


Solutions of Difference Equations
 Restricted class
 Linear Constant Coefficient DE (LCCDE)

N M
y[n]   ak y[n  k ]   bl x[n  l ]
k 1 l 0

 Can we analyze the systems for restricted


time period!
Example
 We are given causal input values
1
y[n]  y[n  1]  y[ n  2]  3 x[n], n  0
2
 If y[-1] and y[-2] are given, the system can
be solved recursively.
 Can we solve this for time region of
interest?
Example
 Restricted class of DE
1
y[n]  y[n  1]  y[ n  2]  3 x[n], n  0
2
 If input were to extend for all time
 This can be solved using Rational Z-
Transform
Example
x[ n]   , n  0
n

1
y[n]  y[n  1]  y[ n  2]  3 x[n], n  0
2
 If input were to extend for all time
 This can be solved using Rational Z-
Transform
Example
x[ n]   [ n]
n

1
y[n]  y[n  1]  y[ n  2]  3 x[n], n  0
2
 If input were to extend for all time
 This can be solved using Rational Z-
Transform
Example
x[ n]   , n  0
n

1
y[n]  y[n  1]  y[ n  2]  3 x[n], n  0
2
 If input were to extend for all time
 This can be solved using Rational Z-
Transform
3
H ( z) 
1 1 2
(1  z  z )
2
Solution depends on:
 Poles of the system and their multipliticity
 Exponential factor in input and
multiplicity of polynomial

 Solution doesn’t depend on specific


coefficients!
Example
n
1
x[ n]    , n  0
2
1
y[n]  y[ n  1]  x[n], n  0
3

System pole at 1/3, input pole at ½ and are distinct !!


Their intersection is NULL!
Rational Systems for limited time
 Typically for such systems solution has
three components
 Natural response  contributed by
system alone
 Forced response  contributed by the
input alone
 Resonant Response  contributed by
common poles of system and input
Example
 Lets solve for n>=0
Num
H ( z) 
1 1 2 1 1
(1  z ) (1  z )
3 4
n n
1 1
x[ n]       , n  0
3 5
Example
 System poles {(1/3,1/3),1/4}

 Input poles {1/3, 1/5}


Example
 System poles {(1/3,1/3),1/4} Natural response

n
Resonant response 1
A2   , n  0
4
 Input poles {1/3, 1/5} Forced response
n
1
n A1   , n  0
1 5
( A3n  A4 n  A5 )   , n  0
2

3
Example
 Lets solve for n>=0
Num
H ( z) 
1 1 2 1 1
(1  z ) (1  z )
3 4
Num
H ( z) 
1  (1 z   2 z   3 z )
1 2 3

M
y[n]  1 y[n  1]   2 y[n  2]   3 y[n  3]   bl x[ n  l ]
l 0
Example
 Lets solve for n>=0
M
y[n]  1 y[n  1]   2 y[n  2]   3 y[n  3]   bl x[n  l ]
l 0

 System has a degree three (no of poles),


then we need three initial conditions
 Solution by Brute Force without
understanding nature of the solution
 This is sufficient! BUT not elegant!
Example
 System poles {(1/3,1/3),1/4} Natural response

n
Resonant response 1
A2   , n  0
4
 Input poles {1/3, 1/5} Forced response
n
1
n A1   , n  0
1 5
( A3n  A4 n  A5 )   , n  0
2

3
Example
 Lets solve for n>=0
M
y[n]  1 y[n  1]   2 y[n  2]   3 y[n  3]   bl x[n  l ]
l 0

 System has a degree three (no of poles),


then we need three initial conditions
 Three conditions and FIVE unknowns!

n n n
1 1 1
y[n]  A1    A2    ( A3 n  A4 n  A5 )  
2

5 4 3


SYNTHESIS
 Design of discrete time filters
 Analysis part has been covered up!
 We are now ready with the tools!
 What type of filters?
 What are the specifications
Example: Ideal Low pass filter!

H ( )   h[n]e
n 
 j n

 c c 
 sin c n
  n , n  0
h[n]  
 c , n  0
 
Example: Ideal Low pass filter!

Where is the
H ( )   h[n]e
n 
 j n

design???

 c c 
 sin c n
  n , n  0
h[n]  
 c , n  0
 
Example: Ideal Low pass filter!

Where is the
H ( )   h[n]e
n 
 j n

Doesn’t converge
design???

 c c 
 sin c n
  n , n  0
h[n]  
 c , n  0
 
Problems with Ideal Filters
 Infinitely non-causal !

 BIBO Unstable !

 Irrational !

 We want to design stable, causal, rational


filter which goes closer to the ideal filters.
Realistic Specifications
 Pass Band

 Stop Band

 Transition Band
Example: Ideal Low pass filter!

 c c 
 sin c n
   n , n  0
H ( )   h[n]e  j n
h[n]  
n   c , n  0
 
Example: Ideal Low pass filter!
Discontinuity results into infinite
spread in frequency response 
Non-causal
Infinite
Zeros:
Irrational!!

 c c 
 sin c n
   n , n  0
H ( )   h[n]e  j n
h[n]  
n   c , n  0
 
Low pass filter: Realistic
Specifications
 1 : passband ripple
| H(ej) |  2 : passband ripple
1 1 1 In some IIR filter design
1
11 11

1 pass band [0,  p ]


2
 2 transition band [ p ,  s ]
0 p s 
1 2 3 3 stop band [ s ,  ]
Rational Design
 IIR: LCCDE is recursive
 System has poles and zeros
 Has precedence in Analog design

 FIR: LCCDE is non-recursive


 Trivial poles, all at z=0
 Boon of only discrete systems! No
precedence !!
IIR Filter Design Concepts
1 Given specification in digital domain
2 Convert it into analog filter specification
3 Design analog filter (Butterworth, Chebyshov, elliptic):H(s)
4 Apply bilinear transform to get H(z) out of H(s)
 
s
3 2 ω
p 2  tan
Td 2
| H( j) | 
1 j
1 1
1
| H(e )| 4
1  2
A 1
12
H ( z)  H (s) 1 1 z 1
1 s 
1 Td 1 z 1

A

 p s 
Example
 Lets say we have Analog TF

1
CS 1 1
H ( s)    ,  RC , s  j
R
1 1  RCS 1  j 
CS
Mapping from Analog to Discrete
 What are the requirements?
◦ Rational function in S should get mapped to
rational function in Z
◦ Mapping itself has to be rational
◦ Stability of analog filter must be preserved
◦ Absolute summability should be maintained
Stability Check !
S-plane Z-plane

j
z , z  e
n
st ,
e t=continuous

s    j n nj
 e
e et j
  0 Decay    1
S-plane to Z-plane conversion

s  plane z  plane

j  axis u.c

- any mapping than maps stable region is s-plane (left half plane)
to stable region in z-plane (inside u.c) ? Td
1 s
1 1  z  1 or 2
bilinear transform! s   z 
T d 1  z 1 Td
1 s
2
* Td inserted for convention may put to any convenient value
for practical use.
S-plane to Z-plane conversion

s  plane z  plane

j  axis u.c

- any mapping than maps stable region is s-plane (left half plane)
to stable region in z-plane (inside u.c) ? Td
1 s
1 1  z  1 or 2
bilinear transform! s   z 
T d 1  z 1 Td
1 s
2
* Td inserted for convention may put to any convenient value
for practical use.
S-plane to Z-plane conversion

 How can we approximate the derivative


operator in discrete time
d st
e  se st

dt
 When system function is ‘s’, underlying
operation is of deivative
 Approximate with a rational system !!
 What happens in the derivative?
Derivative
dx(t )
y (t ) 
dt
x(t  t )  x(t )
y (t )  lim
t  0 t

 In discrete sense it is

y[ n]  x[n]  x[n  1]
System Function

y[n]  x[n]  x[n  1]

1
Y [ z]  X [ z]  z X [ z]
 System Function:
1
H [ z]  1  z
 Can we put s  1 z 1
Examine!
1
s  1 z
1
z , s  j
1 s
1
z
1  j

 Won’t work! Doesn’t approach Unit


Circle !!
Lets identify the problem!
1
s  1 z

s  z 1/ 2 ( z1/ 2  z 1/ 2 )


Lets identify the problem!
1
s  1 z

s  z 1/ 2 ( z1/ 2  z 1/ 2 )


j
ze
j / 2  j / 2 
(e e )  j 2sin
2
 Unit circle at least takes us to imaginary
axis in s-plane, but still doesn’t span the
entire imaginary axis
Lets identify the problem!
 Neither sin nor cos can help us span the
entire axis, it has to be a tan funcion!

j tan
2

z 1/ 2 ( z1/ 2  z 1/ 2 ) ( z1/ 2  z 1/ 2 )


s  1/ 2 1/ 2  1/ 2
z ( z  z ) ( z  z 1/ 2 )
1/ 2

 This one does the job!


Correct sz transition
z 1/ 2 ( z1/ 2  z 1/ 2 ) ( z1/ 2  z 1/ 2 )
s  1/ 2 1/ 2  1/ 2
z ( z  z ) ( z  z 1/ 2 )
1/ 2

1
1 z
s 1
1 z
 This one does the job!
Let’s examine this !

s  j tan
2
Let’s examine this !

j  j tan
2

  tan
2
 As discrete frequency runs from –π to π,
analog frequency runs from -∞ to ∞!
 This mapping is MONOTONICALLY
INCREASING !!
Desired LPF (practical)

 s  p  p s 
Desired LPF (practical) Hence
Filter Causality and
Monotonically
Stability has to be
Increasing!
maintained!

 s  p  p s 

Relative Positions
of Pass and Stop
bands to be
maintained!

 s p p s 
Stability of mapping

1  z 1 z  1 1 s
s 1
 z
1 z z 1 1 s

 Both Forward and Inverse mappings are


RATIOs of linear expressions (first degree
polynomials!)
 Hence called bilinear transformation!
Stability of mapping
1 s
z
1 s
 Right half of s-plane s    j    0
 Correspondingly

1    j
z
1    j
 How the magnitude of z varies?
Stability of mapping
(1   )  
2 2
|z| 2

(1   )  
2 2

 If   0
 Correspondingly

(1   )    (1   )  
2 2 2 2

 Thus, right half plane gets mapped to the


exterior of the unit circle on z-plane
Stability of mapping
(1   )  
2 2
|z| 2

(1   )  
2 2

 If   0
 Correspondingly

(1   )    (1   )  
2 2 2 2

 Thus, left half plane gets mapped to the


interior of the unit circle on z-plane
Stability of mapping
(1   )  
2 2
|z| 2

(1   )  
2 2

 If   0
 Correspondingly

(1   )    (1   )  
2 2 2 2

 Thus, imaginary axis gets mapped to the


unit circle on z-plane
Stability of mapping
1 s
z
1 s
 Right half of s-plane   0 | z | 1
 Left half of s-plane   0 | z | 1
 Imaginary axis   0 | z | 1
Design of IIR Filters
 Designed using experience from analog
filter design
 We wish to design piece-wise constant
filters!
 During bilinear transformation  the
pieces are maintained
 However, segments are distorted
 Inside a piece, mapping is non-linear
 Specifications should be consistent for
pieces (bands)
Attack Strategy
Specifications for
discrete time
filter (problem
definition)

Map it for
corresponding
analog filter
Attack Strategy
Specifications for
discrete time
filter (problem
definition)

  tan
2
Map it for
corresponding
analog filter
Attack Strategy
Specifications for
discrete time
filter (problem
definition)

  tan
2
Map it for Design an Analog
corresponding LPF filter
analog filter
s  sL
Attack Strategy
Specifications for
discrete time
filter (problem 1 s
z
definition) 1 s

  tan
2
Map it for Design an Analog
corresponding LPF filter
analog filter
s  sL
Design of Analog LPF
 The magnitude specifications are reqired!
Design of Analog LPF
1  1
1  1 2
 s p p s 

Pass-band Tolerance
Stop-band
Tolerance
Design of Analog LPF
Approximation Type Pass-Band Stop-Band

Butterworth Monotonic Monotonic


Approximation
Design of Analog LPF
1  1
1  1 2
 s p p s 

Pass-band Tolerance
Stop-band
Tolerance
Monotonic, Causal, Stable and Rational System
Transfer Function
Simplest Monotonic Function

 1 : passband ripple
| H(s)|  2 : passband ripple
1 1 1
1
11 11

1 pass band [0,  p ]


2
 2 transition band [ p ,  s ]
0 p s 
1 2 3 3 stop band [ s ,  ]
Simplest Monotonic Function
Let’s ignore phase for some
time and focus on Magnitude
Transfer Function  1 : passband ripple
| H(s)|  2 : passband ripple
1 1 1
1
11 11

1 pass band [0,  p ]


2
 2 transition band [ p ,  s ]
0 p s 
1 2 3 3 stop band [ s ,  ]
Butterworth LPF Design
 Frequency response in the squared
domain shall be
| H aLPF ( sL ) | | H aLPF ( j ) |
2 2

H aLPF ( j).H aLPF ( j)


H aLPF ( s ).H aLPF ( s )

 So, poles and zeros come in complex


conjugate pairs  Stability needs to be
maintain (right half poles in H aLPF (  s ) )
Butterworth LPF Design
 Simplest possible monotonically
decreasing function could be
1
| H aLPF ( j) |  2 N
2


1 (1) N
| H aLPF ( j) | 
2
2N
 2N
(s / j) s
Butterworth LPF Design
 Simplest possible monotonically
decreasing function could be
1
| H aLPF ( j) |  2 N
2


1 (1) N
| H aLPF ( j) | 
2
2N
 2N
(s / j) s
 But, all the poles are on imaginary axis
 System marginally stable (unstable)
Butterworth LPF Design
 Push poles into left half plane
 Scaling factor for positioning stop and
pass band

1
| H aLPF ( j) | 
2

1 s 2N
Butterworth LPF Design
 Push poles into left half plane
 Scaling factor for positioning stop and
pass band
1
| H aLPF ( j) | 
2
2N
 s 
1  
 c 
 Ωc allows placement of pass and stop
bands!
Butterworth LPF Design
 Push poles into left half plane
 Scaling factor for positioning stop and
pass band
1
| H aLPF ( j) | 
2
2N
 s 
1  
 jc 
 Ωc allows placement of pass and stop
bands!
Butterworth LPF Design
 Push poles into left half plane
 Scaling factor for positioning stop and
pass band
1
| H aLPF ( j) | 
2
2N

1  
 c 
 Clearly monotonic as Ω increases
Butterworth LPF Design
1
| H aLPF ( j) | 
2
2N

1  
 c 
 Point Ωc is the half power point
 N is the rate at which the Magnitude
drops (e.g. for steep transition, higher N
value is needed)
 N = Order of the filter !!
Butterworth LPF Design
1
| H aLPF ( j) | 
2
2N

1   DESIGN !!
 c 
 Point Ωc is the half power point
 N is the rate at which the Magnitude
drops (e.g. for steep transition, higher N
value is needed)
 N = Order of the filter !!
Simplest Monotonic Function
Let’s ignore phase for some
time and focus on Magnitude
Transfer Function  1 : passband ripple
| H(s)|  2 : passband ripple
1 1 1
1
11 11

1 pass band [0,  p ]


2
 2 transition band [ p ,  s ]
0 p s 
1 2 3 3 stop band [ s ,  ]
Passband Requirements
 For the entire PB
1
2N
 (1  1 ) 2

 p 
1  
 c 
 Essentially at edge !
Stopband Requirements
 For the entire SB
1
2N
 2 2

 s 
1  
 c 
 Essentially at edge !
Combined Condition
 For PB
1
2N
 (1  1 ) 2
 p 
1  
 c 
2N
1  p 
1   
(1  1 ) 2
 c 
Combined Condition
 For PB
1
2N
 (1  1 ) 2
 p 
1  
 c 
2N
1  p 
D1 1   
(1  1 ) 2
 c 
Combined Condition
 For SB

2N
1  s 
1   
2 2
 c 
 All the quantities are positive and hence
cross mapping across inequalities can be
worked out
Combined Condition
 For SB

2N
1  s 
D2 1   
2 2
 c 
 All the quantities are positive and hence
cross mapping across inequalities can be
worked out
Combined Condition
 For PB+SB

2N
 p 
2N
 s 
D2    D1   
 c   c 

 Taking then together


Combined Condition
 For PB+SB

2N 2N
 s   c  D2
    
 c   p  D1

 Taking then together


2N
 s  D2
  

 p  D1
Combined Condition
 For PB+SB
1
 s   D2  2N
    
 p   D1 
 To determine N, lets apply ‘log’ function
to both sides (being again
MONOTONIC!!)
 D2 
2 N (log s  log p )  log  
 D1 
Combined Condition
 For PB+SB  D2 
log  
 D1 
2N 
 s 
log  
 
 p
 D2 
log  
1  D1 
N
2  s 
log 
  
 p
Condition on Ωc
 For PB+SB
2N
 p 
2N
 s 
D2    D1   
 c   c 

p s
1
 c  1
D1 2N
D2 2N

 What Next?
 Analysis of poles !
Butterworth LPF Design
1
| H aLPF ( j) | 
2
2N

1  
 c 
1
| H aLPF ( j) | 
2
2N
 j 
1  
 jc 
Butterworth LPF Design
1
| H aLPF ( j) | 
2
2N
 j 
1  
 jc 
 Lets find out poles (no non-trivial zeros)
1
| H aLPF ( j) | 
2
2N
 s 
1  
 jc 
Butterworth LPF Design
1
| H aLPF ( j) | 
2
2N
 j 
1  
 jc 
 Lets find out poles (no non-trivial zeros)
1
| H aLPF ( j) | 
2
2N
 s 
1  
 jc  =0
Butterworth LPF Design
2N
 s 
1   0
 jc 
2N
 s 
   1
 jc 
2N
 s 
   e j (2 k 1)
 jc 
Butterworth LPF Design
2N
 s  j (2 k 1)
  e
 jc 

 s  j (2 k 1)
   e 2N

 jc 
 The poles of the system are at
  
j k 
s  jc e  2N N
Butterworth LPF Design
  
j k 
s  jc e  2N N

 All the poles lie at circle centered at


origin and radius Ωc

 Lets visualize the poles for N=3


Butterworth LPF Design
 Lets visualize the poles for N=3
  
j k 
s  jc e 6 3
Butterworth LPF Design
 Lets visualize the poles for N=3
  
c j k 
s  jc e 6 3
Butterworth LPF Design
 Lets visualize the poles for N=3
  
j k 
k  5 s  jc e 6 3

k 0 
6

k 1 k 4

k2 k 3
Butterworth LPF Design
 Lets visualize the poles for N=3
  
j k 

H aLPF ( s ) s  jc e 6 3


6
H aLPF ( s)
Butterworth LPF Design
 Lets visualize the poles for N=4
  
j k 
s  jc e 8 4
Butterworth LPF Design
 Lets visualize the poles for N=4
  
c j k 
s  jc e 8 4
Butterworth LPF Design
 Lets visualize the poles for N=4
  
j k 
k  7 s  jc e 8 4
k 0
k 1 
8 k 6

k2 k 5
k 3 k 4
Butterworth LPF Design
 Lets visualize the poles for N=4
  
j k 
k  7 s  jc e 8 4
H aLPF ( s ) k 0
k 1 
8 k 6

k2 k 5 H aLPF (  s )
k 3 k 4
Butterworth LPF Design

Constant
| H aLPF ( s ) |
( s  s1 ).( s  s2 )....( s  sN )

 Evaluate System TF at s=0


1
| H aLPF ( j) | 2
2N
 s 
1  
 jc  s= 0
Butterworth LPF Design

Constant
| H aLPF ( s ) |
( s  s1 ).( s  s2 )....( s  sN )

 Evaluate System TF at s=0


1
| H aLPF ( j) | 
2
2N
1
 s 
1  
 jc  s= 0
Butterworth LPF Design

Constant
| H aLPF ( s ) |s 0  1
( s  s1 ).( s  s2 )....( s  sN )
 Evaluate System TF at s=0

Constant  ( s  s1 ).( s  s2 )....( s  sN ) |s  0


Constant  ( s1 ).( s2 )....(  sN )
Constant  (c ) N
Butterworth LPF Design

(c ) N
| H aLPF ( s) |
( s  s1 ).( s  s2 )....( s  sN )

 Then use Bilinear Transform to obtain


discrete time TF for Butterworth
Approximation for LPF.
Example
 Design a Butterworth filter with 1db
cutoff at 1kHz and minimum attenuation
of 40db at 5kHz.
Thank You!
Questions ??

Вам также может понравиться