Professional Documents
Culture Documents
Course Notes Advanced DSP
Course Notes Advanced DSP
Outline:
1. Introduction
2. Digital processing of continuous-time signals
Retition: Sampling and sampling theorem
Quantization
AD- and DA-conversion
3. DFT and FFT
Leakage effect
Windowing
FFT structure
4. Digital filters
FIR-filters: Structures, linear phase filters, least-squares
frequency domain design, Chebyshev approximation
IIR-filters: Structures, classical analog lowpass filter
approximations, conversion to digital transfer functions
Finite word-length effects
5. Multirate digital signal processing
Decimation and interpolation
Filters in sampling rate alteration systems
Polyphase decomposition and efficient structures
Digital filter banks
6. Spectral estimation
Periodogram, Bartletts method, Welchs method,
Blackman-Tukey method
ARMA modeling, Yule-Walker equation and solution
Literature
J. G. Proakis, D. G. Manolakis: Digital Signal Processing: Principles, Algorithms, and Applications, Prentice
Hall, 2007, 4th edition
S. K. Mitra: Digital Signal Processing: A ComputerBased Approach, McGraw Hill Higher Education, 2006,
3rd edition
A. V. Oppenheim, R. W. Schafer: Discrete-time signal
processing, Prentice Hall, 1999, 2nd edition
M. H. Hayes: Statistical Signal Processing and Modeling, John Wiley and Sons, 1996 (chapter 6).
Parts of this textbook have been realized in close collaboration with Dr. Joerg Kliewer whom I warmly thank.
1. Introduction
1.1 Signals, systems and signal processing
What does Digital Signal Processing mean?
Signal:
Amplitude
x 10
0.5
0
0.1
0.2
0.3
0.4
t [s]
0.5
0.6
0.5
1
0.7
Signal Processing:
Examples:
Modification of the signal (filtering, interpolation, noise
reduction, equalization, . . .)
Prediction, transformation to another domain (e.g. Fourier
transform)
3
Analog
input
signal
Analog
signal
processor
Analog
output
signal
A/D
converter
Digital
input
signal
Digital
signal
processor
Digital
output
signal
D/A
converter
Analog
output
signal
Property
Digital
Analog
Dynamics
only
limited
by
complexity
generally
unlimited
(costs, complexity
precision)
without problems
low
generally limited
Precision
Aging
Production
costs
Frequency
range
Linear-phase
frequency
responses
Complex
algorithms
approximately realizable
realizable
strong limitations
(from [Evaluating DSP Processor Performance, Berkeley Design Technology, Inc., 2000])
Family
Arithmetic
Data
width (bits)
BDTImark
2000(TM)
Core
clock speed
Unit price
qty. 10000
Analog Devices
ADSP-219x
ADSP-2126x
ADSP-BF5xx
ADSP-TS20x
DSP563xx
DSP568xx
MSC71xx
MSC81xx
TMS320C24x
TMS320C54x
TMS320C55x
TMS320C64x
TMS320C67x
fixed-point
floating-point
fixed-point
floating/fixed-point
fixed-point
fixed-point
fixed-point
fixed-point
fixed-point
fixed-point
fixed-point
fixed-point
floating-point
16
32/40
16
8/16/32/40
24
16
16
16
16
16
16
8/16
32
410
1090
4190
6400
820
110
3370
5610
n/a
500
1460
9130
1470
160 MHz
200 MHz
750 MHz
600 MHz
275 MHz
80 MHz
300 MHz
500 MHz
40 MHz
160 MHz
300 MHz
1 GHz
300 MHz
$11-26
$5-15
$5-32
$131-205
$4-47
$3-12
$13-35
$77-184
$2-8
$3-54
$4-17
$15-208
$12-31
Freescale
Texas-Instuments
Sample-andhold circuit
A/D
Sample-andhold circuit
D/A
Digital signal
processor
2.1 Sampling
s(t) =
n=
(t nT ),
xs(t) = xc(t)
=
n=
n=
(t nT )
xc(nT ) (t nT )
(2.1)
(2.2)
10
Xs(j) =
t
s(t)
(b)
1 X
Xc(j( ks)).
T k=
(2.4)
Xc (j)
t
0
2T
3T
4T
(a)
5T
.
xs (t)
(c)
S(j)
2T
3T
4T
2
T
(b)
t
5T
3s
2s
2s
3s
s
2s
(s N )
3s
Xs (j)
1
T
(c)
2 X
s(t) S(j) =
( ks)
T k=
3s
2s
s N
(2.3)
6
= T
Xs (j)
(d)
= Aliasing
1
T
Xs(j) =
1
Xc(j) S(j),
2
s 2s
(s N )
11
12
Nonideal sampling
an(t) = a0(t)
n=
(t n T ) =
n=
(2.8)
rect(t) sinc(/2),
sinc(x) := sin(x)/x
(2.7)
a 0 (t )
a0(t nT )
(2.6)
13
jT /2
(2.9)
An(j) = A0(j)
= 2
2 X
( ks)
T k=
sinc(ks T /2) e
jks T /2
(ks)
k=
= 2
sinc(k) e
jk
(ks)
k=
(2.10)
14
Since
1
(Xc(j)An(j))
2
Xn(j) =
sinc(k) e
jk
k=
Xc(j( ks)).
(2.11)
15
16
(t nT )
n=
(a)
xc (t)
Hr (j)
xs (t)
(d)
Xc (j)
(b)
xc(t) =
Hr (j)
xr (t)
T
N < c < (s N )
n=
(e)
Xs (j)
1
T
(c)
2s
s N
s
2s
(s N )
N <
s
2
and
N < c < (s N )
(2.12)
xc(nT ) sinc
( nT ) sinc
1
s(tnT )
2
1
s(t )
2
1
s(t )
2
Sampling theorem:
Every bandlimited continuous-time signal xc(t) with
N < s/2 can be uniquely recovered from its samples
xc(nT ) according to
xc(t) =
n=
xc(nT )
n=
xc(nT ) ( nT ) sinc
n=
Xr (j)
Z X
xc(nT ) sinc
1
s(tnT )
2
(2.15)
Remarks:
18
D/A
S/H
h0 (t)
x0 (t)
Lowpass
hr (t)
xDA (t)
Analysis:
The S/H circuit has the impulse response
t T /2
h0(t) = rect
T
(2.16)
jT /2
(2.17)
20
(a)
|Xs (j)|
1
T
|Xc (j)|
2s
T sinc(T /2)
(b)
2s
2s
|X0 (j)|
(c)
1
T
(2.18)
|Hr (j)|
(d)
c = s /2
|XDA (j)|
(e)
(b) Frequency response of the S/H circuit (phase factor ejT /2 omitted)
(c) Magnitude frequency response after the S/H circuit
(d) Magnitude frequency response: lowpass reconstruction filter
(e) Magnitude frequency response of the reconstructed continuous-time signal
21
22
2.4 Quantization
Conversion carried out by an A/D converter involves quantization
of the sampled input signal xs(nT ) and the encoding of the
resulting binary representation
x1 d2 x2 d3 x3 d4 x4 d5 x5 d6 x6 d7 x7 d8 x8
d9 =
Amplitude
(2.19)
d3 x3 d4 x4 d5
k = 1, 2, . . . , L
Range R of quantizer
(2.21)
< e(n)
2
2
If the dynamic range of the input signal (xmax xmin) is
larger than the range of the quantizer, the samples exceeding
the quantizer range are clipped, which leads to e(n) > /2.
Quantization characteristic function for a midtreat quantizer
with L = 8:
Ik
dk xk dk+1
Amplitude
for all k = 1, 2, . . . , L1
(2.20)
23
24
Coding
The coding process in an A/D converter assigns a binary number
to each quantization level.
b
(2.22)
R
2b
x = 0 +
b1
X
(2.24)
=1
(2.23)
Twos complement representation is used in most fixedpoint DSPs: A b-bit binary fraction [012 . . . b1], 0
denoting the most significant bit (MSB) and b1 the least
25
26
Quantization errors
Quantization error is modeled as noise, which is added to the
unquantized signal:
Actual system
x(n)
Quantizer
Q(x(n))
x
(n)
1
e(n)
Mathematical model
x(n)
2
x
(n) = x(n) + e(n)
2
Assumptions:
range
2 < e(n) < 2 .
2
e
/2
1
=
e p(e) de =
/2
SNR := 10 log10
(2.25)
2
e de =
12
/2
/2
(2.26)
e =
x2
e2
22b R2
,
12
(2.27)
!
12 22b x2
= 10 log10
SNR = 10 log10
R2
R
= 6.02 b + 10.8 20 log10
dB.
(2.28)
x
|
{z
}
x2
e2
()
Term () in (2.28):
27
28
Analog
comparator:
(2.29)
Examples:
Narrowband speech: b = 8 Bit SNR = 46.9 dB
Music (CD): b = 16 Bit SNR = 95.1 dB
Music (Studio): b = 24 Bit SNR = 143.2 dB
30
Vo =
N
1
X
=0
(2N
RL
VR
1)RL + 1
VR : reference voltage
Full-scale output voltage Vo,F S is obtained when = 1 for all
= 0, . . . , N 1:
32
Vo,F S
(2N 1)RL
N
= N
VR VR , since (2 1)RL 1
(2 1)RL + 1
=0
(3.2)
VR
RL
N 1
2(RL + R) 2
Vo,F S
(3.1)
n=0
kn
v(n) WN
N 1
1 X
kn
VN (k) WN
IDFT: VN (k) v(n) =
N k=0
N
1
X
N
1
X
(2N 1)
VR
2N
k=
v1(k) v2(n k) =
k=
33
34
yc(n) = v1(n)
v2(n) = v2(n)
v1(n)
=
n0 +N 1
k=n0
v1(k) v2(n k) =
n0 +N 1
k=n0
v2(k) v1(n k)
(3.4)
"
#
# " N 1
N 1 N 1
X
1 X X
kn
kl
km
y(n) =
v2(l)WN WN
v1(m)WN
N k=0 m=0
l=0
#
"
N
1
N 1
N
1
X
X
1 X
k(nml)
WN
v1(m)
v2(l)
=
N m=0
k=0
l=0
(3.7)
(3.5)
y(n) =
k=0
Proof:
v1(k)
v2(n k + N )
{z
(3.6)
N
1
X
N
1
X
k=0
v1(k)v2((n k))N
(3.9)
= v1(n)
N v2 (n)
N 1
1 X
kn
IDFT of Y (k): y(n) =
Y (k)WN
N k=0
N 1
1 X
kn
V1N (k)V2N (k)WN
=
N k=0
35
36
n
0
Linear convolution:
v1 (n) = (n1)
y(n) =
k=0
n
0
k
N
v2 ((1 k))N , k = 0, . . . , N 1, n = 1
k
0
N
N v2 (n)
y(n) = v1 (n)
n
0
v1(k) v2(n k)
v2 ((0 k))N , k = 0, . . . , N 1, n = 0
N1 1
X
Other interpretation:
Circular convolution as linear
convolution with aliasing
IDFT leads to periodic sequence in the time-domain:
P y(n N ) n = 0, . . . , N 1,
yp(n) = =
0
otherwise
38
n
N1 = N2
N1
Overlap-add method
1. Input signal is segmented into separate blocks:
v (n) = v(n + N1), n {0, 1, . . . , N11}, ZZ.
2. Zero-padding for the signal blocks v (n) v
(n) and the
x1 (n) = x2 (n)
N1 = N2 = 6
n
0
2N1 1
N1
v(n) =
y(nN1 ), N1 = 6
N1
N1
y(n+N1 ), N1 = 6
N1
x1 (n)
N x2 (n)
N1 = N2 = 6
n
N1 = N2
N1
y(n) =
N x2 (n)
x1 (n)
N = 12
n
0
k = 0, . . . , N 1.
4. The N -point IDFT yields data blocks that are free from
aliasing due to the zero-padding in step 2.
5. Since each input data block v (n) is terminated with N N1
zeros the last N N1 points from each output block y (n)
must be overlapped and added to the first NN1 points of the
succeeding block (linearity property of convolution):
n
0
N1
v
(n N1)
since v
(n) = 0 for n = N1 +1, . . . , N .
3. The two N -point DFTs are multiplied together to form
n
0
y (n N1)
Overlap-add method
2N1 1
39
40
x
0 (n)
11
00
00
11
N N1 zeros
x
1 (n)
11
00
00
11
N N1 zeros
x
2 (n)
11
00
00
11
00
11
00
11
11
00
00
11
N N1 zeros
Output signal:
y0 (n)
11
00
00
11
00
11
00
11
N N1 samples
added together
y1 (n)
x0 (n)
N N1 zeros
11
00
00
11
00
11
00
11
N N1 samples
added together
y2 (n)
11
00
00
11
11
00
00
11
00
11
00
11
NL
x1 (n)
Output signal:
Overlap-save method
1. Input signal is segmented into by N N1 samples overlapping
blocks:
v (n) = v(n + N1), n {0, 1, . . . , N 1}, ZZ.
11
00
00
11
11
00
00
11
00
11
00
11
x2 (n)
11
00
00
11
y0 (n)
Discard
N N1 samples
11
00
00
11
y1 (n)
Discard
N N1 samples
11
00
00
11
y2 (n)
Discard
N N1 samples
41
42
We finally have
i
1 h
j
j
j
V (e ) =
V (e )
W (e )
2
i
1h
j(0 )
j(+0 )
W (e
) + W (e
)
=
2
(3.13)
v
(n) = v(n) w(n) with w(n) =
1 for 0 n L1,
0 otherwise.
(3.10)
Suppose that the input sequence just consists of a single sinusoid,
that is v(n) = cos(0n). The Fourier transform is
j
V (e ) = (( 0) + ( + 0)).
(3.11)
W (e ) =
L1
X
n=0
jn
1 ejL
j(L1)/2 sin(L/2)
=
.
=e
j
1e
sin(/2)
(3.12)
43
Special case: If
N = L and 0 =
2
,
N
= 0, . . . , N 1
2
n , v1(n) = cos
5
+
n
v0(n) = cos 5
N
N
N
v0(n)=cos(2/N 5n)
v1(n)=cos((2/N 5+/N) n)
0.5
0.5
V (e ) =
1h
j(1 )
j(2 )
W (e
) + W (e
)+
2
+ W (e
0.5
0.5
20
40
60
n
DFT(v0(n) w(n)), rect. window
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
10
20
40
30
10
20
+ W (e
j(+2 )
)
60
n
DFT(v1(n) w(n)), rect. window
20
j(+1 )
)
2/L < |12|: Two maxima, main lobes for both window
spectra W (ej(1)) and W (ej(2)) can be separated
|1 2| = 2/L: Correct values of the spectral samples,
but main lobes cannot be separated anymore
|1 2| < 2/L: Nain lobes of W (ej(1)) and
W (ej(2)) overlap
30
window, specified as
(3.14)
wHan(n) =
h
1 1 cos
2
2
L1 n
i
for 0 n L 1,
otherwise.
(3.15)
(ej )| from (3.13), where
Nagnitude frequency response |V
W (ej ) is replaced by WHan(ej ) (L = 25):
48
2 n
0.54 0.46 cos L1
0
for 0 n L 1,
otherwise.
(3.16)
10
dB
|Wrect(ej )|
0.5
VN (k) =
50
N
1
X
n=0
20
40
100
60
0.2
0.4
0.6
/
0.8
20 log10 |WHan(e )|
kn
for k = 0, . . . , N 1
v(n)WN
{z
}
|
| {z }
N results
1 complex multiplication
{z
}
49
50
dB
Remarks:
1 complex multiplication 4 real-valued mult. + 2 realvalued additions
1 complex addition 2 real valued additions
A closer evaluation reveals that there are slightly less than N 2
operations:
N values have to be added up (N 1) additions.
0.5
20
40
50
100
60
0.2
0.8
0.8
20 log10 |WHam(e )|
0
dB
0.5
0.4
0.6
/
20
40
60
50
100
0.2
0.4
0.6
/
Fast algorithms for DFT calculation (as the fast Fourier transform,
FFT) exploit symmetry and periodicity properties of WNkn as
k(Nn)
complex conjugate symmetry: WN
= WNkn = (WNkn )
k(n+N )
(k+N )n
periodicity in k and n: WNkn = WN
= WN
.
Since
2
WN = e
=e
N/21
= WN/2
N/21
kn
v(2n) WN/2
n=0
Principle:
Decomposing the DFT computation into DFT computations
of smaller size by means of decomposing the N -point input
sequence v(n) into smaller sequences decimation-in-time
j2/(N/2)
V (k) =
2j2/N
k
WN
kn
v(2n + 1) WN/2
n=0
= G(k) + WN H(k),
k = 0, . . . , N 1
(3.18)
(3.19)
Prerequisite:
N integer power of two, i.e. N = 2m, m = log2(N ) IN
radix-2
DFT V (k) (we drop the subscript N for clarity) can be written
as
V (k) =
N
1
X
kn
v(n) WN ,
n=0
k = 0, . . . , N 1
N/21
n=0
N/21
2kn
v(2n) WN
k(2n+1)
v(2n + 1) WN
n=0
(3.17)
(from [Oppenheim, Schafer, 1999])
Complexity:
2 DFTs of length N/2 2 N 2/4 = N 2/2 operations +
52
N/41
G(k) =
kn
N/41
H(k) =
kn
g(2n+1) WN/4,
n=0
n=0
(3.20)
N/41
kn
h(2n) WN/4
n=0
k
WN/2
kn
h(2n+1) WN/4
n=0
(3.21)
where k = 0, . . . , N/21.
Signal flow graph for N = 8 (v x, V X ):
Complexity:
4 DFTs of length N/4 N 2/4 operations
+ 2 N/2 + N operations for the reconstruction
(3.22)
(3.23)
Flow graph:
v (0)
0
v (1)
0
V2 (0)
0
1
1
V2 (1)
0
Inserting this in the resulting structure from the last step yields the
overall flow graph for (N = 8)-point FFT: (v x, V X ):
53
54
N/2
WN
WN
N/2
= WN WN
= WN .
N m = N ld N
(instead of N 2)
(from [Proakis, Nanolakis, 1996])
Examples:
N = 32 N 2 1000, N ld N 160 factor 6
N = 1024 N 2 106, N ld N 104 factor 100
In-place computations
()
Butterfly computations
Basic building block of the above flow graph is called butterfly
( {0, . . . , N/21}):
1
WN
Simplication
1
1
(+N/2)
WN
WN
(1)
(k2),
(1)
(k2)
()
(1)
(k1) + WN VN
()
(1)
(k1) WN VN
VN (k1) = VN
VN (k2) = VN
56
Inverse FFT
According to (3.2) we have for the inverse DFT
N 1
1 X
kn
VN (k) WN ,
v(n) =
N k=0
Bit-reversal
000
v(000)
001
v(100)
010
v(010)
011
v(110)
100
v(001)
101
v(101)
110
v(011)
111
v(111)
that is
N 1
1 X
kn
v(n) =
VN (k) WN ,
N k=0
v(N n) =
1
DFT{VN (k)}
N
(3.24)
57
58
(a)
(b)
N =r
for
r 2,
r, m IN
(3.25)
Radix-4 butterfly
(q = 0, . . . , N/41)
(N N ):
(from [Proakis, Nanolakis, 1996])
Thus, we have
VN1 (k) =
where
1
VNR (k) + VNR (N k) ,
2
1
VNI (k) VNI (N k) .
VNIo (k) =
2
VNRe (k) =
Define
(3.26)
(3.27)
I
C
VN2 (k) =
1
VNR (k) + VNR (N k) +
2
j
+
VNI (k) VNI (N k) , (3.31)
2
(3.28)
= v2 (n)
1
VNI (k) + VNI (N k)
2
j
VNR (k) VNR (N k) , (3.32)
with
Corresponding DFTs:
(3.29)
(3.30)
61
1
VNI (k) + VNI (N k) ,
2
1
VNRo (k) =
VNR (k) VNR (N k) .
2
VNIe (k) =
62
VN1 (k) =
Define
v
(n) := v(2n) + j v(2n + 1),
1
VN (k) + VN (N k) ,
2
(3.33)
j
VN(1,2) (k) = VN
(1,2)
(N k)
(3.34)
2N
1
X
=: v1(n) + j v2(n),
where the even and odd samples of v(n) are written alternatively
into the real and imaginary part of v
(n). Thus we have a complex
sequence consisting of two real-valued sequences of length N
with the DFT
VN (k ) = VN1 (k ) + j VN2 (k ),
k = 0, . . . , N 1.
(3.36)
VN (k ) + VN (N k ) ,
2
j
VN2 (k ) =
VN (k ) VN (N k )
2
VN1 (k ) =
for k = 0, . . . , N 1.
In order to calculate V2N (k) from VN1 (k) and VN2 (k) we
rearrange the expression for DFT{v(n)} according to
kn
v(n) W2N
n=0
V2N (k) =
with k = 0, . . . , 2N 1.
Hermitian symmetry analog to (3.34) since v(n) IR for all n:
n = 0, . . . , N 1,
(3.35)
k = 0, . . . , N
N
1
X
n=0 = v (n)
1
N
1
X
n=0
63
v(2n)
| {z }
2kn
W2N
kn
v1(n) WN
N
1
X
n=0
k
W2N
(2n+1)k
v(2n + 1) W2N
| {z }
= v2 (n)
N
1
X
nk
v2(n) WN ,
n=0
64
4. Digital Filters
Finally we have
k
VN1 (k)
1/2
V2N (k)
k = 0, . . . , N
H(z) =
k=N k=0
VN (N k)
i=0
N
P
i=0
j
1/2
N
P
k
VN2 (k) W2N
bN i z i
aN i
bi z i
i=0
zi
N
P
1+
N
P
i=1
(4.1)
ai
z i
H(z) = b0
N
Q
(z z0i)
i=1
N
Q
i=1
(4.2)
(z zi)
where the z0i are the zeros, and the zi are the poles of the
transfer function (the latter are responsible for stability).
Difference equation:
y(n) =
N
X
i=0
65
bi v(n i)
N
X
i=1
ai y(n i),
(4.3)
66
with v(n) denoting the input signal and y(n) the resulting signal
after the filtering
Remarks
b0 z N
N
P
i=0
aN i z i
b0 z N
N
Q
i=1
N
X
i=1
(4.5)
y(n) =
i=0
bi v(n i)
(4.7)
(z zi)
ai y(n i)
N
N
X
1 X
i
i
H(z) = N
bN i z =
bi z
z i=0
i=0
(4.4)
Transfer function:
(4.6)
y(n) =
Non-recursive filter
L1
X
k=0
67
h(L1)
h(L2)
z 1
z 1
h(3)
z 1
h(2)
h(1)
z 1
h(0)
z 1
y(n)
When the FIR filter has linear phase (see below) the impulse
response of the system satisfies either the symmetry or asymmetry
condition
h(n) = h(L 1 n).
(4.8)
Thus, the number of multiplications can be reduced from L to
L/2 for L even, and from L to (L+1)/2 for L odd.
Signal flow graph for odd L:
z 1
z 1
z 1
z 1
z 1
z 1
h(1)
h(2)
h(3)
z 1
z 1
z 1
z 1
z 1
z 1
v(n)
h(0)
z 1
h(L2)
h(L1)
z 1
h(0)
z 1
h(1)
z 1
h(2)
z 1
z 1
h(3)
y(n)
L3
2
L1
2
y(n)
H(z) = H0
z 1
P
Y
Hp(z)
(4.9)
p=1
we obtain a cascade realization. The Hp(z) are normally secondorder, since in order to obtain real coefficients, conjugate complex
69
70
zeros z0i and z0i
have to be grouped:
Hp(z) = (1 z0iz
= 1 + b1 z
)(1 z0iz
+ b2 z
Xi(z)
1
=
Yi(z)
qi
qi z 1
Xi1(z)
.
z 1
Yi1(z)
(4.10)
1
and (z0i
) are
appear in quadruples: Both z0i and z0i
, and z0i
a pair of complex-conjugate zeros. Consequently, we have
1
)(1z0iz
+ b2 z
Hp(z) = (1z0iz
= 1 + b1 z
1 1
+ b1 z
)(1z0i z
3
+z
)(1(z0i)
1 1
),
X1(z) = V (z) + q1 z
V (z),
Y1(z) = q1 V (z) + z
V (z).
It follows
.
H1(z) =
X1(z)
1
1
= 1 + q1 z = 01 + 11 z ,
V (z)
G1(z) =
Y1(z)
1
1
= q1 + z = 01 + 11 z .
V (z)
Second stage:
General structure:
v(n)
(4.11)
1-th stage
x1 (n)
x2 (n)
y1 (n)
(L1)-th
xL1 (n)
stage
yL1 (n)
Y1(z),
Y1(z).
(4.12)
xi (n)
qi
yi1 (n)
X2(z) =X1(z) + q2 z
z 1
qi
V (z) + q2q1z
yi (n)
71
V (z) + q1z
V (z) + q2z
V (z) + z
V (z),
V (z),
72
H2(z) =
X2(z)
1
2
= 1 + (q1 + q1 q2)z + q2 z , (4.13)
V (z)
= 02 + 12 z
G2(z) =
+ 22z
= 02 + 12 z
+ 22z
(4.14)
G2(z
Gi(z
),
for
a1
z 1
z 1
a2
b2
z 1
z 1
a3
b3
),
that is, the zeros of H2(z) can be obtained by reflecting the zeros
of G2(z) at the unit circle. Generally, it can be shown that
Hi(z) = z
z 1
b1
H2(z) = z
y(n)
z 1
Y2(z)
1
2
= q2 + (q1 + q1 q2)z + z ,
V (z)
1
b0
v(n)
i = 1, . . . , L 1.
(4.15)
z 1
z 1
z 1
z 1
aN 1
bN 1
z 1
z 1
aN
bN
H1(z) =
N
X
i=0
bi z ,
H2(z) =
1+
1
N
P
i=1
ai z i
w(n) =
N
X
i=1
ai w(n i) + v(n),
The all-zero H1(z) can be realized with the direct form from
Section 3.1.1. By attaching the all-pole system H2(z) in cascade,
73
74
y(n) =
N
X
i=0
bn w(n i).
v(n)
b0
y(n)
z
b0
a1
b1
z 1
y(n)
a2
b2
z 1
z 1
b1
a1
a3
b3
z 1
b2
a2
z 1
z 1
b3
a3
z 1
aN 1
bN 1
z 1
z 1
aN
bN
z 1
bN 1
aN 1
z 1
aN
bN
Only one single delay line is required for storing the delayed
versions of the sequence w(n). The resulting structure is called
a direct form II realization. Furthermore, it is said to be canonic,
since it minimizes the number of memory locations (among other
structures).
Transposing the direct form II realization leads to the following
75
H(z) =
P
Y
Hp(z).
(4.16)
p=1
76
Example:
A so called Chebyshev lowpass filter of 5-th order and the cut-off frequency
fco = 0.25 fs (fs denoting the sampling frequency) is realized. A filter design
approach (we will discuss the corresponding algorithms later on) yields the
transfer function
b0
v(n)
z
y(n)
b1
a1
H(z) = 0.03217
H(z) =
Y (z)
b0 + b1 z 1
=
V (z)
1 + a1 z 1
(4.17)
Every first order transfer function can be realized with the above
flow graph:
b + b1 z 1 (b0/a0) + (b1/a0) z 1 b0 + b1 z 1
=
=
H(z) = 0
a0 + a1 z 1
1 + (a1/a0) z 1
1 + a1 z 1
Second order subsystems:
1 + 5 z 1 + 10 z 2 + 10 z 3 + 5 z 4 + z 5
1 0.782 z 1 + 1.2872 z 2 0.7822 z 3 + 0.4297 z 4 0.1234 z 5
(4.19)
The zeros are all at z = 1: z0i = 1 for i = 1, 2, . . . , 5.
The location of the poles are:
z1,2 = 0.0336 j 0.8821,
z3,4 = 0.219 j 0.5804,
3,4 (z) =
H
b1
z 1
a2
b0 + b1 z 1 + b2 z 2
Y (z)
=
V (z)
1 + a1 z 1 + a2 z 2
1 + 2 z 1 + z 2
1 0.4379 z 1 + 0.3849 z 2
b2
5 (z) =
H
H(z) =
1 + 2 z 1 + z 2
1 + 0.0672 z 1 + 0.7793 z 2
y(n)
z 1
a1
(4.20)
1,2 (z) =
H
v(n)
z5 = 0.4113.
1 + z 1
.
1 0.4113 z 1
(4.18)
77
78
5 (z)
H
H1 (z) =
H2 (z) =
H3 (z) =
5 (z = 1)
H
3,4 (z)
H
3,4 (z = 1)
H
1,2 (z)
H
1,2 (z = 1)
H
0.2943 + 0.2943 z 1
1 0.4113 z 1
0.4616 + 0.9233 z
+ 0.4616 z
1 0.4379 z 1 + 0.3849 z 2
10
20
20
0
dB
dB
0
20
40
0
0.5
/
10
|H (ej )|
20
20
40
10
N
X
20
Ai
.
1 ziz 1
(4.21)
Ai
Ai
+
z 1 =
1 zi z 1
1 zi
2 {Ai } 2 {Ai zi
}z 1
b0 + b1 z 1
=:
1 2 {zi }z 1 + |zi |2 z 2
1 + a1 z 1 + a2 z 2
(4.22)
40
0.5
/
0
dB
dB
0.5
/
20 log
i=1
20
H(z) = A0 +
40
20 log
20
20 log10 |H2(e )|
|H (e )|
(from [Fliege: Analoge und digitale Filter, Hamburg University of Technology, 1990])
0.5
/
79
80
Ai
+
=
1 zi z 1
1 zj z 1
(Ai + Aj ) (Ai zj + Aj zi ) z
1 (zj + zi ) z 1 + (zj zi ) z 2
=:
b0 + b1 z
1 + a1 z 1 + a2 z 2
(4.23)
Example:
Consider again the 5-th order Chebyshev lowpass filter with the transfer
function from (4.19). The partial fraction expansion can be given as
H(z) = 0.2607 +
+
A1
A1
+
z 1 +
1 z1 z 1
1 z1
A3
A5
A3
+
+
1
1
1 z3 z
1 z3 z
1 z5 z 1
z1 = 0.0336 + j 0.8821,
Parallel structure:
z3 = 0.219 + j 0.5804,
H0
A3 = 0.5533 + j 0.00926,
z5 = 0.4114,
A5 = 1.1996.
H1(z)
H2(z)
V (z)
A1 = 0.1 + j 0.0941,
H(z) = 0.2607 +
1.1996
1.1066 + 0.3498 z 1
+
.
1 0.4379 z 1 + 0.3849 z 2
1 0.4114 z 1
Y (z)
HP (z)
0.2 0.1592 z 1
+
1 + 0.0673 z 1 + 0.7793 z 2
v(n)
z
yp (n)
ap1
bp1
z 1
ap2
p = 1, . . . , P
(from [Fliege: Analoge und digitale Filter, Hamburg University of Technology, 1990])
81
82
v = [A, . . . , 1, 0, 1, . . . , B ] =
B
X
=A
2 .
(4.25)
=1
Negative fraction:
b1
X
2 ,
(4.28)
v1C = 12 +
b1
X
(1)2
= 22
b+1
=1
v = [0.12 . . . b1] =
(4.27)
Example: [101.01]2 = 1 22 + 0 21 + 1 20 + 0 21 + 1 22
b1
X
(4.24)
where is the digit, r is the radix (base), A the number of integer
digits, B the number of fractional digits.
v = [0.12 . . . b1] =
Sign-magnitude format:
(4.26)
=1
|v| (4.29)
Twos-complement format:
v2C = [1.12 . . . b1]
+ [00 . . . 01] for v < 0,
(4.30)
where
+ denotes a binary addition. We thus have by using
(4.29)
v2C = v1C + 2
b+1
= 2 |v|.
(4.31)
b+1
2 +2
1=
=1
83
84
= 1 +
b1
X
v=
Example:
=1
=1
+11
(1 ) 2
| {z }
+2
b+1
= v2C 2.
Remarks:
Most DSPs use twos-complement arithmetic. Thus any b-bit
number v has the number range
v {1, 1 + 2
b+1
,...,1 2
b+1
b+1
bu +1
) Et 0
}.
0 Et (2
b+1
bu +1
).
85
86
Twos-complement representation:
+1
+1
+1
+1
+ [0.001] = [1.000]
[0.111]
| {z }
| {z }
| {z }
7
+1
+1
87
88
zi =
(from [Oppenheim, Schafer, 1999])
N
X
n=1
N
Q
=1, 6=i
N n
zi
an,
i = 1, . . . , N.
(zi z)
(4.32)
a
i = ai + ai,
i = 1, . . . , N,
bi = bi + bi,
i = 0, . . . , N,
90
Poles: z1,2 = r ej ,
Coefficients:
a1 = 2r cos , a2 = r 2,
Stability condition: |r| 1
v(n)
y(n)
z 1
2r cos
z 1
r2
Unquantized:
(a) Magnitude frequency response 20 log10 |H(ej )|
(b) Passband details
H(z) =
1
.
1 (2r cos ) z 1 + r 2 z 2
91
(4.33)
92
v(n)
z 1
r cos
r sin
y(n)
r cos
z 1
P
Y
bp0 + bp1 z 1 + bp2 z 2
1 + ap1 z 1 + ap2 z 2
p=1
Cascade form:
H(z) =
Parallel form:
H(z) = A0 +
P
X
p=1
Y (z)
(r sin ) z 1
H(z) =
=
.
V (z)
1 (2r cos ) z 1 + r 2 z 2
We can see from the signal flow graph that the two coefficients
r sin and r cos are now linear in r , such that a
quantization of these parameters lead to equally spaced pole
locations in the z-plane:
cp0 + cp1 z 1
1 + ap1 z 1 + ap2 z 2
93
94
P
Y
(1 + bp1 z
+ bp2 z
p=1
y(n) =
N
X
i=0
95
bi v(n i)
N
X
i=1
ai y(n i).
96
1 b+1
1 b+1
(2
) ei(n) (2
),
2
2
b+1
ei(n) 0.
e = 0,
e =
22b+2
,
12
(4.35)
e =
y(n) =
N
X
i=0
N
X
i=1
2b+1
,
2
e =
22b+2
.
12
(4.36)
ee(n) = e (n) + e .
(4.37)
98
f (n) =
N
X
i=1
aif (n i) + e(n),
(4.39)
Hef (z) =
1
,
D(z)
H(z) =
N (z)
D(z)
analog to (4.1).
4
X
i=0
2
i
e = 5
22b+2
12
= (2N + 1)
2b+2
12
(4.38)
2
= e
2
|Hef (e )| d = e
n=
|hef (n)| ,
(4.40)
where the last expression is obtained by applying Parsevals
theorem.
By combining (4.38) and (4.40) we can now state the total output
99
100
2
f
22b+2
= (2N +1)
2 12
d
|D(ej )|2
22b+2 X
2
= (2N +1)
|hef (n)|
12 n=
b0 + b1 z 1 + b2 z 2
(1 r ej z 1)(1 r ej z 1)
H(z) =
Thus we have
H(z) =
b0
,
1 a1z 1
|a1| < 1
v(n)
b0
22b+2 1
=5
12 2
d
.
|(1 r ej ej )|2 |(1 r ej ej )|2
y(n)
z 1
Direct-form II structure
a1
Considering (4.41) and the two error sources ea1 (n), eb0 (n), we
have
22b+2 X
22b+2
1
2n
=2
|a1| =
.
12 n=0
6
1 |a1|2
(4.42)
The output noise variance increases when the pole z = a1
2
f
101
w(n) =
y(n) =
N
X
i=1
N
X
i=0
22b+2 X
22b+2
2
=N
|h(n)| + (N + 1)
.
12 n=
12
(4.47)
f f (e ) = N
22b+2
22b+2
j 2
|H(e )| + (N + 1)
.
12
12
(4.45)
We then have:
2
f
22b+2 1
=N
12 2
22b+2
,
|H(e )| d + (N + 1)
12
j
(4.46)
103
|a| < 1.
104
y(n)
z
y(n)
z 1
Q[]
a
= [1.010] = 3/4
107
108
(4.49)
H(z) =
L1
X
h(n)z
(4.50)
n=0
=z
"
h(S) +
S1
X
h(n) z
n=0
(Sn)
(Sn)
(4.51)
L/21
H(z) = z
h(n) z
n=0
(Sn)
(Sn)
(4.52)
(L1)
H(z
) = H(z),
(4.53)
109
H(e ) = e
=e
jS
jS
"
h(S) + 2
S1
X
n=0
(4.54)
H01()
110
h(n)
h(n)
0.5
0
10
15
20
n
type 3, amplitude frequency response
25
30
1
10
15
20
n
type 1, amplitude frequency response
25
0.5
30
03
H ()
0
0.5
01
H ()
1
0
0.5
1.5
2
/
0.5
0.5
1.5
2
/
2.5
3.5
=e
H(e ) = e
3.5
0
0
2.5
jS
jS
"
j h(S) + 2
S1
X
n=0
j H03() = e
jS+j/2
(4.55)
H(e ) = e
=e
jS
jS
L/21
n=0
H02()
H03()
linear phase 2() = arg H(ej ) = S
S = (21)/2, IN H(ej ) = 0
111
112
L/21
H02() = 2
n=0
L/21
H02( + 2) = 2
n=0
L/21
X
j
jS
H(e ) = e
j 2
h(n) sin ((S n))
n=0
(4.57)
L/21
=2
n=0
=e
= cos((L12n)) = 1
= H02()
jS
j H04() = e
jS+j/2
H04()
h(n)
h(n)
0.5
0
0
10
15
20
n
type 2, amplitude frequency response
25
25
30
0.5
04
H ()
0.5
H02()
10
15
20
n
type 4, amplitude frequency response
0.5
0.5
1
0
30
0.5
1.5
2
/
2.5
3.5
113
0.5
1.5
2
/
2.5
3.5
114
Hd(e ) =
hd(n) e
jn
1
hd(n) =
2
(4.58)
n=
hd(n) =
1
2
Hd(e ) e
jn
d.
1 n = 0, . . . , L 1
h(n) =
0 otherwise
hd (n) n = 0, . . . , L 1
otherwise
0
115
sin c n
n
L1
2
L1
2
L1
2
n 6=
d.
n 6=
L1
2
(4.61)
L1
,
2
n = 0, . . . , L 1
1.2
1
L=61, c=0.2
0.8
0.6
0.6
0.4
0.2
0.2
0.2
0.4
0.6
/
0.8
L=101, c=0.2
0.8
0.4
0
0
1.2
|H(ej )|
w(n) =
j(n(L1)/2)
Rectangular window:
h
i
sin c n L1
2
h(n) =
,
n L1
2
For L odd:
Zc
(4.59)
(4.60)
|H(ej )|
Applications:
0
0
0.2
0.4
0.6
/
0.8
Gibbs phenomenon:
Type of window
Rectangular
Bartlett
Hanning
Hamming
Blackman
Approximate transition
width of main lobe
Peak
sidelobe [dB]
4/L
8/L
8/L
8/L
12/L
-13
-27
-32
-43
-58
118
20
40
0.2
0.8
100
0
Blackman window
20
0.2
0.8
L=61, c=0.2
20
40
0.4
0.6
/
Kaiser window, =4
20 log10 |H(ej )|
L=61, c=0.2
20 log
j 2 (k+)
L
)
L1
X
j2k/L
Hd(e
60
80
80
100
0
100
0
0.2
0.4
0.6
/
0.8
L1
X
h(n)e
j2(k+)n/L
(4.63)
j 2 (k+)
L
)
k=0
40
60
jn
10
|H(ej )|
0.4
0.6
/
h(n)e
n=0
80
20 log
Hd(e
60
80
L1
X
40
60
100
0
L=61, =0.2
c
20 log10 |H(ej )|
20
n=0
Hamming window
L=61, =0.2
c
10
|H(ej )|
Hd(e ) =
L1
L1 X
X
h(n)e
j2(k+)n/L
j2k/L
k=0 n=0
0.2
0.4
0.6
/
0.8
L1
X
h(n)e
j2n/L
n=0
= L h() e
L1
X
j2(n)k/L
k=0
j2/L
(4.64)
120
Example:
Remarks:
Hd(e
j 2 (k+)
L
)
= Hd (e
1
2 (k+)
j 2 (k+)
j L1
2 L
Hd (e L
)=e
T1
k = 0, 1, . . . , 5,
k = 6,
k = 7, 8, . . . , 15.
j 2 (Lk)
L
).
L odd,
k = 0, 1, . . . , L1
2
2
L
k =
(k + ),
L even,
k = 0, 1, . . . , 2 1
0, 1 .
(4.65)
122
L = 32, = 0:
L = 32, = 0.5:
j(L1)/2
where A() is a real-valued positive or negative function (amplitude frequency response) (cmp. (4.54), (4.55), (4.56), (4.57)).
It can be shown that for all types of linear-phase symmetry A()
can always be written as a weighted sum of cosines. For example
for type 1 linear-phase filters we have
(L1)/2
A() =
an cos(n)
(4.67)
n=0
L1
L1
with a0 = h
, an = 2 h n +
. (4.68)
2
2
Remaining linear-phase filters ( 2f ):
123
124
Problem definition
Acceptable frequency response for the resulting FIR filter:
Linear phase,
transition bandwidth between pass- and stopband,
passband deviation 1 from unity,
stopband deviation 2 from zero.
E(m) = E(m+1),
m = 1, 2, . . . , r,
i = 1, . . . , r + 1.
and
F
L = 13
(4.69)
A() =
r1
X
an cos(n)
n=0
(L1)/2
P
an cos(n),
n=0
125
126
r1
X
an cos(n)
(4.70)
n=0
D(i) =
r1
X
an cos(ni)+(1) ,
i = 1, . . . , r+1,
n=0
(4.71)
from which we obtain a unique solution for the coefficients
an, n = 0, . . . , r1 and the error magnitude .
In the Remez exchange algorithm {F } is usually chosen as
an equally spaced grid of frequency points with the number of
frequency points being approximately 10 L. The algorithm
is initialized with a trial set of arbitrarily chosen frequencies
T = {1, 2, . . . , r+1}.
The Remez algorithm now consists of the following basic
computations:
1. Solve the linear equations in (4.71), yielding an error
magnitude k in the k-th iteration.
127
Example:
Choose the two coefficients d0 and d1 such that they minimize the Chebyshev
error
2
max |x (d0 + d1 x1 )|
x[0,1]
xi = d0 + d1 xi + (1) ,
i = 0, 1, 2
(4.72)
1
1
1
0.0
0.625
1.0
1 = 0.1171875
0.0
1
d0
1 d1 = 0.390625
0
1.0
1
1
1
1
0.0
0.5
1.0
0.0
1
d0
1 d1 = 0.25
1.0
0
1
1 = 0.125 =
b maximum error T2 is the extremal point set
0.0625
1 0.25
1
d0
1
0.5
1 d1 = 0.25
1.0
0
1
1.0
1
N =
0 = 0.0625
10 log10(1 2) 13
.
2.324
(4.73)
2. Next trial set chosen as those three points, where the error
2
E(x) = x (d0 + d1 x)
129
130
Design example
Design a linear-phase lowpass filter with the specifications
Impulse response
0.6
p = 0.4,
s = 0.6.
0.4
20
40
0.2
60
2 = 0.001,
h(n)
1 = 0.01,
80
0.2
0
10
15
n
20
100
0
25
0.2
0.4
0.6
/
0.8
Passband detail
0.6
20 log10 |H(ej )| [dB]
0
1.01
20
1.005
|H(ej )|
h(n)
0.4
40
0.2
60
0.995
80
0.99
0.2
0
10
15
20
100
0
25
0.2
0.4
0.6
/
0.8
Passband detail
0.4
1.01
|H(e )|
0.2
/
1.005
1
0.995
0.99
0.985
0
0.985
0
0.2
/
0.4
N (s)
n=0
=
Ha(s) =
N
P
D(s)
n sn
(4.74)
sn
n=0
Ha(s) =
h(t) e
st
dt
1 X
2n
H(j) =
Ha j j
T n=
T
(4.75)
Ha(s) =
Note that linear-phase designs are not possible for causal and
stable IIR filters, since the condition
H(z) = z
N
X
Ai
,
s si
i=1
(Laplace transform).
H(z
ha(t) =
N
X
Ai e
si t
N
X
Ai e
si nT
i=1
H(z) =
n=0
133
t 0.
Periodical sampling:
i=1
h(n) = ha(nT ) =
(4.77)
(4.76)
h(n)z
n=0
N
X
i=1
Ai e
si nT
134
We then have
H(z) =
N
X
i=1
Ai
X
si T
n=0
n
N
X
i=1
H(z) =
Ai
1 esiT z 1
Thus, given an analog filter Ha(s) with poles si, the transfer
function of the corresponding digital filter using the impulse
invariant transform is
H(z) =
N
X
i=1
Ai
s
e iT
z 1
0.5
1 e(0.1j3)T z 1
0.5
1 e(0.1+j3)T z 1
1 (e0.1T cos(3T )) z 1
.
1 (2 e0.1T cos(3T )) z 1 + e0.2T z 2
(4.78)
Example:
Convert the analog filter with transfer function
Ha (s) =
s + 0.1
(s + 0.1)2 + 9
Definition:
2
s=
T
Ha (s) =
1 z 1
1 + z 1
(4.79)
0.5
0.5
+
s + 0.1 j3
s + 0.1 + j3
135
136
according to
H(z) := Ha
"
1 z 1
1 + z 1
2
T
!#
= Ha(s).
2
tan(/2),
T
= 2arctan(T /2).
(4.81)
Properties
1 + (T /2)s
,
1 (T /2)s
(4.80)
z=
1 + T /2 + jT /2
.
1 T /2 jT /2
2
=
T
j sin(/2)
cos(/2)
1 ej
1 + ej
2
j =
T
Remarks:
2j
tan(/2)
T
137
138
Butterworth filters
Ha (s) =
c
,
s + c
|H()| =
2
0.65
tan(c /2) =
.
T
T
0.65/T
,
s + 0.65/T
which is transformed back into the digital domain using the bilinear
transform in (4.79), leading to the transfer function of our desired digital
filter:
0.245 (1 + z 1 )
.
H(z) =
1 0.509 z 1
Note that the parameter T has been divided out. The frequency response is
H(e
)=
(4.82)
Ha (s) =
1
,
1 + (/c)2N
0.245 (1 + ej )
,
1 0.509 ej
H(s) H(s) =
1
.
1 + (s2/2c )N
s,n = c e
j/2
j(2n+1)/(2N )
n = 0, . . . , 2N 1
(4.83)
139
140
3 dB frequency c = 2 fc = 1000 ,
N =
log10 (104 1)
= 6.64
2 log10 2
20
0.8
|H(ej )|
40
which leads to
N =
log((1/22)
1)
.
2 log(s/c)
(4.84)
60
141
100
0
0.6
0.4
0.2
80
Transition band
0
20 log10 |H(ej )| [dB]
1
2
= 2 ,
1 + (s/c)2N
0.1
0.2
0.3
0.4
/
0.5
0.6
0
0
0.05
0.1
0.15
/
0.2
0.25
142
Phase response
0.5
5
Im{z}
Pole/zero locations
10
Examples:
0.5
1
15
0
0.2
0.4
0.6
/
0.8
0.5
0
Re{z}
0.5
Chebyshev filters
Two types of Chebyshev filters:
|H()| =
1
,
1 + 2 TN2 (/p)
(4.85)
TN (x) =
cos(N cos1(x))
cosh(N cosh
N = 1, 2, . . .
for |x| 1,
2
(1 1)2
1+
which establishes a relation between the passband ripple 1 and
the parameter .
(4.86)
143
144
|H()| =
1
1 + 2 [TN2 (s/p)/TN2 (s/)]
(4.88)
|H()| =
1
,
1 + 2 UN (/p)
(4.90)
145
146
22
x
0
x(n)
.
y(m)
X0(z) =
x0(m)z
m=
X0(z) = X0(z ) =
x(mM )z
M 1
1 X
k
X(zWM ).
Y (z ) =
M k=0
mM
m=
(5.5)
M m
y(m)(z )
m=
M
= Y (z ) = Y (z ) y(m)
(5.1)
x0(m) = x(m)
(5.4)
By replacing Y (z M ) = X0(z) in (5.4) we have for the ztransform of the downsampled sequence y(m)
M 1
1 X X
k
m
x(m)(WM z) .
M k=0 m=
M 1
1 X
km
W
,
M k=0 M
WM := e
j2/M
Y (e
M 1
1 X
j( k2)/M )
)=
X(e
)
M k=0
(5.6)
(5.3)
149
150
a)
|Q(e j)|
|Q(e j)| |H(e j)| = |X(e j)|
0
= 3
m
8
8
b)
|X(e j(+m))|
= 3
m
8
8
c)
= 3
m
8
8
0 2
16
32
h(n)
x(n)
.
M
y(m)
(from [Mitra, 2000])
151
152
x(m) = x(m)
M 1
1 X
k(m)
WM
,
M k=0
(5.9)
Example for = 2
X(z) =
M 1
1 X X
k
m
k
x(m)(WM z) WM
M k=0 m=
M 1
1 X
k
k
X(zWM ) WM .
M k=0
(5.10)
`
0
Y(e
`
2
= m `=M
Y(e
Note that y2 (m) in (c) is a formal description for the output signal of the
downsampler with non-integer sample indices. The real output signal y2 () is
jM
M 1
1 X
j( 2k)/M
k
X(e
) WM ,
)=
M k=0
M 1
1 X
jj2k/M
k
)=
X(e
) WM .
M k=0
(5.11)
(5.12)
(5.8)
153
154
M 1
1 X j2k(m)/M
e
=
M k=0
1 for m = M + ,
0 otherwise.
ZZ,
.
y(m)
.
u(n)
the majority of the technical literature in the following we will denote the length
of an FIR filter with LF .
Interpolation
The inserted zero values are interpolated with suitable values,
which corresponds to the suppression of the L 1 imaging
spectra in the frequency domain by a suitable lowpass
interpolation filter.
U (z) = Y (z ).
(5.14)
y(m)
.
u(n)
.
g(n)
v(n)
U (e ) = Y (e
jL
).
(5.15)
Suppose y(m) is obtained by sampling a bandlimited continuoustime signal ya(t) at the Nyquist rate (such that the sampling
theorem is just satisfied). The Fourier transform Y (ej ) can thus
be written with (2.4) and = /T0 as
j( 2k)
1 X
Ya
,
Y (e ) =
T0 k=
T0
j
156
V (e ) =
1 X
j( 2k)
Ya
,
T k=
T
(5.16)
j( 2k)
L X
Ya
.
=
T0 k=
(T0/L)
On the other hand by upsampling of y(m) with factor L we
obtain the Fourier transform of the upsampled sequence u(n)
analog to (5.15) as
j
U (e ) = Y (e
jL
).
h(n)
u(n)
y(m)
v(n)
.
f (n)
x(n)
Input-output relation?
Relation between Y (z) and U (z) (see (5.5)), where z is replaced
157
158
Example:
by z 1/M :
Y (z) =
1
M
M
1
X
U (z
1/M
M = 4, no aliasing:
WM ),
k=0
(5.18)
(5.19)
with aliasing:
(5.20)
160
x0(0) = x(0),
x0(1) = x(3),
...
x1(0) = x(1),
x1(1) = x(4),
...
x2(0) = x(2),
x2(1) = x(5),
...
n = mM + .
(5.21)
M
1
X
(M 1)
X(z )
(5.23)
=0
X(z) =
M
1
X
X(z )
(5.22)
=0
x1(1) = x(4),
x2(1) = x(3),
x2(0) = x(0),
0 1 2
x0 (m)
X(z) =
...
...
...
x(n)
x0(1) = x(5),
x1(0) = x(1),
Example for M = 3:
x0(0) = x(2),
M
1
X
M
z X
(z )
(5.25)
=0
x1 (m)
m
(z) x
with X
(n) = x(nM )
x2 (m)
0
(5.26)
161
162
5.1.5 Nyquist-Filters
Properties:
u(n)
g(n)
G1(z ) + + z
(L1)
L1
X
Y (z ) +
G(zWL) = L = 1.
(5.29)
=0
V (z) = z
(5.28)
otherwise.
g(n)
GL1(z ),
L1
X
v(n)
for n = 0,
G(z) = G0(z ) + z
g(Ln) =
G(zWL ) G(zWL2 )
G(zWLL1 )
G(z )Y (z ).
=0, 6=m
(5.27)
v(Ln+m) = y(n); the input samples appear at the output
of the system without any distortion for all n. All in-between
(L 1) samples are determined by interpolation.
163
Half-band filters
Special case of L-band filters for L = 2:
164
G(e ) + G(e
j()
) = 1.
x(n) =
k=0
y(m) =
j
G(ej )
(5.31)
LF 1
X
LF 1
X
k=0
Visualization (M = 3):
h(k)
h(0)
h(LF 1)
k
v(k)
v(0)
p
x(0) y(0)
v(1 k)
v(0)
x(1) is removed
Length is restricted to
v(2 k)
v(0)
x(2) is removed
k
v(3 k)
v(0)
v(n)
.
(5.32)
h(n)
x(n)
x(3) y(1)
.
M
y(m)
165
166
k
y(m)
m
u(k)
k
(from [Fliege: Multiraten-Signalverarbeitung, 1993])
v(0)
y(m)
.
u(n)
.
g(n)
v(n)
v(n) =
LF 1
X
k=0
168
rate, however the output delay chain still runs in the higher
sampling rate.
Zero multiplications are avoided.
Additional reductions can be obtained by exploiting the
symmetry of h(n) (linear-phase).
5.3 Decimation and interpolation with polyphase filters
5.3.1 Decimation
M
H(z) =
z H(z ),
(5.33)
=0
M
denoting
the
downsampling
factor
and
Y (z )
0
(z 0 )
(z 0 )
(z 0 )
5.3.2 Interpolation
(z 0 )
169
170
G(z) =
L1
X
G(z ),
=0
Y (z )
Y (z)
(z 0 )
"L
Y1(z)
G(z)
X1(z)
X (z)
#M
(z 0 )
(z 0 )
(z )
0
Notation: For simplicity a delay by one sample will be generally denoted with
171
172
a ratio L/M < 1. However, a ratio L/M > 1 can also be used
with the dual structures.
1. Implementation of the filter G(z) in polyphase structure,
shifting of all subsamplers into the polyphase branches:
(c) Finally, if M and L are coprime, it can be shown that upand downsampler may be exchanged in their order:
.
G (z)
z`
#M
"L
m0
0 L m0 M = 1 (diophantic equation)
(5.34)
G (z)
z `
"L
( 0
L m0 M )
#M
G (z)
z`
"L
#M
m0
174
V (z) f
H (z)
fs1 = fs =M
H (z)
s1
"
H (z)
i
f Y (z)
s
H (z)
Hd(z) is the (input) decimation filter, the actual filtering is carried
out with the core filter Hc(z) in the M -times lower sampling rate
with sampling frequency fs1 = fs/M , and after upsampling
the output signal is interpolated with Hi(z) Single-stage
implementation
Stopband- and passband edge frequencies of the decimation and
interpolation filters have to be adjusted to the filter specifications
of the core filter:
j dj j ij
H
j
j
H
fpass
; H
fstop
fs1 =
f
fs1
fstop
fs1
175
176
V (z )
(5.37)
Y (z )
H (z )
No real multirate filter since both filters are calculated with the
same (input) sampling rate. Multirate technique is applied to
the coefficients of the impulse response h(n).
Realization of G(z K ) in the first direct structure:
v(n)
z K
g(0)
z K
z K
g(1)
g(2)
z K
z K
g(3)
z K
g(LF 2)
g(LF 1)
y(n)
F (z )
approximation
G(z K )
jK
|G(e
)|
177
178
Ks
2
s.
K
(5.39)
1 + 1 = (1 + 1,G) (1 + 1,F ).
(5.40)
p,F = p,
s,F =
Small passband ripples 1,G for G(z) and 1,F for F (z),
resp., lead to the simplification
1 1,G + 1,F .
2 2,F = 2,G.
p s
d = 0.05,
(5.43)
Example:
p,G = K p,
(5.41)
Kp
(5.38)
s = 0.1,
p,G = 0.2,
s,G = 0.4,
Impulse response
Impulse response
0.4
0.3
0.1
40
0.4
60
0.1
0
20 log10 |G(ej)| [dB]
0.3
0.2
0
20
0.2
g(n)
20
0.2
g1(n)
2. We use an linear-phase FIR Chebyshev design and insert these values for
G(z) into (4.73), yielding a filter order N = 19. However, several test
designs show that the above specifications are only met for N = 21,
leading to a filter length of LF = N +1 = 22.
0.1
40
n
60
80
0
80
40
20
0.2
0.4
0.6
/
0.8
Passband detail
60
0.1
1.02
10
n
15
20
0.2
0.4
0.6
/
0.8
p,F = p = 0.05,
s,F =
40
2
s = 0.4,
K
0.99
60
0.98
80
0
0.2
0.4
0.6
/
0.8
0.02
0.04
/
0.06
1.01
20
|H(ej )|
80
0
0.2
0
0.3
f(n)
0.2
0.1
20
40
60
Structure:
0.1
0
6
n
10
12
80
0
0.2
0.4
0.6
/
0.8
x(t)
= 4
181
Q
b bit
T /2
Q[xL (n)]
h(n)
y(n)
2L
y(n)
A/D converter
182
|H(e )| =
0 otherwise.
1
=
2
The filtering with the lowpass h(n) now reduces the quantization
noise variance by factor 2L, since
(L,b)
1
=
2
L
/2
Z
(L)
/2L
22b+2
.
12 2L
(5.44)
e2
= 10 log10(2L) = L3.01 dB.
Gain = 10 log10 2
e
(L,b)
(5.45)
An increase of the oversampling factor 2L by factor 2 leads to
an increase in quantizer resolution by half a bit (compare (2.29))
and to an increase of the signal-to-noise ratio (SNR) in (2.29) by
3 dB!
Visualization:
j
ee (e )
e2
(a)
11111111111111
00000000000000
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111
(L)
ee (ej )
e2
(b)
11
00
00
11
00
11
00
11
00
11
00
11
00
11
00
0011
11
00
11
2L
ee(e ) d.
ee (e ) d =
2L
183
184
Analysis:
Requirements:
e2
(L,bL )
e2
(0,b0 )
2bL +2
2
!
= 1 = L 2b +2
2 2 0
L
bL = b0 , (5.46)
2
Given a b0 = 16 bit A/D converter, where the analog input signal is sampled
at the Nyquist rate. Choose the parameter L in the oversampled A/D converter
from above such that the same quantization noise variance for bL = 1 bit is
achieved.
From (5.46) we obtain L = 30, leading to an oversampling factor of
2L 109 .
E(z) = E(z) 1 z
,
[xL (n)]Q
|ee(e )|
xL (n)
z 1
22b+2
(1 cos()).
6
(5.49)
x 10
1/3 22b+2
5
+
| .
2b+2
j 2
With ee(ej ) = 2 12
(noise power spectrum of a b-bit
midtreat quantizer with range R = 2) we have
ee(e ) =
(5.48)
4
3
2
e(n)
1
0
0
185
0.2
0.4
0.6
/
0.8
186
2
e
(L,b)
1
=
2
L
/2
Z
Structure:
j
ee(e ) d,
x(n)
/2L
22b+2
=
12
b bit
L+1
2
L
sin(2 )
(5.50)
Gain = 10 log10
L+1
2
L
sin(2 )
e2
(L,bL )
1
= 1 bL = b0+ log2
2
!
L+1
h(n)
xL (n)
(5.51)
2
L
sin(2 )
(5.52)
Example:
The above example is again carried out for the noiseshaping case: For
Q[xL (n)]
b1 < b bit
h1 (n)
b1 bit
DAC
b bit
e2
xL (n)
y(t)
2L
H0(z)
H1(z)
y0 (m)
y1 (m)
F0(z)
F1(z)
x(n)
h1 (n)
hK1 (n)
u1 (n)
uK1 (n)
M0
M1
MK1
y0 (m0 )
M0
subband processing
h0 (n)
x(n)
u0 (n)
y1 (m1 )
M1
v0 (n)
v1 (n)
f0 (n)
x(n)
yK1 (mK1 )
MK1
vK1 (n)
fK1 (n)
a)
X(ej)
0
0
0
0
"1"
"0"
2
4
2
4
c)
"0"
2
"1" 1
0
0
"0"
3
"1" 1
H1(z)
2
2
Encoder
Encoder
Channel
Demultiplexer
H0(z)
Multiplexer
x(n)
Decoder
F0(z)
Decoder
F1(z)
x(n)
(a): Magnitude frequency response of the input signal, (b) magnitude frequency
response of the lowpass, and (c) highpass branch after analysis filtering and
downsampling
Only the errors in the above system related to the filter bank are
189
190
Analysis
How do we have to design the filters such that
Y (z ) =
x
(n) = x(n D) holds?
(D denotes the delay of the overall analysis-synthesis system in
samples)
We have the following relations:
1
[H0(z) X(z) + H0(z)X(z)]
2
1
2
Y1(z ) = [H1(z) X(z) + H1(z)X(z)]
2
2
Y0(z ) =
(5.53)
(5.54)
Proof:
These relations can be obtained from (5.18)
Y (z) =
M 1
1 X
1/M
k
1/M
k
H(z
WM ) X(z
WM )
M k=0
=e
j2k/2
=e
jk
Y (z) =
=
1
2
k 1/2
H((1) z
1
[H0(z) F0(z) + H1(z) F1(z)] X(z).
2
(5.57)
(5.57) consists of two parts:
for n even,
1 for n odd,
k 1/2
) X((1) z
and finally by combining (5.56), (5.53), and (5.54) the inputoutput relation for the two-channel filter bank writes
we have
1
X
X(z)
= Y0(z ) F0(z) + Y1(z ) F1(z) ,
(5.56)
X(z)
= [H0(z) F0(z) + H1(z) F1(z)] X(z)+
2
for M = 2. With
k
W2
1
[H(z) X(z) + H(z) X(z)] ,
2
(5.58)
(5.59)
k=0
i
1h
1/2
1/2
1/2
1/2
H(+z ) X(+z ) + H(z ) X(z ) .
2
(5.55)
191
S(z) = 2z
(5.60)
192
G(z) = 0.
(5.61)
H1(z) = H0(z),
F0(z) = H0(z),
F1(z) = H1(z)
(5.62)
(5.64)
1
1
1
2
1
2
1
(1 + 2z + z ) (1 2z + z ) = 2z
2
2
The magnitude frequency responses of highpass and lowpass
filter have for real-valued filter coefficients the mirror image
property (therefore the name QMF):
|H1(e
j(
2 )
)| = |H0(e
j(
2 +)
)|
(5.65)
194
1.2
|H0(ej )|
|H1(ej )|
0.6
0.4
0.2
0
0
0.2
0.4
0.6
/
0.8
0.6
0.5
0.4
h0(n)
0.5
h1(n)
|H(e )|
0.8
0.3
0.2
0.1
0
|H0(e )| + |H0(e
j()
=0
)| 1
0.1
0
d,
20
0.5
0
(5.68)
10
n
15
20
0.04
|H (ej )|
|H (ej )|
0.03
20
40
10
=s
|H0(e )| d,
15
20
Es =
10
n
(5.67)
20 log10|S(e j )| [dB]
Er = 2
Z
0.02
0.01
0
0.01
60
0.02
80
100
0
0.03
0.2
0.4
0.6
/
0.8
0.04
0
0.2
0.4
0.6
/
0.8
196
yields
(5.69)
+1
H0(z)F0(z) (5.71)
!
(5.72)
T (z) + (1)
+1
T (z) = 2 z
(5.73)
Interpretation:
F0(z) = z
H1(z),
F1(z) = z
H0(z)
(5.70)
Aliasing transfer function: Inserting (5.70) into (5.59) yields
Transfer function for the input signal: Inserting (5.70) into (5.58)
197
t(n) =
for
n = D,
0
for n = D + 2,
arbitrary otherwise.
6= 0,
(5.74)
198
zeros of H0 (z)
zeros of F0 (z)
Example:
(a): linear-phase half-band filter
(b): half-band filter with lower system delay
H0(z) = (1 + 2z
F0(z) = (1 + 2z
+ 6z
+z
+ 2z
),
H1(z) = z
(LF 1)
H0(z
),
(5.75)
(L 1)
1
F0(z) = (z) F
H0(z ), F1(z) = H0(z).
F0(z) = z
199
(LF 1)
H0(z
), F1(z) = H0(z).
(5.76)
200
S(z) = z
!
(LF 1)
= 2z
(H0(z) H0(z
) + H0(z) H0(z
)),
TZ (z) + TZ (z) = 2
H0(z) H0(z
) + H0(z) H0(z
) = 2.
|H0(e )| + |H0(e
j(+)
)| = 2
(5.78)
j(+) 2
|H (e )|
|H (e
)|
1.5
H1(z) = z
(LF 1)
H0(z
F0(z) = z
(LF 1)
H0(z
),
0.5
F1(z) = z
(LF 1)
H1(z
) = H0(z).
0
0
0.2
0.4
0.6
/
0.8
(5.79)
),
(5.80)
202
Visualization:
A(e ) = AZ
j(LF 1)
()e
AZ (): Real-valued amplitude frequency response of the halfband filter a(n), AZ () aZ (n), LF : length of h0(n).
If the value
= min AZ () < 0,
(5.82)
[0,2]
for
n 6= 0,
n = 0.
(5.84)
(aZ (n) denotes the zero-phase impulse response with the center
of symmetry located at n = 0).
for
203
TZ (z) =
1
AZ+(z).
1 + ||
(5.85)
Remark:
In practice for double zeros on the unit circle the separation
process is numerically very sensitive. As a solution, the parameter
|| in (5.82) and (5.83) can be enlarged by a small value
zeros move pairwise off the unit-circle where due to the linearphase property they are mirrored at the unit-circle
204
Example
Parameter for the design of TZ (z): LF = 16, s = 0.6 ,
= 0.2 , = 104
30
0.5
1
1
0
Re{z}
0
Re{z}
|H0(ej )|
0.6
0.6
5
10
15
0.8
0
10
15
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0.2
0.2
0.4
0.4
0.6
0.6
5
10
15
0.8
0
10
15
|H1(ej )|=|H0(ej )|
1.5
TZ ()
0.4
0.8
0
1.5
0.4
0.2
15
2.5
0.2
0.8
0
0.5
0.4
0.2
0.5
0.6
0.4
f (n)
0.5
Im{z}
Im{z}
0.6
0.2
f0(n)
h (n)
h0(n)
0.5
0.5
0
0
0.2
0.4
0.6
/
0.8
0
0
0.2
0.4
0.6
/
0.8
205
206
(a): Fully iterated tree filter bank, (b): Octave filter bank
If the two band filter bank is of the perfect reconstruction
type, the generated multiband structure also exhibits the perfect
reconstruction property.
which leads to two filters of length 6.
h0 (n)
h1 (n)
u0 (n)
u1 (n)
y0 (m)
y1 (m)
yK1 (m)
v0 (n)
v1 (n)
f0 (n)
x(n)
f1 (n)
F
F
F
hK1 (n)
uK1 (n)
vK1 (n)
fK1 (n)
F
F
F
F
All K analysis and synthesis filters are obtained from one single
analysis and synthesis prototype, resp.
(From [Mertins: Signal analysis, 1999])
207
208
Advantages:
|Hn (ej )|
p(n)
| {z }
analysis prototype
fk (n) =
q(n)
| {z }
synthesis prototype
e
|
j 2 k(n D
2)
K
{z
(5.86)
e
|
j 2 k(n D
2)
K
{z
{z
Fk (e ) =
j( 2 k)
K )
Q(e
{z
|
(5.88)
j 2 k D
(5.89)
phase factor
e K 2
| {z }
z-transforms:
kD
nD
P (z) =
K1
X
P(z ).
(5.91)
=0
j 2 k D
e K 2
| {z }
|HK1 (ej )|
2
K
Hk (z) =
j( 2 k)
K )
P (e
Frequency responses:
Hk (e ) =
|H0 (ej )|
(5.87)
K=8
phase factor
kD
WK 2
K1
X
P(z ) WK .
(5.92)
=0
K1
1 X
kn
X(k) WK
Analogy to the IDFT: x(n) =
K k=0
210
6. Spectral Estimation
The n-th output of the IDFT has finally to be multiplied with the
nD
rotation factors WK 2 .
Structure of the analysis filter bank:
x(k)
xk
P0 (zK )
( )
WKD=
y0(m)
xk
(
1)
P1 (zK )
WK
WKD=
2(K 1)
xk M
(
+1)
PK 1(zK )
WK K
(
1)
K IDFT
yK 1(m)
211
212
vv (e ) =
vv () e
wr (n) =
v(k + ) v (k).
vv () = lim
N 2N + 1
k=N
(6.1)
(6.2)
(per)(ej ) =
vv
N
1
X
vv ()e
1 n = 0, . . . , N 1,
0 otherwise,
(6.4)
1 X
1
vN (k+) vN (k) =
vN ()vN ().
N k=
N
(6.5)
Fourier transform of the rightmost equation in (6.5)
finally yields the following expression for the periodogram
(VN (ej ) vN (n)):
vv () =
vv () =
v(k + ) v (k)
N k=0
N
vv
N
N
(6.6)
MATLAB-command: periodogram
(per)(ejk2/M ) =
(per)(k) can be
The sampled version
vv
vv
obtained from the M1-point DFT VN (k) of vN (n):
(per)(k) = 1 |VN (k)|2,
vv
N
k = 0, . . . , M1 1.
(6.7)
(6.3)
213
214
=N +1
Autocorrelation sequence
vv ()
0.8
v(n)
0.6
0
0.4
0.2
0
0.2
3
0
10
15
n
20
25
40
30
20
20
40
j
j
(per)
Periodogram
vv (e ) (solid), power spectrum vv (e ) (dashed)
10
vv
Magnitude [dB]
10
15
0
0.2
0.4
0.6
/
0.8
N 1
1 X
E{
vv ()} =
E{v(k + ) v (k)}
N k=0
= 0.
(6.8)
lim E
vv (e ) vv (e )
N
N 1
N
1 X
vv () (6.11)
vv () =
N k=0
N
N it follows
(triangular) window
Spectral resolution
( N ||
N
wB () =
for || N,
(6.12)
for || > N.
(per)(ej )
vv
N
1
X
E{
vv ()}e
wB () vv () e
spectral smoothing,
spectral leaking,
the loss of the ability to resolve two nearby spectral lines.
Similarly, this also holds for the convolution between the power
spectrum and the Bartlett window frequency response in (6.13).
Example: (a) Power spectrum of two sinusoids in white noise,
(b) expected value of the periodogram
=N +1
(per)(ej )
vv
1
j
j
vv (e )
WB (e )
2
(6.13)
lim E
(per)(ej )
vv
= vv (e )
(6.14)
217
2
,
N
(6.15)
vv
N
xx
N
(6.18)
If N is large compared to the length of h(n), vN (n) can be
described as vN (n) h(n)xN (n), since the transition effects
can be neglected. Thus, the magnitude square frequency response
|VN (ej )|2 of vN (n) can be with (6.17) expressed as
j
(per)(ej )
Var
vv
2
j
vv (e ).
(6.16)
|H(e )| = vv (e ).
(6.17)
vv
xx
Applying the variances on both sides results in
n
o
n
o
(per)(ej ) 2 (ej ) Var
(per)(ej ) ,
Var
vv
vv
xx
(6.20)
Thus, although the periodogram for white Gaussian noise is unbiased, the
variance is independent of the data record length N .
10
2.5
10
Variance
Magnitude [dB]
20
30
50
0
0.2
0.4
0.6
/
0.8
10
2.5
10
Variance
Magnitude [dB]
20
30
50
0
0.2
0.4
0.6
/
0.8
0.2
0.4
0.6
/
0.8
0
0
0.2
0.4
0.6
/
0.8
10
10
20
30
40
0.4
0.6
/
0.8
= vv (e ),
.
i
vi vi
L
K1
1 X (per) j
j
vv (e ) =
(e ).
K i=0 vivi
20
30
50
0
10
40
0.2
(per)(ej )
vv
n=0
0
Magnitude [dB]
0
10
2
1.5
0.5
50
0
lim E
40
Magnitude [dB]
1.5
0
0
0.5
40
0.2
0.4
0.6
/
0.8
221
(6.22)
(6.13)
Properties
vv (ej )
=E
=
(per) (ej )
v v
i i
1
j
j
vv (e )
WB (e ).
2
(6.23)
vv (ej ) is asymptotically
As with the periodogram, the estimate
unbiased, i.e. for L .
vv (ej )}
For uncorrelated data records vi(n) the variance Var{
can be obtained in the same way from (6.22) and (6.20) as
o
o
n
n
(per) (ej ) 1 2 (ej ).
vv (ej ) = 1 Var
Var
vi vi
K
K vv
(6.24)
We can observe that the variance goes to zero if K goes to infinity
vv (ej ) is a consistent estimate of the power spectrum if
(B)(ej )
vv
2
K1 L1
1 X X
jn
=
v(n + iL) e
.
N i=0 n=0
(6.25)
(B)(ej )
vv
1
j
j
vv (e )
WB (e )
2
(6.26)
= 0.89
2
2
= 0.89 K
,
L
N
(6.27)
o
n
(B)(ej ) 1 2 (ej ).
Var
vv
K vv
(6.28)
j
(B)
vv (e ) is a consistent estimate for K, L .
The Bartlett estimate allows to trade spectral resolution for a
reduction in variance by adjusting the parameters L and K .
Examples:
224
K = 4, L = 64, approximated
variance of Bartlett estimates
0.5
0.4
0.2
0.4
0.6
/
0.8
K = 8, L = 32, overlay of 30
j
(B)
Bartlett estimates
vv (e )
10
0.5
0.4
30
20
20
10
10
0
0.2
0.4
0.6
/
0.8
10
10
0
0.2
0.4
0.6
/
0.8
Periodogram
30
0.2
0.4
0.6
/
0.8
0
0
5
Magnitude [dB]
10
10
0.4
0.6
/
0.8
10
0.2
0.4
0.6
/
0.8
10
0.2
0.4
0.6
/
0.8
15
0
20
10
0
10
0.2
Magnitude [dB]
0.1
10
Magnitude [dB]
0.8
30
0.2
15
0
0.4
0.6
/
0.3
15
0
0.2
K = 8, L = 32, approximated
variance of Bartlett estimates
Variance
Magnitude [dB]
0
0
Magnitude [dB]
0.1
10
(6.29)
0.2
15
0
0.3
(n) of variance 2 = 1,
Magnitude [dB]
10
Variance
Magnitude [dB]
K = 4, L = 64, overlay of 30
j
(B)
Bartlett estimates
vv (e )
0.2
0.4
0.6
/
0.8
Here, the input signal consists of two sinusoids in white Gaussian noise
225
(mod)(ej )
vi vi
1
=
LU
2
L1
X
jn
v
(n)
w(n)e
i
(6.31)
Properties
(W )(ej )
vv
n=0
2
L1
K1
X
X
1
jn
(W )(ej ) =
v(n
+
iD)
w(n)e
.
vv
KLU i=0 n=0
(6.33)
MATLAB-command: pwelch
227
Sidelobe
level [dB]
3 dB bandwidth
3 dB
Rectangular
-13
0.89 2
L
Bartlett
-27
1.28 2
L
Hanning
-32
1.44 2
L
Hamming
-43
1.30 2
L
Blackman
-58
1.68 2
L
Type of window
(W )(ej )
Var
vv
9
j
2
vv (e )
8K
(6.35)
30
30
20
20
Magnitude [dB]
Magnitude [dB]
10
10
10
0
0.2
0.4
0.6
/
0.8
10
0
0.2
0.4
0.6
/
0.8
Compared to the Bartlett estimate for the same example above the use of
the Hamming window reduces the spectral leakage in the estimated power
spectrum.
Since the number of sections (7) are about the same to those in the above
(W )(ej )
Var
vv
9L 2 j
(e ).
16N vv
(6.36)
o
o
n
n
(B)(ej ) .
(W )(ej ) 9 Var
Var
vv
vv
16
(6.37)
vv (N 1) =
1
v(N 1) v(0).
N
(BT )(ej ) =
vv
M
X
vv () w() e
(6.38)
=M
W (e ),
vv
2 vv
Z
1
(per)(eju) W (ej(u)) du
=
vv
2
(6.39)
(BT )(ej )
vv
(BT )(ej )
Var
vv
2
j
vv (e )
1
N
M
X
w ().
=M
(6.42)
From (6.41) and (6.42) we again see the trade-off between bias
and variance: For a small bias, M should be large in order to
minimize the width of the main lobe of W (ej ), whereas M
should be small to minimize the sum term in (6.42). As a
general rule of thumb, M is often chosen as M = N/5.
Examples:
(6.40)
231
232
10
0.5
0.4
Variance
Magnitude [dB]
Overlay of 30 Blackman-Tukey
(BT ) j
vv
(e )
estimates
0
5
0.2
0.1
0.2
0.4
0.6
/
0.8
0
0
0.2
0.4
0.6
/
0.8
10
Magnitude [dB]
5
0
M = V .
0.2
0.4
0.6
/
0.8
30
30
20
20
Magnitude [dB]
Magnitude [dB]
10
0.4
0.6
/
0.8
Variability
V
Periodogram
Bartlett
1
K
Resolution
2
N
2
0.89 K
N
0.89
Figure of merit
M
2
N
2
0.89
N
0.89
9
8K
1.28
2
L
0.72
2
N
Blackman-Tukey
(Bartlett window of length
2M , 1 M N )
2M
3N
0.64
2
M
0.43
2
N
10
10
0.2
(6.44)
10
15
0
(6.43)
n
o
vv (ej )
Var
o,
n
V =
vv (ej )
E2
0.3
10
15
0
10
0
0.2
0.4
0.6
/
0.8
233
234
difference equation is
v(n) =
q
X
i=0
bi w(n i)
p
X
i=1
ai v(n i),
(6.46)
where v(n) denotes the output and w(n) the input sequence
6.2 Parametric methods for power spectrum estimation
Disadvantages
methods:
of
the
periodogram-based
(nonparametric)
H(z) =
q
P
(6.45)
model process
v(n)
!
= received process
w
ai , bi
vv (e ) = w |H(e )| = w
bi z i
p
P
H(ej )
2
vv (ej ) = w
|H(ej )|2
i=0
w(n)
white noise
source, = 0
|B(ej )|2
.
|A(ej )|2
(6.48)
235
236
1+
i=1
ai
z i
v(n) = w(n)
Moving average (MA) process
p
X
i=1
ai v(n i).
(6.49)
v(n) =
q
X
i=0
bi w(n i).
E{v(n) v (n )} =
(6.50)
i=0
p
X
i=1
bi E{w(n i) v (n )}
ai E{v(n i) v (n )},
which leads to
vv () =
Remarks:
q
X
q
X
i=0
bi wv ( i)
p
X
i=1
ai vv ( i). (6.51)
2
h(k) w (n k) w(n + ) = w h().
=E
k=0
(6.52)
238
In the last step we have used our prerequisite from above that the
process w(n) is assumed to be a zero-mean white random process
2
with E{w(n k)w(n + )} = ( + k)w
and known
2
variance w . Thus we have from (6.52)
wv () =
0
2
w
for
> 0,
h() for 0.
(6.53)
p
P
for > q,
ai vv ( i)
i=1
p
q
P
vv () =
2 P
ai vv ( i) for 0 q
h(i) bi+
w
i=1
i=0
vv ()
for < 0.
(6.54)
p
P
ai vv ( i)
for > 0,
i=1
p
P
vv () =
2
ai vv ( i) for = 0
w
i=1
vv ()
for < 0.
(6.55)
vv (0)
(1)
vv
..
.
vv (p 1)
vv (1)
vv (0)
..
.
vv (p 2)
...
...
...
...
vv (p 1)
a1
vv (1)
(2)
vv (p 2)
a2
vv
.. =
..
..
.
.
.
vv (0)
ap
vv (p)
(6.56)
= vv (0) +
p
X
aivv (i).
(6.57)
i=1
v(n + ) v (n),
vv () =
N n=0
= 0, . . . , p.
(6.58)
In the matrix version of the Yule-Walker equations (6.56) we
replace vv () with
vv (). The resulting linear equation
system is solved for the parameter vector a, which now contains
the estimated AR parameters a
i, i = 1, . . . , p. Finally, we
239
240
10
10
0
The input process consists of two sinusoids in white Gaussian noise (n) of
variance 2 = 1 according to (6.29) with 1 = 0.2 , 2 = 0.25 . The
model order of the Yule-Walker method is chosen as p = 50.
Magnitude [dB]
Magnitude [dB]
20
10
0
10
0
0.4
0.6
/
0.8
0.4
0.6
/
0.8
10
0
0.2
0.4
0.6
/
0.8
Magnitude [dB]
40
40
30
30
20
10
10
0
20
10
0
0.2
0.4
0.6
/
0.8
10
0
0.2
0.4
0.6
/
0.8
40
40
30
30
20
10
0
20
10
0
20
10
0
10
0
0.2
0.2
Magnitude [dB]
30
30
10
40
20
MATLAB-command: paryule
40
30
20
(6.59)
k=1
30
Magnitude [dB]
(AR)(ej ) =
2 .
vv
p
P
jk
1 +
a
k e
40
Magnitude [dB]
2
w
40
Magnitude [dB]
Magnitude [dB]
2
obtain w
via (6.57) from the a
i and the estimated autocorrelation
sequence
vv ().
10
0
0.2
0.4
0.6
/
0.8
241
0.2
0.4
0.6
/
0.8
10
0
0.2
0.4
0.6
/
0.8
We can see that only for the longer data sequence with N = 512 the
resolution of the estimates are comparable. Clearly, for N = 100 the
estimate based on an AR-model provides much better frequency resolution
for the sinusoidal components than the Blackman-Tukey method.
242
vv (e
) = 2 2 cos(2).
Magnitude [dB]
5
0
5
10
YuleWalker (AR(4) model)
BlackmanTukey
exact power spectrum
15
20
0
0.2
0.4
0.6
/
0.8
243