Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
SIGNAL
PROCESSING
Part 3
Digital Signal Processing
A.S.Kayhan
IIR Filters:
Infinite impulse response (IIR) filters have rational transfer
M
functions as
k
H (z)
bk z
ak z k
k 0
N
k 0
A.S.Kayhan
20 log
10
( )
A.S.Kayhan
K ,
0,
c
c
K 1 a 1 2 a n 1 2 n 2
,
1 b1 2 b n 2 n
bn 0
A.S.Kayhan
a i bi ,
H ( )
K 1 b1 2 b n 1 2 n 2
,
1 b1 2 b n 2 n
bn 0
a i bi 0,
Then, we have
2
H ( )
K
1 bn
2n
A.S.Kayhan
1
1 bn
2n
1
1
2
1 bn
2n
o
bn
2n
1
1
o
2n
A.S.Kayhan
10
/ 10
10
10
H ( ) dB .
2n
2n
dB .
To find n:
Using max and p
10
max
/ 10
10
/ 10
1/ 2n
p
o
2n
10
min
/ 10
s
o
2n
A.S.Kayhan
10
10
min
max
/ 10
/ 10
1
1
s
p
2n
10 min / 10 1
log
10 max / 10 1
2 log s
p
A.S.Kayhan
H ( )
1
1
2n
1
1
2n
1 (s / j)
1 ( 1) n s 2 n
( 1) n s 2 n 1
If n is even, then
s 2n 1 e
sk e
1 2 k
j (
)
2n
j ( 2 k )
, k 0 ,1 ,..., 2 n 1 .
, k 0 ,1 ,..., 2 n 1 .
Digital Signal Processing
A.S.Kayhan
If n is odd, then
s 2n 1 e
sk e
k
n
j 2k
, k 0 ,1 ,..., 2 n 1 .
, k 0 ,1 ,..., 2 n 1 .
Note that all the poles lie on a circle with radius 1, because
the frequency is normalized. (If we want to design analog
filter we need to correct this).
Also, choose the poles in the left-half plane to get a stable
filter.
A.S.Kayhan
k
3
, k 0 ,1 ,..., 5 .
1
( s 1 )( s 2 s 1 )
1
.
1
3
1
3
( s 1 )( s ( j
))( s ( j
))
2
2
2
2
H (s)
A.S.Kayhan
1
1
.
n
1 F n ( ) 2
1 ( ) 2
( x ))
( x ))
When x 1 , Cn(x) 0.
Digital Signal Processing
A.S.Kayhan
C2(x)
C3(x)
C4(x)
C5(x)
-1
-1
0
x
-1
1 -1
n 1
0
x
-1
-1
0
x
-1
1 -1
(x) 2 x C n (x) C
-1
1 -1
0
x
n 1
0
x
( x ),
C o ( x ) 1, C 1 ( x ) x .
A.S.Kayhan
Use Cn(.) in :
H ( )
1
1 2 C n2 ( )
1 , C n ( ) cosh( n cosh
1 , C n ( ) cos( n cos
2 1 ,
( ))
( ))
A.S.Kayhan
Behaviour at =0:
C n2 ( ) 0 , H ( 0 )
C n2 ( ) 1 , H ( 0 )
1,
if n is odd
1
,
(1 2 )
if n is even
Behaviour at =1:
C n2 ( ) 1 ,
for all n
H ( 1)
1
(1 2 )
A.S.Kayhan
The attenuation is
10 log 1 2 C n2 ( )
10
max/ 10
When 2 C n2 ( ) 1 3 . 01 dB .
This defines the half-power frequency (3dB cut-off) hp.
Then,
1
cosh( n cosh
1
1
cosh 1 ( hp )
cosh 1 ( )
n
1
1
hp cosh(
cosh 1 ( )).
n
C n (
hp
hp
))
hp
1 ).
A.S.Kayhan
min 10 log 1 2 C n2 ( s )
10 min
With
cosh( n cosh
Finally,
cosh
n
/ 10
10
1
1 2 C n2 ( s )
max/ 10
( s ))
10
/ 10
min
cosh
10
10
1
10
min
/ 10
max
/ 10
max
1
1
/ 10
( s )
A.S.Kayhan
then
1
1 C n2 ( s / j )
2
1 2 C n2 ( s / j ) 0 C n ( s / j ) j
Let
With
cos( x )
cos( w ) cos( u jv ) s / j
cos 1 ( s / j ) w
e
jx
e
2
jx
, cos( jx )
C n ( s / j ) cos( n cos
ex ex
cosh( x )
2
( s / j )) cos( nw )
A.S.Kayhan
With
cos( nu ) cosh( nv ) 0
C n (s / j) j
then
sin( nu ) sinh( nv )
3 5
,
,
,
2n 2n 2n
( 2 k 1 ), k 0 ,1 , , 2 n 1 .
2n
uk
uk
A.S.Kayhan
Remember that
then
1
sinh
n
cos
1
) a.
( s / j ) w u jv
2 k 1 ja
s k j cos( w k ) j cos
2n
2k 1
) sinh( a )
2n
2k 1
cos(
) cosh( a )
2n
sin(
Choose left
half poles.
A.S.Kayhan
10
h [ n ] T d h c nT
H ( )
H c(
k ).
Td
Td
If
then
A.S.Kayhan
/ Td
H c ( ) 0 ,
),
.
Td
Analog and digital frequencies have a linear relation:
Td .
H ( ) H c (
H c (s)
k 1
Ak
,
s sk
hc (t )
Ak e skt ,
t 0.
k 1
A.S.Kayhan
11
N
d
T d A k e s k nT d u n
k 1
h n
T d ( A k e s k T d ) n u n .
k 1
H (z)
k 1
Poles are
Td Ak
.
1 e sk T d z 1
s s k z e skTd .
If Hc(s) is stable (k < 0), then H(z) is also stable (|z| < 1).
Digital Signal Processing
A.S.Kayhan
.
s 1
1
3
1
3
s ( j
)
s ( j
)
2
2
2
2
H c (s)
then
Td
1 z 1e Td
1
1
1
Td ( j
)
Td ( j
2
2
12
H (z)
1 z 1 e
Td (
1
3
j
)
2
2
1 z 1e
Td (
1
)
12
.
1
3
2
A.S.Kayhan
12
Bilinear Transformation:
Transformation needed to convert an analog filter to a
discrete time filter must have following properties:
1- j axis of the s-plane must be mapped onto the unit
circle of the z-plane,
2- stable analog filters must be tranformed into stable
discrete time filters (left hand plane of the s-plane must be
mapped into inside the unit circle of the z-plane).
Following BT satisfies these conditions:
1 z 1
s K
1 z 1
1 s / K
.
1 s / K
Let
s j ,
z re
A.S.Kayhan
then
r
(1 / K ) 2 ( / K ) 2
.
(1 / K ) 2 ( / K ) 2
Therefore
0
( LH plane ) r 1 ( inside
( RH plane ) r 1 ( outside
Digital Signal Processing
the u.c. )
the u.c. )
A.S.Kayhan
13
Now, let
then
s j ,
z e
1 e j
e j / 2 ( e j / 2 e
j K
K j / 2
1 e j
e
( e j / 2 e
sin( / 2 )
j Kj
jK tan( / 2 ).
cos( / 2 )
or
A.S.Kayhan
j / 2
j / 2
)
.
)
K tan( / 2 ).
A.S.Kayhan
14
Observations:
1- According to Taylor series expansion of tan(), for small
K / 2 3 / 24 K / 2 .
2- For high frequencies, the relation is nonlinear causing a
distortion called warping effect. Therefore, BT is usually used
for the design of LPF to avoid this.
A.S.Kayhan
A.S.Kayhan
15
Then, we use
in
H
( )
1
1
2n
( )
tan( 0 . 5 )
1
tan( 0 . 5 HP )
2n
min / 10
1
log 10
max / 10
10
2 log tan( 0 . 5 s )
tan( 0 . 5 p )
A.S.Kayhan
HP
2 tan
tan( 0 . 5
10
max
/ 10
1/ 2n
K b cot(0.5 HP ).
(s)
1
(s2
2 s 1)
A.S.Kayhan
16
Remarks:
1- Given the specs.:
a) find the filter order n
b) obtain the analog filter H(s)(using LHP poles)
c) calculate HP and Kb
d) use biliear transformation to find H(z).
2- H(z) is BIBO stable, because H(s) is stable.
3- Applying the BT to high order filters may be tedious.
Therefore, first express H(s) as product or some of first
and second order functions, then apply the BT.
A.S.Kayhan
(z2
0 . 0037 ( z 1 ) 6
0 . 59 )( z 2 0 . 17 )( z 2 0 . 0 . 02 )
Digital Signal Processing
A.S.Kayhan
17
1 C
2
n
1
(tan( 0 . 5 ) / tan( 0 . 5
))
max 10 log 1
10 min
Also using s ,
We find the filter order
10
max
min
10
1
cosh 1 [tan( 0 . 5 s ) / tan( 0 . 5 p )]
cosh
/ 10
A.S.Kayhan
min
/ 10
max
/ 10
A.S.Kayhan
18
f smp
Filter order n = 3,
H 3(z)
fs
f smp
Kc = 1
(z2
0 . 09 ( z 1 ) 3
0 . 15 z 0 . 72 )( z 0 . 54 )
A.S.Kayhan
(z2
0 . 736 ( z 1 ) 3
0 . 505 z 0 . 619 )( z 0 . 472 )
(z)
z(z2
Kb = 1
0 . 01656 ( z 1 ) 7
0 . 636 )( z 2 0 . 232 )( z 2 0 . 052 )
Digital Signal Processing
A.S.Kayhan
19
Frequency Transformations:
The objective is to obtain transfer functions of other types of
dicrete filters from already available prototype Low Pass
Filters using tranformation functions g(z) as
H (z) H
LP
( g ( z ))
LPF
(z)
z3
A.S.Kayhan
0 . 09 ( z 1 ) 3
0 . 691 z 2 0 . 802 z 0 . 39
A.S.Kayhan
20
HPF
(z)
z3
(1 0 . 5095 z 1 )
0 . 0066 ( z 3 3 z 2 3 z 1 )
2 . 361 z 2 2 . 102 z 0 . 6884
A.S.Kayhan
A.S.Kayhan
21
1
)
2
(e
)W ( e
)d .
A.S.Kayhan
A.S.Kayhan
22
Main lobe width and transition region; Peak side lobe level
and oscillations of filter are related.
A.S.Kayhan
A.S.Kayhan
23
A.S.Kayhan
A.S.Kayhan
24
x n x n N .
1
x n
N
X [ k ]e
2
nk
N
k0
x n e
X [k ]
2
nk
N
n0
Let
A.S.Kayhan
2
N
x n W
X [k ]
nk
N
n0
x n
1
N
N 1
X [k ] W
nk
N
k 0
x n
[ n rN ]
The DTFS
~
X [k ]
N 1
n W
nk
N
for all k .
n0
A.S.Kayhan
25
Properties:
1- Linearity: It is linear.
2- Shift of a sequence: If
x n X [ k ]
x n m W
then
Similarly,
nl
N
km
N
X [k ]
x n X [ k l ]
x 1 n X 1 [ k ]
x 2 n X 2 [ k ]
Then,
~
X 3[ k ] X 1[ k ] X 2 [k ]
x 3 n
N 1 ~
x 1 [ n m ] x 2 [ m ].
m0
A.S.Kayhan
A.S.Kayhan
26
X [ k ] X ( ) |
2
k
N
X
k
N
N 1
X [k ] W
nk
N
k 0
A.S.Kayhan
Substituting,
X
x m
e j m ,
X k X ( ) | 2
then,
x n x n *
n rN
x n
rN .
A.S.Kayhan
27
A.S.Kayhan
X (e
x [ n ]e
j n
We define:
W
2
k
N
j
, k 0 ,1 , N 1 .
2
N
A.S.Kayhan
28
X [k ]
x[ n ] W
kn
N
n0
for k=0,1,...,N-1.
The inverse DFT is defined as (synthesis equation):
x[ n ]
1
N
X [k ] W
kn
N
n0
for n=0,1,...,N-1.
A.S.Kayhan
A.S.Kayhan
Example:
N=5
29
N=10
Properties:
1- Linearity: DFT is a linear operation.
2- Circular shift:
x n m
N , 0
n N 1 e
A.S.Kayhan
2
km
N
X [ k ].
A.S.Kayhan
30
3- Circular convolution:
x 3 n x 1 n
x 2 n
N 1
x 1 [ n m
] x2[m ]
m 0
Example:
A.S.Kayhan
A.S.Kayhan
Example:
N=L
31
N=2L
A.S.Kayhan
4- Multiplication(Modulation):
x 3 n x 1 n x 2 n X
k .
x 2 n
A.S.Kayhan
32
) X 1 (e
) X 2 (e
A.S.Kayhan
Taking N samples
X
k X 2 k .
x 3 n rN , 0 n N 1
x 3 p n r
0,
otherwise.
x 3 p n x 1 n
x 2 n
A.S.Kayhan
33
Example:
A.S.Kayhan
A.S.Kayhan
Example:
34
A.S.Kayhan
x n
x r n rL
A.S.Kayhan
35
y r n rL ,
y r n x r n * h n
A.S.Kayhan
A.S.Kayhan
36
Overlap-Save Method :
Consider again h[n] of length P, and length of x[n] is much
grater than P.
In this method L-point circular convolution (or DFT) is
used. Since the first (P-1) points will be incorrect,
input segments must overlap.
We can write each L sample segment of x[n] as :
x r n x n r ( L P 1 ) ( P 1 ) ,
y n
0 n L 1
y r n r ( L P 1 ) ( P 1 ) ,
y r n y rp n , P 1 n L 1
Digital Signal Processing
A.S.Kayhan
A.S.Kayhan
Example:
37
x[ n ]
N 1
X [k ] W
kn
N
X [k ]
n0
x[n ] W
kn
N
n0
kn
Im{ x [ n ] } Im{ W N }
j Im{ x [ n ] } Re{ W kn }
N
X [k ]
n0
A.S.Kayhan
k(N n)
N
k(N n)
N
W
W
kn
N
kn
N
(W
W
kn
N
)*
(k N )n
N
Example:
Re{ x [ n ] } Re{ W
kn
N
} Re{ x [ N n ] } Re{ W
kn
N
k(N n)
N
}.
A.S.Kayhan
38
A.S.Kayhan
X [k ]
kn
N
x[n ] W
, k 0 ,1 , , N 1
n0
x[ n ] W
kn
N
n even
x[n ] W
kn
N
n odd
X [k ]
N / 2 1
x [ 2 r ] (W
2
N
) rk W
k
N
r0
x [ 2 r ] (W
rk
N / 2
r0
G k
2
N
) rk
r0
N / 2 1
x [ 2 r 1 ] (W
N / 2 1
) W
k
N
x[ 2 r 1] W
rk
N / 2
r0
k
N
k .
Digital Signal Processing
A.S.Kayhan
39
X [ k ] G k
k
N
k .
A.S.Kayhan
Since G[k] and H[k] requires 2(m-1)-point DFTs, each one can
be similarly decomposed until we reach 2-point DFTs.
A.S.Kayhan
40
A.S.Kayhan
A.S.Kayhan
Butterfly:
(in place comp.)
Bit reversed
order
41
X [k ]
x[n ] W
kn
N
, k 0 ,1 , , N 1
n0
then
N 1
X [2 r ]
x[ n ] W
2 rn
N
r 0 ,1 , , ( N / 2 1 )
n0
N / 2 1
X [2 r ]
N 1
x[ n ] W
2 rn
N
n0
2 rn
N
N / 2 1
x[ n ] W
2 rn
N
n0
N / 2 1
X [2r ]
x[ n ] W
nN /2
N / 2 1
X [2 r ]
x[ n N / 2 ] W
2r(n N /2)
N
n0
N / 2 1
( x [ n ] x [ n N / 2 ]) W
rn
N /2
n0
rn
N /2
n0
Similarly for
g [n ] W
A.S.Kayhan
0 r ( N / 2 1)
N / 2 1
X [ 2 r 1]
( x [ n ] x [ n N / 2 ]) W
n
N
rn
N /2
n0
N / 2 1
h [ n ] W Nn W
rn
N /2
n0
A.S.Kayhan
42
A.S.Kayhan
1
N
X [ k ]W
kn
N
, n 0 ,1 , , N 1
n0
X [k ]
x[ n ] W
kn
N
, k 0 ,1 , , N 1
n0
1 N
1
x [n]
X * [ k ]W Nkn
DFT
N n0
N
*
1
x[ n ]
DFT X * [ k ]
N
*
[k ]
A.S.Kayhan
43
End of Part 3
A.S.Kayhan
44