Upload
fikret
View
217
Download
3
Tags:
Embed Size (px)
Citation preview
1Digital Signal Processing A.S.Kayhan
DIGITAL SIGNAL
PROCESSING
Part 2
Digital Signal Processing A.S.Kayhan
Frequency Analysis of LTI Systems:the Input/Output (I/O) relation of a LTI system is given by convolution:
k
knxkhnhnxny ][][][*][][
In z-domain)()()( zHzXzY
jez
jjj eHeXeY
)()()(
On the unit circle
where is the frequency response of the system.
)( jeH
2Digital Signal Processing A.S.Kayhan
)()()( jjj eHeXeY
Magnitude is
where is the magnitude response of the system.
)( jeH
Phase is )()()( jjj eHeXeY
where is the phase response of the system.
)( jeH
Digital Signal Processing A.S.Kayhan
Discrete-time ideal filters: LPF, HPF, BPF:
These are not realizable. Why?
3Digital Signal Processing A.S.Kayhan
Phase distortion and delay:Assume that ][][ did nnnh
thendnjj
id eeH )(
ord
jid
jid neHeH
)(,1)(
Linear phase distortion causes simple delay.
Group delay: It measures linearity of the phase response.Consider nnsnx ocos][][ where is a narrowband (slowly varying) signal.][ ns
Digital Signal Processing A.S.Kayhan
Assume around o
dojj neHeH )(,1)(
Then doood nnnnsny cos][][
Thus, group delay of a system is
)(arg)]([
jj eHd
deHgrd
where is the continuous phase. )(arg jeH
4Digital Signal Processing A.S.Kayhan
Digital Signal Processing A.S.Kayhan
Example: Consider the following filter
5Digital Signal Processing A.S.Kayhan
Input is the following signal
Digital Signal Processing A.S.Kayhan
Pulses are at 85.0,5.0,25.0
6Digital Signal Processing A.S.Kayhan
Systems with Difference Equation Models:Assume that the Input/Output (I/O) relation of a system is given by a constant coefficient difference equation:
M
kk
N
kk knxbknya
00
][][
Applying z-transform, using linearity and shifting properties, we obtain
M
k
kk
N
k
kk zXzbzYza
00
)()(
)()(00
zXzbzYzaM
k
kk
N
k
kk
Digital Signal Processing A.S.Kayhan
Then, the transfer function (or system function) is
N
k
kk
M
k
kk
za
zb
zX
zYzH
0
0
)(
)()(
We can write the transfer function in terms of its poles, dk, and zeros, ck, as
N
kk
M
kk
o
o
zd
zc
a
bzH
1
1
1
1
)1(
)1()(
7Digital Signal Processing A.S.Kayhan
Example: Consider system function
)4
31)(
2
11(
)1()(
11
21
zz
zzH
)(
)(
83
41
1
21)(
21
21
zX
zY
zz
zzzH
then
)()8
3
4
11()()21( 2121 zYzzzXzz
]2[8
3]1[
4
1][
]2[]1[2][
nynyny
nxnxnx
Digital Signal Processing A.S.Kayhan
Stability and Causality: A system is causal if ROC for the transfer function H(z) is outward.A sytem is stable if ROC for the transfer function H(z) includes the unit circle.
8Digital Signal Processing A.S.Kayhan
Inverse Systems :Let be the inverse system of , then )( zH)( zH i
1)()()( zHzHzG i
then
)(
1)(,
)(
1)(
j
jii eH
eHzH
zH
Not all systems have an inverse. Ideal LPF does not have an inverse, we can not recover high frequency components.Now, consider
N
kk
M
kk
o
o
zd
zc
a
bzH
1
1
1
1
)1(
)1()(
nnhnhng i *Eq.(1)
Digital Signal Processing A.S.Kayhan
Then the inverse system has
M
kk
N
kk
o
oi
zc
zd
b
azH
1
1
1
1
)1(
)1()(
Poles become zeros of the inverse system, zeros become poles. For Eq.(1) to hold, ROC of and must overlap. If is causal, ROC is
)( zH i )( zH)( zH
kdz max
Some part of ROC of must overlap with this.)( zH i
9Digital Signal Processing A.S.Kayhan
Example: Suppose
9.0,9.01
5.0)(
1
1
zz
zzH
The inverse system is
1
1
1
1
21
8.12
5.0
9.01)(
z
z
z
zzH i
Two possible ROC:
2z nununh nni 11 28.1121which is stable but noncausal.
2z 128.12 112
nununh nni
unstable but causal.
Digital Signal Processing A.S.Kayhan
Example: Suppose
9.0,9.01
5.01)(
1
1
zz
zzH
1
1
5.01
9.01)(
z
zzH i
The inverse system is
The only choice for ROC is overlaps with is 9.0z
5.0z
then
15.09.05.0 1 nununh nni
which is both stable and causal.
10
Digital Signal Processing A.S.Kayhan
Impulse Response for Rational System:Assume that a stable LTI system has a rational transfer function.
N
kk
M
kk
o
o
zd
zc
a
bzH
1
1
1
1
)1(
)1()(
N
k k
kNM
NMifr
rr zd
AzBzH
11
00 1
)(
then
N
k
nkk
NM
rr nudArnBnh
10
1
Impulse response is of infinite length, called Infinite Impulse Response (IIR) system.
Digital Signal Processing A.S.Kayhan
If the system has no poles, then
M
k
kk zbzH
0
)(
M
kk knbnh
1
Impulse response is of finite length, called Finite Impulse Response (FIR) system.
Example: Consider a causal system with][]1[][ nxnayny
If then stable and the impulse response is
1a
.nuanh n
11
Digital Signal Processing A.S.Kayhan
Example: Consider .
otherwise,0
0,
Mna
nhn
Then
1
11
0 1
1)(
az
zazazH
MMM
n
nn
Zeros at
.,,1,0,12
Mkaez Mk
j
k
Difference equation is
However, we can also write
1][]1[][ 1 Mnxanxnayny M
M
k
k knxany1
Digital Signal Processing A.S.Kayhan
Frequency Response for Rational System Functions:Assume that a stable LTI system has a rational transfer function. Then frequency response is obtained by evaluating it on the unit circle:
N
k
kjk
M
k
kjk
j
ea
eb
eH
0
0)(
N
k
jk
M
k
jk
o
oj
ed
ec
a
beH
1
1
)1(
)1()(
12
Digital Signal Processing A.S.Kayhan
The magnitude response of the system is
N
k
jk
M
k
jk
o
oj
ed
ec
a
beH
1
1
1
1)(
The magnitude-squared response of the system is
)()()( *2 jjj eHeHeH
N
k
jk
jk
M
k
jk
jk
o
oj
eded
ecec
a
beH
1
*
1
*2
2
11
11)(
Digital Signal Processing A.S.Kayhan
Log magnitude or Gain in decibels(dB) :
N
k
jk
M
k
jk
o
oj
ed
eca
beH
110
1101010
1log20
1log20log20)(log20
Attenuation in dB = - Gain in dB
Note that :
)(log20
)(log20)(log20
10
1010
j
jj
eX
eHeY
13
Digital Signal Processing A.S.Kayhan
Phase response for rational system function:
N
k
jk
M
k
jk
o
oj
ed
eca
beH
1
1
1
1)(
Group delay for rational system function:
N
k
jk
M
k
jk
j
edd
d
ecd
deH
1
1
]1arg[
]1arg[)(grd
Digital Signal Processing A.S.Kayhan
Frequency Response of A single Zero:Consider transfer function of a system as
11)( azzH
then with jrea jjeHjjj ereeeHeH
j 1)()( )(
then magnitude is
and magnitude in dB is
)cos(21)( 22
rreH j
)]cos(21[Log20)(Log20 21010 rreH j
14
Digital Signal Processing A.S.Kayhan
then phase is
)cos(1
)sin(tan)( 1
r
reH j
group delay is derivative of the (unwrapped) phase function
d
eHdeHgrd
jj ))(()]([
Example: Consider two cases : r=0.9, =0 and r=0.9, =:
Digital Signal Processing A.S.Kayhan
15
Digital Signal Processing A.S.Kayhan
magnitudes of vectors give the magnitude response
31
3)( vv
v
e
reeeH
j
jjj
jezz
azzH
)(
Digital Signal Processing A.S.Kayhan
phases of vectors give the phase response
31313
)(
vv
e
reeeH
j
jjj
16
Digital Signal Processing A.S.Kayhan
Example: Consider a second order system with
11
1
11
1)(
zrezre
zezH
jj
j
21
3)(vv
veH j
Digital Signal Processing A.S.Kayhan
jez
j zHeH
)()(
:
17
Digital Signal Processing A.S.Kayhan
Example: Consider a third order system with
211
211
7957.04461.11683.01
0166.11105634.0)(
zzz
zzzzH
Digital Signal Processing A.S.Kayhan
Relation Between Magnitude and Phase:In general, knowledge about magnitude does not provide information about phase, and vice versa.But, for rational system functions, with some additional information such as number of poles and zeros, magnitude and phase responses provide information about each other.Consider
jez
jjj
zHzH
eHeHeH
|)/1()(
)()()(
**
*2
with
N
kk
M
kk
o
o
zd
zc
a
bzH
1
1
1
1
)1(
)1()(
18
Digital Signal Processing A.S.Kayhan
N
kk
M
kk
o
o
zd
zc
a
bzH
1
*
1
*
**
)1(
)1()/1(
Then
N
kkk
M
kkk
o
o
zdzd
zczc
a
bzHzHzC
1
*1
1
*12
**
)1)(1(
)1)(1()/1()()(
Notice that poles and zeros of C(z) occur in conjugate reciprocal pairs. If one pole/zero is inside the unit circle there is another outside.
Digital Signal Processing A.S.Kayhan
If H(z) is causal and stable, then all poles must be inside the unit circle, with this we can identify the poles. But zeros of H(z) can not be uniquely identified from zeros of C(z) with this constraint alone.
Example: Consider two stable systems with
14/14/
11
1 8.018.01
5.0112)(
zeze
zzzH
jj
and
14/14/
11
2 8.018.01
211)(
zeze
zzzH
jj
19
Digital Signal Processing A.S.Kayhan
Pole/zero plots are
Digital Signal Processing A.S.Kayhan
zezezeze
zzzz
zHzHzC
jjjj 4/4/14/14/
11
**111
8.018.018.018.01
5.01125.0112
)/1()()(
zezezeze
zzzz
zHzHzC
jjjj 4/4/14/14/
11
**222
8.018.018.018.01
211211
)/1()()(
Observe that (with )
zzzz 21215.015.014 11
then
)()( 21 zCzC
1224 zz
20
Digital Signal Processing A.S.Kayhan
Example: Consider pole/zero plot of C(z) for a system, determine H(z).
For a causal and stable system, poles of H(z) are: p1, p2,p3.For real ak, bk, zeros/poles occur in complex conjugate pairs.
Digital Signal Processing A.S.Kayhan
All-Pass Systems:Consider following stable system function
1
*1
1)(
az
azzH ap
j
jj
j
jj
ap ae
aee
ae
aeeH
1
)1(
1)(
**
then constant )(but ,1)( jap
jap eHeH
This is called an all-pass system .A general all-pass system has the following form
cr M
k kk
kkM
k k
kap zeze
ezez
zd
dzAzH
11*1
1*1
11
1
)1)(1(
))((
1)(
21
Digital Signal Processing A.S.Kayhan
Example: Consider pole/zero plot of a typical all-pass system
Digital Signal Processing A.S.Kayhan
Example: First order all-pass system with a real pole: z=0.9 (z=-0.9)
22
Digital Signal Processing A.S.Kayhan
Example: Second order all-pass system with poles:4/9.0 jez
Digital Signal Processing A.S.Kayhan
Notice that group delay for causal all-pass systems are positive (unwrapped/continuous phase is nonpositive).All-pass systems may be used as phase compensators.They are also useful in transforming lowpass filters into other frequency-selective forms.
23
Digital Signal Processing A.S.Kayhan
Block-Diagram Representation:LTI systems with difference equation represetation (rational system function) may be imlemented by converting to an algorithm or structure that can be realized in desired technology. These structures consists of basic operations of addition, multiplication by a constant and delay.In block diagram representation:
Digital Signal Processing A.S.Kayhan
Example: Consider the second order system :][]2[]1[][ 21 nxbnyanyany o
with
22
111
)(
zaza
bzH o
Block diagram representation is
24
Digital Signal Processing A.S.Kayhan
For a system with higher order difference equation
M
kk
N
kk knxbknyany
01
][][][
with system function
N
k
kk
M
k
kk
za
zbzH
1
0
1)(
Rewriting the equation as
][][
][][][
1
01
nvknya
knxbknyany
N
kk
M
kk
N
kk
where
M
kk knxbnv
0
][][
Digital Signal Processing A.S.Kayhan
N+MDelayelement
Direct Form I:
25
Digital Signal Processing A.S.Kayhan
Previous diagram is implementation of
M
k
kkN
k
kk
zbza
zHzHzH0
1
21
1
1)()()(
or
)()()()(0
1 zXzbzXzHzVM
k
kk
)(1
1)()()(
1
2 zVza
zVzHzY N
k
kk
Digital Signal Processing A.S.Kayhan
We can rearrange the system function
)(1
1)()()(
1
2 zXza
zXzHzW N
k
kk
)()()()(0
1 zWzbzWzHzYM
k
kk
In the time domain
M
kk knwbny
0
][][
][][][1
nxknwanwN
kk
26
Digital Signal Processing A.S.Kayhan
M = N
Digital Signal Processing A.S.Kayhan
Direct Form II:
Max(N,M)Delay elements
27
Digital Signal Processing A.S.Kayhan
Example:Consider the system with
21
1
9.05.11
21)(
zz
zzH
Digital Signal Processing A.S.Kayhan
Flow Graph Representation:Similar to the block diagram representation:
28
Digital Signal Processing A.S.Kayhan
Example:Consider the system with
)()()( 41 zXzWzW )()( 12 zWzW )()()( 23 zXzWzW
)()( 31
4 zWzzW
)()()( 42 zWzWzY
Digital Signal Processing A.S.Kayhan
1
1
1)(
z
zzH
)(1
)(1
1
zXz
zzY
29
Digital Signal Processing A.S.Kayhan
Structures for IIR Systems:Some considerations:Computaional complexity(no. of multiplication, delay )Finite precision, Ease of implementation, etc.
Direct Forms:We have already seen direct forms.
Cascade Form:We factor numerator and denominator polynomials of H(z)
21
21
1
1*1
1
1
1
1*1
1
1
)1)(1()1(
)1)(1()1()( N
kkk
N
kk
M
kkk
M
kk
zdzdzc
zgzgzfAzH
Digital Signal Processing A.S.Kayhan
We have cascade of first or second order subsystems
s
ss
N
k kk
kk
o
N
k kk
kkokN
kk
zaza
zbzbb
zaza
zbzbbzHzH
12
21
1
22
~1
1
~
12
21
1
22
11
1
1
1
1)()(
30
Digital Signal Processing A.S.Kayhan
Example:Consider the system with
11
11
21
21
25.015.01
11
125.075.01
21)(
zz
zz
zz
zzzH
Digital Signal Processing A.S.Kayhan
Parallel Form:H(z) may be written as sum of subsystems
crf N
k kk
kkN
kk
k
kN
kk zdzd
zeB
zc
AzCzH
01*1
1
00
1
)1)(1(
)1(
1)(
N
k kk
kokN
kk zaza
zeezCzH
f
02
21
1
11
0
1
1)(
31
Digital Signal Processing A.S.Kayhan
Digital Signal Processing A.S.Kayhan
Example:Consider the system with
112121
25.01
25
5.01
188
125.075.01
21)(
zzzz
zzzH
32
Digital Signal Processing A.S.Kayhan
Transposed Forms :Reverse the directions of all branches while keeping the values as they were and reverse roles of input and output. Transposed forms may be useful in finite precision implementation.
Example:Consider the second order system with
Digital Signal Processing A.S.Kayhan
Structures for FIR Systems:Consider an FIR system with following input-output relation
][][0
knxbnyM
kk
Observe that the impulse response of this system is
otherwise,0
0,][
Mnbnh n
Direct form (or tapped delay line or transversal filter) :
33
Digital Signal Processing A.S.Kayhan
Transposed direct form structure:
Digital Signal Processing A.S.Kayhan
ss N
kkkok
N
kk zbzbbzHzH
1
22
11
1
)()()(
Cascade form:
34
Digital Signal Processing A.S.Kayhan
Linear-Phase FIR Systems:Finite impulse response (FIR) systems with linear-phase have symmetry properties such as
MnnMhnh 0],[][
MnnMhnh 0],[][or
For M even and odd. Thus there are four types of linear phase FIR filters.
Digital Signal Processing A.S.Kayhan
)2/sin(
)2/5sin()( 2
jj eeH
otherwise,0
40,1][
nnh
Example: Consider
35
Digital Signal Processing A.S.Kayhan
Example: Consider
]2[]1[2][][ nnnnh
)].cos(1[2
2
21)(
1
111
21
j
jjj
jjj
e
eee
eeeH
Digital Signal Processing A.S.Kayhan
Assume M is even
M
Mk
M
k
M
k
knxkh
MnxMhknxkh
knxkhny
12/
12/
0
0
][][
]2/[]2/[][][
][][][
With, in the last term, k=M-l, l=0M/2-1
12/
0
12/
0
][][
]2/[]2/[][][][
M
l
M
k
lMnxlMh
MnxMhknxkhny
36
Digital Signal Processing A.S.Kayhan
][][ nMhnh If
]2/[]2/[
])[][]([][12/
0
MnxMh
kMnxknxkhnyM
k
If ][][ nMhnh
])[][]([][12/
0
kMnxknxkhnyM
k
Digital Signal Processing A.S.Kayhan
Finite-Precision Numerical Effects:Input Quantization:We have seen earlier that continuous-time signals are sampled, quantized and coded first
37
Digital Signal Processing A.S.Kayhan
Example:
Digital Signal Processing A.S.Kayhan
In twos complement binary system leftmost bit is the sign bit. If we have (B+1)-bit twos complement fraction of the following form
Baaaa 210 Value is B
Baaaa 2222 22
11
00
Example: Binary Code Numeric value
110 4/3
101 2/1
011 4/1
38
Digital Signal Processing A.S.Kayhan
Quantizer step size is12
2
B
mX
With][][
^^
nxXnx Bmwhere
)complement s(two'1][1^
nx B
Analysis of Quantization Errors:We observe that the quantized samples are in general different from the true values. The difference is the quantization error
].[][][^
nxnxne
and2/][2/ ne
Digital Signal Processing A.S.Kayhan
A simplified model of quantizer is
Assumptions about e[n]:e[n] is stationarye[n] is uncorrelated with x[n]e[n] is white noisee[n] is uniformly distributed
39
Digital Signal Processing A.S.Kayhan
Example:
3bit quantizer
Error for 3bit
Error for 8bit
Sinusoidal signal
Digital Signal Processing A.S.Kayhan
Mean value of e[n] is zero
012/
2/
deee
Variance (or power) of e[n] is
12
1 22/
2/
22
deee
For (B+1)-bit quantizer with full-scale value Xm
12
2 222 mXB
e
40
Digital Signal Processing A.S.Kayhan
Signal-to-Noise Ratio (SNR) is defined as the ratio of signal variance (power) to noise variance. Expressed in dB
x
m
m
xB
e
x
XB
X
10
2
22
102
2
10
log208.1002.6
212log10log10SNR
If
6dB-SNRSNR,2/
dB 6SNRSNR,1
xx
BB
Digital Signal Processing A.S.Kayhan
Coefficient Quantization in IIR Systems:Consider
N
k
kk
M
k
kk
za
zbzH
1
0
1)(
If the coefficients are quantized, we get
N
k
kk
M
k
kk
za
zbzH
1
^
0
^
^
1)(
wherekkkkkk aaabbb
^^
,
41
Digital Signal Processing A.S.Kayhan
Each pole or zero will be affected by all the errors in the coefficient quantization. If the poles (or zeros) are close to each other (clustered), then quantization of coefficients may cause large shifts of poles (or zeros).Direct form structures are more sensitive to coefficient quantization than the other forms (parallel, cascade,...)
Digital Signal Processing A.S.Kayhan
Example: Consider a bandpass IIR elliptic filter of order 12 implemented in cascade form of 2nd order subsystems and direct form.
42
Digital Signal Processing A.S.Kayhan
Passband cascade unquantized
Passband cascade 16-bit
Digital Signal Processing A.S.Kayhan
Passband parallel 16-bit
Direct form 16-bit
43
Digital Signal Processing A.S.Kayhan
Poles of Quantized 2nd order subsystems :Because of robustness, parallel and cascade forms are used more than direct forms.We can further improve the robustness, by improving implementation of the 2nd order subsystems. Consider the following implementation in direct form:
Digital Signal Processing A.S.Kayhan
When coefficients are quantized, a finite number of pole possitions possible.
4bits 7bits
Circles correspond to r2, vertical lines to 2rcos
44
Digital Signal Processing A.S.Kayhan
Consider the following coupled form
Digital Signal Processing A.S.Kayhan
4bits 7bits
45
Digital Signal Processing A.S.Kayhan
Coefficient Quantization in FIR Systems:Consider FIR system with transfer function
M
n
nznhzH0
][)(
If][][][
^
nhnhnh
)()(][)(0
^
zHzHznhzHM
n
n
then
where
M
n
nznhzH0
][)(and
)()()(^
jjj eHeHeH
Digital Signal Processing A.S.Kayhan
Example: Consider FIR filter of order 27
46
Digital Signal Processing A.S.Kayhan
Digital Signal Processing A.S.Kayhan
Effects of Round-off Noise:Analysis of Direct Form IIR Structures:Consider Nth-order difference equation for Direct Form I
M
kk
N
kk knxbknyany
01
][][][
Assume that all signal values and coefficients are represented by (B+1)-bit fixed point binary numbers. Therefore, each multiplication is followed by a quantizer, then
M
kk
N
kk knxbQknyaQny
01
^^
][][][
47
Digital Signal Processing A.S.Kayhan
Digital Signal Processing A.S.Kayhan
An alternative representation is as following
48
Digital Signal Processing A.S.Kayhan
Rounding or truncation of a product bx[n] is represented by a noise source of the form
][][][ nbxnbxQne
Assumptions about e[n]s:Each e[n] is stationaryEach e[n] is uncorrelated with x[n] and other e[n]sEach e[n] is uniformly distributed
For (B+1)-bit rounding
2/2][2/2 BB ne
Digital Signal Processing A.S.Kayhan
For (B+1)-bit truncation
0][2 neB
Mean and variance for rounding are
0e 122 22
B
e
Mean and variance for truncation are
2
2 Be
12
2 22B
e
49
Digital Signal Processing A.S.Kayhan
Now, lets try to determine effect of quantization noise on the output of the system. We can redraw the system as
][][][][][][ 43210 nenenenenene
Digital Signal Processing A.S.Kayhan
Since all the noise sources are
12
255
22222222
043210
B
eeeeeee
For the general Direct Form I case
12
21
22
B
e NM
Now, we observe that
][][][1
neknfanfN
kk
For rounding mean of the output noise is zero.The variance for rounding or truncation is
22
2 ][12
21
n
ef
B
f nhNM
is impulse response for ][ nh ef )(/1)( zAzH ef
50
Digital Signal Processing A.S.Kayhan
Example: Consider the following system
.1,1
)(1
aazb
zH
][][ nuanh nef
Then the noise variance(power) at the output is
2222
2
1
1
12
22
12
22
aa
Bn
n
B
f
Digital Signal Processing A.S.Kayhan
Analysis of Direct Form FIR systems:Consider
M
k
knxkhny0
][][][
12
21,][][][
22
0
B
f
M
kk Mnenenf
51
Digital Signal Processing A.S.Kayhan
End of Part 2