You are on page 1of 122

1

Advanced Digital Signal Processing 6. Spectral estimation


• Periodogram, Bartlett’s method, Welch’s method,
Abdellatif Zaidi † Blackman-Tukey method
Department of Electrical Engineering
• ARMA modeling, Yule-Walker equation and solution
University of Notre Dame
azaidi@nd.edu

Literature
Outline: • J. G. Proakis, D. G. Manolakis: Digital Signal Process-
1. Introduction ing: Principles, Algorithms, and Applications, Prentice
2. Digital processing of continuous-time signals Hall, 2007, 4th edition
• Retition: Sampling and sampling theorem • S. K. Mitra: Digital Signal Processing: A Computer-
• Quantization Based Approach, McGraw Hill Higher Education, 2006,
• AD- and DA-conversion 3rd edition
3. DFT and FFT • A. V. Oppenheim, R. W. Schafer: Discrete-time signal
• Leakage effect processing, Prentice Hall, 1999, 2nd edition
• Windowing • M. H. Hayes: Statistical Signal Processing and Model-
• FFT structure ing, John Wiley and Sons, 1996 (chapter 6).
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
Parts of this textbook have been realized in close collaboration with Dr. Joerg Kliewer whom I warmly thank.

2
1. Introduction – Numerical integration and differentiation
– Determination of mean value, correlation, p.d.f., . . .
1.1 Signals, systems and signal processing
• Properties of the system (e.g. linear/nonlinear) determine the
What does “Digital Signal Processing” mean? properties of the whole processing operation
Signal: • System: Definition also includes:
• Physical quantity that varies with time, space or any other – software realizations of operations on a signal, which
independent variable are carried out on a digital computer (⇒ software
implementation of the system)
• Mathematically: Function of one or more independent
– digital hardware realizations (logic circuits) configured
variables, s1(t) = 5 t, s2(t) = 20 t2
such that they are able to perform the processing operation,
• Examples: Temperature over time t, brightness (luminance) of or
an image over (x, y), pressure of a sound wave over (x, y, z) – most general definition: a combination of both
or (x, y, z, t)
Digital signal processing: Processing of signals by digital means
Speech signal:
4 (software and/or hardware)
x 10
1 Includes:
• Conversion from the analog to the digital domain and back
Amplitude →

0.5
(physical signals are analog)
0
• Mathematical specification of the processing operations ⇒
−0.5 Algorithm: method or set of rules for implementing the system
−1 by a program that performs the corresponding mathematical
0.1 0.2 0.3 0.4 0.5 0.6 0.7
t [s] → operations
• Emphasis on computationally efficient algorithms, which are
Signal Processing: fast and easily implemented.
• Passing the signal through a system
• Examples:
– Modification of the signal (filtering, interpolation, noise
reduction, equalization, . . .)
– Prediction, transformation to another domain (e.g. Fourier
transform)

3 4
Basic elements of a digital signal processing system 1.2 Digital signal processors (DSPs)
Analog signal processing: • Programmable microprocessor (more flexibility), or hardwired
digital processor (ASIC, application specific integrated circuit)
Analog Analog Analog
input signal output (faster, cheaper)
signal processor signal
Often programmable DSPs (simply called ”DSPs”) are used for
Digital signal processing: evaluation purposes, for prototypes and for complex algorithms:
(A/D: Analog-to-digital, D/A: Digital-to-analog)
• Fixed-point processors: Twos-complement number repre-
Digital Digital
input output sentation.
Analog signal Digital signal Analog
A/D D/A
input
converter
signal
converter
output • Floating-point processors: Floating point number repre-
signal processor signal
sentation (as for example used in PC processors)

Why has digital signal processing become so popular? Overview over some available DSP processors see next page.
Digital signal processing has many advantages compared to Performance example: 256-point complex FFT
analog processing:
Property Digital Analog
Dynamics only limited by generally limited
complexity
Precision generally unlimited generally limited (costs
(costs, complexity ∼ increase drastically with
precision) required precision)
Aging without problems problematic
Production low higher
costs
Frequency ωdmin ≪ ωamin , ωdmax ≪ ωamax
range
Linear-phase exactly realizable approximately realizable
frequency
responses
Complex realizable strong limitations
(from [Evaluating DSP Processor Performance, Berkeley Design Technology, Inc., 2000])
algorithms

5 6
Some currently available DSP processors and their properties (2006):
Data BDTImark Core Unit price
Manufacturer Family Arithmetic width (bits) 2000(TM) clock speed qty. 10000
Analog Devices ADSP-219x fixed-point 16 410 160 MHz $11-26
ADSP-2126x floating-point 32/40 1090 200 MHz $5-15
ADSP-BF5xx fixed-point 16 4190 750 MHz $5-32
ADSP-TS20x floating/fixed-point 8/16/32/40 6400 600 MHz $131-205
Freescale DSP563xx fixed-point 24 820 275 MHz $4-47
DSP568xx fixed-point 16 110 80 MHz $3-12
MSC71xx fixed-point 16 3370 300 MHz $13-35
MSC81xx fixed-point 16 5610 500 MHz $77-184
Texas-Instuments TMS320C24x fixed-point 16 n/a 40 MHz $2-8
TMS320C54x fixed-point 16 500 160 MHz $3-54
TMS320C55x fixed-point 16 1460 300 MHz $4-17
TMS320C64x fixed-point 8/16 9130 1 GHz $15-208
TMS320C67x floating-point 32 1470 300 MHz $12-31

8
2. Digital Processing of Continuous-Time Signals

9
Digital signal processing system from above is refined:

Anti-aliasing Sample-and- Digital signal


A/D
lowpass filter hold circuit processor

Lowpass recon- Sample-and-


D/A
struction filter hold circuit

2.1 Sampling
⇒ Generation of discrete-time signals from continuous-time
signals

Ideal sampling
Ideally sampled signal xs(t) obtained by multiplication of the
continuous-time signal xc(t) with the periodic impulse train


X
s(t) = δ(t − nT ),
n=−∞

where δ(t) is the unit impulse function and T the sampling


period:


X
xs(t) = xc(t) · δ(t − nT ) (2.1)
n=−∞

X
= xc(nT ) δ(t − nT ) (2.2)
n=−∞

10
(”sifting property” of the impulse function) we finally have for the Fourier transform of xs(t)
xc (t)


(a) 1 X
Xs(jΩ) = Xc(j(Ω − kΩs)). (2.4)
T k=−∞
t

s(t) (lengths of Dirac deltas correspond to their weighting)


⇒ Periodically repeated copies of Xs(jΩ)/T , shifted by integer
(b) 1 multiples of the sampling frequency
Xc (jΩ)
t
(a) 1
0 T 2T 3T 4T 5T
.

xs (t) (lengths of Dirac deltas correspond to their weighting)
−ΩN ΩN

(c) S(jΩ)


t (b) T

. 0 T 2T 3T 4T 5T

−3Ωs −2Ωs −Ωs 0 Ωs 2Ωs 3Ωs
How does the Fourier transform F {xs(t)} = Xs(jΩ) look
Xs (jΩ)
like? 1
(c) T

Fourier transform of an impulse train:



∞ −3Ωs −2Ωs −Ωs −ΩN ΩN Ωs 2Ωs 3Ωs
2π X .
(Ωs − ΩN ) ω .
s(t) ◦−• S(jΩ) = δ(Ω − kΩs) (2.3)
T k=−∞ −6π −4π −2π 0 2π 4π 6π
ω = ΩT
Xs (jΩ)
Ωs = 2π/T : sampling frequency in radians/s. (d) 1 = Aliasing
T
Writing (2.1) in the Fourier domain,

1 Ωs 2Ωs
Xs(jΩ) = Xc(jΩ) ∗ S(jΩ), (Ωs − ΩN )

11 12
(a) Fourier transform of a bandlimited continuous-time input a0(t) denotes the rectangular prototype window:
signal Xc(jΩ), highest frequency is ΩN  
t − αT /2
(b) Fourier transform of the Dirac impulse train a0(t) = rect (2.7)
αT
(c) Result of the convolution S(jΩ) ∗ Xc(jΩ). It is evident that (
when 0 for |t| > 1/2
Ωs − ΩN > ΩN or Ωs > 2ΩN (2.5) with rect(t) := (2.8)
1 for |t| < 1/2
the replicas of Xc(jΩ) do not overlap.
a 0 (t )
⇒ xc(t) can be recovered with an ideal lowpass filter!
(d) If (2.5) does not hold, i.e. if Ωs ≤ 2ΩN , the copies of 1 rect(t) ◦−• sinc(Ω/2),
Xc(jΩ) overlap and the signal xc(t) cannot be recovered by sinc(x) := sin(x)/x
lowpass filtering. The distortions in the gray shaded areas are t
called aliasing distortions or simply aliasing. T T

Also in (c): Representation with the discrete (normalized) frequency Fourier transform of an(t):
ω = ΩT = 2πf T (f frequency in Hz) for the discrete signal xc (nT ) = x(n) Fourier transform of the rectangular time window in (2.7) (see
with F∗ {x(n)} = X(ejω ), F∗ {·} denoting the Fourier transform for properties of the Fourier transform)
discrete-time aperiodic signals (DTFT)
−jΩαT /2
A0(jΩ) = F {a0(t)} = α T · sinc(ΩαT /2) · e
Nonideal sampling (2.9)
⇒ Modeling the sampling operation with the Dirac impulse train Fourier transform of an(t) in (2.6) (analog to (2.3)):
is not a feasible model in real life, since we always need a finite ∞
2π X
amount of time for acquiring a signal sample. An(jΩ) = A0(jΩ) · δ(Ω − kΩs)
T k=−∞
Nonideally sampled signal xn(t) obtained by multiplication of a ∞
X
continuous-time signal xc(t) with a periodic rectangular window = 2πα sinc(kΩsα T /2) e
−jkΩs αT /2
δ(Ω−kΩs)
function an(t): xn(t) = xc(t) · an(t) where k=−∞

∞ ∞ X
X X −jkπα
an(t) = a0(t) ∗ δ(t − n T ) = a0(t − nT ) = 2πα sinc(kπα) e δ(Ω−kΩs)
k=−∞
n=−∞ n=−∞
(2.6) (2.10)

13 14
Since Solution: Sampling is performed by a sample-and-hold (S/H)
circuit
1
xn(t) = xc(t) an(t) ◦−• Xn(jΩ) = (Xc(jΩ)∗An(jΩ))

we finally have by inserting (2.10)

X −jkπα
Xn(jΩ) = α sinc(kπα) e Xc(j(Ω − kΩs)).
k=−∞
(2.11)
From (2.11) we can deduce the following:
• Compared to the result in the ideal sampling case (cp. (2.4))
here each repeated spectrum at the center frequency kΩs is
weighted with the term sinc(kπα) e−jkπα.
• The energy |Xn(jΩ)|2 is proportional α2: This is
problematic since in order to approximate the ideal case we (from [Proakis, Manolakis, 1996])
would like to choose the parameter α as small as possible. (a) Basic elements of an A/D converter, (b) time-domain response of an ideal
S/H circuit

• The goal is to continously sample the input signal and to hold


that value constant as long as it takes for the A/D converter to
obtain its digital representation.
• Ideal S/H circuit introduces no distortion and can be modeled
as an ideal sampler.
⇒ Drawbacks for the nonideal sampling case can be avoided
(all results for the ideal case hold here as well).

15 16
2.2 Sampling Theorem Then, with the definition of the rect(·) function in (2.8) we have
Reconstruction of an ideally sampled signal by ideal lowpass
filtering:
Hr (jΩ) = T rect(Ω/Ωs) •−◦ hr (t) = sinc(Ωst/2).
(2.14)

P
s(t) =
n=−∞
δ(t − nT ) Combining (2.13), (2.14), and (2.2) yields
(a)
Z∞ X
∞  
Hr (jΩ) 1
xc (t) xs (t) xr (t) Hr (jΩ) xc(t) = xc(nT ) δ(τ − nT ) sinc Ωs(t−τ ) dτ
ΩN < Ωc < (Ωs − ΩN ) 2
(d) T −∞ n=−∞
Xc (jΩ)
(b) 1 Ω ∞ Z∞  
X 1
−Ωc Ωc = xc(nT ) δ(τ −nT ) sinc Ωs(t − τ ) dτ
Ω n=−∞
2
Xr (jΩ) −∞
−ΩN ΩN
∞  
Xs (jΩ) (e) 1 X 1
= xc(nT ) sinc Ωs(t−nT ) .
(c) 1
T
Ω n=−∞
2
−ΩN ΩN

Sampling theorem:
−2Ωs −Ωs −ΩN ΩN Ωs 2Ωs
(Ωs − ΩN ) Every bandlimited continuous-time signal xc(t) with
In order to get the input signal xc(t) back after reconstruction, ΩN < Ωs/2 can be uniquely recovered from its samples
i.e. Xr (jΩ) = Xc(jΩ), the conditions xc(nT ) according to

Ωs ∞  
ΩN < and ΩN < Ωc < (Ωs − ΩN ) (2.12) X 1
2 xc(t) = xc(nT ) sinc Ωs(t−nT ) . (2.15)
n=−∞
2
have both to be satisfied. Then,

Remarks:
Xc(jΩ) = Xr (jΩ) = Xs(jΩ) · Hr (jΩ) •−◦
• Eq. (2.15) is called the ideal interpolation formula, and the
xc(t) = xr (t) = xs(t) ∗ hr (t). (2.13) sinc-function is named ideal interpolation function
We now choose the cutoff frequency Ωc of the lowpass filter as
Ωc = Ωs/2 (satisfies both inequalities in (2.12)).

17 18
• Reconstruction of a continuous-time signal using ideal ⇒ S/H circuit serves as a ”deglitcher”:
interpolation: Output of the D/A converter is held constant at the previous
output value until the new sample at the D/A output reaches
steady state

(from [Proakis, Manolakis, 1996])

Anti-aliasing lowpass filtering:


In order to avoid aliasing, the continuous-time input signal has to
be bandlimited by means of an anti-aliasing lowpass-filter with
cut-off frequency Ωc ≤ Ωs/2 prior to sampling, such that the
sampling theorem is satisfied.

2.3 Reconstruction with sample-and-hold circuit


In practice, a reconstruction is carried out by combining a D/A
converter with a S/H circuit, followed by a lowpass reconstruction
(smoothing) filter
digital
input signal x0 (t) xDA (t) (from [Proakis, Manolakis, 1996])
S/H Lowpass
D/A
h0 (t) hr (t)

Analysis:
• D/A converter accepts electrical signals that correspond to The S/H circuit has the impulse response
binary words as input, and delivers an output voltage or current  
being proportional to the value of the binary word for every t − T /2
h0(t) = rect (2.16)
clock interval nT T
• Often, the application on an input code word yields a which leads to a frequency response
high-amplitude transient at the output of the D/A converter
−jΩT /2
(”glitch”) H0(jΩ) = T · sinc(ΩT /2) · e (2.17)

19 20
• No sharp cutoff frequency response characteristics ⇒ we |Xs (jΩ)|
(a)
have undesirable frequency components (above Ωs/2), which 1
T |Xc (jΩ)| 1
T
can be removed by passing x0(t) through a lowpass

reconstruction filter hr (t). This operation is equivalent −Ωs 0 Ωs 2Ωs
to smoothing the staircase-like signal x0(t) after the S/H
operation. T sinc(ΩT /2)
(b)
• When we now suppose that the reconstruction filter hr (t) is T

an ideal lowpass with cutoff frequency Ωc = Ωs/2 and an Ω


amplification of one, the only distortion in the reconstructed −Ωs 0 Ωs 2Ωs

signal xDA(t) is due to the S/H operation:


|X0 (jΩ)|
(c)
1
|XDA(jΩ) = |Xc(jΩ)| · |sinc(ΩT /2)| (2.18)

−Ωs 0 Ωs 2Ωs
|Xc(jΩ)| denotes the magnitude spectrum for the ideal
reconstruction case.
|Hr (jΩ)|
(d)
Ωc = Ωs /2
1
⇒ Additional distortion when the reconstruction filter is not ideal
(as in real life!) Ω
−Ωs −Ωc 0 Ωc Ωs
⇒ Distortion due to the sinc-function may be corrected by pre-
biasing the frequency response of the reconstruction filter
|XDA (jΩ)|
(e)
1
Spectral interpretation of the reconstruction process (see next page):

(a) Magnitude frequency response of the ideally sampled continuous-time −Ωs 0 Ωs
signal

(b) Frequency response of the S/H circuit (phase factor e−jΩT /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 • Example: midtreat quantizer with L = 8 levels and range
Conversion carried out by an A/D converter involves quantization R = 8∆
of the sampled input signal xs(nT ) and the encoding of the −4∆ −3∆ −2∆ −∆ 0 ∆ 2∆ 3∆

resulting binary representation d1 = −∞ x1 d2 x2 d3 x3 d4 x4 d5 x5 d6 x6 d7 x7 d8 x8 d9 = ∞


Amplitude
• Quantization is a nonlinear and noninvertible process which Range R of quantizer
realizes the mapping
• Quantization error e(n) with respect to the unquantized
xs(nT ) = x(n) −→ xk ∈ I, (2.19) signal
∆ ∆
where the amplitude xk is taken from a finite alphabet I . − < e(n) ≤ (2.21)
2 2
• Signal amplitude range is divided into L intervals In using the If the dynamic range of the input signal (xmax − xmin) is
L+1 decision levels d1, d2, . . . , dL+1: larger than the range of the quantizer, the samples exceeding
the quantizer range are clipped, which leads to e(n) > ∆/2.
In = {dk < x(n) ≤ dk+1}, k = 1, 2, . . . , L • Quantization characteristic function for a midtreat quantizer
with L = 8:
Quantization Decision
levels levels Ik

d3 x3 d4 x4 d5 dk xk dk+1
Amplitude

• Mapping in (2.19) is denoted as x̂(n) = Q[x(n)]


• Uniform or linear quantizers with constant quantization step
size ∆ are very often used in signal processing applications:

∆ = xk+1 − xk = const., for all k = 1, 2, . . . , L−1


(2.20)
• Midtreat quantizer: Zero is assigned a quantization level
Midrise quantizer: Zero is assigned a decision level
(from [Proakis, Manolakis, 1996])

23 24
Coding significant bit (LSB), has the value
The coding process in an A/D converter assigns a binary number b−1
X
to each quantization level. x = −β0 + βℓ 2
−ℓ
(2.24)
b
• With a wordlength of b bits we can represent 2 > L binary ℓ=1

numbers, which yields


• Number representation has no influence on the performance of
b ≥ log2(L). (2.22) the quantization process!
Performance degradations in practical A/D converters:
• The step size or the resolution of the A/D converter is given as

R
∆= with the range R of the quantizer. (2.23)
2b
• Commonly used bipolar codes:

(from [Proakis, Manolakis, 1996])

• Two’s complement representation is used in most fixed-


point DSPs: A b-bit binary fraction [β0β1β2 . . . βb−1], β0
denoting the most significant bit (MSB) and βb−1 the least (from [Proakis, Manolakis, 1996])

25 26
Quantization errors where σx2 denotes the signal power and σe2 the power of the
Quantization error is modeled as noise, which is added to the quantization noise.
unquantized signal: Quantization noise is assumed to be uniformly distributed in the
range (−∆/2, ∆/2):
Quantizer
Actual system p(e)
x(n) Q(x(n)) x̂(n)
1

e(n)
e
Mathematical model  
x(n) x̂(n) = x(n) + e(n) 2 2

Assumptions: ⇒ Zero mean, and a variance of

• The quantization error e(n) is uniformly distributed over the Z Z


2
∆/2
2 1 ∆/2
2 ∆2
range − ∆
2 < e(n) < 2 .

σe = e p(e) de = e de =
−∆/2 ∆ −∆/2 12
• The error sequence e(n) is modeled as a stationary white
noise sequence. (2.26)
Inserting (2.23) into (2.26) yields
• The error sequence e(n) is uncorrelated with the signal
sequence x(n). 2−2b R2
2
σe = , (2.27)
• The signal sequence is assumed to have zero mean. 12
Assumptions do not hold in general, but they are fairly well and by using this in (2.25) we obtain
satisfied for large quantizer wordlengths b. ! !
Effect of the quantization error or quantization noise on the σx2 12 22b σx2
SNR = 10 log10 = 10 log10
resulting signal x̂(n) can be evaluated in terms of the signal-to- σe2 R2
noise ratio (SNR) in Decibels (dB)  
R
= 6.02 b + 10.8 −20 log10 dB. (2.28)
! σx
| {z }
σx2 (∗)
SNR := 10 log10 , (2.25)
σe2
Term (∗) in (2.28):

27 28
• σx root-mean-square (RMS) amplitude of the signal v(t) 2.5 Analog-to-digital converter realizations
• σx to small ⇒ decreasing SNR Flash A/D converter
• Furthermore (not directly from (∗)): σx to large ⇒ range R
is exceeded
⇒ Signal amplitude has to be carefully matched to the range of Analog
the A/D converter comparator:
For music and speech a good choice is σx = R/4. Then the SNR
of a b-bit quantizer can be approximately determined as

SNR = 6.02 b − 1.25 dB. (2.29)

Each additional bit in the quantizer increases the signal-to-noise (from [Mitra, 2000], N = b: resolution in bits)
ratio by 6 dB!
• Analog input voltage VA is simultaneously compared with a
Examples: set of 2b −1 separated reference voltage levels by means of a
Narrowband speech: b = 8 Bit ⇒ SNR = 46.9 dB set of 2b−1 analog comparators ⇒ locations of the comparator
Music (CD): b = 16 Bit ⇒ SNR = 95.1 dB circuits indicate range of the input voltage.
Music (Studio): b = 24 Bit ⇒ SNR = 143.2 dB
• All output bits are developed simultaneously ⇒ very fast
conversion
• Hardware requirements increase exponentially with an
increase in resolution

⇒ Flash converters are used for low-resultion (b < 8 bit) and


high-speed conversion applications.

Serial-to-parallel A/D converters


Here, two b/2-bit flash converters in a serial-parallel
configuration are used to reduce the hardware complextity
at the expense of a slightly higher conversion time

29 30
Subranging A/D converter: approximation in the shift register is converted into an (analog)
reference voltage VD by D/A conversion (binary representation
[β0β1 . . . βk βk+1 . . . βb−1], βk ∈ {0, 1}∀k):
• Case 1: Reference voltage VD < VA ⇒ increase the binary
number by setting both the k-th bit and the (k+1)-th bit to 1
• Case 2: Reference voltage VD ≥ VA ⇒ decrease the binary
number by setting the k-th bit to 0 and the (k+1)-th bit to 1
(from [Mitra, 2000], N = b: resolution in bits)
Ripple A/D converter: ⇒ High resolution and fairly high speed at moderate costs, widely
used in digital signal processing applications
Oversampling sigma-delta A/D converter, to be discussed in Section 5. . .

2.6 Digital-to-analog converter realizations


Weighted-resistor D/A converter
(from [Mitra, 2000], N = b: resolution in bits)
Advantage of both structures: Always one converter is idle while
the other one is operating
⇒ Only one b/2-bit converter is necessary
N 1 N 2 1 0
Sucessive approximation A/D converter
(from [Mitra, 2000], N = b: resolution in bits)

Output Vo of the D/A converter is given by

N −1
X ℓ RL
Vo = 2 βℓ VR
ℓ=0
(2N − 1)RL + 1

VR : reference voltage
(from [Mitra, 2000], N = b: resolution in bits) Full-scale output voltage Vo,F S is obtained when βℓ = 1 for all
Iterative approach: At the k-th step of the iteration the binary ℓ = 0, . . . , N −1:

31 32
(2N − 1)RL N
Vo,F S = N VR ≈ VR , since (2 −1)RL ≫ 1
(2 − 1)RL + 1 3. DFT and FFT
Disadvantage: For high resolutions the spread of the resistor 3.1 DFT and signal processing
values becomes very large Definition DFT from Signals and Systems:
Resistor-ladder D/A converter
N
X −1
kn
DFT: v(n) ◦−• VN (k) = v(n) WN (3.1)
n=0

N −1
1 X −kn
IDFT: VN (k) •−◦ v(n) = VN (k) WN (3.2)
0 1 2 3 N N N k=0
2 1

(from [Mitra, 2000], N = b: resolution in bits)


with WN := e−j2π/N , N : number of DFT points
⇒ R–2R ladder D/A converter, most widely used in practice.
Output Vo of the D/A converter:
3.1.1 Linear and circular convolution
N −1
X ℓ RL VR Linear convolution of two sequences v1(n) and v2(n), n ∈ ZZ:
Vo = 2 βℓ · N −1
ℓ=0
2(RL + R) 2

In practice, often 2RL ≫ R, and thus, the full-scale output yl (n) = v1(n) ∗ v2(n) = v2(n) ∗ v1(n)
voltage Vo,F S is given as ∞
X ∞
X
= v1(k) v2(n − k) = v2(k) v1(n − k) (3.3)
(2N − 1) k=−∞ k=−∞
Vo,F S ≈ VR
2N
Circular convolution of two periodic sequences v1(n) and
Oversampling sigma-delta D/A converter, to be discussed in Section 5. . .
v2(n), n = {0, . . . , N1,2 − 1} with the same period
N1 = N2 = N and n0 ∈ ZZ:

33 34
Substitution of the DFT definition in (3.1) for v1(n) and v2(n):
"
N −1 N −1
# " N −1 #
yc(n) = v1(n)
∗ v2(n) = v2(n)
∗ v1(n) 1 X X km
X kl −kn
y(n) = v1(m)WN v2(l)WN WN
n0 +N −1 n0 +N −1 N k=0 m=0 l=0
X X
= v1(k) v2(n − k) = v2(k) v1(n − k) N −1 N −1
" N −1
#
1 X X X −k(n−m−l)
k=n0 k=n0 = v1(m) v2(l) WN
(3.4) N m=0 l=0 k=0
(3.7)
We also use the symbol
N instead of
∗ .
DFT and circular convolution Term in brackets: Summation over the unit circle
N −1
(
Inverse transform of a finite-length sequence v(n), X j2πk(n−m−l)/N N for l = n−m+λN, λ ∈ ZZ
n, k = 0, . . . , N −1: e =
k=0
0 otherwise
(3.8)
v(n) ◦−• VN (k) •−◦ v(n) = v(n + λN ) (3.5)
Substituting (3.8) into (3.7) yields the desired relation
⇒ DFT of a finite-length sequence and its periodic extension is N −1 ∞
X X
identical! y(n) = v1(k) v2(n − k + λN )
Circular convolution property (n, k = 0, . . . , N −1) k=0 λ=−∞
(v1(n) and v2(n) denote finite-length sequences): | {z }
=: v2 ((n−k))N (periodic extension)

N −1
y(n) = v1(n)
N v2 (n) ◦−• Y (k) = V1 (k) · V2 (k)
X
N N = v1(k)v2((n − k))N (3.9)
(3.6) k=0
Proof: = 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
Example: Circular convolution y(n) = v1(n)
N v2 (n): operation for linear filtering is linear convolution. How can
this be achieved by means of the DFT?
v2 (n)
Given: Finite-length sequences v1(n) with length N1 and v2(n)
n
with length N2
0 N
• Linear convolution:
v1 (n) = δ(n−1) N1 −1
X
y(n) = v1(k) v2(n − k)
n k=0
0 N
Length of the convolution result y(n): N1 + N2 − 1
v2 ((0 − k))N , k = 0, . . . , N −1, n = 0
• Frequency domain equivalent: Y (ejω ) = V1(ejω ) V2(ejω )
• In order to represent the sequence y(n) uniquely in the
k frequency domain by samples of its spectrum Y (ejω ), the
0 N number of samples must be equal or exceed N1 + N2 − 1
v2 ((1 − k))N , k = 0, . . . , N −1, n = 1 ⇒ DFT of size N ≥ N1 + N2 − 1 is required.
• Then, the DFT of the linear convolution y(n) = v1(n) ∗
v2(n) is Y (k) = V1(k) · V2(k), k = 0, . . . , N −1.
k
0 N
This result can be summarized as follows:
The circular convolution of two sequences v1(n) with length N1
y(n) = v1 (n)°
N v2 (n)
and v2(n) with length N2 leads to the same result as the linear
convolution v1(n) ∗ v2(n) when the lengths of v1(n) and v2(n)
are increased to N = N1 +N2 −1 points by zero padding.
n
0 N Other interpretation: Circular convolution as linear
convolution with aliasing
3.1.2 Use of the DFT in linear filtering IDFT leads to periodic sequence in the time-domain:
• Filtering operation can also be carried out in the frequency 

domain using the DFT ⇒ attractive since fast algorithms (fast  P y(n − λN ) n = 0, . . . , N −1,

Fourier transforms) exist yp(n) = λ=−∞

0
• DFT only realizes circular convolution, however, the desired otherwise

37 38
with Y (k) = DFTN {y(n)} = DFTN {yp(n)} 3.1.3 Filtering of long data sequences

⇒ For N < N1 + N2 − 1: Circular convolution equivalent to Filtering of a long input signal v(n) with the finite impulse
linear convolution followed by time domain aliasing response h(n) of length N2
Example: Overlap-add method
x1 (n) = x2 (n) 1. Input signal is segmented into separate blocks:
1 N1 = N2 = 6 vν (n) = v(n + νN1), n ∈ {0, 1, . . . , N1−1}, ν ∈ ZZ.
n 2. Zero-padding for the signal blocks vν (n) → ṽν (n) and the
0 N1 = N2
impulse response h(n) → h̃(n) to the length N = N1 +
N1 N2 −1.
y(n) = x1 (n) ∗ x2 (n)
Input signal can be reconstructed according to
n ∞
0 2N1 −1
X
v(n) = ṽν (n − νN1)
N1 y(n−N1 ), N1 = 6 ν=−∞

since ṽν (n) = 0 for n = N1 +1, . . . , N .


n
0 N1
3. The two N -point DFTs are multiplied together to form

N1
y(n+N1 ), N1 = 6
Yν (k) = Ṽν (k) · H̃(k), k = 0, . . . , N −1.

n 4. The N -point IDFT yields data blocks that are free from
−N1 0 aliasing due to the zero-padding in step 2.
N1
5. Since each input data block vν (n) is terminated with N −N1
x1 (n)°
N x2 (n)
zeros the last N − N1 points from each output block yν (n)
N1 = N2 = 6
must be overlapped and added to the first N−N1 points of the
n
0 N1 = N2
succeeding block (linearity property of convolution):

X
N1
N x2 (n)
x1 (n)° y(n) = yν (n − νN1)
N = 12
ν=−∞
n
0 2N1 −1 ⇒ Overlap-add method

39 40
Linear FIR (finite impulse response) filtering by the overlap-add 4. Since the input signal block is of length N the first N − N1
method: points are corrupted by aliasing and must be discarded. The
Input signal: last N2 = N −N1 −1 samples in yν (n) are exactly the same
as the result from linear convolution.
L L L

5. In order to avoid the loss of samples due to aliasing the last


N −N1 samples are saved and appended at the beginning of

11
00
the next block. The processing is started by setting the first
00
11
x̂0 (n)
N −N1 samples of the first block to zero.
N −N1 zeros

11
00 Linear FIR filtering by the overlap-save method:
00
11
x̂1 (n)
Input signal:
N −N1 zeros
L L L

11
00 11
00
00
11
00
11
x̂2 (n)

N −N1 zeros
Output signal:
00
11 11
00
00
11 00
11
x0 (n)

11
00
00
11

N−L
y0 (n) N −N1 samples N −N1 zeros

00
11 11
00
added together

00
11
00
11
y1 (n) 11
00
00
11 N −N1 samples 00
11
x1 (n)
00
11
added together

00
11
00
11 11
00
00
11 00
11 11
00
00
11 00
11
y2 (n) x2 (n)

Output signal:
Overlap-save method
11
00
00
11
y0 (n)

1. Input signal is segmented into by N −N1 samples overlapping


11
00
00
11
Discard
y1 (n)
blocks: N −N1 samples

vν (n) = v(n + νN1), n ∈ {0, 1, . . . , N −1}, ν ∈ ZZ. 11


00
00
11
Discard
y2 (n)
N −N1 samples
2. Zero-padding of the filter impulse response h(n) → h̃(n) to
Discard
the length N = N1 +N2 −1. N −N1 samples

3. The two N -point DFTs are multiplied together to form Nore computationally efficient than linear convolution? Yes, in
Yν (k) = Vν (k) · H̃(k), k = 0, . . . , N −1. combination with very efficient algorithms for DFT computation.

41 42
3.1.4 Frequency analysis of stationary signals We finally have
Leakage effect 1 h i
jω jω jω
V̂ (e ) = V (e ) ∗ W (e )
Spectral analysis of an analog signal v(t): 2π
1h j(ω−ω0 ) j(ω+ω0 )
i
• Antialiasing lowpass filtering and sampling with Ωs ≥ 2Ωb, = W (e ) + W (e ) (3.13)
2
Ωb denoting the cut-off frequency of the signal
Nagnitude frequency response |V̂ (ejω )| for L = 25:
• For practical purposes (delay, complexity): Limitation of the
signal duration to the time interval T0 = L T (L: number of
samples under consideration, T : sampling interval)

Limitation to a signal duration of T0 can be modeled as


multiplication of the sampled input signal v(n) with a rectangular
window w(n)
(from [Proakis, Nanolakis, 1996])
(
1 for 0 ≤ n ≤ L−1,
v̂(n) = v(n) w(n) with w(n) = Windowed spectrum V̂ (ejω ) is not localized to one frequency,
0 otherwise.
instead it is spread out over the whole frequency range
(3.10)
⇒ spectral leaking
Suppose that the input sequence just consists of a single sinusoid,
that is v(n) = cos(ω0n). The Fourier transform is First zero crossing of W (ejω ) at ωz = ±2π/L:
• The larger the number of sampling points L (and thus also the
jω width of the rectangular window) the smaller becomes ωz (and
V (e ) = π(δ(ω − ω0) + δ(ω + ω0)). (3.11)
thus also the main lobe of the frequency response).
• ⇒ Decreasing the frequency resolution leads to an increase
For the window w(n) the Fourier transform can be obtained as of the time resolution and vice versa (duality of time and
frequency domain).
L−1

X −jωn 1 − e−jωL −jω(L−1)/2 sin(ωL/2) In practice we use the DFT in order to obtain a sampled
W (e ) = e = =e .
n=0
1−e −jω sin(ω/2) representation of the spectrum according to V̂ (ejωk ),
(3.12) k = 0, . . . , N −1.

43 44
Special case: If ωk = k2π/N except for k = 5, since ω0 is exactly an integer
multiple of 2π/N

N = L and ω0 = ν, ν = 0, . . . , N −1 ⇒ periodic repetition of v0(n) leads to a pure cosine
N sequence
then the Fourier transform is exactly zero at the sampled • Right hand side: slight increase of ω0 6= ν2π/N for ν ∈ ZZ
frequencies ωk , except for k = ν . ⇒ V̂1(ejωk ) 6= 0 for ωk = k2π/N , periodic repetition is
Example: (N = 64, n = 0, . . . , N − 1, rectangular window not a cosine sequence anymore
w(n)) Windowing and different window functions
    
2π 2π π Windowing not only distorts the spectral estimate due to leakage
v0(n) = cos 5 n , v1(n) = cos 5 + n
N N N effects, it also reduces the spectral resolution.
Consider a sequence of two frequency components
v0(n)=cos(2π/N ⋅5⋅n) v1(n)=cos((2π/N ⋅5+π/N) ⋅n) v(n) = cos(ω1n)+cos(ω2n) with the Fourier transform
1 1

0.5 0.5 jω 1h j(ω−ω1 ) j(ω−ω2 )


V (e ) = W (e ) + W (e )+
2
0 0 i
j(ω+ω1 ) j(ω+ω2 )
+ W (e ) + W (e )
−0.5 −0.5

−1 −1 where W (ejω ) is the Fourier transform of the rectangular


0 20 40 60 0 20 40 60
n n window from (3.12).
DFT(v0(n) w(n)), rect. window DFT(v1(n) w(n)), rect. window
1 1 • 2π/L < |ω1−ω2|: Two maxima, main lobes for both window
0.8 0.8
spectra W (ej(ω−ω1)) and W (ej(ω−ω2)) can be separated
0.6 0.6
• |ω1 − ω2| = 2π/L: Correct values of the spectral samples,
but main lobes cannot be separated anymore
0.4 0.4
• |ω1 − ω2| < 2π/L: Nain lobes of W (ej(ω−ω1)) and
W (ej(ω−ω2)) overlap
0.2 0.2

0 0
0 10
k
20 30 0 10
k
20 30 ⇒ Ability to resolve spectral lines of different frequencies is
limited by the main lobe width, which also depends on the length
• Left hand side: V̂0(ejωk ) = V0(ejωk )
∗ W (ejωk ) = 0 for of the window impulse response L.

45 46
Example: Magnitude frequency response |V (ejω )| for window, specified as
 h  i
 1 1 − cos 2π
2 L−1 n for 0 ≤ n ≤ L − 1,
wHan(n) =
v(n) = cos(ω0n) + cos(ω1n) + cos(ω2n) (3.14) 0 otherwise.
(3.15)
Nagnitude frequency response |V̂ (ejω )| from (3.13), where
with ω0 = 0.2 π , ω1 = 0.22 π , ω2 = 0.6 π and (a) L = 25, W (ejω ) is replaced by WHan(ejω ) (L = 25):
(b) L = 50, (c) L = 100

(from [Proakis, Nanolakis, 1996])

Spectrum of the signal in (3.14) after it is windowed with wHan(n)


in (3.15):

(from [Proakis, Nanolakis, 1996])


The cosines with the frequencies ω0 and ω1 are only resolvable
for L = 100.

To reduce leakage, we can choose a different window function


with lower side lobes (however, this comes with an increase of
the width of the main lobe). One choice could be the Hanning (from [Proakis, Nanolakis, 1996])

47 48
is increasing N ). However, the spectral resolution is not
The reduction of the sidelobes and the reduced resolution increased (separation of two closely adjacent sine spectra
compared to the rectangular window can be clearly observed. lines).
• An increase in resolution can only be obtained by increasing
Alternative: Hamming window
the length of the input signal to be analyzed (that is
 
(
2π n
0.54 − 0.46 cos L−1 for 0 ≤ n ≤ L − 1, increasing L), which also results in a longer window (see
wHam (n) = examples above).
0 otherwise.
(3.16)
3.2 Fast computation of the DFT: The FFT
Comparison of rectangular, Hanning and Hamming window
(L = 64): Complexity of the DFT calculation in (3.1) for v(n) ∈ C
I,
VN (k) ∈ C
I:
Rectangular window wrect(n) 20 log
10
|Wrect(ejω )|
1 0
N
X −1
kn
VN (k) = v(n)WN for k = 0, . . . , N −1
dB

0.5 −50
| {z } | {z }
n=0 1 complex multiplication N results
0 −100 | {z }
0 20 40 60 0 0.2 0.4 0.6 0.8 1
n → ω/π → N compl. mult., N compl. add.

Hanning window wHan(n) 20 log10 |WHan(e )|
1 0
⇒ Overall N 2 complex multiplications and additions.
Remarks:
dB

0.5 −50

• 1 complex multiplication → 4 real-valued mult. + 2 real-


0 −100
0 20 40 60 0 0.2 0.4 0.6 0.8 1 valued additions
n→ ω/π →
Hamming window wHam(n) 20 log10 |WHam(e )|
jω 1 complex addition → 2 real valued additions
• A closer evaluation reveals that there are slightly less than N 2
1 0

operations:
dB

0.5 −50

– N values have to be added up ⇒ (N −1) additions.


π
0
0 20 40 60
−100
0 0.2 0.4 0.6 0.8 1 – Factors ej0, ejπλ, e±j 2 λ ⇒ no real multiplications.
n → ω/π →
– For k = 0 no multiplication at all.
Remark: Spectral analysis with DFT
• Complexity of the the DFT becomes extremely large for
• Sampling grid can be made arbitrarily fine by increasing large values of N (i.e. N = 1024) ⇒ efficient algorithms
the length of the windowed signal with zero padding (that advantageous.

49 50
Fast algorithms for DFT calculation (as the fast Fourier transform, Since
FFT) exploit symmetry and periodicity properties of WNkn as 2 −2j·2π/N −j2π/(N/2)
WN = e =e = WN/2
k(N−n)
• complex conjugate symmetry: WN = WN−kn = (WNkn )∗
k(n+N ) (k+N )n we can rewrite (3.17) as
• periodicity in k and n: WNkn = WN = WN .
N/2−1 N/2−1
X kn k
X kn
V (k) = v(2n) WN/2 + WN v(2n + 1) WN/2
3.2.1 Radix-2 decimation-in-time FFT algorithms
n=0 n=0
Principle: (3.18)
Decomposing the DFT computation into DFT computations k
= G(k) + WN H(k), k = 0, . . . , N − 1 (3.19)
of smaller size by means of decomposing the N -point input
sequence v(n) into smaller sequences ⇒ ”decimation-in-time” • Each of the sums in (3.18) represents a N/2 DFT over the
Prerequisite: even- and odd-numbered points of v(n), respectively.
N integer power of two, i.e. N = 2m, m = log2(N ) ∈ IN ⇒ • G(k) and H(k) need only to be computed for 0, . . . , N/2−
”radix-2” 1 since both are periodic with period N/2.

Decomposing a N -point DFT into two N/2-point transforms Signal flow graph for N = 8 (v → x, V → X ):

DFT V (k) (we drop the subscript N for clarity) can be written
as

N
X −1
kn
V (k) = v(n) WN , k = 0, . . . , N −1
n=0

N/2−1 N/2−1
X 2kn
X k(2n+1)
= v(2n) WN + v(2n + 1) WN ,
n=0 n=0
(3.17)
(from [Oppenheim, Schafer, 1999])
where in the last step v(n) is separated into two N/2-point
sequences consisting of the even- and odd-numbered points in Complexity:
v(n). 2 DFTs of length N/2 → 2 · N 2/4 = N 2/2 operations +

51 52
N operations for the combination of both DFTs The overall flow graph now looks like (v → x, V → X ):
⇒ N + N 2/2 operations (less than N 2 for N > 2)
Decomposition into 4 N/4-point DFTs
G(k) and H(k) from (3.19) can also be written as

N/4−1 N/4−1
X kn k
X kn
G(k) = g(2n) WN/4 + WN/2 g(2n+1) WN/4,
n=0 n=0
(3.20)
N/4−1 N/4−1
X kn k
X kn (from [Oppenheim, Schafer, 1999])
H(k) = h(2n) WN/4 + WN/2 h(2n+1) WN/4
n=0 n=0
(3.21) Complexity:
4 DFTs of length N/4 → N 2/4 operations
where k = 0, . . . , N/2−1. + 2 · N/2 + N operations for the reconstruction
Signal flow graph for N = 8 (v → x, V → X ): ⇒ N 2/4 + 2N complex multiplications and additions

Final step: Decomposition into 2-point DFTs


DFT of length 2:
′ ′ 0 ′ ′ ′
V2 (0) = v (0) + W2 v (1) = v (0) + v (1) (3.22)
′ ′ 1 ′ ′ ′
(from [Oppenheim, Schafer, 1999]) V2 (1) = v (0) + W2 v (1) = v (0) − v (1) (3.23)

Flow graph:
1
v (0)
0
V2 (0)
0

1
v (1)
0

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 = e−j(2π/N )N/2 = e−jπ = −1. Therefore we have

ρ+N/2 ρ N/2 ρ
WN = WN WN = −WN .

Using this modification, the resulting flow graph for N = 8 is


given as (v → x, V → X ):

(from [Oppenheim, Schafer, 1999])

In general, our decomposition requires m = log2(N ) = ld N


stages and for N ≫ 1 we have

N · m = N ld N complex multiplications and additions.

(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 • The intermediate results VN (k1,2) in the ℓ-th stage,
ℓ = 0, . . . , m−1 are obtained as
Basic building block of the above flow graph is called butterfly
(ρ ∈ {0, . . . , N/2−1}): (ℓ) (ℓ−1) ρ (ℓ−1)
1 1
VN (k1) = VN (k1) + WN VN (k2),
Simpli£cation (ℓ) (ℓ−1) ρ (ℓ−1)
WNρ 1 VN (k2) = VN (k1) − WN VN (k2)

1 1
(ρ+N/2)
WN WNρ −1
(butterfly computations) where k1, k2, ρ ∈ {0, . . . , N −1}
The simplification is due to the fact that vary from stage to stage.

55 56
• ⇒ Only N storage cells are needed, which first contain the Inverse FFT
values v(n), then the results from the individual stages and According to (3.2) we have for the inverse DFT
finally the values VN (k) ⇒ In-place algorithm
N −1
Bit-reversal 1 X −kn
v(n) = VN (k) WN ,
N k=0
• v(n)-values at the input of the decimation-in-time flow graph
in permuted order
that is
• Example for N = 8, where the indices are written in binary
N −1
notation: 1 X kn
v(−n) = VN (k) WN , ⇐⇒
# flow graph input 000 001 010 011 N k=0
v(n) v(000) v(100) v(010) v(110)
1
# flow graph input 100 101 110 111 v(N − n) = DFT{VN (k)} (3.24)
v(n) v(001) v(101) v(011) v(111) N

⇒ Input data is stored in bit-reversed order ⇒ With additional scaling and index permutations the IDFT can
be calculated with the same FFT algorithms as the DFT!
Bit-reversed order is due to the sorting in even and odd indices in
every stage, and thus is also necessary for in-place computation: 3.2.2 FFT alternatives
(v → x):
Alternative DIT structures
Rearranging of the nodes in the signal flow graphs lead to
FFTs with almost arbitrary permutations of the input and output
sequence. Reasonable approaches are structures
(a) without bitreversal, or
(b) bit-reversal in the frequency domain

(from [Oppenheim, Schafer, 1999])

57 58
(a) Signal flow graph for N = 8 (v → x, V → X ):

(b) (from [Proakis, Nanolakis, 1996])

Radix r and mixed-radix FFTs


When we gerally use
m
N =r for r ≥ 2, r, m ∈ IN (3.25)

we obtain DIF or DIT decompositions with a radix r . Besides


r = 2, r = 3 and r = 4 are commonly used.
(from [Oppenheim, Schafer, 1999], v → x, V → X )

The flow graph in (a) has the disadvantage, that it is a non-inplace


algorithm, because the butterfly-structure does not continue past Radix-4 butterfly
the first stage. (q = 0, . . . , N/4−1)
(N → N ):
Decimation-in-frequency algorithms
Instead of applying the decomposition to time domain, we could
also start the decomposition in the frequency domain, where (from [Proakis, Nanolakis, 1996])
the sequence of DFT coefficients VN (k) is decomposed into For special lengths, which can not be expressed as N = r m,
smaller sequences. The resulting algorithm is called decimation- so called mixed-radix FFT algorithms can be used (i.e. for
in-frequency (DIF) FFT. N = 576 = 26 ·32).

59 60
3.3 Transformation of real-valued sequences Thus, we have
v(n) ∈ IR → FFT program/hardware: vR (n) + j vI (n) ∈ C
I
| {z }
=0 1 
⇒ Inefficient due to performing arithmetic calculations with zero VN1 (k) = VNR (k) + VNR (N − k) +
values 2
j 
In the following we will discuss methods for the efficient usage of + VNI (k) − VNI (N − k) , (3.31)
a complex FFT for real-valued data. 2

3.3.1 DFT of two real sequences where


Given: v1(n), v2(n) ∈ IR, n = 0, . . . , N −1
How can we obtain VN1 (k) •−◦ v1(n), VN2 (k) •−◦ v2(n)? 1 
VNRe (k) = VNR (k) + VNR (N − k) ,
Define 2
v(n) = v1(n) + j v2(n) (3.26) 1 
VNIo (k) = VNI (k) − VNI (N − k) .
2
leading to the DFT

VN (k) = DFT{v(n)} = VN1 (k) +j VN2 (k) . (3.27) Likewise, we have for VN2 (k) the relation
| {z } | {z }
∈C
I ∈C
I

1 
Separation of VN (k) into VN1 (k), VN2 (k)? VN2 (k) = VNI (k) + VNI (N − k) −
2
Symmetry relations of the DFT: j 
− VNR (k) − VNR (N − k) , (3.32)
2
v(n) = vRe (n) + vRo (n) + j vIe (n) + j vIo (n) (3.28)
| {z } | {z }
= v1 (n) = v2 (n)
with

Corresponding DFTs:
1 
VNIe (k) = VNI (k) + VNI (N − k) ,
2
vRe (n) ◦−• VNRe (k), vRo (n) ◦−• j VNIo (k), (3.29)
1 
j vIe (n) ◦−• j VNIe (k), j vIo (n) ◦−• VNRo (k). (3.30) VNRo (k) = VNR (k) − VNR (N − k) .
2

61 62
Rearranging (3.31) and (3.32) finally yields Define

1  ṽ(n) := v(2n) + j v(2n + 1), n = 0, . . . , N − 1,



VN1 (k) = VN (k) + VN (N − k) , (3.35)
2
(3.33)
j  =: v1(n) + j v2(n),

VN2 (k) = − VN (k) − VN (N − k) .
2
where the even and odd samples of v(n) are written alternatively
into the real and imaginary part of ṽ(n). Thus we have a complex
Due to the Hermitian symmetry of real-valued sequences
sequence consisting of two real-valued sequences of length N
∗ with the DFT
VN(1,2) (k) = VN (N − k) (3.34)
(1,2)
′ ′ ′ ′
ṼN (k ) = VN1 (k ) + j VN2 (k ), k = 0, . . . , N − 1.
the values VN(1,2) (k) for k ∈ {N/2 + 1, . . . , N − 1} can be (3.36)
′ ′
obtained from those for k ∈ {0, . . . , N/2}, such that only a VN1 (k ) and VN2 (k ) can easily be obtained with (3.33) as
calculation for N/2+1 values is necessary.
′ 1 ′ ∗ ′

VN1 (k ) = ṼN (k ) + ṼN (N − k ) ,
Application: Fast convolution of two real-values sequences with 2
the DFT/FFT ′ j ′ ∗ ′

VN2 (k ) = − ṼN (k ) − ṼN (N − k )
3.3.2 DFT of a 2N -point real sequence 2
Given: v(n) ∈ IR, n = 0, . . . , 2 N −1 for k′ = 0, . . . , N −1.
Wanted: In order to calculate V2N (k) from VN1 (k′) and VN2 (k′) we
2N −1
rearrange the expression for DFT{v(n)} according to
X kn
V2N (k) = DFT{v(n)} = v(n) W2N
N
X −1 N
X −1
n=0 2kn (2n+1)k
V2N (k) = v(2n) W2N + v(2n + 1) W2N ,
| {z } | {z }
n=0 = v (n) n=0
with k = 0, . . . , 2N −1. 1 = v2 (n)

Hermitian symmetry analog to (3.34) since v(n) ∈ IR for all n: N


X −1 N
X −1
kn k nk
= v1(n) WN + W2N · v2(n) WN ,

V2N (2N − k) = V2N (k), k = 0, . . . , N n=0 n=0

63 64
Finally we have 4. Digital Filters

k
V2N (k) = VN1 (k)+W2N VN2 (k), k = 0, . . . , 2N −1 Digital filter = linear-time-invariant (LTI) causal system with a
(3.37) rational transfer function (without loss of generality: numerator
Due to the Hermitian symmetry ∗
V2N (k) = V2N (2N−k),
k only degree N = denominator degree)
needs to be evaluated from 0 to N with VN1/2 (N ) = VN1/2 (0).
N
P N
P
Signal flow graph: bN −i z i bi z −i
i=0 i=0
ṼN (k)
1/2 VN1 (k)
V2N (k)
H(z) = = (4.1)
N
P N
P
k=N →k=0
k = 0, . . . , N aN −i zi 1+ ai z −i
i=0 i=1
−j
ṼN∗ (N − k)
k
1/2 j VN2 (k) W2N
where a0 = 1 without loss of generality.
⇒ Computational savings by a factor of two compared to the ai, bi: parameters of the LTI system (⇒ coefficients of the digital
complex-valued case since for real-valued input sequences only filter), N is said to be the filter order
an N point DFT is needed
Product notation of (4.1):

N
Q
(z − z0i)
i=1
H(z) = b0 (4.2)
N
Q
(z − z∞i)
i=1

where the z0i are the zeros, and the z∞i are the poles of the
transfer function (the latter are responsible for stability).
Difference equation:

N
X N
X
y(n) = bi v(n − i) − ai y(n − i), (4.3)
i=0 i=1

65 66
with v(n) denoting the input signal and y(n) the resulting signal Transfer function:
after the filtering
N N
1 X i
X −i
Remarks H(z) = N bN −i z = bi z (4.7)
z i=0 i=0
• Generally, (4.3) describes a recursive filter with an infinite
impulse response (IIR filter): – Poles z∞i = 0, i = 1, . . . , N , but not relevant for
y(n) is calculated from v(n), v(n−1), . . . , v(n−N ) and stability ⇒ all-zero filter
recursively from y(n−1), y(n−2), . . . , y(n−N ). – According to (4.6): y(n) obtained by a weighted average
• The calculation of y(n) requires memory elements in order to of the last N + 1 input values ⇒ Moving average (MA)
store v(n−1), . . . , v(n−N ) and filter (as opposite to the AR filter from above)
y(n−1), y(n−2), . . . , y(n−N ) ⇒ dynamical system. – From (4.7) it can be seen that the impulse response has
• bi ≡ 0 for all i 6= 0: finite length ⇒ Finite impulse response (FIR) filter of
length L = N + 1 and order N
b0 z N b0 z N
H(z) = = (4.4)
N N
P Q 4.1 Structures for FIR systems
aN −i z i (z − z∞i)
i=0 i=1 • Difference equation given by (4.6)
⇒ Filter has no zeros ⇒ All-pole or autoregressive (AR-) • Transfer function given by (4.7)
filter. • Unit sample response is equal to the coefficients bi
Transfer function is purely recursive: (
bn for 0 ≤ n ≤ L−1
N
X h(n) =
y(n) = b0 v(n) − ai y(n − i) (4.5) 0 otherwise
i=1
4.1.1 Direct form structures
• ai ≡ 0 for all i 6= 0, a0 = 1 (causal filter required!):
The direct form structure follows immediately from the
Difference equation is purely non-recursive:
nonrecursive difference equation given in (4.6), which is
N
X equivalent to the linear convolution sum
y(n) = bi v(n − i) (4.6)
L−1
i=0 X
y(n) = h(k) v(n − k).
⇒ Non-recursive filter k=0

67 68
Transversal filter in the second direct form:
v(n)

h(L−1) h(L−2) h(3) h(2) h(1) h(0)

z −1 z −1 z −1 z −1 z −1
y(n)

(from [Proakis, Manolakis, 1996], v → x, L → M ) When the FIR filter has linear phase (see below) the impulse
⇒ Tapped-delay-line or transversal filter in the first direct form response of the system satisfies either the symmetry or asymmetry
condition
If the unit impulse v(n) = δ(n) is chosen as input signal, all h(n) = ±h(L − 1 − n). (4.8)
samples of the impulse response h(n) appear successively at the
Thus, the number of multiplications can be reduced from L to
output of the structure.
L/2 for L even, and from L to (L+1)/2 for L odd.
Signal flow graph for odd L:
In the following we mainly use the more compact signal flow
z −1 z −1 z −1 z −1 z −1 z −1
graph notation:
z −1
z −1 z −1 z −1 z −1 z −1 z −1
v(n)
z −1 z −1 z −1 z −1 z −1 z −1
v(n)

h(0) h(1) h(2) h(3) h(L−2) h(L−1) ¡ L−3 ¢ ¡ L−1 ¢


h(0) h(1) h(2) h(3) h 2 h 2

y(n)
y(n)

The second direct form can be obtained by transposing the flow 4.1.2 Cascade-form structures
graph: By factorizing the transfer function
P
• Reversing the direction of all branches, Y
H(z) = H0 Hp(z) (4.9)
• exchanging the input and output of the flow graph p=1

• exchanging summation points with branching points and vice we obtain a cascade realization. The Hp(z) are normally second-
versa. order, since in order to obtain real coefficients, conjugate complex

69 70

zeros z0i and z0i have to be grouped: The behavior of the i-th stage can be written in matrix notation as

     
Hp(z) = (1 − z0iz
−1
)(1 − z0iz
∗ −1
) Xi(z) 1 qi z −1 Xi−1(z)
= · . (4.10)
−1 −2 Yi(z) qi z −1 Yi−1(z)
= 1 + b1 z + b2 z

After the first stage we have


For linear-phase filters due to the special symmetry (4.8) the zeros
∗ −1 ∗ −1 −1
appear in quadruples: Both z0i and z0i , and z0i and (z0i ) are X1(z) = V (z) + q1 z V (z),
a pair of complex-conjugate zeros. Consequently, we have (4.11)
−1
Y1(z) = q1 V (z) + z V (z).
−1 ∗ −1 −1 −1 ∗ −1 −1
Hp(z) = (1−z0iz )(1−z0iz )(1−z0i z )(1−(z0i) z ),
It follows
−1 −2 −3 −4
= 1 + b1 z + b2 z + b1 z +z .
X1(z) −1 −1
H1(z) = = 1 + q1 z = α01 + α11 z ,
4.1.3 Lattice structures V (z)

Lattice structures are mainly used as predictor filter (i.e. in digital Y1(z) −1 −1
G1(z) = = q1 + z = β01 + β11 z .
speech processing) due to their robustness against coefficient V (z)
quantization:
Second stage:
General structure:

x1 (n) x2 (n) −1
(L−1)-th xL−1 (n) X2(z) =X1(z) + q2 z Y1(z),
v(n) 1-th stage 2-th stage y2 (n)
y1 (n)
stage yL−1 (n)
(4.12)
−1
Y2(z) =q2 X1(z) + z Y1(z).

i-th stage lattice filter: Inserting (4.11) into (4.12) yields


1 1 1
xi−1 (n) xi (n)
qi −1 −1 −2
X2(z) = V (z) + q1z V (z) + q2q1z V (z) + q2z V (z),
qi
z −1 1 1 −1 −1 −2
yi−1 (n) yi (n) Y2(z) = q2V (z) + q1q2z V (z) + q1z V (z) + z V (z),

71 72
which finally leads to the transfer functions we obtain the direct form I realization:

X2(z) −1 −2 b0
H2(z) = = 1 + (q1 + q1 q2)z + q2 z , (4.13) v(n) y(n)
V (z)
z −1 z −1
−1 −2
= α02 + α12 z + α22z , b1 −a1

Y2(z) −1 −2 z −1 z −1
G2(z) = = q2 + (q1 + q1 q2)z + z , (4.14)
V (z) b2 −a2
−1 −2
= β02 + β12 z + β22z . z −1 z −1
b3 −a3
By comparing (4.13) and (4.14) we can see that
z −1 z −1
−2 −1
H2(z) = z G2(z ),

that is, the zeros of H2(z) can be obtained by reflecting the zeros z −1 z −1
of G2(z) at the unit circle. Generally, it can be shown that bN −1 −aN −1

−i −1
Hi(z) = z Gi(z ), for i = 1, . . . , L − 1. (4.15) z −1 z −1
bN −aN
4.2 Structures for IIR systems
All-zero system N (z) All-pole system 1/D(z)
4.2.1 Direct form structures
Rational system function (4.1) can be viewed as two systems in Another realization can be obtained by exchanging the order of
cascade: H(z) = N (z)/D(z) = H1(z) · H2(z) with the all-pole and all-zero filter. Then, the difference equation for
N
the all-pole section is
X −i 1
H1(z) = bi z , H2(z) =
N
P N
i=0 1+ ai z −i X
i=1 w(n) = − ai w(n − i) + v(n),
i=1
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, where the sequence w(n) is an intermediate result and represents

73 74
the input to the all-zero section: structure, which requires the same number of multiplications,
additions, and memory locations as the original structure:
N
X
y(n) = bn w(n − i). v(n)
b0
y(n)
i=0 −1
z

The resulting structure is given as follows: b1 −a1

b0 z −1
v(n) y(n)
b2 −a2
z −1
−a1 b1 z −1
b3 −a3
z −1
−a2 b2 z −1

z −1
−a3 b3
z −1
bN −1 −aN −1
z −1

z −1
bN −aN
z −1
−aN −1 bN −1
4.2.2 Cascade-form structures
z −1
Analog to Section 4.1.2 we can also factor an IIR system H(z)
−aN bN
into first and second order subsystems Hp(z) according to

⇒ Only one single delay line is required for storing the delayed P
Y
versions of the sequence w(n). The resulting structure is called H(z) = Hp(z). (4.16)
p=1
a direct form II realization. Furthermore, it is said to be canonic,
since it minimizes the number of memory locations (among other
⇒ Degrees of freedom in grouping the poles and the zeros
structures).
Transposing the direct form II realization leads to the following

75 76
First order subsystems: Example:
Canonical direct form for N = 1: 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
b0 approach (we will discuss the corresponding algorithms later on) yields the
v(n) y(n)
−1
transfer function
z
−a1 b1
H(z) = 0.03217·

Corresponding transfer function: 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
Y (z) b0 + b1 z −1 (4.19)
H(z) = = (4.17)
V (z) 1 + a1 z −1 • The zeros are all at z = −1: z0i = −1 for i = 1, 2, . . . , 5.
The location of the poles are:
Every first order transfer function can be realized with the above
flow graph: z∞1,2 = −0.0336 ± j 0.8821,
(4.20)
z∞3,4 = 0.219 ± j 0.5804, z∞5 = 0.4113.
b′ + b′1 z −1 (b′0/a′0) + (b′1/a′0) z −1 b0 + b1 z −1
H(z) = ′0 = =
a0 + a′1 z −1 1 + (a′1/a′0) z −1 1 + a1 z −1 Grouping of poles z∞1,2 :

Second order subsystems: 1 + 2 z −1 + z −2


Ĥ1,2 (z) =
1 + 0.0672 z −1 + 0.7793 z −2
Canonical direct form for N = 2:
b0 Grouping of poles z∞3,4 :
v(n) y(n)

z −1 1 + 2 z −1 + z −2
Ĥ3,4 (z) =
−a1 b1 1 − 0.4379 z −1 + 0.3849 z −2
z −1
Real-valued pole z∞5 leads to a first-order subsystem
−a2 b2

1 + z −1
Ĥ5 (z) = .
Corresponding transfer function: 1 − 0.4113 z −1

• For the implementation on a fixed-point DSP it is advantageous to ensure


Y (z) b0 + b1 z −1 + b2 z −2 that all stages have similar amplification in order to avoid numerical
H(z) = = (4.18)
V (z) 1 + a1 z −1 + a2 z −2 problems. Therefore, all subsystems are scaled such that they have

77 78
approximately the same amplification for low frequencies: • Resulting signal flow graph (V → U ):

Ĥ5 (z) 0.2943 + 0.2943 z −1


H1 (z) = =
Ĥ5 (z = 1) 1 − 0.4113 z −1

Ĥ3,4 (z) 0.2367 + 0.4735 z −1 + 0.2367 z −2


H2 (z) = =
Ĥ3,4 (z = 1) 1 − 0.4379 z −1 + 0.3849 z −2 (from [Fliege: ”Analoge und digitale Filter”, Hamburg University of Technology, 1990])

Ĥ1,2 (z) −1 −2
0.4616 + 0.9233 z + 0.4616 z
H3 (z) = = 4.2.3 Parallel-form structures
Ĥ1,2 (z = 1) 1 − 0.4379 z −1 + 0.3849 z −2
⇒ An alternative to the factorization of a general transfer function
Remark: The order of the subsystems is in principle arbitrary. However,
is to use a partial-fraction expansion, which leads to a parallel-
here we know from the pole analysis in (4.20) that the poles of Ĥ1,2 (z)
are closest to the unit circle. Thus, using a fixed-point DSP may lead more form structure
likely to numerical overflow compared to Ĥ3,4 (z) and Ĥ5 (z). Therefore, • In the following we assume that we have only distinct poles
it is advisable to realize the most sensible filter as the last subsystem.
(which is quite well satisfied in practice). The partial-fraction
• Frequency responses:
jω jω
expansion of a transfer function H(z) with numerator and
20⋅ log |H (e )| 20⋅ log10 |H2(e )|
20
10 1
20 denominator degree N is then given as
N
0 0 X Ai
H(z) = A0 + . (4.21)
1 − z∞iz −1
dB

dB

−20 −20 i=1

−40 −40
The Ai, i ∈ {1, . . . , N } are the coefficients (residues) in
the partial-fraction expansion, A0 = bN /aN .
0 0.5 1 0 0.5 1
ω/π ω/π • We furthermore assume that we have only real-valued
20⋅ log |H (ejω )| 20⋅ log |H(ejω )| (overall filter) coefficients, such that we can combine pairs of complex-
10 3 10
20 20
conjugate poles to form a second order subsystem
0 0 (i ∈ {1, . . . , N }):
Ai A∗i
dB

dB

−20 −20
+ ∗ z −1 =
1 − z∞i z −1 1 − z∞i

−40 −40 2 ℜ{Ai } − 2 ℜ{Ai z∞i }z −1 b0 + b1 z −1
=:
0 0.5 1 0 0.5 1
1 − 2 ℜ{z∞i }z −1 + |z∞i |2 z −2 1 + a1 z −1 + a2 z −2
ω/π ω/π (4.22)

79 80
• Two real-valued poles can also be combined to a second order Example:
transfer function (i, j ∈ {1, . . . , N }): Consider again the 5-th order Chebyshev lowpass filter with the transfer
Ai Aj function from (4.19). The partial fraction expansion can be given as
+ =
1 − z∞i z −1 1 − z∞j z −1
A1 A∗1
(Ai + Aj ) − (Ai z∞j + Aj z∞i ) z −1 −1 H(z) = −0.2607 + + ∗ z −1 +
b0 + b1 z 1 − z∞1 z −1 1 − z∞1
=:
1 − (z∞j + z∞i ) z −1 + (z∞j z∞i ) z −2 1 + a1 z −1 + a2 z −2
A3 A∗3 A5
(4.23) + + +
1 − z∞3 z −1 ∗
1 − z∞3 z −1 1 − z∞5 z −1
• If N is odd, there is one real-valued pole left, which leads to with the poles from (4.20) and the residues
one first order partial fraction (see example).
z∞1 = −0.0336 + j 0.8821, A1 = 0.1 + j 0.0941,
Parallel structure:
z∞3 = 0.219 + j 0.5804, A3 = −0.5533 + j 0.00926,
H0
z∞5 = 0.4114, A5 = 1.1996.

With (4.22) the resulting transfer function writes


H1(z)
0.2 − 0.1592 z −1
H2(z) H(z) = −0.2607 + +
V (z) 1 + 0.0673 z −1 + 0.7793 z −2
−1.1066 + 0.3498 z −1 1.1996
+ .
1 − 0.4379 z −1 + 0.3849 z −2 1 − 0.4114 z −1
Y (z)
HP (z) Resulting signal flow graph (V → U ):
P : number of parallel subsystems

Signal flow graph of a second order section:


bp0
v(n) yp (n)
−1
z
−ap1 bp1

z −1
−ap2 p = 1, . . . , P
(from [Fliege: ”Analoge und digitale Filter”, Hamburg University of Technology, 1990])

81 82
can be represented with one of the three following formats
4.3 Coefficient quantization and round-off effects
• Sign-magnitude format:
In this section we discuss the effects of a fixed-point digital filter
implementation on the system performance.
vSM = [1.β1β2 . . . βb−1] for v < 0. (4.27)
4.3.1 Errors resulting from rounding and truncation
Number representation in fixed-point format: • One’s-complement format:
A real number v can be represented as
B
X v1C = [1.β̄1β̄2 . . . β̄b−1] for v < 0, (4.28)
−ℓ
v = [β−A, . . . , β−1, β0, β1, . . . , βB ] = βℓr ,
ℓ=−A
with β̄ℓ = 1 − βℓ denoting the one’s complement of βℓ.
(4.24)
where βℓ is the digit, r is the radix (base), A the number of integer Alternative definition:
digits, B the number of fractional digits.
b−1
Example: [101.01]2 = 1 · 22 + 0 · 21 + 1 · 20 + 0 · 2−1 + 1 · 2−2 0
X −ℓ −b+1
v1C = 1·2 + (1−βℓ)·2 = 2−2 −|v| (4.29)
Most important in digital signal processing: ℓ=1

• Binary representation with r = 2 and βℓ ∈ {0, 1}, β−A MSB,


βB LSB. • Two’s-complement format:
• b-bit fraction format: A = 0, B = b−1, binary point between
β0 and β1 → numbers between 0 and 2 − 2−b+1 are possible. v2C = [1.β̄1β̄2 . . . β̄b−1]
+ [00 . . . 01] for v < 0,
Positive numbers are represented as (4.30)
where + denotes a binary addition. We thus have by using
b−1
X (4.29)
−ℓ
v = [0.β1β2 . . . βb−1] = βℓ2 . (4.25) −b+1
v2C = v1C + 2 = 2 − |v|. (4.31)
ℓ=1
Does (4.30) really represent a negative number? Using the
Negative fraction:
identity
b−1
X Xb−1
−ℓ −ℓ −b+1
v = [−0.β1β2 . . . βb−1] = − βℓ2 , (4.26) 1= 2 +2
ℓ=1 ℓ=1

83 84
we can express a negative number as
b−1
• Important property: If the sum of numbers is within the range
X −ℓ it will be computed correctly, even if individual partial sums
v=− βℓ2 +1−1
ℓ=1
result in overflow.
b−1
X Truncation and rounding:
−ℓ −b+1
= −1 + (1 − β ) 2 +2 = v2C − 2.
| {z ℓ} Problem: Multiplication of two b-bit numbers yields a result of
ℓ=1 = β̄ℓ length (2b−1) → truncation/rounding necessary → can again be
regarded as quantization of the (filter) coefficient v
Example:
Express the fractions 7/8 and −7/8 in sign-magnitude, two’s-complement,
Suppose that we have a fixed-point realization in which a number
and one’s-complement format. v is quantized from bu to b bits.
v = 7/8 can be represented as 2−1 + 2−2 + 2−3 , such that v = [0.111]. In We first discuss the truncation case. Let the truncation error be
sign-magnitude format, v = −7/8 is represented as vSM = [1.111], in one’s defined as Et = Qt[v] − v .
complement we have v1C = [1.000], and in two’s-complement the result is
v2C = [1.000] + [0.001] = [1.001]. • For positive numbers the error is
(For further examples see also the table in Section 2.4.)
−b+1 −bu +1
−(2 −2 ) ≤ Et ≤ 0
Remarks:
• Most DSPs use two’s-complement arithmetic. Thus any b-bit
(truncation leads to a number smaller than the unquantized
number v has the number range
number)
−b+1 −b+1 • For negative numbers and the sign-magnitude representation
v ∈ {−1, −1 + 2 ,...,1 − 2 }.
the error is
• Two’s-complement arithmetic with b bits can be viewed as
−b+1 −bu +1
arithmetic modulo 2b (Example for b = 3): 0 ≤ Et ≤ (2 −2 ).

(truncation reduces the magnitude of the number)


• For negative numbers in the two’s-complement case the error
is
−b+1 −b +1
−(2 − 2 u ) ≤ Et ≤ 0
(negative of a number is obtained by subtracting the
(from [Proakis, Manolakis, 1996]) corresponding positive number from 2, see (4.31))

85 86
• Quantization characteristic functions for a continuous input
signal v (v → x): 4.3.2 Numerical overflow
Sign-magnitude representation: Two’s-complement representation:
If a number is larger/smaller than the maximal/minimal possible
number representation

+1 +1
• ±(1 − 2−b+1) for sign magnitude and ones’s-complement
arithmetic;
+1 +1

• −1 and 1 − 2−b+1, resp., for two’s-complement arithmetic,


we speak of an overflow/underflow condition.
Overflow example in two’s-complement arithmetic
(from [Proakis, Manolakis, 1996]) (range: −8, . . . , 7)

Rounding case, rounding error is defined as Er = Qr [v] − v : [0.111]


+ [0.001] = [1.000]
| {z } | {z } | {z }
• Rounding affects only the magnitude of the number and is thus 7 1 −8

independent from the type of fixed-point realization.


⇒ resulting error can be very large when overflow/underflow
• Rounding error is symmetric around zero and falls in the range occurs
1 −b+1 −b +1 1 −b+1 −b +1
Two’s-complement quantizer for b = 3, ∆ = 2−b (v → x):
− (2 − 2 u ) ≤ Er ≤ (2 − 2 u ).
2 2
• Quantization characteristic function, bu = ∞ (v → x):

+1

+1

(from [Oppenheim, Schafer, 1999])

Alternative: saturation or clipping, error does not increase


(from [Proakis, Manolakis, 1996]) abruptly in magnitude when overflow/underflow occurs:

87 88
As an example, we are interested in the deviation
∆z∞i = z∞i − z̄∞i, when the denominator coefficients ai
are quantized (z̄∞i denotes the resulting pole after quantization).
It can be shown [Proakis, Manolakis, 1996, pp. 569] that this
deviation can be expressed as:

N N −n
X z∞i
∆z∞i = − ∆an, i = 1, . . . , N.
N
Q
n=1 (z∞i − z∞ℓ)
(from [Oppenheim, Schafer, 1999]) ℓ=1, ℓ6=i
(4.32)
Disadvantage: ”Summation property” of the two’s-complement From (4.32) we can observe the following:
representation is violated
• By using the direct form, each single pole deviation ∆z∞i
4.3.3 Coefficient quantization errors depends on all quantized denominator coefficients āi.
• In a DSP/hardware realization of an FIR/IIR filter the accuracy • The error ∆z∞i can be minimized by maximizing the distance
is limited by the wordlength of the computer ⇒ Coefficients |z∞i − z∞ℓ| between the poles z∞i and z∞ℓ.
obtained from a design algorithm have to be quantized
• Wordlength reduction of the coefficients leads to different ⇒ Splitting the filter into single or double pole sections (first or
poles and zeros compared to the desired ones. This may lead second order transfer functions):
to

– modified frequency response with decreased selectivity • Combining the poles z∞i and z∞i into a second order section
– stability problems leads to a small perturbation error ∆z∞i, since complex
conjugate poles are normally sufficiently far apart.
Sensitivity to quantization of filter coefficients
• ⇒ Realization in cascade or parallel form: The error of a
Direct form realization, quantized coefficients: ∗
particular pole pair z∞i and z∞i is independent of its distance
from the other poles of the transfer function.
āi = ai + ∆ai, i = 1, . . . , N,
b̄i = bi + ∆bi, i = 0, . . . , N, Example: Effects of coefficient quantization
Elliptic filter of order N = 12 (Example taken from [Oppenheim, Schafer,
∆ai and ∆bi represent the quantization errors. 1999]):

89 90
v(n) y(n)
Poles: z∞1,2 = r e±jθ , z −1
Coefficients: 2r cos θ

a1 = −2r cos θ , a2 = r 2, z −1

Stability condition: |r| ≤ 1 −r2

Quantization of a1 and a2 with b = 4 bits: → possible pole


positions:

Unquantized:
• Nonuniformity of the pole position is due to the fact that
(a) Magnitude frequency response 20 · log10 |H(ejω )|
(b) Passband details a2 = r 2 is quantized, while the pole locations z∞1,2 = r e±jθ
are proportional r .
Quantized with b = 16 bits:
(c) Passband details for cascade structure • Sparse set of possible pole locations around θ = 0 and θ = π .
(d) Passband details for parallel structure Disadvantage for realizing lowpass filters where the poles are
(e) Magnitude frequency response (log) for direct structure normally clustered near θ = 0 and θ = π .
Pole locations of quantized second order sections Alternative: Coupled-form realization
Consider a two-pole filter with the transfer function y1(n) = v(n) + r cos θ y1(n − 1) − r sin θ y(n − 1),
1 y(n) = r sin θ y1(n − 1) + r cos θ y(n − 1),
H(z) = .
1 − (2r cos θ) z −1 + r 2 z −2 (4.33)

91 92
which corresponds to the following signal flow graph: • Disadvantage: Increased computational complexity compared
to the direct form.
v(n) y1 (n)
r cos θ z −1

Cascade or parallel form?


−r sin θ r sin θ
y(n)
P
r cos θ z −1 Y bp0 + bp1 z −1 + bp2 z −2
Cascade form: H(z) =
p=1
1 + ap1 z −1 + ap2 z −2
By transforming (4.33) into the z-domain, the transfer function of P
X cp0 + cp1 z −1
the filter can be obtained as Parallel form: H(z) = A0 +
p=1
1 + ap1 z −1 + ap2 z −2
Y (z) (r sin θ) z −1
H(z) = = .
V (z) 1 − (2r cos θ) z −1 + r 2 z −2
• Cascade form: Only the numerator coefficients bpi of
an individual section determine the perturbation of the
• We can see from the signal flow graph that the two coefficients
corresponding zero locations (an equation similar to (4.32) can
r sin θ and r cos θ are now linear in r , such that a
be derived) → direct control over the poles and zeros
quantization of these parameters lead to equally spaced pole
locations in the z-plane: • Parallel form: A particular zero is affected by quantization
errors in the numerator and denominator coefficients of all
individual sections → numerator coefficients cp0 and cp1 do
not specify the position of a zero directly, direct control over
the poles only

⇒ Cascade structure is more robust against coefficient


quantization and should be used in most cases

Example:
Elliptic filter of order N = 7, frequency and phase response
(taken from [Proakis, Manolakis, 1996]):

93 94
Cascade form (3 digits =
b b ≈ 10 bits, 4 digits =
b b ≈ 14 bits) Coefficient quantization in FIR systems
In FIR systems we only have to deal with the locations of the
zeros, since for causal filters all poles are at z = 0.
Remarks:
• For FIR filters an expression analogous to (4.32) can be
derived for the zeros ⇒ FIR filters should also be realized
in cascade form according to

P
Y −1 −2
H(z) = H0 (1 + bp1 z + bp2 z )
p=1

with second order subsections, in order to limit the effects of


coefficient quantization to the zeros of the actual subsection
Parallel form (b = 10 bits) only.
• However, since the zeros are more or less uniformly spread in
the z-plane, in many cases the direct form is also used with
quantized coefficients.
• For a linear-phase filter with the symmetry (4.8) in the
impulse response, quantization does not affect the phase
characteristics, but only the magnitude.

4.3.4 Round-off effects


Direct-form I IIR structure
Starting point for the analysis: Direct-form I structure with the
difference equation

N
X N
X
y(n) = bi v(n − i) − ai y(n − i).
i=0 i=1

95 96
All signal values and coefficients are represented by b-bit As already stated in Section 2.4 the result of each single
binary fixed-point numbers (for example in two’s-complement quantization stage can be modeled by adding a noise source ei(n)
representation): with the following properties:
• truncation or rounding of the (2b − 1)-bit products to b bit • Each ei(n) corresponds to a wide-sense-stationary white-
necessary −
noise process.
• modelling as a constant multiplication followed by a quantizer • Each ei(n) has an uniform distribution of amplitudes over one
quantization interval (uniform p.d.f.).
• Each ei(n) is uncorrelated with the quantizer input, all other

quantization noise sources and the input signal of the filter.
− We have shown above that for b-bit quantization the rounding
error falls in the range

1 −b+1 1 −b+1
− − (2 ) ≤ ei(n) ≤ (2 ),
2 2

and for two’s-complement truncation we have
−b+1
−2 ≤ ei(n) ≤ 0.

− Mean and variance for rounding

2 2−2b+2
− µe = 0, σe = , (4.35)
12
and for truncation
(from [Oppenheim, Schafer, 1999], v → x) 2−b+1 2 2−2b+2
µe = − , σe = . (4.36)
This can be described with the difference equation 2 12
N
X N
X Autocorrelation (white noise process):
y(n) = Q[bi v(n − i)] − Q[ai y(n − i)]. (4.34)
2 2
i=0 i=1 ϕee(n) = σe δ(n) + µe . (4.37)

97 98
In the following we will restrict ourselves to the rounding case, quantization noise e(n) now is given as
where ϕee(n) = σe2δ(n) and thus, for the power spectral density
we have Φ(ejω ) = σe2: N
X
f (n) = aif (n − i) + e(n), (4.39)
• The following structure can be obtained by summing up all the i=1
noise sources:
X4
e(n) = ei(n), since e(n) can be regarded as the input to an all-pole system
i=0 with output f (n).

• Suppose that the allpole-filter has the transfer function


Hef (z) with

1 N (z)
Hef (z) = , H(z) = analog to (4.1).

D(z) D(z)
(from [Oppenheim, Schafer, 1999], v → x)

– Mean of f (n): µf = µe Hef (ej0) = 0 for rounding.


• ⇒ Overall noise variance in the special case from above: – Power spectral density (power spectrum)
Φf f (ejω ) = σe2 |Hef (ejω )|2.
4
2
X 2 2−2b+2 – Variance σf2 = F∗−1{Φf f (ejω )}|n=0:
σe = σe = 5 ·
i 12
i=0
Z ∞
2 σ2 π
jω 2 2
X 2
Overall noise variance in the general case: σf = e |Hef (e )| dω = σe |hef (n)| ,
2π −π n=−∞

2 −2b+2 (4.40)
2
σe = (2N + 1) · (4.38) where the last expression is obtained by applying Parseval’s
12
theorem.

• Due to linearity the output of the whole filter is ŷ(n) =


y(n) + f (n). Thus, the difference equation for the By combining (4.38) and (4.40) we can now state the total output

99 100
variance due to internal round-off as approaches the unit circle ⇒ In order to neep the noise variance
below a certain level, the wordlength b has to be increased.

2 2−2b+2 dω Round-off noise in a second-order system
σf = (2N +1)
2π · 12 |D(ejω )|2
−π Second-order direct form I system:
(4.41)

2−2b+2 X 2 b0 + b1 z −1 + b2 z −2
= (2N +1) |hef (n)| H(z) =
12 n=−∞ (1 − r ejθ z −1)(1 − r e−jθ z −1)
Thus we have
Round-off noise in a first-order system

2 2−2b+2 1 dω
Given: Transfer function σf =5 .
12 2π |(1 − r ejθ e−jω )|2 |(1 − r e−jθ e−jω )|2
b0 −π
H(z) = , |a1| < 1
1 − a1z −1 With a1 = −2r cos θ and a2 = r 2 it can be shown via a partial
→ Impulse response: h(n) = b0 an1 u(n) (u(n): unit step fraction expansion that
function) !
2 2−2b+2 1 + r 2 1
σf = 5 . (4.43)
e(n) = ea1 (n) + eb0 (n) 12 1 − r 2 r 4 + 1 − 2r 2 cos(2θ)

b0 As in the first-order case we can see that the total variance


v(n) y(n)
increases if the poles approach the unit circle (r → 1).
z −1
a1 Direct-form II structure
In this case, the nonlinear difference equations are of the form
Considering (4.41) and the two error sources ea1 (n), eb0 (n), we
have N
X
∞   w(n) = − Q[ai w(n − i)] + v(n),
2 2−2b+2 X 2n 2−2b+2 1 i=1
σf =2 |a1| = . (4.44)
12 n=0 6 1 − |a1|2 N
X
(4.42) y(n) = Q[bi w(n − i)].
The output noise variance increases when the pole z∞ = a1 i=0

101 102
Signal flow graph: and by applying a relation similar to (4.40)


2 2−2b+2 X 2 2−2b+2
σf =N |h(n)| + (N + 1) .
− 12 n=−∞ 12

(4.47)

• White noise produced in implementing the poles is filtered
by the entire system, whereas the white noise produced in
implementing the zeros is added directly to the output of the
system.
• A comparison with (4.41) for the direct form I structure shows
that both structures are affected differently by the quantization

of products.

4.3.5 Zero-input limit cycles


(from [Oppenheim, Schafer, 1999], v → x) • Stable IIR filters implemented with infinite-precision
arithmetic: If the excitation becomes zero and remains
zero for n > n0 then the output of the filter will decay
For rounding (µe = 0) the power spectrum of the output noise is: asymptotically towards zero.
• Same system implemented with fixed-point arithmetic: Output
may oscillate indefinitely with a periodic pattern while the
jω 2−2b+2 jω 2 2−2b+2 input remains equal to zero: ⇒ Zero-input limit cycle
Φf f (e ) = N |H(e )| + (N + 1) .
12 12 behavior, due to nonlinear quantizers in the feedback loop or
(4.45)
We then have: overflow of additions.
No general treatment, but two examples are given
Zπ Limit cycles due to round-off and truncation
2 2−2b+2 1 jω 2 2−2b+2
σf =N |H(e )| dω + (N + 1) , Given: First-order system with the difference equation
12 2π 12
−π
(4.46) y(n) = a y(n − 1) + v(n), |a| < 1.

103 104
Register length for storing a and the intermediate results: 4 bits ⇒ A constant steady value is obtained for n ≥ 3.
(sign bit plus 3 fractional digits) ⇒ product a y(n − 1) must be For a = −1/2 we have a periodic steady-state oscillation
rounded or truncated to 4 bits, before being added to v(n) between −1/8 and 1/8.
Signal flow graphs: ⇒ Such periodic outputs are called limit cycles.
Infinite-precision linear system
v(n) y(n)
−1
z
a

Nonlinear system due to quantization


v(n) ŷ(n)

Q[·] z −1
a

Nonlinear difference equation (Q[·] represents two’s-complement


rounding):

ŷ(n) = Q[a ŷ(n − 1)] + v(n).

Suppose we have a = 1/2 = [0.100], v(n) = 7/8 δ(n) =


(from [Oppenheim, Schafer, 1999])
[0.111] δ(n):

ŷ(0) = 7/8 = [0.111]


Limit cycles due to overflow
ŷ(1) = Q[a ŷ(0)] = Q [ [0.100] × [0.111] ] Consider a second-order system realized by the difference
= Q [ [0.011100] ] = Q[7/16] = [0.100] = 1/2 equation
ŷ(2) = Q[a ŷ(1)] = [0.010] = 1/4 ŷ(n) = v(n) + Q [a1 ŷ(n − 1)] + Q [a2 ŷ(n − 2)] ,
ŷ(3) = Q[a ŷ(2)] = [0.001] = 1/8 (4.48)
Q[·] represents two’s-complement rounding with one sign and
ŷ(4) = Q[a ŷ(3)] = Q [ [0.000100] ] = [0.001] = 1/8 3 fractional digits.

105 106
Overflow can occur with the two’s-complement addition of the 4.4 Design of FIR filters
products in (4.48). General remarks (IIR and FIR filters)
Suppose that a1 = 3/4 = [0.110], a2 = −3/4 = [1.010],
• Ideal filters are noncausal, and thus physically unrealizable for
ŷ(−1) = 3/4 = [0.110], ŷ(−2) = −3/4 = [1.010],
real-time signal processing applications.
v(n) = 0 for all n ≥ 0:
• Causality implies that the a filter frequency response H(ejω )
ŷ(0) = Q[ [0.110] × [0.110] ] + Q[ [1.010] × [1.010] ] cannot have an infinitely sharp cutoff from passband to
stopband, and that the stopband amplification can only be zero
= Q[ [0.100100] ] + Q[ [0.100100] ] = [0.101] + [0.101] for a finite number of frequencies ω .
= [1.010] = −3/4
Magnitude characteristics of physically realizable filters:
ŷ(1) = [1.011] + [1.011] = [0.110] = 3/4

⇒ ŷ(n) continues to oscillate unless an input is applied.

Remarks
Some solutions for avoiding limit cycles:
• Use of structures which do not support limit-cycle oscillations.
• Increasing the computational wordlength. (from [Proakis, Manolakis, 1996])

• Use of a double-length accumulator and quantization after the δ1: passband ripple, δ2: stopband ripple,
accumulation of products. ωp: passband edge frequency, ωs: stopband edge frequency

FIR-filters are limit-cycle free since there is no feedback involved Filter design problem:
in its signal flow graph. • Specify δ1, δ2, ωp, and ωs corresponding to the desired
application.
• Select the coefficients ai and bi (free parameters), such that
the resulting frequency response H(ejω ) best satisfies the
requirements for δ1, δ2, ωp, and ωs.
• The degree to which H(ejω ) approximates the specifications
depends on the criterion used for selecting the ai and bi and

107 108
also on the numerator and denominator degree N (number of which is the z-transform equivalent to (4.49). Consequences:
coefficients)
• The roots of the polynomial H(z) are identical to the roots of
4.4.1 Linear phase filters the polynomial H(z −1): If z0i is a zero of H(z) then z0i−1
is
Important class of FIR filters, which we will mainly consider in also a zero.
the following. Definition: A filter is said to be a linear-phase • If additionally the impulse response h(n) is real-valued, the
filter, if its impulse response satisfies the condition (L = N +1): roots must occur in complex-conjugate pairs: If z0i is a zero

of H(z) then z0i is also a zero.
h(n) = ±h(L − 1 − n). (4.49) ⇒ The zeros of a real-valued linear-phase filter occur in
quadruples in the z-plane (exception: zeros on the real axis, zeros
With the definition S := (L − 1)/2 and for L odd this leads to on the unit circle)
a z-transform
L−1
X −n
H(z) = h(n)z (4.50)
n=0
" S−1
#
X  
−S (S−n) −(S−n)
=z h(S) + h(n) z ±z ,
n=0
(4.51) (from [Proakis, Manolakis, 1996])

for L even we have


(a) Type-1 linear phase system
L/2−1
−S
X 
(S−n) −(S−n)
 Definition: Odd length L, even symmetry h(n) = h(L−1−n)
H(z) = z h(n) z ±z . (4.52) Frequency response from (4.51):
n=0
" S−1
#
When we now substitute z −1 for z in (4.50) and multiply both jω −jSω
X
H(e ) = e h(S) + 2 h(n) cos ((S − n)ω)
sides by z −(L−1) we obtain with (4.49) n=0
(4.54)
−(L−1) −1 −jSω
z H(z ) = ±H(z), (4.53) =e H01(ω)

109 110
H01(ω): amplitude frequency response, real-valued (generally
denoted with H0(ω)) type 3, odd length (L=31)
0.5
• linear phase ϕ1(ω) = −arg H(ejω ) = Sω

h(n)
0
type 1, odd length (L=31)

−0.5
0 5 10 15 20 25 30
h(n)

n
type 3, amplitude frequency response
0
1

0.5
0 5 10 15 20 25 30

H (ω)
n 0

03
type 1, amplitude frequency response
−0.5
1
−1
H (ω)

0 0.5 1 1.5 2 2.5 3 3.5 4


0.5 ω /π
01

0 (c) Type-2 linear phase system


0 0.5 1 1.5 2 2.5 3 3.5 4
ω /π Definition: Even length L, even symmetry h(n) = h(L−1−n)
(b) Type-3 linear phase system
Frequency response from (4.52):
Definition: Odd length L, odd symmetry h(n) = −h(L−1−n)
Frequency response from (4.51):  
L/2−1
" # jω −jSω
X
S−1
X H(e ) = e 2 h(n) cos ((S − n)ω) (4.56)
jω −jSω
H(e ) = e j h(S) + 2 h(n) sin ((S − n)ω) n=0
n=0
−jSω
(4.55) =e H02(ω)
−jSω −jSω+jπ/2
=e j H03(ω) = e H03(ω)
• linear phase ϕ2(ω) = −arg H(ejω ) = Sω
• linear phase ϕ3(ω) = −arg H(ejω ) = Sω − π/2
• H(ej0) = 0, S ∈ IN ⇒ H(ejπ ) = 0 • S = (2λ−1)/2, λ ∈ IN ⇒ H(ejπ ) = 0

111 112
• Amplitude frequency response has 4π -periodicity: (d) Type-4 linear phase system

L/2−1 Definition: Even length L, odd symmetry h(n) = −h(L−1−n)


X
H02(ω) = 2 h(n) cos ((S − n)ω) Frequency response from (4.52):
n=0  
L/2−1
jω −jSω 
X
L/2−1
X H(e ) = e j 2 h(n) sin ((S − n)ω)
H02(ω + 2π) = 2 h(n) cos ((S − n)(ω + 2π)) n=0
n=0
(4.57)
L/2−1
X −jSω −jSω+jπ/2
=2 h(n) cos ((S − n)ω) · =e j H04(ω) = e H04(ω)
n=0
• linear phase ϕ4(ω) = −arg H(ejω ) = Sω − π/2
· cos ((S − n)2π)
| {z } • H(ej0) = 0
= cos((L−1−2n)π) = −1
• Similar to the type-2 filter the amplitude frequency response
= −H02(ω) has 4π -periodicity: H04(ω + 2π) = −H04(ω). The
multiplication with the exponential factor e−jSω+jπ/2 then
• Remark: H(ejω ) is 2π -periodic again due to the e−jSω phase again leads to 2π -periodicity for H(ejω ).
factor
type 4, even length (L=30)
0.5
type 2, even length (L=30)

h(n)
0
h(n)

−0.5
0 5 10 15 20 25 30
0 5 10 15 20 25 30 n
n type 4, amplitude frequency response
type 2, amplitude frequency response
1
1
0.5
0.5

H (ω)
H02(ω)

04
0

−0.5 −0.5

−1 −1
0 0.5 1 1.5 2 2.5 3 3.5 4 0 0.5 1 1.5 2 2.5 3 3.5 4
ω /π ω /π

113 114
Applications: L with the desired frequency response
• Type-1 and Type-2 filters used for ”ordinary” filtering, (
jω e−jω(L−1)/2 for 0 ≤ |ω| < ωc,
however type 2 filters are unsuitable for highpass filtering Hd(e ) = (4.60)
0 otherwise,
• Type-3 and Type-4 filters for example used for 90 degree phase
shifters and so called Hilbert transformers where ωc is denoting the cut-off frequency.
4.4.2 Design of linear-phase filters using a window function Corresponding unit sample response:

Given: Desired frequency response Zωc


1 jω(n−(L−1)/2)
hd(n) = e dω.

X 2π
jω −jωn −ωc
Hd(e ) = hd(n) e (4.58)
 L−1

n=−∞ sin ωc n − 2 L−1
= L−1
 , n 6= (4.61)
π n− 2
⇒ Impulse response hd(n) can be obtained with the inverse 2

Fourier-Transform Multiplication with a rectangular window of length L leads to


h  i
Zπ sin ωc n − L−1
2 L−1
1 jω jωn h(n) =   , n 6= , n = 0, . . . , L − 1
hd(n) = Hd(e ) e dω. (4.59) π n − L−1 2
2π 2
−π
 
L−1 ωc
For L odd: h =
2 π
Impulse response has generally infinite length ⇒ truncation
Example for ωc = 0.2π , L = 61 and L = 101:
to length L by multiplication with a window function w(n)
1.2 1.2
necessary: h(n) = hd(n) · w(n).
1 1
Rectangular window: L=61, ω c=0.2⋅π L=101, ω c=0.2⋅π
0.8 0.8

|H(ejω )| →
|H(ejω )| →
( (
1 n = 0, . . . , L − 1 hd (n) n = 0, . . . , L − 1 0.6 0.6
w(n) = ⇒ h(n) =
0 otherwise 0 otherwise 0.4 0.4

0.2 0.2
Frequency response of the rectangular window: see (3.12)
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π → ω/π →
Suppose, we want to design a linear-phase lowpass filter of length Disadvantage of using an rectangular window:

115 116
Large sidelobes lead to in undesirable ringing effects (overshoot (n → n, L → M , I0 : Bessel function of the first kind of order zero)
at the boundary between pass- and stopband) in the frequency
response of the resulting FIR filter
⇒ Gibbs phenomenon:
• Result of approximating a discontinuity in the frequency
response with a finite number of filter coefficients and a mean
square error criterion
• Eq. (4.58) can be interpreted as a Fourier series representation
for Hd(ejω ) with the Fourier coefficients hd(n) → Gibbs
phenomenon resulting from a Fourier series approximation

• Squared integral error E = (Hd(ejω ) − H(ejω ))2 dω
−π
approaches zero with increasing length of h(n). However, the
maximum value of the error |Hd(ejω )−H(ejω )| approaches
a constant value. (from [Proakis, Manolakis, 1996])

⇒ Use of other appropriate window functions with lower


Frequency-domain characteristics of some window functions
sidelobes in their frequency responses
(taken from [Proakis, Manolakis, 1996]):

Approximate transition Peak


Type of window width of main lobe sidelobe [dB]
Rectangular 4π/L -13
Bartlett 8π/L -27
Hanning 8π/L -32
Hamming 8π/L -43
Blackman 12π/L -58

Parameter α in the Kaiser window allows to adjust the width of


the main lobe, and thus also to adjust the compromise between
overshoot reduction and increased transition bandwidth in the

117 118
resulting FIR filter. Frequency response of an FIR filter (requirement):

Magnitude frequency response 20 log10 |H(ejω )| of the L−1


X
jω ! −jωn
resulting linear-phase FIR filter, when different window functions Hd(e ) = h(n)e
are used to truncate the infinite-length impulse response from n=0

(4.61) (desired frequency response Hd(ejω ) in (4.60)):


With (4.62) we obtain for k = 0, . . . , L−1:
0 Rectangular window 0 Hamming window
L−1
j 2π (k+α)
L=61, ω =0.2⋅π L=61, ω =0.2⋅π
X −j2π(k+α)n/L
c c
Hd(e L ) = h(n)e . (4.63)
|H(ejω )| →

20 log10 |H(ejω )| →
−20 −20

−40 −40
n=0
10
20 log

Multiplication of (4.63) with ej2πkℓ/L, ℓ = 0, . . . , L − 1 and


−60 −60

−80 −80
summation over k = 0, . . . , L−1 yields to
−100 −100
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π → ω/π → L−1
j 2π (k+α)
X j2πkℓ/L
0 Blackman window 0 Kaiser window, β=4 e Hd(e L ) =
L=61, ω c=0.2⋅π L=61, ω c=0.2⋅π
k=0
|H(ejω )| →

20 log10 |H(ejω )| →

−20 −20

−40 −40 X L−1


L−1 X
−j2π(k+α)n/L j2πkℓ/L
= h(n)e e
10
20 log

−60 −60
k=0 n=0
−80 −80
L−1
X L−1
X
−100 −100 −j2παn/L −j2π(n−ℓ)k/L
0 0.2 0.4
ω/π →
0.6 0.8 1 0 0.2 0.4
ω/π →
0.6 0.8 1 = h(n)e e
n=0 k=0
MATLAB-command for windowed linear-phase FIR design: −j2παℓ/L
fir1 = L h(ℓ) e .
4.4.3 Frequency sampling design Thus, the impulse response h(n) can be obtained from the
Desired frequency response Hd(ejω ) is specified as a set of sampled desired frequency response as (n = 0, . . . , L−1):
equally spaced frequencies:
  L−1
2π 1 1 X j 2π (k+α) j2π(k+α)n/L
ωk = (k + α), k = 0, 1, . . . , L − 1, α ∈ 0, . h(n) = Hd(e L )e (4.64)
L 2 L k=0
(4.62)

119 120
Remarks: Example:
• For α = 0 (4.64) is identical to the IDFT ⇒ fast evaluation Determine the coefficients of a type 2 linear-phase filter with length L = 32,
and the desired sampled frequency response
with IFFT

• In general Hd(ej L (k+α)) has to be specified in amplitude 
and phase for every k. 1 k = 0, 1, . . . , 5,
j 2π (k+α) −j L−1
2 L
2π (k+α) 
Exception: Type 1/3 linear-phase filters, where Hd(·) can be Hd (e L )=e · T1 k = 6,


real-valued with an additional shift of the obtained impulse 0 k = 7, 8, . . . , 15.
response (see below).
The parameter T1 is responsible for the transition band behavior and is
If h(n) is a real-valued sequence, the frequency response and thus obtained via numerical optimization in order to reduce the magnitude of the
also its sampled version have the Hermitian symmetry sidelobes. The corresponding values are tabulated in the literature ([Rabiner,
Gold, McGonegal, 1970], [Proakis, Manolakis, 1996]).
j 2π (k+α) ∗ j 2π (L−k−α)
Hd(e L ) = Hd (e L ).
For L = 32 we obtain T1 = 0.3789795 for α = 0, and T1 = 0.3570496 for
⇒ The number of frequency specifications can be reduced, and α = 1/2.
(4.62) becomes

 k = 0, 1, . . . , L−1

 2 L odd, Coefficients of the impulse response h(n):
2π L
ωk = (k + α), k = 0, 1, . . . , 2 − 1 L even,
L 
 α ∈  0, 1 .

2
(4.65)
Linear-phase FIR filters:
• Symmetry in h(n) can be additionally exploited such that
(4.64) only has to be evaluated for n = 0, . . . , L2 − 1 for L
even, and n = 0, . . . , L−1
2 for L odd, resp.
• Linear-phase property may be included by specifying real-

valued frequency response samples Hd(ej L (k+α)) →
Application of (4.64) leads to a zero-phase response which has
to be shifted to the right by L−1
2 samples.

121 122
Magnitude frequency responses (20 log10 |H(ejω )|): Linear-phase filters revisited

L = 32, α = 0: L = 32, α = 0.5: As we have shown in section 4.4.1, every linear-phase filter has a
frequency response of the form
jω m −jω(L−1)/2
H(e ) = (j) ·A(ω)·e , m ∈ {0, 1}, (4.66)

where A(ω) is a real-valued positive or negative function (ampli-


tude 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
(from [Proakis, Manolakis, 1996])
for type 1 linear-phase filters we have
MATLAB-command for the frequency sampling design of
(L−1)/2
linear-phase FIR filters: fir2 X
A(ω) = an cos(nω) (4.67)
n=0
4.4.4 Optimum equiripple design (Chebyshev approximation)    
L−1 L−1
• Windowing design techniques (section 4.4.2) try to reduce with a0 = h , an = 2 h − n + . (4.68)
2 2
the difference between the desired and the actual frequency
response (error function) by choosing suitable windows Remaining linear-phase filters (ω → 2πf ):
• How far can the maximum error be reduced?
⇒ Theory of Chebyshev approximation answers this question
and provides us with algorithms to find the coefficients
of linear-phase FIR filters, where the maximum frequency
response error is minimized
• Chebyshev approximation: Approximation that minimizes the
maximum errors over a set of frequencies
• Resulting filters exhibit an equiripple behavior in their
frequency responses ⇒ equiripple filters

(from [Parks, Burrus: Digital Filter Design, 1987])

123 124
then a necessary and sufficient condition that A(ω) be the
Problem definition unique, best weighted Chebyshev approximation to a given
Acceptable frequency response for the resulting FIR filter: continuous function D(ω) on F is that the weighted error
function E(ω) = W (ω) · (D(ω) − A(ω)) exhibit at least
• Linear phase,
r + 1 extremal frequencies in F . These frequencies are points
• transition bandwidth ∆ω between pass- and stopband, for which ω1 < · · · < ωr < ωr+1,
• passband deviation ±δ1 from unity,
• stopband deviation ±δ2 from zero. E(ωm) = −E(ωm+1), m = 1, 2, . . . , r,
(Multiple bands are possible as well.)
and
We will restrict ourselves in the following to lowpass type 1 linear-
phase filters. |E(ωi)| = max E(ω), i = 1, . . . , r + 1.
ω∈F
Approximation problem: Given
• a compact subset F of [0, π] in the frequency domain • Consequences from the alternation theorem: Best Chebyshev
(consisting of pass- and stopband in the lowpass filter case), approximation must have an equiripple error function E(ω),
• a desired real-valued frequency response D(ω), defined on and is unique.
F, • Example: Amplitude frequency response of an optimum
• a positive weight function W (ω), defined on F , and type 1 linear-phase filter with L = 13 → r = 7
• the form of A(ω), here (type-1 linear-phase) (L−1)/2
P
P r−1 L = 13 A(ω) = an cos(nω)
A(ω) = n=0 an cos(nω). n=0

Goal: Minimization of the error

Emax = max W (ω) · |D(ω) − A(ω)| (4.69)


ω∈F

over an by the choice of A(ω). ωp ωs π ω

Alternation theorem (without proof):


If A(ω) is a linear combination of r cosine functions, (from [Parks, Burrus: Digital Filter Design, 1987])

r−1
X
A(ω) = an cos(nω), • If the r+1 extremal frequencies were known, we could use the
n=0 frequency-sampling design from above to specify the desired

125 126
values 1 ± δ1 at the extremal frequencies in the passband, and 2. Interpolate to find the frequency response on the entire grid
±δ2 in the stopband, respectively. of frequencies.
How to find the set of extremal frequencies? 3. Search over the entire grid of frequencies for a larger error
magnitude than δk obtained in step 1.
Remez exchange algorithm (Parks, McClellan, 1972) 4. Stop, if no larger magnitude error has been found.
• It can be shown that the error function Otherwise, take the r + 1 frequencies, where the error
attains its maximum magnitude as a new trial set of
r−1
X extremal frequencies and go to step 1.
E(ω) = D(ω) − an cos(nω) (4.70)
n=0
Flowchart (ω → f ):
can always be forced to take on some values ±δ for any given
set of r+1 frequency points ωi, i = 1, . . . , r + 1.
Simplification: Restriction to W (ω) = 1, leading to δ1 =
δ2 = δ .
This can be written as a set of linear equations according to

r−1
X i
D(ωi) = an cos(nωi)+(−1) δ, i = 1, . . . , r+1,
n=0
(4.71)
from which we obtain a unique solution for the coefficients
an, n = 0, . . . , r−1 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 (from [Parks, Burrus: Digital Filter Design, 1987])
frequency points being approximately 10 · L. The algorithm
is initialized with a trial set of arbitrarily chosen frequencies
T = {ω1, ω2, . . . , ωr+1}. Example:
• The Remez algorithm now consists of the following basic Choose the two coefficients d0 and d1 such that they minimize the Chebyshev
error
computations: 2
max |x − (d0 + d1 x1 )|
1. Solve the linear equations in (4.71), yielding an error x∈[0,1]
magnitude δk in the k-th iteration. (approximation of a parabola by a straight line) → three extremal points →

127 128
resulting linear equations to be solved: achieves its maximum magnitude: → T1 = [0.0, 0.625, 1.0]
2 i
Linear equations to solve:
xi = d0 + d1 xi + (−1) δ, i = 0, 1, 2 (4.72)
    
1 0.0 1 d0 0.0
1 0.625 −1  d1  =  0.390625
1 1.0 1 δ0 1.0

→ δ1 = 0.1171875
3. Next trial set: T2 = [0.0, 0.5, 1.0]
Linear equations to solve:
    
1 0.0 1 d0 0.0
1 0.5 −1  d1  =  0.25
1 1.0 1 δ0 1.0

→ δ1 = 0.125 =
b maximum error → T2 is the extremal point set

After the extremal points ωi are found, the coefficients an from


Step 1 of the above algorithm are used to obtain the filter
coefficients with (4.68).
MATLAB-command for optimum equiripple design: remez
Estimation of the filter length
(from [Parks, Burrus: Digital Filter Design, 1987])
Given the stop- / passband ripple δ1, δ2, and the transition
bandwidth ∆ω = ωs − ωp the necessary filter order N can
1. Arbitrarily chosen trial set: T0 = [0.25, 0.5, 1.0]
Matrix version of the linear equations in (4.72):
be estimated as (Kaiser, 1974)
    
1 0.25 1 d0 0.0625 −10 log10(δ1 δ2) − 13
1 0.5 −1  d1  =  0.25  N = . (4.73)
1 1.0 1 δ0 1.0 2.324∆ω

→ δ0 = 0.0625
MATLAB-command for estimating the filter order: remezord
2. Next trial set chosen as those three points, where the error
2
E(x) = x − (d0 + d1 x)

129 130
Design example the filter-length by one, L = 28:
Design a linear-phase lowpass filter with the specifications Impulse response Magnitude frequency response
0.6
0
δ1 = 0.01, δ2 = 0.001, ωp = 0.4π, ωs = 0.6π.

20 log10 |H(ejω )| [dB] →


0.4 −20

h(n) →
−40
→ weighting δ2/δ1 = 10 in the stopband. 0.2

−60
Inserting these values into (4.73) leads to N ≈ 25.34 and 0
−80
rounding up (to be on the save side) yields a filter length
−0.2 −100
L = N +1 = 27. 0 5 10
n →
15 20 25 0 0.2 0.4
ω/π →
0.6 0.8 1

Impulse response Magnitude frequency response Passband detail


0.6
0
20 log10 |H(ejω )| [dB] →

0.4 1.01
−20
1.005
h(n) →

|H(ejω )| →
−40
0.2
1
−60
0 0.995
−80
0.99
−0.2 −100
0 5 10 15 20 25 0 0.2 0.4 0.6 0.8 1 0.985
n → ω/π → 0 0.2 0.4
ω/π →

Passband detail 4.5 Design of IIR filters

1.01 • In the following only design algorithms are discussed which


1.005 convert an analog into a digital filter, however, there are also
|H(e )| →

numerous algorithms for directly designing an IIR filter in the


0.995 z-domain (frequency sampling method, least-squares design).


0.99
• Why starting point analog filter? Analog filter design is a well
0.985
0 0.2 0.4 developed field (lots of existing design catalogs). Problem can
ω/π →
be defined in the z-domain, transformed into the s-domain and
In the passband the specifications are not satisfied → Increasing solved there, and finally transformed back into the z-domain.

131 132
• Analog filter: Transfer function Frequency response (ideal sampling assumed, compare (2.4)):
∞  
M
P 1 X 2πn
βn sn H(jΩ) = Ha jΩ − j (4.76)
N (s) n=0 T n=−∞ T
Ha(s) = = (4.74)
D(s) PN
αn sn • T should be selected sufficiently small to avoid aliasing.
n=0
• Method is not suitable to design highpass filters due to the
with the filter coefficients αn, βn, and the filter order N . large amount of possible aliasing.
Furthermore, Suppose that the poles of the analog filter are distinct. Then the
partial-fraction expansion of Ha(s) writes
Z∞
−st
Ha(s) = h(t) e dt (4.75) N
X Ai
−∞
Ha(s) = , (4.77)
i=1
s − s∞i
(Laplace transform). the Ai are the coefficients of the partial-fraction expansion, and
• Note that linear-phase designs are not possible for causal and the s∞i denote the poles of the analog filter. Inverse Laplace
stable IIR filters, since the condition transform of (4.77) yields

−N −1 N
H(z) = ±z H(z ) X s∞i t
ha(t) = Ai e , t ≥ 0.
i=1
has to be satisfied (compare (4.53)) → mirror-image pole
outside the unit-circle for every pole inside the unit-circle → Periodical sampling:
unstable filter.
N
X s∞i nT
4.5.1 Filter design by impulse invariance h(n) = ha(nT ) = Ai e .
i=1
Goal: Design an IIR filter with an impulse response h(n) being
the sampled version of the impulse response ha(t) of the analog Transfer function H(z) •−◦ h(n):
filter: !
∞ ∞ N
h(n) = ha(nT ), n = 0, 1, 2, . . . , X −n
X X s∞i nT −n
H(z) = h(n)z = Ai e z .
where T is the sampling interval. n=0 n=0 i=1

133 134
We then have From (4.78) we then finally have

0.5 0.5
N ∞  N H(z) = +
X X s∞i T −1
n X Ai 1 − e−(0.1−j3)T z −1 1 − e−(0.1+j3)T z −1
H(z) = Ai e z = .
i=1 n=0 i=1
1 − es∞iT z −1 1 − (e−0.1T cos(3T )) z −1
= .
1 − (2 e−0.1T cos(3T )) z −1 + e−0.2T z −2
Thus, given an analog filter Ha(s) with poles s∞i, the transfer Magnitude frequency responses:
function of the corresponding digital filter using the impulse
Digital filter: 20 log10 |H(ejω )| Analog filter: 20 log10 |Ha (jΩ)|
invariant transform is

N
X Ai
H(z) = (4.78)
i=1
1− e ∞iT
s z −1

(from [Proakis, Manolakis, 1996])


with poles at z∞i = es∞iT , i = 1, . . . , N . Note: (4.78)
holds only for distinct poles, generalization to multiple-order
poles possible. 4.5.2 Bilinear transform
Algebraic transformation between the variables s and z , mapping
Example:
of the entire jΩ-axis of the s-plane to one revolution of the unit
Convert the analog filter with transfer function circle in the z -plane.
s + 0.1
Ha (s) = Definition:
(s + 0.1)2 + 9
!
into a digital filter using the impulse invariant method.
2 1 − z −1
s= , (4.79)
Poles of Ha (s): s∞0,1 = −0.1 ± j3
T 1 + z −1
Partial-fraction expansion:
T denoting the sampling interval.
0.5 0.5 The transfer function of the corresponding digital filter can be
Ha (s) = +
s + 0.1 − j3 s + 0.1 + j3 obtained from the transfer function of the analog filter Ha(s)

135 136
according to ⇒ Nonlinear mapping between ω and Ω (warping of the
" !# frequency axis) according to
2 1 − z −1
H(z) := Ha = Ha(s). 2
T 1 + z −1 Ω= tan(ω/2), ω = 2arctan(ΩT /2). (4.81)
T
Properties
• Solving (4.79) for z yields

1 + (T /2)s
z= , (4.80)
1 − (T /2)s

and by substituting s = σ + jΩ we obtain

1 + σT /2 + jΩT /2
z= .
1 − σT /2 − jΩT /2

σ < 0 → |z| < 1, σ > 0 → |z| > 1 for all Ω


⇒ causal, stable continuous-time filters map into causal stable (from [Oppenheim, Schafer, 1999])

discrete-time filters Remarks:


• By inserting s = jΩ into (4.80), it can be seen that |z| = 1 for
• Design of a digital filter often begins with frequency
all values of s on the jΩ-axis ⇒ jΩ-axis maps onto the unit
specifications in the digital domain, which are converted
circle.
to the analog domain by (4.81). The analog filter is
• Relationship between ω and Ω: From (4.79) we obtain with then designed considering these specifications (i.e. using the
s = jΩ and z = ejω classical approaches from the following section) and converted
! back into the digital domain using the bilinear transform.
2 1 − e−jω • When using this procedure, the parameter T cancels out and
jΩ = ,
T 1 + e−jω can thus be set to an arbitrary value (T = 1).
2

j sin(ω/2)

2j • Example:
= = tan(ω/2) Design a digital single-pole lowpass filter with a −3 dB frequency (cutoff
T cos(ω/2) T frequency) of ωc = 0.2π , using the bilinear transform applied to the

137 138
analog filter with the transfer function Butterworth filters
Ωc Lowpass Butterworth filters are allpole-filters characterized by the
Ha (s) = ,
s + Ωc squared magnitude frequency response
Ωc denoting the analog cutoff frequency. 1
2
Ωc is obtained from ωc using (4.81) |H(Ω)| = , (4.82)
1 + (Ω/Ωc)2N
2 0.65
Ωc = tan(ωc /2) = .
T T N is the order of the filter, Ωc is the −3 dB frequency (cutoff
The analog filter now has the transfer function
frequency).
Since H(s) · H(−s)|s=jΩ = |H(jΩ)|2 we have from (4.82)
0.65/T by analytic continuation into the whole s-plane
Ha (s) = ,
s + 0.65/T
1
which is transformed back into the digital domain using the bilinear H(s) · H(−s) = .
transform in (4.79), leading to the transfer function of our desired digital 1 + (−s2/Ω2c )N
filter:
0.245 (1 + z −1 ) → Poles of H(s) H(−s):
H(z) = .
1 − 0.509 z −1
Note that the parameter T has been divided out. The frequency response is −s2 1/N j(2n+1)π/N
2
= (−1) =e
0.245 (1 + e−jω )
Ωc

H(e )= ,
1 − 0.509 e−jω → s∞,n = Ωc e
jπ/2
e
j(2n+1)π/(2N )
, n = 0, . . . , 2N − 1
especially we have H(ej0 ) = 1, and |H(ej0.2π )| = 0.707, which is
(4.83)
the desired response.
• From (4.83): The 2N poles of H(s) H(−s) occur on a
circle of radius Ωc at equally spaced points in the s-plane.
4.5.3 Characteristics of commonly used analog filters
• The N poles for n = 0, . . . , N − 1 in (4.83) are located in
• Design of a digital filter can be reduced to design an the left half of the s-plane and belong to H(s).
appropriate analog filter and then performing the conversion • The N remaining poles lie in the right half of the s-plane and
from H(s) to H(z). belong to H(−s) (stability!).
• In the following we briefly discuss the characteristics of • Furthermore, a Butterworth filter has N zeros at Ω → ∞.
commonly used analog (lowpass) filters.

139 140
Pole locations in the s-plane: for the design of the corresponding digital filter obtained via
bilinear transform.

Example:
Determine the order and the poles of a lowpass Butterworth filter that has a
−3 dB bandwidth of 500 Hz and an attenuation of 40 dB at 1000 Hz.

(from [Proakis, Manolakis, 1996])


• −3 dB frequency Ωc = 2 π · fc = 1000 π ,
Frequency responses (ω → Ω, |H(Ωp)|2 = 1/(1 + ǫ2))
• stopband frequency Ωs = 2 π · fs = 2000 π ,

• attenuation of 40 dB → δ2 = 0.01.

From (4.84) we then obtain

log10 (104 − 1)
N = = 6.64
2 log10 2

In order to be on the safe side we choose N = 7.


(from [Proakis, Manolakis, 1996])
Properties of the resulting digital filter designed with butter for N = 7,
Estimation of the required filter order N : fsamp = 8000 Hz, and the above parameters (continuous-time filter
transformed by bilinear transform into the discrete-time domain):
At the stopband edge frequency Ωs (4.82) can be written as
Magnitude frequency response Transition band
1 2 0 1
= δ2 ,
1 + (Ωs/Ωc)2N

20 log10 |H(ejω )| [dB] →


−20 0.8

|H(ejω )| →
−40 0.6
which leads to
log((1/δ22)
− 1) −60 0.4
N = . (4.84)
2 log(Ωs/Ωc) −80 0.2

−100 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0 0.05 0.1 0.15 0.2 0.25
MATLAB commands: buttord for order estimation, butter ω/π → ω/π →

141 142
Phase response Pole/zero locations The Chebyshev polynomials can be obtained by the recursive
0
1 equation
0.5
arg H(ejω ) [rad] →

−5 TN +1(x) = 2 x TN (x) − TN −1(x), N = 1, 2, . . .

Im{z}
0

−10
−0.5
Examples:
• T0(x) = 1, T1(x) = cos(cos−1(x)) = x
−1
• T2(x) = cos(2 cos−1(x)) = 2cos2(cos−1x) − 1
−15 −1 −0.5 0 0.5 1
0 0.2 0.4 0.6 0.8 1
ω/π → Re{z}

= 2 x2 − 1
Chebyshev filters
• T3(x) = cos(3 cos−1(x))
Two types of Chebyshev filters: = 4 cos3(cos−1x) − 3 cos(cos−1(x)) = 4 x3 − 3 x
• Type 1 filters are all-pole filters with equiripple behavior • ...
in the passband and monotonic characteristic (similar to a ⇒ TN (x) represents a polynom of degree N in x.
Butterworth filter) in the stopband. ⇒ Chebyshev behavior (minimizing the maximal error) in the
• Type 2 filters have poles and zeros (for finite s), and equiripple passband (or in the stopband for type 2 filters).
behavoir in the stopband, but a monotonic characteristic in the
The filter parameter ǫ in (4.85) is related to the passband ripple:
passband.
For N odd, TN (0) = 0 → |H(0)|2 = 1,
Type 1 Chebyshev filter: for N even, TN (0) = 1 → |H(0)|2 = 1+ǫ 1
2

Squared magnitude frequency response: At the passband edge frequency Ω = Ωp we have TN (1) = 1,
such that
2 1 s
|H(Ω)| = , (4.85) 1 1
1 + ǫ2 TN2 (Ω/Ωp) √ = 1−δ1 ⇐⇒ ǫ = − 1, (4.87)
1+ǫ 2 (1 − δ1)2
where ǫ is a parameter related to the passband ripple, and TN (x)
is the N -th order Chebyshev polynomial defined as which establishes a relation between the passband ripple δ1 and
the parameter ǫ.
(
cos(N cos−1(x)) for |x| ≤ 1, Typical squared magnitude frequency response for a Chebyshev
TN (x) = −1
(4.86)
cosh(N cosh (x)) for |x| > 1. type 1 filter:

143 144
Estimation of the filter order:
Chebyshev filter only depend on the parameters N , ǫ, δ2, and the
ratio Ωs/Ωp. Using these values, it can be shown that the required
order can be estimated as
 q q  
log 2 2 2
1 − δ2 + 1 − δ2 (1 + ǫ ) /(ǫ δ2)
N = h p i .
log Ωs/Ωp + (Ωs/Ωp)2 − 1
(from [Proakis, Manolakis, 1996]) (4.89)
MATLAB commands:
Type 2 Chebyshev filter: • Order estimation: cheb1ord for type 1, cheb2ord for
type 2.
Squared magnitude frequency response:
• Design of the corresponding digital filter, obtained from the
2 1 analog version by bilinear transform: cheby1 for type 1,
|H(Ω)| = (4.88)
1 + ǫ2 [TN2 (Ωs/Ωp)/TN2 (Ωs/Ω)] cheby2 for type 2.

⇒ contains zeros at s < ∞ and poles Elliptic (Cauer) filters


Typical squared magnitude frequency response for a Chebyshev • Elliptic filters have equiripple (Chebyshev) behavior in both
type 2 filter: pass- and stopband.
• Transfer function contains both poles and zeros, where the
zeros are located on the jΩ-axis.
• Squared magnitude frequency response

2 1
|H(Ω)| = , (4.90)
1 + ǫ2 UN (Ω/Ωp)

where UN (x) denotes the Jacobian elliptic function of order


N , and the parameter ǫ controls the passband ripple.
(from [Proakis, Manolakis, 1996])
• Characteristic squared magnitude frequency response for a
elliptic filter:

145 146
5. Multirate Digital Signal Processing

• In many practical signal processing applications different


sampling rates are present, corresponding to different
bandwidths of the individual signals → multirate systems.

• Often, a signal has to be converted from one rate to another.


Æ22 Æ22
This process is called sampling rate conversion.
(from [Proakis, Manolakis, 1996]) – Sampling rate conversion can be carried out by analog
• Filter design is optimal in pass- and stopband in the equiripple means, that is D/A conversion followed by A/D conversion
sense: However, other types of filters may be preferred due to using a different sampling rate → D/A converter
their better phase response characteristics (i.e. approximately introduces signal distortion, and the A/D converter leads
linear-phase), for example the Butterworth filter. to quantization effects.
– Sampling rate conversion can also be carried out
Estimation of the filter order:
completely in the digital domain: Less signal distortions,
Required order to achieve the specifications
√ with the parameters more elegant and efficient approach.
δ1,√δ2 and Ωp/Ωs, (1 − δ1 = 1/ 1 + ǫ2, 1 − δ2 =
1/ 1 + δ 2): • ⇒ Topic of this chapter is multirate signal processing and
p sampling rate conversion in the digital domain.
K(Ωp/Ωs) K( 1 − (ǫ/δ)2)
N = p (4.91)
K(ǫ/δ) K( 1 − (Ωp/Ωs)2) 5.1 Basic multirate operations
where K(x) denotes the complete elliptic integral of the first kind 5.1.1 Sampling rate reduction
(tabulated)
Reduction of the sampling rate (downsampling) by factor M :
Zπ/2
dθ Only every M -th value of the signal x(n) is used for further
K(x) = p . processing, i.e. y(m) = x(m · M )
1 − x 2 sin2 θ
0 .
MATLAB commands: ellipord for order estimation, ellip x(n) ↓M y(m)
for the design of the corresponding digital filter obtained via .
bilinear transform.
Example: Sampling rate reduction by factor 4
147 148
With (5.3) the z-transform X0(z) can be obtained as


X −m
X0(z) = x0(m)z
m=−∞

M −1 ∞
1 X X k −m
= x(m)(WM z) . (5.4)
M k=0 m=−∞

By replacing Y (z M ) = X0(z) in (5.4) we have for the z-


(from [Fliege: Multiraten-Signalverarbeitung, 1993]) transform of the downsampled sequence y(m)

In the z-domain we have



X
M −mM M −1
X0(z) = X0(z ) = x(mM )z 1 XM k
Y (z ) = X(zWM ). (5.5)
m=−∞ M k=0

X M −m
= y(m)(z )
m=−∞ With z = ejω and ω ′ = ωM the corresponding frequency
M ′ response can be derived from (5.5):
= Y (z ) = Y (z ) •−◦ y(m) (5.1)

Frequency response after downsampling


M −1
Starting point: orthogonality of the complex exponential sequence jω ′ 1 X j(ω ′ −k2π)/M )
Y (e )= X(e ) (5.6)
M −1
( M k=0
1 X j2πkm/M 1 for m = λM, λ ∈ ZZ,
e = (5.2)
M k=0 0 otherwise.
⇒ Downsampling by factor M leads to a periodic repetition of
With x0(mM ) = x(mM ) it follows the spectrum X(ejω ) at intervals of 2π/M (related to the high
sampling frequency).
M −1
1 X −km −j2π/M
x0(m) = x(m) W , WM := e (5.3) Example: Sampling rate reduction of a bandpass signal
M k=0 M by M = 16 (Ω → ω )

149 150
a) ⇒ Antialiasing filtering followed by downsampling is often
|Q(e jΩ)|
|Q(e jΩ)| ⋅ |H(e jΩ)| = |X(e jΩ)| called decimation.
Specification for the desired magnitude frequency response of the
0 π Ω = 3π π 2π Ω lowpass antialiasing (or decimation) filter:
m
8 8
b) (
|X(e j(Ω+Ωm))| jω 1 for |ω| ≤ ωc/M,
|Hd(e )| = (5.7)
0 for π/M ≤ |ω| ≤ π,
0 π Ω = 3π π 2π Ω
m
8 8 where ωc < π denotes the highest frequency that needs to be
c)
preserved in the decimated signal.
Downsampling in the frequency domain, illustration for M = 2:
π Ω = 3π (a) input and filter spectra, (b) output of the decimator, (c) no
0 m π 2π Ω
8 8 filtering, only downsampling (V → X ):
0 2π 16 π 32π Ω´
(from [Vary, Heute, Hess: Digitale Sprachsignalverarbeitung, 1998])

(a) Bandpass spectrum X(e ) is obtained by filtering.
(b) Shift to the baseband, followed by decimation with M = 16.

(c) Magnitude frequency response |X(ejω )| at the lower sampling rate.
Remark: Shifted versions of X(ejω ) are weighted with the factor
1/M according to (5.6).
Decimation and aliasing
If the sampling theorem is violated in the lower clock rate,
we obtain spectral overlapping between the repeated spectra ⇒
Aliasing
How to avoid aliasing? Bandlimitation of the input signal v(n)
prior to the sampling rate reduction with an antialiasing filter
h(n) (lowpass filter).
.
x(n)
v(n) h(n) ↓M y(m)
. (from [Mitra, 2000])

151 152
More general approach: Sampling rate reduction with phase Using (5.8) we have
offset
M −1
1 X −k(m−ℓ)
Up to now we have always used y(0) = x(0), now we introduce xℓ(m) = x(m) WM , (5.9)
an additional phase offset ℓ into the decimation process. M k=0

Example for ℓ = 2 and transforming (5.9) into the z-domain yields


M −1 ∞
1 X X k −m kℓ
Xℓ(z) = x(m)(WM z) WM
M k=0 m=−∞
M −1
1 X k kℓ
= X(zWM ) WM . (5.10)
M k=0

The frequency response can be obtained from (5.10) by


substituting z = ejω and ω ′ = M ω as
M −1
jω ′ 1 X j(ω ′ −2πk)/M kℓ
Yℓ(e )= X(e ) WM , (5.11)
` ` ` M k=0
0 1 2 3  = m `=M M −1
jM ω 1 X jω−j2πk/M kℓ
(from [Fliege: Multiraten-Signalverarbeitung, 1993]) Yℓ(e )= X(e ) WM . (5.12)
M k=0
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 ⇒ We can see that each repeated spectrum is weighted with a
obtained by assuming integer sample locations. complex exponential (rotation) factor.
Derivation of the Fourier transform of the output signal y(m): 5.1.2 Sampling rate increase
Orthogonality relation of the complex exponential sequence: Increase of the sampling rate by factor L (upsampling): Insertion
( of L − 1 zero samples between all samples of y(m)
M −1
1 X j2πk(m−ℓ)/M 1 for m = λM + ℓ, λ ∈ ZZ, (
e = y(n/L) for n = λL, λ ∈ ZZ,
M k=0 0 otherwise. u(n) = (5.13)
(5.8) 0 otherwise.

153 154
.
y(m) ↑L u(n)
.
Notation: Since the upsampling factor is named with L in conformance with
ω′
the majority of the technical literature in the following we will denote the length
of an FIR filter with LF .

Example: Sampling rate increase by factor 4


ω

(from [Fliege: Multiraten-Signalverarbeitung, 1993])

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
(from [Fliege: Multiraten-Signalverarbeitung, 1993])
interpolation filter.
In the z-domain the input/output relation is .
u(n)
y(m) ↑L g(n) v(n)
L .
U (z) = Y (z ). (5.14)
g(n): Interpolation or antiimaging lowpass filter
Frequency response after upsampling
Specifications for the interpolation filter:
From (5.14) we obtain with z = ejω
Suppose y(m) is obtained by sampling a bandlimited continuous-
jω jLω time signal ya(t) at the Nyquist rate (such that the sampling
U (e ) = Y (e ). (5.15)
theorem is just satisfied). The Fourier transform Y (ejω ) can thus
be written with (2.4) and Ω = ω/T0 as
⇒ The frequency response of y(m) does not change by
upsampling, however the frequency axis is scaled differently. The ∞  
jω 1 X j(ω − 2πk)
new sampling frequency is now (in terms of ω ′ for the lower Y (e ) = Ya ,
sampling rate) equal to L · 2π . T0 k=−∞ T0

155 156
where T0 denotes the sampling period. If we instead sample ya(t) Upsampling in the frequency domain, illustration for L = 2:
at a much higher rate T = T0/L we have (a) input spectrum, (b) output of the upsampler, (c) output after
interpolation with the filter h(n):
∞  
jω 1 X j(ω − 2πk)
V (e ) = Ya , (5.16)
T k=−∞ T
∞  
L X j(ω − 2πk)
= 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ω jωL
U (e ) = Y (e ).

⇒ If u(n) is passed through an ideal lowpass filter with cutoff


frequency at π/L and a gain of L, the output of the filter will be
precisely v(n) = F −1{V (ejω )} in (5.16).
Therefore, we can now state our specifications for the lowpass
interpolation filter: (from [Mitra, 2000])
(
jω L for |ω| ≤ ωc/L,
|Gd(e )| = (5.17) 5.1.3 Example: Decimation and interpolation
0 for π/L ≤ |ω| ≤ π,
Consider the following structure:
where ωc denotes the highest frequency that needs to be .
u(n) y(m) v(n)
preserved in the interpolated signal (related to the lower sampling x(n) h(n) ↓M ↑M f (n) x̂(n)
frequency). .

Input-output relation?

Relation between Y (z) and U (z) (see (5.5)), where z is replaced

157 158
by z 1/M : Example:
M −1
1 X 1/M k M = 4, no aliasing:
Y (z) = U (z WM ),
M k=0 F
which by using U (z) = H(z)X(z) leads to

M −1
1 X 1/M k 1/M k
Y (z) = H(z WM ) X(z WM ). (5.18)
M k=0

With V (z) = Y (z M ) it follows

M −1
1 X k k
V (z) = H(zWM ) X(zWM ), (5.19)
M k=0

and we finally have

M −1
M1 X k k
X̂(z) = F (z)Y (z ) = F (z) H(zWM ) X(zWM ).
M k=0
with aliasing:
(5.20)

(from [Mertins: Signal Analysis, 1999])

5.1.4 Polyphase decomposition


• A polyphase decomposition of a sequence x(n) leads to M
subsequences xℓ(m), ℓ = 0, . . . , M − 1, which contain

159 160
only every M -th value of x(n). Example for M = 2:
Decomposition into an even and odd subsequence.
x0(0) = x(0), x0(1) = x(3), ...
• Important tool for the derivation of efficient multirate filtering
structures later on. x1(0) = x(1), x1(1) = x(4), ...

Three different decomposition types: x2(0) = x(2), x2(1) = x(5), ...

• Type-1 polyphase components: • Type-2 polyphase components:


Decomposition of x(n) into xℓ(m), ℓ = 0, 1, . . . , M − 1
with M −1
X −(M −1−ℓ) ′ M
X(z) = z Xℓ(z ) (5.23)
xℓ(m) = x(mM + ℓ), n = mM + ℓ. (5.21) ℓ=0

With xℓ(m) ◦−• Xℓ(z) the z-transform X(z) can be ′ ′


with Xℓ(z) •−◦ xℓ(n) = x(nM + M − 1 − ℓ) (5.24)
obtained as
Example for M = 3:
M
X −1
−ℓ M ′ ′
X(z) = z Xℓ(z ) (5.22) x0(0) = x(2), x0(1) = x(5), ...
ℓ=0 ′ ′
x1(0) = x(1), x1(1) = x(4), ...
′ ′
Example for M = 3: x2(0) = x(0), x2(1) = x(3), ...

x(n) • Type-3 polyphase components:


n
0 1 2

M
X −1
x0 (m)
ℓ M
0 1 2
m X(z) = z X̄ℓ(z ) (5.25)
ℓ=0
x1 (m)
m
0 1 2
with X̄ℓ(z) •−◦ x̄ℓ(n) = x(nM − ℓ) (5.26)
x2 (m)
m
0 1 2

161 162
5.1.5 Nyquist-Filters Properties:
Nyquist- or L-band filters: • Impulse response of a zero-phase L-th band filter:
• Used as interpolator filters since they preserve the nonzero (
samples at the output of the upsampler also at the interpolator α for n = 0,
g(Ln) = (5.28)
output. 0 otherwise.
• Computationally more efficient since they contain zero
coefficients. ⇒ every L-th coefficient is zero (except for n = 0) →
• Preferred in interpolator and decimator designs. computationally attractive
g(n)
.
u(n)
y(m) ↑L g(n) v(n)
.
n
Using (5.14) the input-output relation of the interpolator can be
stated as V (z) = G(z) Y (z L). (from [Mitra, 2000])

The filter G(z) can be written in polyphase notation according to • It can be shown for α = 1/L that for a zero-phase L-th band
filter
L −1 L −(L−1) L
G(z) = G0(z ) + z G1(z ) + · · · + z GL−1(z ), L−1
X ℓ
G(zWL) = Lα = 1. (5.29)
where the Gℓ(z), ℓ = 0, . . . , L−1 denote the type 1 polyphase ℓ=0
components of the filter G(z).
⇒ The sum of all L uniformly shifted versions of G(ejω )
Suppose now that the m-th polyphase component of G(z) is a
add up to a constant.
constant, i.e. Gm(z) = α. Then the interpolator output V (z) z = ejω
can be expressed as
G(z) G(zWL ) G(zWL2 ) G(zWLL−1 )
L−1
X
−m L −ℓ L L
V (z) = αz Y (z ) + z Gℓ(z )Y (z ).
ℓ=0, ℓ6=m ω
(5.27) (from [Mitra, 2000])
⇒ v(Ln+m) = αy(n); the input samples appear at the output
of the system without any distortion for all n. All in-between Half-band filters
(L − 1) samples are determined by interpolation. Special case of L-band filters for L = 2:

163 164
• Transfer function G(z) = α + z −1G1(z 2) The convolution with the length LF FIR filter h(n) can be
• For α = 1/2 we have from (5.29) for the zero-phase filter described as
g(n) LF −1
X
G(z) + G(−z) = 1. (5.30) x(n) = h(k) · v(n − k),
k=0
• If g(n) is real-valued then G(−ejω ) = G(ej(π−ω)) and by
using (5.30) it follows and the downsampling with y(m) = x(m M ). Combining both
equations we can write the decimation operation according to
jω j(π−ω)
G(e ) + G(e ) = 1. (5.31) LF −1
X
y(m) = h(k) · v(m M − k). (5.32)
jω k=0
⇒ G(e ) exhibits a symmetry with respect to the half-band
frequency π/2 → halfband filter. Visualization (M = 3):
G(ejω )
h(k)
h(0) h(LF −1)

k
v(−k)
v(0)
⇒ x(0) → y(0)
ω
ωp ωs k
v(1 − k)
(from [Mitra, 2000])
v(0)
⇒ x(1) is removed
• FIR linear-phase halfband filter: Length is restricted to
k
LF = 4λ − 1, λ ∈ IN v(2 − k)

v(0)
⇒ x(2) is removed
5.2 Structures for decimation and interpolation
k
5.2.1 FIR direct form realization for decimation v(3 − k)
v(0)
⇒ x(3) → y(1)
.
x(n) k
v(n) h(n) ↓M y(m)
.

165 166
⇒ Multiplication of h(n) with v(1 − n) and v(2 − n) leads to which is depicted in the following:
the results x(1) and x(2) which are discarded in the decimation g(k)
process → these computations are not necessary.
More efficient implementation (v(n) → u(n), LF → N ):
k
y(−m)

m
u(−k)

⇒ v(0)
k

(from [Fliege: Multiraten-Signalverarbeitung, 1993]) ⇒ The output sample v(0) is obtained by multiplication of g(n)
(a) Antialiasing FIR filter in first direct form followed by with u(−n), where a lot of zero multiplications are involved,
downsampling. which are inserted by the upsampling operation.
(b) Efficient structure obtained from shifting the downsampler More efficient implementation (v(n) → x(n), LF → N ):
before the multipliers:
• Multiplications and additions are now performed at the lower
sampling rate.
• Additional reductions can be obtained by exploiting the
symmetry of h(n) (linear-phase).
5.2.2 FIR direct form realization for interpolation
.
u(n)
y(m) ↑L g(n) v(n)
. (a) Upsampling followed by interpolation FIR filter in second
The output v(n) of the interpolation filter can be obtained as direct form
(b) Efficient structure obtained from shifting the upsampler behind
LF −1
X the multipliers:
v(n) = g(k) · u(n − k),
k=0 • Multiplications are now performed at the lower sampling

167 168
rate, however the output delay chain still runs in the higher
sampling rate. (a): Decimator with decimation filter in polyphase representation
• Zero multiplications are avoided. (b): Efficient version of (a) with M times reduced complexity
• Additional reductions can be obtained by exploiting the
Remark: The structure in (b) has the same complexity as the direct
symmetry of h(n) (linear-phase).
form structure from Section 5.2.1, therefore no further advantage.
5.3 Decimation and interpolation with polyphase filters However, the polyphase structures are important for digital filter
5.3.1 Decimation banks which will be discussed later on.
• From Section 5.1.4 we know that a sequence can be Structure (b) in time domain (v(n) → u(n)):
decomposed into polyphase components. Here type-1
polyphase components (5.21) are considered in the following.
• Type-1 polyphase decomposition of the decimation filter
h(n): The z-transform H(z) can be written according to
(5.22) as
M
X −1
−ℓ M
H(z) = z Hℓ(z ), (5.33)
ℓ=0
M denoting the downsampling factor and

Hℓ(z ) •−◦ hℓ(m) the z-transform of the type-1 polyphase
components hℓ(m), ℓ = 0, . . . , M − 1.
Resulting decimator structure (V (z) → U (z)):

Y (z )
0
Y (z )
0

(z 0 )

(z 0 )

(z 0 )
(from [Fliege: Multiraten-Signalverarbeitung, 1993])

(z 0 ) 5.3.2 Interpolation
(from [Fliege: Multiraten-Signalverarbeitung, 1993]) Transfer function of the interpolation filter can be written analog

169 170
to (5.33) for the decimation filter as z −1 for every sampling rate in a multirate system in the following (instead of
introducing a special z for each sampling rate as in the sections before).
L−1
X −ℓ L • In practice often there are applications where data has to be
G(z) = z Gℓ(z ),
ℓ=0 converted between different sampling rates with a rational
ratio.
L denoting the upsampling factor, and gℓ(m) the type-1 • Noninteger (synchronous) sampling rate conversion by factor
polyphase components of g(n) with gℓ(m) ◦−• Gℓ(z ′). L/M : Interpolation by factor L, followed by a decimation
Resulting interpolator structure (V (z) → X(z)): by factor M ; decimation and interpolation filter can be
combined:
.
Y1(z) X1(z) X (z)
Y (z )
0
Y (z ) 0
Y (z) "L G(z) #M
(z 0 ) .

(z 0 )
• Magnitude frequency responses:

(z 0 )

(z )
0

ω
(from [Fliege: Multiraten-Signalverarbeitung, 1993])

ω
(a): Interpolator with interpolation filter in polyphase
representation
(b): Efficient version of (a) with L times reduced complexity ω

As in the decimator case the computational complexity of the


ω
efficient structure in (b) is the same as for the direct form
interpolator structure from Section 5.2.2. (from [Fliege: Multiraten-Signalverarbeitung, 1993])

5.4 Noninteger sampling rate conversion Efficient conversion structure


Notation: For simplicity a delay by one sample will be generally denoted with In the following derivation of the conversion structure we assume

171 172
a ratio L/M < 1. However, a ratio L/M > 1 can also be used (c) Finally, if M and L are coprime, it can be shown that up-
with the dual structures. and downsampler may be exchanged in their order:
1. Implementation of the filter G(z) in polyphase structure, .

shifting of all subsamplers into the polyphase branches: G (z) z` 0 #M "L z m0
.

(d) In every branch we now have a decimator (marked with the


dashed box), which can again be efficiently realized using
the polyphase structure from Section 5.3.1. Thus, each
type-1 polyphase component gλ(n) is itself decomposed
again in M polyphase components gλµ(n) ◦−• Gλµ(z),
λ = 0, . . . , L − 1, µ = 0, . . . , M − 1.
Resulting structure:
(from [Fliege: Multiraten-Signalverarbeitung, 1993])

2. Application of the following structural simplifications:


(a) It is known that if L and M are coprime (that is they have
no common divider except one) we can find ℓ0, m0 ∈ IN
such that

ℓ0 L − m0 M = −1 (diophantic equation) (5.34)

⇒ delay z −λ in one branch of the polyphase structure can


be replaced with the delay z λ(ℓ0 L−m0 M )
.
G (z) "L z `
( 0 L m0 M )
#M
.

(b) The factor z λℓ0L can be shifted before the upsampler, and
the factor z −λm0M behind the downsampler:
.
G (z) z` 0 "L #M z m0 (from [Fliege: Multiraten-Signalverarbeitung, 1993])
.
• Delays z −λm0 are realized with the output delay chain.

173 174
• The terms z λℓ0 are noncausal elements: In order to obtain a presented methods can easily be extended to band- or highpass
causal representation, we have to insert the extra delay block filters.
z −(L−1)ℓ0 at the input of the whole system, which cancels out
the ”negative” delays z λℓ0 . 5.5.1 Filtering with lower sampling rate

• Polyphase filters are calculated with the lowest possible If the stopband edge frequency of a lowpass filter is substantially
sampling rate. smaller than half of the sampling frequency, it may be advisable
to perform the filtering at a lower sampling rate:
• L/M > 1 is realizable using the dual structure (exchange:
input ↔ output, downsamplers ↔ upsamplers, summation .

points ↔ branching points, reverse all branching directions) V (z) f s


H (z)
d # M fs1 = fs =M
H (z)

f s1
" M H (z)
i
f Y (z)
s

Example for L = 2 and M = 3: H (z)


Application: Sampling rate conversion for digital audio signals
Hd(z) is the (input) decimation filter, the actual filtering is carried
from 48 kHz to 32 kHz sampling rate
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:

(from [Fliege: Multiraten-Signalverarbeitung, 1993])


j dj j ij
H ; H

Polyphase filters are calculated with 16 kHz sampling rate


j jH
compared to 96 kHz sampling rate in the original structure. f

fpass fstop 2
fs1 = fs1 fstop fs1
Rate conversion from 32 kHz to 48 kHz: Exercise!
• Stop- and passband edge frequencies fstop and fpass of the
5.5 Efficient multirate filtering core filter Hc(z) are identical with those for the overall filter
In the following we only consider lowpass filtering, however, the H(z) = Y (z)/V (z).

175 176
• Stopband edge frequency for the decimation filter then has to 5.5.2 Interpolating FIR (IFIR) filters
be chosen less or equal than (fs1 −fstop). Alternative to multirate filters with decimation and interpolation,
• The interpolation filter can be chosen identical to the also suitable for very narrowband filters.
decimation filter, since then it is guaranteed that all imaging
components are in the stopband region of the interpolation Principle:
.
filter.
V (z ) G(z K ) F (z ) Y (z )
• Transition bandwidth for H(z) is M -times smaller than for .

Hc(z) ⇒ design with a fairly small number of coefficients H (z )


for Hc(z) possible (compared to a direct design of H(z)).
• No real multirate filter since both filters are calculated with the
• Stopband ripple δ2 for the overall filter H(z): same (input) sampling rate. Multirate technique is applied to
( the coefficients of the impulse response h(n).
δ2,c (1 + δ1,i )(1 + δ1,d ) ≈ δ2,c , fstop ≤ f ≤ (fs1 −fstop ),
δ2 =
δ2,c δ2,d δ2,i , (fs1 −fstop ) < f ≤ fs
• Realization of G(z K ) in the first direct structure:
z −K z −K z −K z −K z −K z −K
(5.35) v(n)

where the approximation for fstop ≤ f ≤ (fs1 −fstop) holds


g(0) g(1) g(2) g(3) g(LF −2) g(LF −1)
for small decimation and interpolation filter passband ripples
δ1,d and δ1,i. y(n)

K −1
• Passband ripple δ1 for H(z): G(z ) is a function where all z are replaced by z −K ,
which is equivalent to inserting K − 1 zeros between the
1 + δ1 = (1 + δ1,c) (1 + δ1,d) (1 + δ1,i), coefficients of G(z).
(5.36) • G(ejω ) → G(ejKω ): Frequency response G(ejω ) is
approximation
”compressed” by factor K , K−1 imaging spectra are present:
=⇒ δ1 ≈ δ1,c + δ1,d + δ1,i, (5.37) |G(ejω )|

where the last approximation is valid for small passband


ω
ripples δ1,c, δ1,d, and δ1,i. jKω
|G(e )|
• Complexity savings (#multiplications and #additions) can be
obtained by roughly a factor of 100. An even higher gain can
ω
be achieved by multistage implementations.
(from [Fliege: Multiraten-Signalverarbeitung, 1993])

177 178
Furthermore, the transition bandwidth and the width of the interpolation filter F (z):
the passband for G(ejKω ) are K -times smaller than for

the original filter G(ejω ) with the same number of filter ωp,F = ωp, ωs,F = − ωs. (5.39)
coefficients. K
• The filter F (z) removes the imaging spectra, and • Passband ripple δ1 for H(z):
H(z) = G(z K ) · F (z) only consists of the baseband
1 + δ1 = (1 + δ1,G) (1 + δ1,F ). (5.40)
part of G(ejKω ).

Design: Starting point for the design: Passband and stopband Small passband ripples δ1,G for G(z) and δ1,F for F (z),
edge frequencies ωs, ωp for the overall filter H(z) → search for resp., lead to the simplification
a suitable factor K leading to a less complex interpolation filter δ1 ≈ δ1,G + δ1,F . (5.41)
f (n).
• Stopband ripple δ2 for H(z):
Filter specifications (H, F, G are all magnitude frequency responses) (
δ2,G (1 + δ1,F ) for ωs ≤ ω ≤ ωs,F ,
δ2 = (5.42)
δ2,F (1 + δ1,G) for ωs,F < ω ≤ π.
Kωp Kωs ω
For small passband ripples δ1,G, δ1,F we have approximately

δ2 ≈ δ2,F = δ2,G. (5.43)


ωp ωs ω Example:
(from [Fliege: Multiraten-Signalverarbeitung, 1993]) Design a lowpass IFIR filter with the following specifications:

ωd = 0.05π, ωs = 0.1π,
20 log10 (1 + δ1 ) = 0.2 dB → δ1 ≈ 0.023, 20 log10 (|δ2 |) = −40 dB
• Requirements for passband and stopband edge frequency of
the prototype G(z): 1. We select a factor K = 4: Prototype G(z) has the parameters

ωp,G = 0.2π, ωs,G = 0.4π,


ωp,G = K · ωp, ωs,G = K · ωs. (5.38)
δ1G ≈ 0.0116 → 20 log10 (1+δ1,G ) ≈ 0.1 dB,

• Requirements for passband and stopband edge frequency of 20 log10 (|δ2,G |) = −40 dB,

179 180
ripple is equally distributed between G(z) and F (z), see (5.41). Impulse response Magnitude frequency response
0.4
2. We use an linear-phase FIR Chebyshev design and insert these values for
0
G(z) into (4.73), yielding a filter order N = 19. However, several test

20 log10 |G(ejKΩ)| [dB] →


0.3

designs show that the above specifications are only met for N = 21, 0.2 −20
leading to a filter length of LF = N +1 = 22.

g1(n) →
0.1
−40
Impulse response Magnitude frequency response 0
0.4 −60
0 −0.1
0.3

20 log10 |G(ejΩ)| [dB] →


−0.2 −80
0 20 40 60 80 0 0.2 0.4 0.6 0.8 1
0.2 −20 n → ω/π →
g(n) →

0.1
−40
5. Final IFIR filter h(n) = g1 (n) ∗ f (n):
0 Magnitude frequency response Passband detail
−60
−0.1 1.02
0

20 log10 |H(ejω )| [dB] →


−0.2 −80
0 5 10 15 20 0 0.2 0.4 0.6 0.8 1 1.01
n → ω/π → −20

|H(ejω )| →
3. Specifications for the interpolation filter F (z): 1
−40

2π 0.99
ωp,F = ωp = 0.05π, ωs,F = − ωs = 0.4π, −60
K 0.98
−80
20 log10 (1 + δ1,F ) ≈ 0.1 dB, 20 log10 (|δ2,F |) = −40 dB. 0 0.2 0.4 0.6 0.8 1 0 0.02 0.04 0.06
ω/π → ω/π →

⇒ resulting filter order ((4.73)) N = 12: 6. H(z) in the IFIR realization has an overall length of 35 coefficients. On
the other hand we obtain from (4.73) an estimated length of 65 coefficients
Impulse response Magnitude frequency response for the direct form implementation.
0.3
0
5.6 Application: Oversampled A/D and D/A converter
20 log10 |F(ejΩ)| [dB] →

0.2
−20 5.6.1 Oversampled A/D converter
f(n) →

0.1
−40 Extension of the A/D and D/A conversion concepts from
0 −60
Section 2.
Structure:
−0.1 −80
0 2 4 6 8 10 12 0 0.2 0.4 0.6 0.8 1
n → ω/π → x(t) R
x(nT /2L ) = xL (n) Q[xL (n)] ŷ(n) y(n)
Q
C h(n) ↓ 2L
L b bit
4. Upsampling of the impulse response g(n) by factor K = 4 → T /2

g1 (n) ◦−• G(ejKω ): A/D converter

181 182
• Continuous-time input signal is band-limited by the analog The filtering with the lowpass h(n) now reduces the quantization
lowpass such that the frequency ωu represents the maximum noise variance by factor 2L, since
frequency in the interesting frequency range for the input
π/2 L
signal: Z
2 1 (L) jω 2−2b+2
L
Sampling with a sampling frequency 2 · ωs ≥ 2 · ωu, σe = Φee (e ) dω = . (5.44)
(L,b) 2π 12 · 2L
L ∈ {0, 1, 2, . . . }, after the analog filtering. Here ωs −π/2L
denotes the lowest possible sampling frequency in order not
to violate the sampling theorem: ωs = 2 · ωu = 2π/T . ⇒ Reduction of the noise variance due to oversampling by
factor 2L:
• A/D converter here is idealized as concatenation of sampler  
and quantizer. σe2
Gain = 10 log10  2  = 10 log10(2L) = L·3.01 dB.
• After A/D conversion a lowpass filtering is carried out where σe
(L,b)
the lowpass has the idealized frequency response
(5.45)
( ⇒ An increase of the oversampling factor 2L by factor 2 leads to
jω 1 for |ω| < π/2L,
|H(e )| = an increase in quantizer resolution by half a bit (compare (2.29))
0 otherwise. and to an increase of the signal-to-noise ratio (SNR) in (2.29) by
3 dB!
The resulting bandlimited signal can then be downsampled by Visualization:
factor 2L. jω
Φee (e )

σe2 11111111111111
00000000000000
Quantization noise variance of a b-bit midtreat quantizer 00000000000000
11111111111111
(a) 00000000000000
11111111111111
according to (2.27), where the range R of the quantizer is chosen 00000000000000
11111111111111
00000000000000
11111111111111
−π 0 π
ω
as R = 2:
2 2−2b+2
σe = . (L)
Φee (ejω )
12
As an alternative σe2 can also be obtained via the power spectral σe2 11
0000
11
00
1100
11
density (power spectrum) Φee(ejω ) as (b) 00
11
00
1100
11
0011
00
1100
11
− 2πL 0 π
π
ω
2L

2 1 jω
σe = Φee(e ) dω. Gain in (5.45) can also be used for reducing the quantizer

−π wordlength while keeping the SNR constant:

183 184
• Reduction of the hardware complexity of the core A/D Analysis:
converter
y(n) = [xL(n)]Q = Q̂[xL(n) − ê(n − 1)],
• Extreme case: Quantizer wordlength is reduced to b = 1 bit
→ only a simple comparator is necessary = xL(n) − ê(n − 1) + ê(n),

Requirements: = xL(n)+ ê(n) ∗ (1−δ(n−1)) (5.47)


−1
◦−• Y (z) = XL(z) + Ê(z)(1 − z ). (5.48)
σe2 2 −2bL +2
L
(L,bL ) !
= 1 = L −2b +2 → bL = b0 − , (5.46) Therefore, the z-transform of the overall quantization error
σe2 2 ·2 0 2
(0,b0 ) sequence can be expressed as
 
with bL denoting the quantizer wordlength for a given L leading E(z) = Ê(z) 1 − z
−1
,
to the same quantization noise variance as b0 for L = 0, bL ≤ b0.
Example: which leads to the quantization noise power spectrum
Given a b0 = 16 bit A/D converter, where the analog input signal is sampled
jω jω −jω 2
at the Nyquist rate. Choose the parameter L in the oversampled A/D converter Φee(e ) = Φêê(e )|1 − e | .
from above such that the same quantization noise variance for bL = 1 bit is
achieved. −2b+2
With Φêê(ejω ) = 2 12 (noise power spectrum of a b-bit
From (5.46) we obtain L = 30, leading to an oversampling factor of midtreat quantizer with range R = 2) we have
2L ≈ 109 .
jω 2−2b+2
Improvement: Shaping of the quantization noise Φee(e ) = (1 − cos(ω)). (5.49)
6
The quantizer in the above block is now replaced by the following −3
x 10
6
structure:
1/3⋅ 2−2b+2 →
5

xL (n) + x̂L (n) [xL (n)]Q

|Φee(e )| →
4


3
− +
2
ê(n)
z −1 1

0
0 0.2 0.4 0.6 0.8 1
Q ω/π →

185 186
⇒ Quantization noise power spectrum now has highpass ⇒ Improved noiseshaping by other techniques, where the
character → noiseshaping quantization noise power spectrum shows even stronger highpass
The noise variance after lowpass filtering with h(n) in the above character (sigma-delta modulation, more selective shaping filters).
oversampled A/D converter structure is now given with (5.49) as
5.6.2 Oversampled D/A converter
π/2 L
Z Structure:
2 1 jω
σe = Φee(e ) dω,
(L,b) 2π x(n)
↑ 2L
x̂L (n)
h(n)
xL (n)
Q
Q[xL (n)]
h1 (n)
−π/2L b bit b bit b1 < b bit
 
2−2b+2 −L+1 2 −L
= 2 − sin(2 π) . (5.50) y(t) R
12 π C
b1 bit
DAC

Reduction of the noise variance due to oversampling by factor 2L:


1. Input signal sampled with b bits is upsampled by factor 2L and
 
−L+1 2 −L then interpolated with h(n).
Gain = −10 log10 2 − sin(2 π) . (5.51)
π 2. The resulting signal xL(n) is requantized to a wordlength
of b1 < b bits, leading to a worse SNR due to higher
For L = 4: Gain ≈ 31 dB (compared to 12 dB without noise
quantization noise.
shaping, see (5.45)).
3. Filtering by h1(n) removes the quantization noise in the
Reducing the quantizer wordlength for constant SNR: unused spectral regions, which increases the SNR again.
σe2   4. The b1 bit DAC in combination with a simple analog lowpass
(0,b0 ) ! 1 −L+1 2 −L converts the signal back into the analog domain.
= 1 → bL = b0+ log2 2 − sin(2 π) .
σe2 2 π
(L,bL )
(5.52) Reason for performing a requantization: Use of a cheap low
resolution D/A converter is possible, often with b1 = 1 bit.
Example:
In combination with a noiseshaping approach the same SNR is
The above example is again carried out for the noiseshaping case: For
obtained as when a b bit converter would be used directly on the
b0 = 16 bit and bL = 1 bit we obtain from (5.52) via a computer search
input signal (but with higher costs).
(fix-point iteration) L ≈ 10.47 → When the input signal is sampled with
fs = 44.1 kHz and b0 = 16 the new sampling frequency in the oversampled ⇒ Favored converter principle in CD players (→ ”bitstream”
A/D converter would be fsover = 211 · fs ≈ 90 MHz for bL = 1. conversion for b1 = 1 bit)

187 188
5.7 Digital filter banks investigated in the following → simplified structure:
• A digital filter bank consists of a set of filters (normally y0 (m)
.

x(n) H0(z) ↓2 ↑2 F0(z) x̂(n)


lowpass, bandpass and highpass filters) arranged in a parallel
bank. H1(z) ↓2
y1 (m)
↑2 F1(z)
.
• The filters split the input signal x(n) into a number of subband
signals yk (n), k = 0, . . . , K − 1 (analysis filter bank).
⇒ Critically subsampled filter bank: The number of subband
• Subband signals are processed and finally combined in a equals the subsampling factor in every subband.
synthesis filter bank leading to the output signal x̂(n). Typical frequency responses for the analysis filters:
• If the bandwidth of the subband signal is smaller than the
bandwidth of the original signal, they can be downsampled
before processing → processing is carried out more efficiently.
.
u0 (n) y0 (m0 ) v0 (n)
x(n) h0 (n) ↓ M0 ↑ M0 f0 (n) x̂(n)

(from [Mitra, 2000])


subband processing

u1 (n) y1 (m1 ) v1 (n)


h1 (n) ↓ M1 ↑ M1 f1 (n)
Frequency responses of the subband signals (for ideal filters)
(Ω → ω ) :
b)

uK−1 (n) yK−1 (mK−1 ) vK−1 (n)


hK−1 (n) ↓ MK−1 ↑ MK−1 fK−1 (n)
a)
0 "0" 0 "0"
analysis filter bank synthesis filter bank X(ejΩ) 0 π 2π Ω
.
0 π 2π 3π 4π Ω´

c)
Subband processing: Quantization (wordlength reduction) → 0
0 1
π
"1" "0"
2π Ω
coding, (adaptive) filtering → equalization, . . . "1" 1 "1" 1
0 π 2π Ω
5.7.1 Two-channel filter banks: Structure and analysis 0 π 2π 3π 4π Ω´
(From [Vary, Heute, Hess: Digitale Sprachsignalverarbeitung, 1998])
Basic two-channel subband coder: (a): Magnitude frequency response of the input signal, (b) magnitude frequency
.

x(n) H0(z) ↓2 ↑2 F0(z) x̂(n)


Demultiplexer

Encoder Decoder
response of the lowpass, and (c) highpass branch after analysis filtering and
Multiplexer

Channel

H1(z) ↓2 Encoder Decoder ↑2 F1(z)


downsampling
.
⇒ Highpass subband: Baseband spectra in frequency reversed
Only the errors in the above system related to the filter bank are order

189 190
Analysis Replacing z by z 2 then leads to
How do we have to design the filters such that
2 1
Y (z ) = [H(z) X(z) + H(−z) X(−z)] ,
x̂(n) = x(n − D) holds? 2
where (5.53), (5.54) can be obtained by replacing H with H0 and
(D denotes the delay of the overall analysis-synthesis system in
H1, resp. 2
samples)
The connection between the subband signals and the reconstructed
We have the following relations:
signal is
21 h i
Y0(z ) = [H0(z) X(z) + H0(−z)X(−z)] (5.53) 2 2
2 X̂(z) = Y0(z ) F0(z) + Y1(z ) F1(z) , (5.56)
2 1
Y1(z ) = [H1(z) X(z) + H1(−z)X(−z)] (5.54) and finally by combining (5.56), (5.53), and (5.54) the input-
2
output relation for the two-channel filter bank writes
Proof:
These relations can be obtained from (5.18)
1
M −1
X̂(z) = [H0(z) F0(z) + H1(z) F1(z)] X(z)+
1 X 1/M k 1/M k
2
Y (z) = H(z WM ) X(z WM )
M k=0 1
+ [H0(−z) F0(z) + H1(−z) F1(z)] X(−z).
2
for M = 2. With
( (5.57)
k −j2πk/2 −jπk 1 for n even, (5.57) consists of two parts:
W2 =e =e =
−1 for n odd,
S(z) = [H0(z) F0(z) + H1(z) F1(z)] , (5.58)
we have G(z) = [H0(−z) F0(z) + H1(−z) F1(z)] (5.59)
1
1 X k 1/2 k 1/2
Y (z) = H((−1) z ) X((−1) z ) • S(z): Transfer function for the input signal X(z) through
2 k=0 the filter bank, desirable is
1h 1/2 1/2 1/2 1/2
i
= H(+z ) X(+z ) + H(−z ) X(−z ) . ! −D
2 S(z) = 2z . (5.60)
(5.55)

191 192
• G(z): Transfer function for the aliasing component X(−z), ⇒ Cancelation of all aliasing components
desirable is (no aliasing!) For the linear distortion transfer function S(z) one obtains by
inserting (5.62) into (5.58)
!
G(z) = 0. (5.61) 2
S(z) = H0 (z) − H0 (−z),
2

Two cases have now to be distinguished: that is, the prototype H0(z) has to be designed such that
1. If G(z) = 0, but S(z) 6= c z −D , then the reconstructed 2 2 ! −D
signal x̂(n) is free of aliasing, however, linear distortions are S(z) = H0 (z) − H0 (−z) ≈ 2z (5.64)
present.
is satisfied as good as possible → requirement for an ideal
2. If G(z) = 0 and S(z) = c z −D , then we have a perfect
(constant) overall frequency response for the whole analysis-
reconstruction (PR) system, except of a scaling factor c/2 and
synthesis system
an additional delay of D samples.
• Unfortunately, (5.64) can not be satisfied exactly with FIR
5.7.2 Two-channel quadrature-mirror filter (QMF) banks filters, but it can be approximated with an arbitrarily small
(Crosier, Esteban, Galand, 1976) error
Quadrature-mirror filter (QMF) banks allow the cancelation of ⇒ Linear distortions can be kept small
all aliasing components, but generally lead to linear distortions • Exception: (5.64) is satisfied exactly by using the prototype
(i.e. phase and amplitude distortions)
1 −1
H0(z) = √ (1 + z )
Starting point: Given (lowpass) prototype H0(z), all other filters 2
are chosen as
(Haar filter):
F0(z) = H0(z), H1(z) = H0(−z), F1(z) = −H1(z) 1 1
−1 −2 −1 −2 −1
(1 + 2z + z ) − (1 − 2z + z ) = 2z
(5.62) 2 2
Thus we have from (5.59) for the aliasing transfer function
• The magnitude frequency responses of highpass and lowpass
G(z) = H0(−z) F0(z) + H1(−z) F1(z) filter have for real-valued filter coefficients the mirror image
property (therefore the name QMF):
= H0(−z) H0(z) + H0(z)(−H0(−z)) = 0
(5.63) j( π
2 −ω) j( π
2 +ω)
|H1(e )| = |H0(e )| (5.65)

193 194
1.2 minimization approach for a given ∆ω and given prototype
|H0(ejω )| |H1(ejω )|
1
length LF .
• Catalogs with optimized filter coefficients for h0(n) may
0.8
|H(e )| → for example be found in [Akansu, Haddad: Multirate signal
0.6 decomposition, 1992].

0.4 • Once a good prototype H0(z) has been found, the remaining
0.2
filters can be obtained from (5.62).

0
Example: (LF = 20, ∆ω = 0.2π )
0 0.2 0.4 0.6 0.8 1
ω /π→
Impulse response h0 (n) Impulse response h1 (n)

Design of QMF banks 0.6 0.5

0.5
• Usually the design is carried out by minimization of an error 0.4
measure

h0(n) →

h1(n) →
0.3
! 0
E = Er + αEs = min. (5.66) 0.2

Er refers to the linear distortion error energy 0.1

Zπ   −0.1
0 5 10 15 20
−0.5
0 5 10 15 20
jω 2 j(ω−π) 2 n→ n→
Er = 2 |H0(e )| + |H0(e )| − 1 dω,
ω=0 Frequency responses for H0 , H1 Frequency response of the QMF bank
(5.67)
20 0.04
and Es to the energy in the stopband region of the filter |H (ejω )| |H (ejω )| 0.03
0 1
0

20 log |H(ejω )| [dB] →

20 log10|S(e jω )| [dB] →
0.02
Zπ −20
0.01
jω 2
Es = |H0(e )| dω, (5.68) −40 0

10
−0.01
ω=ωs −60
−0.02
−80
−0.03
with the stopband edge ωs = (π + ∆ω)/2. ∆ω denotes the
−100 −0.04
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
width of the transition band, which is symmetrically centered ω /π→ ω /π→

around ω = π/2.
• Minimization of (5.66) can be carried out via a numerical

195 196
Efficient realization using polyphase components yields
From (5.62) we know that H1(z) = H0(−z) holds for the
analysis highpass filter. Then, the type-1 polyphase components S(z) = H0(z) F0(z) + H1(z) F1(z)
H0ℓ(z) and H1ℓ(z), ℓ ∈ {0, 1}, are related according to = H0(z) F0(z) + (−1)
ℓ+1
H0(−z)F0(−z) (5.71)
H10(z) = H00(z) and H11(z) = −H01(z). (5.69) !
Condition for a linear distortion free system: S(z) = 2z −D
This leads to an efficient realization of the analysis and synthesis With the abbreviation
filter bank, where the number of multiplications and additions can
be reduced by factor four: T (z) := F0(z) H0(z) (5.72)

0
the PR condition in (5.71) becomes

ℓ+1 −D
0
T (z) + (−1) T (−z) = 2 z . (5.73)
(From [Mertins: Signal analysis, 1999])
Interpretation:
5.7.3 Two-channel perfect reconstruction filter banks
• [T (z) + T (−z)] refers to the z-transform of a sequence
In order to obtain a perfect reconstruction filter bank the analysis
whose odd coefficients are zero.
and synthesis filters are chosen as follows (ℓ ∈ {0, 1, 2, . . . }):
• [T (z) − T (−z)]: All coefficients with an even index are
−ℓ −ℓ zero.
F0(z) = z H1(−z), F1(z) = −z H0(−z)
• The PR condition in (5.71) now states that the corresponding
(5.70) sequences with z-transforms [T (z) + T (−z)] or
Aliasing transfer function: Inserting (5.70) into (5.59) yields [T (z) − T (−z)] are allowed to have only one non-zero
coefficient. Hence, for t(n) ◦−• T (z) holds
G(z) = H0(−z) F0(z) + H1(−z) F1(z)
  
−ℓ −ℓ
= H0(−z) z H1(−z) + H1(−z) −z H0(−z) 1

 for n = D,
t(n) = 0 for n = D + 2λ, λ 6= 0,
=0 ⇒ No aliasing components in the reconstructed signal! 

 arbitrary otherwise.
Transfer function for the input signal: Inserting (5.70) into (5.58) (5.74)

197 198
⇒ Half-band filter (Nyquist(2) filter), see Section 5.1.5. The zeros are {3.7321, −1.0, −1.0, 0.2679}, {−1.0, −1.0},
| {z } | {z }
A half-band filter has 4λ − 1 coefficients (λ ∈ IN). zeros of H0 (z) zeros of F0 (z)
such that (linear-phase filter).
Example:
(a): linear-phase half-band filter −1 −2 −3 −4
H0(z) = α(−1 + 2z + 6z + 2z −z ),
(b): half-band filter with lower system delay
−1 −2
F0(z) = β(1 + 2z +z )

Orthogonal filter banks


• In the above example: Still two filters F0(z) and H0(z) to
design in order to construct the whole PR filter bank.
• In an orthogonal two-channel filter bank (Smith, Barnwell,
1984), (Mintzer, 1985) it suffices to design the lowpass
analysis filter H0(z) for a PR system.

(From [Mertins: Signal analysis, 1999])


For an orthogonal two-channel bank the filter H1(z) is chosen as
−(LF −1) −1
Filter design via spectral factorization H1(z) = z H0(−z ), (5.75)
A given half-band filter T (z) can be factorized according to LF denoting the length of h0(n). In the following we will only
consider even lengths LF . Then, using (5.70) with ℓ = 0, the
T (z) = F0(z) H0(z),
remaining synthesis filter can be obtained as
i.e. one looks for the zeros of T (z), and distributes them among −(LF −1) −1
the polynomials F0(z) and H0(z). F̂0(z) = (−z) H0(z ), F̂1(z) = −H0(−z).
The missing filters F1(z) and H1(z) can then be obtained from Note that (−z)−(LF −1) = (−1)−(LF −1) z −(LF −1) =
(5.70). (−1) z −(LF −1) since (LF −1) odd.
⇒ General approach for the PR design of two-channel banks The factor (−1) in F0(z), F1(z) can be regarded as a common
Example: factor multiplied to the output of the synthesis bank and can thus
A half-band filter is given as be removed for simplicity reasons:
−(LF −1) −1
{t(n)} = {−1, 0, 9, 16, 9, 0, −1}. F0(z) = z H0(z ), F1(z) = H0(−z). (5.76)

199 200
Removing the factor (−1) does not change anything at the → It can be easily shown that the power-complementary property
aliasing cancelation property: Inserting F0(z) and F1(z) into also holds for h1(n), f0(n), and f1(n).
(5.59) still yields G(z) = 0.
Design of orthogonal filter banks
In order to obtain the condition for a analysis-synthesis system
1. Search a prototype H0(z) which satisfies the power-
free of linear distortions we now insert (5.75) and (5.76) into
complementary property (5.78) or (for the interesting real-
(5.58), leading to
valued filters) the corresponding equation (5.77) in the z-
S(z) = z
−(LF −1)
(H0(z) H0(z
−1
) + H0(−z) H0(−z
−1
)), domain.

! −D
With the abbreviation TZ (z) = H0(z) H0(z −1)
= 2z .
TZ (z) + TZ (−z) = 2 (5.79)
Hence, the PR condition is
!
is satisfied, where TZ (z) denotes a zero-phase half-band filter.
−1 −1
H0(z) H0(z ) + H0(−z) H0(−z ) = 2. (5.77) Notation: In the following zero-phase filters and amplitude responses are
denoted with the subscript ”Z ” instead of ”0” to avoid confusion with the
With z = ejω (5.77) can be written for real-valued h0(n)
lowpass analysis filter h0 (n).
according to
Valid half-band filter: TZ (z) is a valid half-band filter if it can
jω 2 j(ω+π) 2 be factorized into H0(z) and H0(z −1).
|H0(e )| + |H0(e )| = 2 (5.78)
⇒ Design goal: Find a valid half-band filter and factorize it
into H0(z) and H0(z −1).
⇒ power-complementary property for H0(ejω ).
2. When a suitable filter H0(z) has been found, the remaining
jω 2
|H (e )| |H (e
j(ω+π) 2
)| filter can be obtained from
2 0 0

−(LF −1) −1
1.5 H1(z) = z H0(−z ),
−(LF −1) −1
1 F0(z) = z H0(z ), (5.80)
−(LF −1) −1
0.5 F1(z) = z H1(z ) = H0(−z).
0
0 0.2 0.4 0.6 0.8 1
ω /π→ ⇒ special case of the conditions in (5.70).

201 202
How to design a valid half-band filter? Visualization:
Spectral factorization may be problematic:
With TZ (z) = H0(z) H0(z −1) and z = ejω :

!
jω jω −jω jω 2
TZ (e ) = H0(e ) H0(e ) = |H0(e )| ≥ 0 for all ω .
(5.81)
Design approach due to Smith and Barnwell, 1986
Starting point is an arbitrary linear-phase half-band filter (for
example designed with the Remez algorithm from Section 4.4.4):
ω
jω −jω(LF −1)
A(e ) = AZ (ω)e (From [Fliege: Multiraten-Signalverarbeitung, 1993])

AZ (ω): Real-valued amplitude frequency response of the half- ⇒ Single zeros on the unit-circle are converted to double zeros
band filter a(n), AZ (ω) •−◦ aZ (n), LF : length of h0(n). → factorization into two filters is now possible
If the value A valid zero-phase half-band filter TZ (z) can finally be
δ = min AZ (ω) < 0, (5.82) obtained by scaling of the resulting transfer function such that
ω∈[0,2π] !
TZ (ejπ/2) = 1 (note that TZ (z) + TZ (−z) = 2 has to hold),
a non-negative amplitude frequency response can be generated
leading to the expression
with
AZ+(ω) = AZ (ω) + |δ|. (5.83) 1
TZ (z) = AZ+(z). (5.85)
In time-domain this corresponds with 1 + |δ|
(
aZ (n) for n 6= 0, Remark:
AZ+(ω) •−◦ aZ+(n) = In practice for double zeros on the unit circle the separation
aZ (n) + |δ| n = 0.for
(5.84) process is numerically very sensitive. As a solution, the parameter
(aZ (n) denotes the zero-phase impulse response with the center |δ| in (5.82) and (5.83) can be enlarged by a small value ǫ →
of symmetry located at n = 0). zeros move pairwise off the unit-circle where due to the linear-
phase property they are mirrored at the unit-circle

203 204
Example Impulse response h0 (n) Impulse response h1 (n)
0.8 0.8
Parameter for the design of TZ (z): LF = 16, ωs = 0.6π ,
0.6 0.6
∆ω = 0.2π , ǫ = 10−4 0.4 0.4

0.2 0.2

h0(n) →

h (n) →
0 0

1
−0.2 −0.2
Pole-zero pattern TZ (z) Pole-zero pattern H0 (z)
−0.4 −0.4

−0.6 −0.6
1 1 −0.8 −0.8
0 5 10 15 0 5 10 15
n→ n→
0.5 0.5
Im{z} →

Im{z} →
0 30
0 15
Impulse response f0 (n) Impulse response f1 (n)
0.8 0.8
−0.5 −0.5
0.6 0.6
−1 −1 0.4 0.4

0.2 0.2

f0(n) →

f (n) →
−1 0 1 2 −1 0 1 2
Re{z} → Re{z} → 0 0

1
−0.2 −0.2

−0.4 −0.4
−0.6 −0.6
Amplitude frequency response TZ (ω) Frequency responses analysis filters −0.8 −0.8
0 5 10 15 0 5 10 15
2.5 1.5 n→ n→

2
|H0(ejω )| |H1(ejω )|=|H0(−e−jω )| • Filter in orthogonal two-channel filter banks have an even
1
1.5 number of coefficients since TZ (z) = H0(z) H0(z −1)
TZ (ω) →

1 Example:
0.5

0.5

0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
Ω/π→ ω /π→

TZ (z) with 7 coefficients can be factorized into two filters of


After h0(n) has been constructed, the remaining impulse length 4.
responses h1(n), f0(n), f1(n) are obtained with (5.80). The next feasible length is 11 coefficients

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. 5.9 K -band filter banks
• Filter in orthogonal two-channel filter banks can not be made
In the following we briefly consider K -band systems with equal
linear-phase (except two trivial cases) (Vaidyanathan, 1985).
subband widths and equal subsampling factors in every subband.
5.8 Tree filter banks .

K channel filter banks can be developed by iterating the two- x(n) h0 (n)
u0 (n)
↓ M y0 (m) ↑ M
v0 (n)
f0 (n) x̂(n)

channel systems from above.


u1 (n) v1 (n)
h1 (n) ↓ M y1 (m) ↑ M f1 (n)

F
F
F
uK−1 (n) vK−1 (n)
hK−1 (n) ↓ M yK−1 (m) ↑ M fK−1 (n)

F analysis filter bank synthesis filter bank


.
F
F
• If K = M the analysis-synthesis system is called critically
subsampled, for K > M we speak of an oversampled
system.
• The case K < M (undersampled system) is infeasible since
the sampling theorem is violated in the subbands also for ideal
F
(brickwall) filters → no reasonable reconstruction is possible.

F
Subset of general K -band filter banks:
F
→ Modulated filter banks
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ω )| K=8

• More efficient implementation compared to general K -band |H0 (ejω )| |HK−1 (ejω )|

systems.
ω
• Less design complexity since only the prototype filters have to π
K

K
π 2π

be designed.
• z-transforms:
• (Less storage required for the filter coefficients.)
k kD k nD
Two important types of modulated filter banks: DFT and cosine- Hk (z) = P (zWK )WK 2 , Fk (z) = Q(zWK )WK 2
modulated filter banks (5.90)
In the following only DFT filter banks are briefly considered. • Perfect reconstruction in the critical subsampled case is only
possible for filter lengths LF = K → not very good
DFT filter banks
frequency selectivity. Therefore, the DFT filter bank is mainly
• Analysis and synthesis filters (k = 0, 1, . . . , K − 1): used with M < K .

j 2π k(n− D Why the name DFT filter bank?


hk (n) = p(n) · e K 2) (5.86)
| {z } | {z } Type 1 polyphase components of the analysis prototype,
analysis prototype modulation and phase shifting

j 2π k(n− D
2)
K−1
fk (n) = q(n) · e K (5.87) X −ℓ K
| {z } | {z } P (z) = z Pℓ(z ). (5.91)
synthesis prototype modulation and phase shifting
ℓ=0

D denotes the overall analysis-synthesis system delay, for Inserting (5.91) into (5.90) then yields
linear phase filters we have D = LF − 1.
K−1
• Frequency responses: kD X −ℓ K −kℓ
Hk (z) = WK 2 z Pℓ(z ) WK . (5.92)
jω j(ω− 2π k) −j 2π k D ℓ=0
Hk (e ) = P (e K ) ·e K 2 (5.88)
| {z } | {z } K−1
frequency shift by k 2π/K phase factor 1 X −kn
Analogy to the IDFT: x(n) = X(k) WK
jω j(ω− 2π k) −j 2π k D K k=0
Fk (e ) = Q(e K ) ·e K 2 (5.89)
| {z } | {z }
frequency shift by k 2π/K phase factor
⇒ The subband filter of an DFT filter bank can be calculated
with the IDFT (and thus also with the fast IFFT), where the input

209 210
signals of the IDFT are obtained by filtering with the delayed 6. Spectral Estimation
polyphase components In this chapter we consider the problem of estimating the power
spectral density (power spectrum) of a wide-sense stationary
The n-th output of the IDFT has finally to be multiplied with the
nD (WSS) random process.
rotation factors WK 2 .
Applications for power spectrum estimation:
Structure of the analysis filter bank: .
Signal detection and tracking, frequency estimation (e.g. for sonar
1
or radar signals), harmonic analysis and prediction, beamforming
xk 1
and direction finding,. . .
x(k) ( )
P0 (zK ) # N y0(m)
z 1 WKD= 2
Problems in power spectrum estimation:
xk WK 1
( 1)
P1 (zK ) # N y1(m)
• The amount of data is generally limited, for example, a random
z 1
process may be stationary only for a short time (e.g. speech
z 1 WKD=
2(K 1) signal). On the other hand, as we have seen in Section 3.1.4 for
xk M WK K
( 1)
the frequency analysis of non-random signals using the DFT,
( +1)
PK 1(zK ) # N yK 1(m)
K IDFT

the longer the input data vector, the higher the frequency
.
resolution of the spectral analysis.
(dual structure for the synthesis) • Often, only one representation of a stochastic process may be
available. Therefore, an ergodic process is often assumed.
If K = cM , c ∈ IN, then besides the IDFT also the polyphase
• Additionally, the input data may be corrupted by noise.
filtering can be calculated in the lower sampling rate.
Estimation approaches can be classified into two classes:
1. Classical or nonparametric methods: Estimation of the
autocorrelation sequence, where the power spectrum is then
obtained by Fourier transform of the autocorrelation sequence.
2. Nonclassical or parametric approaches, which use a model for
the random process in order to estimate the power spectrum.

6.1 Periodogram-based nonparametric methods


6.1.1 The periodogram
Power spectrum Φvv (ejω ) of a WSS random process v(n) is the

211 212
Fourier transform of the autocorrelation function ϕvv (κ): With the rectangular window
∞ (

X −jκω 1 n = 0, . . . , N − 1,
Φvv (e ) = ϕvv (κ) e . wr (n) =
κ=−∞ 0 otherwise,

⇒ Spectral estimation is also an autocorrelation estimation we can describe the input sequence being analyzed also as
problem
From Signals and Systems we know that for a stationary random vN (n) = v(n) · wr (n). (6.4)
process v(n) which is ergodic in the first and second moments
the autocorrelation sequence can be theoretically obtained from Then, the estimated autocorrelation sequence may be written as
the time-average ∞
1 X ∗ 1 ∗
N ϕ̂vv (κ) = vN (k+κ) vN (k) = vN (κ)∗vN (−κ).
1 X ∗ N k=−∞ N
ϕvv (κ) = lim v(k + κ) v (k). (6.1)
N →∞ 2N + 1 (6.5)
k=−N
Fourier transform of the rightmost equation in (6.5)
If v(n) is only measured over a finite interval of N samples, finally yields the following expression for the periodogram
n = 0, . . . , N −1, the autocorrelation sequence is estimated as (VN (ejω ) •−◦ vN (n)):
N −1−κ
1 X ∗ jω 1 jω ∗ jω 1 jω 2
ϕ̂vv (κ) = v(k + κ) v (k) (6.2) (per)
Φ̂vv (e ) = VN (e ) VN (e ) = |VN (e )| .
N k=0 N N
(6.6)
with the values of ϕ̂vv (κ) for κ < 0 defined via the symmetry
relation ϕ̂vv (−κ) = ϕ̂∗vv (κ), and with ϕ̂vv (κ) = 0 for MATLAB-command: periodogram
|κ| ≥ N . The sampled version Φ̂(per) jk2π/M
) = Φ̂(per)
vv (e vv (k) can be
The discrete Fourier transform of ϕ̂vv (κ) from (6.2) is called obtained from the M1-point DFT VN (k) of vN (n):
periodogram (Schuster, 1898) and leads to an estimate of the
power spectrum according to (per) 1 2
Φ̂vv (k) = |VN (k)| , k = 0, . . . , M1 − 1. (6.7)
N
N
X −1
(per) jω −jκω
Φ̂vv (e ) = ϕ̂vv (κ)e . (6.3) Thus, the periodogram can be calculated very efficiently using the
κ=−N +1 FFT.

213 214
Example: Periodogram of white noise asymptotically unbiased, which means that for N → ∞ the
If v(n) is white noise with a variance of σv2 , then ϕvv (κ) = σv2 δ(κ) with a expectation value of the estimated power spectrum is equal to
constant power spectrum Φvv (ejω ) = σv2 . the true power spectrum:
Sample realization for N = 32 Autocorrelation sequence ϕ̂vv (κ)
n o
(per) jω ! jω
lim E Φ̂vv (e ) = Φvv (e ). (6.9)
2 1 N →∞
0.8
1
On the other hand for a biased estimator there would be a
0.6
0 difference between the expectation value and the true result.
v(n) →

0.4

−1 0.2
• Furthermore, the estimation variance should go to zero as the
0
data length N goes to infinity:
−2
−0.2 n o
(per) jω !
−3
0 5 10 15 20 25 30 −40 −20 0 20 40 lim Var Φ̂vv (e ) = 0. (6.10)
n → λ → N →∞
(per)
Periodogram Φ̂vv (ejω ) (solid), power spectrum Φvv (ejω ) (dashed) • If (6.9) and (6.10) are satisfied we say that the periodogram

10
Φ̂(per)
vv (e ) is a consistent estimate of the power spectrum.
5 Note that there are different definitions of consistency in the literature.
Magnitude [dB] →

0 Bias of the periodogram


−5 First step: Calculation of the expected value of the autocorrelation
−10 ϕ̂vv (κ). From (6.2) we have
−15 N −1−κ
0 0.2 0.4
ω/π →
0.6 0.8 1
1 X ∗
E{ϕ̂vv (κ)} = E{v(k + κ) v (k)}
Definition: Bias and consistency N k=0
Desirable: N −1−κ
1 X N −κ
• Convergence of the periodogram to the exact power spectrum = ϕvv (κ) = ϕvv (κ) (6.11)
N k=0 N
in the mean-square sense
  2 for κ = 0, . . . , N − 1, and for κ ≥ N it follows
(per) jω jω !
lim E Φ̂vv (e ) − Φvv (e ) = 0. (6.8) E{ϕ̂vv (κ)} = 0.
N →∞
By using the symmetry relation ϕ̂vv (−κ) = ϕ̂∗vv (κ) (6.11) can
• In order to achieve this it is necessary that the periodogram is be written as E{ϕ̂vv (κ)} = wB (κ) ϕvv (κ) with the Bartlett

215 216
(triangular) window Spectral resolution
( N −|κ| We know from the discussion in Section 3.1.4 that the convolution
N for |κ| ≤ N,
wB (κ) = (6.12) with the frequency response of a window may lead to
0 for |κ| > N.
• spectral smoothing,
The expected value of the periodogram can now be obtained as • spectral leaking,
n o N −1 • the loss of the ability to resolve two nearby spectral lines.
(per) jω
X −jκω
E Φ̂vv (e ) = E{ϕ̂vv (κ)}e , Similarly, this also holds for the convolution between the power
κ=−N +1 spectrum and the Bartlett window frequency response in (6.13).

X Example: (a) Power spectrum of two sinusoids in white noise,
−jκω
= wB (κ) ϕvv (κ) e , (b) expected value of the periodogram
κ=−∞

which finally yields

n
(per) jω
o 1 jω jω
E Φ̂vv (e ) = Φvv (e )
∗ WB (e ) (6.13)

with WB (ejω ) denoting the Fourier transform of the Bartlett


window  2
jω 1 sin(N ω/2)
WB (e ) = .
N sin(ω/2)
⇒ Periodogram is a biased estimate, since the expected value is
the convolution between the true power spectrum and the Fourier
transform of the Bartlett window. (from [Hayes, 1996])

Since WB (ejω ) converges to an impulse for N → ∞ the • Width of the main lobe of WB (ejω ) increases as the data
periodogram is asymptotically unbiased: record length decreases.
n o • ⇒ For a given length N there is a limit on how closely two
(per) jω jω
lim E Φ̂vv (e ) = Φvv (e ) (6.14) sinusoids or narrowband processes may be located before they
N →∞
no longer can be resolved.

217 218
• One way to define this frequency resolution limit is to set ∆ω analog to (6.4). The periodograms of these processes are
equal to the width of the main lobe of the Bartlett window at
(per) jω 1 jω 2 (per) 1
jω jω 2
its −6 dB point: Φ̂vv (e ) = |VN (e )| , Φ̂xx (e ) = |XN (e )| .
N N
(6.18)
2π If N is large compared to the length of h(n), vN (n) can be
∆ω = 0.89 , (6.15)
N described as vN (n) ≈ h(n)∗xN (n), since the transition effects
can be neglected. Thus, the magnitude square frequency response
which is also the frequency resolution of the periodogram. |VN (ejω )|2 of vN (n) can be with (6.17) expressed as
jω 2 jω 2 jω 2 jω jω 2
Variance of the periodogram |VN (e )| ≈ |H(e )| |XN (e )| = Φvv (e ) |XN (e )| .
(6.19)
White Gaussian random processes: Inserting (6.18) into (6.19) yields
It can be shown that for a white Gaussian random process v(n)
the variance of the periodogram is equal to the square of the power (per) jω jω (per) jω
Φ̂vv (e ) ≈ Φvv (e ) Φ̂xx (e ).
spectrum Φvv (ejω ) (see [Hayes, 1996]):
n o Applying the variances on both sides results in
(per) jω 2 jω
Var Φ̂vv (e ) = Φvv (e ). (6.16) n o n o
(per) jω 2 jω (per) jω
Var Φ̂vv (e ) ≈ Φvv (e ) Var Φ̂xx (e ) ,
Non-white Gaussian random processes: jω
and, since Var{Φ̂(per)
xx (e )} = 1 according to (6.16), the variance
For non-white Gaussian processes, which are more important for large N can be obtained as
in practice, we derive an approximation for the variance of the
periodogram in the following. n
(per) jω
o
2 jω
Var Φ̂vv (e ) ≈ Φvv (e ). (6.20)
A random process v(n) with power spectrum Φvv (ejω ) may be
generated by filtering white noise x(n) with variance σx2 = 1
with a linear filter h(n) ◦−• H(ejω ) and ⇒ Periodogram is not a consistent estimator
Example:
jω 2 jω For a white Gaussian noise process v(n) with σv2 = 1 and Φvv (ejω ) = 1 it
|H(e )| = Φvv (e ). (6.17) follows from (6.13) and (6.16), resp., that
n o n o
(per) jω (per) jω
The sequences vN (n) and xN (n) are now formed by windowing E Φ̂vv (e ) = 1 and Var Φ̂vv (e ) = 1.

219 220
Thus, although the periodogram for white Gaussian noise is unbiased, the 6.1.2 Bartlett’s method: Periodogram averaging
variance is independent of the data record length N .
In contrast to the periodogram, Bartlett’s method (1948) provides
N = 64, overlay of 30 periodo- N = 64, approximated periodo-
(per) a consistent estimate of the power spectrum.
grams Φ̂vv (ejω ) gram variance
10 3
The motivation for this method comes from the fact that by
0 2.5
averaging a set of uncorrelated measurements for a random
Magnitude [dB] →

−10 2
variable v one obtains a consistent estimate of the mean E{v}.

Variance →
−20 1.5
Since the periodogram is asymptotically unbiased
−30 1

−40 0.5
n o
(per) jω jω
lim E Φ̂vv (e ) = Φvv (e ),
−50
0 0.2 0.4 0.6 0.8 1
0
0 0.2 0.4 0.6 0.8 1
N →∞
ω/π → ω/π →
N = 256, overlay of 30 periodo- N = 256, approximated periodo-
(per)
grams Φ̂vv (ejω ) gram variance it obviously suffices to find a consistent estimate of the

10 3
periodogram E{Φ̂(per)vv (e )} in order to find a consistent
0 2.5
estimate for the true power spectrum Φvv (ejω ).
Magnitude [dB] →

−10 2 ⇒ Estimation of the power spectrum by periodogram averaging!


Variance →

−20 1.5

−30 1
Let vi(n) for i = 0, . . . , K − 1 denote K uncorrelated
realizations of a random process v(n) for n = 0, . . . , L − 1.
−40 0.5
The periodogram of each single realization is obtained from (6.6)
−50 0
0 0.2 0.4
ω/π →
0.6 0.8 1 0 0.2 0.4
ω/π →
0.6 0.8 1 as
2
XL−1
(per) jω 1 −jnω
N = 64, periodogram average N = 256, periodogram average Φ̂v v (e ) = vi(n)e . (6.21)
i i L
10 10 n=0
0 0 The average of these periodograms is
Magnitude [dB] →

Magnitude [dB] →

−10 −10

K−1
−20 −20
jω 1 X (per) jω
Φ̂vv (e ) = Φ̂ (e ). (6.22)
−30 −30
K i=0 vivi
−40 −40

−50 −50
0 0.2 0.4
ω/π →
0.6 0.8 1 0 0.2 0.4
ω/π →
0.6 0.8 1
For the expected value of Φ̂vv (ejω ) we have with (6.22) and

221 222
(6.13) Properties
n

o n
(per) jω
o From (6.23) the expected value is
E Φ̂vv (e ) =E Φ̂v (e )
i vi

1 jω jω
n
(B) jω
o 1 jω jω
= Φvv (e )
∗ WB (e ). (6.23) E Φ̂vv (e ) = Φvv (e )
∗ WB (e ) (6.26)
2π 2π

As with the periodogram, the estimate Φ̂vv (ejω ) is asymptotically As the periodogram the Bartlett estimate is asymptotically
unbiased, i.e. for L → ∞. unbiased.
For uncorrelated data records vi(n) the variance Var{Φ̂vv (ejω )} The spectral resolution of the Bartlett estimate can be obtained
can be obtained in the same way from (6.22) and (6.20) as from the resolution of the periodogram in (6.15). Since we now
use sequences of length L the resolution becomes
n

o 1 n
(per) jω
o 1 2 jω
Var Φ̂vv (e ) = Var Φ̂v v (e ) ≈ Φ (e ).
K i i K vv 2π 2π
(6.24) ∆ω = 0.89 = 0.89 K , (6.27)
We can observe that the variance goes to zero if K goes to infinity L N
⇒ Φ̂vv (ejω ) is a consistent estimate of the power spectrum if
both L and K tend to infinity. which is K times larger (worse!) than that of the periodogram.
Variance: Assuming that the data sequences vi(n) are
In practice:
approximately uncorrelated (this is generally not the case!) the
Uncorrelated realizations of a random process are generally not
variance of the Bartlett estimate is for large N
available, instead we have only one single realization of length N .
Alternative: v(n) of length N is divided into K nonoverlapping
sequences of length L with N = L · K , that is
n
(B) jω
o 1 2 jω
Var Φ̂vv (e ) ≈ Φ (e ). (6.28)
vi(n) = v(n + iL), n = 0, . . . , L−1, i = 0, . . . , K −1. K vv

Thus, the Bartlett estimate is


• Φ(B) jω
vv (e ) is a consistent estimate for K, L → ∞.

2 • The Bartlett estimate allows to trade spectral resolution for a


K−1 L−1
(B) jω 1 X X
−jnω reduction in variance by adjusting the parameters L and K .
Φ̂vv (e ) = v(n + iL) e . (6.25)
N i=0 n=0 Examples:
• The power spectrum of a white noise Gaussian process with σv2 = 1 of
length N = 256 is estimated with Bartlett’s method.

223 224
K = 4, L = 64, overlay of 30 K = 4, L = 64, approximated η(n) of variance ση2 = 1,
(B)
Bartlett estimates Φ̂vv (ejω ) variance of Bartlett estimates
0.5
v(n) = 3 · sin(nω1 ) + sin(nω2 ) + η(n) (6.29)
10

5 0.4
with ω1 = 0.2π , ω2 = 0.25π , and length N = 512 samples.
Magnitude [dB] →

The following figures show the average power spectrum estimate over

Variance →
0 0.3 30 realizations, and demonstrate the reduced spectral resolution of the
−5 0.2
Bartlett estimate compared to the periodogram.
K = 4, L = 128, Bartlett estimate K = 8, L = 64, Bartlett estimate
−10 0.1 30 30

−15 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π → 20 20

Magnitude [dB] →

Magnitude [dB] →
ω/π →
K = 8, L = 32, overlay of 30 K = 8, L = 32, approximated
(B)
Bartlett estimates Φ̂vv (ejω ) variance of Bartlett estimates 10 10

10 0.5
0 0
5 0.4
Magnitude [dB] →

−10 −10
Variance →

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


ω/π → ω/π →
Periodogram
−5 0.2 30

−10 0.1
20

Magnitude [dB] →
−15 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π → ω/π → 10

K = 4, L = 64, Bartlett estimate K = 8, L = 32, Bartlett estimate 0


average average
10 10 −10
0 0.2 0.4 0.6 0.8 1
ω/π →
5 5
6.1.3 Welch’s method: Averaging modified periodograms
Magnitude [dB] →

Magnitude [dB] →

0 0
In 1967, Welch proposed two modifications to Bartlett’s method:
−5 −5
1. The data segments vi(n) of length L are allowed to overlap,
−10 −10
where D denotes the offset between successive sequences:
−15 −15
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π → ω/π → vi(n) = v(n+iD), n = 0, . . . , L−1, i = 0, . . . , K−1.
• Here, the input signal consists of two sinusoids in white Gaussian noise (6.30)

225 226
The amount of overlap between vi(n) and vi+1(n) is L−D Properties
samples, and if K sequences cover the entire N data points • It can be shown that the expected value of Welch’s estimate is
we have N = L + D(K − 1). If D = L the segments do
not overlap as in Bartlett’s method with K = N/L. n
(W ) jω
o 1 jω jω 2
E Φ̂vv (e ) = Φvv (e ) ∗ |W (e )| ,
⇒ By allowing the sequences to overlap it is possible to 2πLU
increase the number and/or length of the sequences that are (6.34)
averaged. Reduction of the variance (for larger K ) can thus jω
where W (e ) denotes the Fourier transform of the general
be traded in for a reduction in resolution (for smaller L) and L-point window sequence w(n). Thus, Welch’s method is an
vice versa. asymptotically unbiased estimate of the power spectrum.
2. The second modification is to window the data segments prior • The spectral resolution of Welch’s estimate depends on the
to computing the periodogram. This leads to a so called used window sequence and is specified as the 3 dB width
modified periodogram ∆ω3 dB of the main lobe of the spectral window. ∆ω3 dB is
2 specified for some commonly used windows in the following
XL−1
(mod) jω 1 −jnω table.
Φ̂v v (e ) = v i (n) w(n)e (6.31)
i i LU
n=0
Sidelobe 3 dB bandwidth
Type of window level [dB] ∆ω3 dB
with a general window w(n) of length L, and U denoting
a normalization factor for the power in the window function Rectangular -13 0.89 2π
L
according to Bartlett -27 1.28 2π
L
L−1
1X 2 Hanning -32 1.44 2π
U = |w(n)| . (6.32) L
L n=0
Hamming -43 1.30 2π
L

Welch’s method may explicitly be written as Blackman -58 1.68 2π


L

K−1
L−1 2 Remark: In (6.15) we stated the frequency resolution of the peridogram
1 X X
(W ) jω −jnω
as the 6 dB main lobe width of the Bartlett window. Since WB (ejω ) =

Φ̂vv (e ) = v(n + iD) w(n)e .
KLU i=0 n=0
|WR (ejω )|2 this is equivalent to the 3 dB bandwidth of the frequency
(6.33) response WR (ejω ) of the rectangular window.
MATLAB-command: pwelch • The variance of Welch’s estimate highly depends on the

227 228
amount of overlapping. For a Bartlett window and a 50% Overlay plot of 30 Welch estimates Welch estimate ensemble average
overlap the variance is approximately 30 30

20
n o 9 20

Magnitude [dB] →

Magnitude [dB] →
(W ) jω 2 jω
Var Φ̂vv (e ) ≈ Φvv (e ) (6.35)
8K 10
10

0
(→ consistent estimate). A comparison with (6.28) shows that 0

the variance for Welch’s method seems to be larger than for −10

Bartlett’s method. However, for fixed amount of data N and a 0 0.2 0.4 0.6 0.8 1
−10
0 0.2 0.4 0.6 0.8 1
ω/π → ω/π →
fixed resolution L here twice as many sections are averaged
Compared to the Bartlett estimate for the same example above the use of
compared to Bartlett’s method. With K = 2N/L (50%
the Hamming window reduces the spectral leakage in the estimated power
overlap) (6.35) becomes spectrum.
Since the number of sections (7) are about the same to those in the above
n
(W ) jω
o 9L 2 jω example for the Bartlett estimate with K = 8, L = 64 (8 sections) both
Var Φ̂vv (e ) ≈ Φ (e ). (6.36)
16N vv variances are also approximately the same.

6.1.4 Blackman-Tukey method: Periodogram smoothing


A comparison with (6.28) and K = N/L for the Bartlett
estimate we have Recall that the periodogram is obtained by a Fourier transform
from the estimated autocorrelation sequence. However, for any
n
(W ) jω
o 9 n
(B) jω
o
finite data record of length N the variance of ϕ̂vv (κ) will be
Var Φ̂vv (e ) ≈ Var Φ̂vv (e ) . (6.37)
16 large for values of κ, which are close to N . For example for
lag κ = N − 1 we have from (6.2)
Increasing the amount of overlap yields higher computational
complexity and also the correlation between the subsequences 1
vi(n) → amount of overlap is typically chosen as 50% or ϕ̂vv (N − 1) = v(N − 1) v(0).
N
75%.
Two approaches for reducing the variance of ϕ̂vv (κ) and thus also
Example:
As an input signal we again use (6.29) which contains two sinusoids in white the variance of the peridogram:
Gaussian noise η(n) of variance ση2 = 1, with ω1 = 0.2π , ω2 = 0.25π , 1. Averaging periodograms and modified periodograms, resp., as
and a signal length of N = 512 samples. The section length is chosen as
L = 128, the amount of overlapping is 50%, and for the window we use a
utilized in the methods of Bartlett and Welch.
Hamming window. 2. Periodogram smoothing → Blackman-Tukey method (1958)

229 230
Blackman-Tukey method: Variance of the autocorrelation • W (ejω ) ≥ 0, such that Φ̂vv(BT ) jω
(e ) is nonnegative for all ω .
function is reduced by applying a window to ϕ̂vv (κ) to decrease Note that some of the window functions we have introduced
the contribution of the undesired estimates to the periodogram. do not satisfy this condition, for example, the Hamming and
The Blackman-Tukey estimate is given as Hanning windows.
Properties
M
(BT ) jω
X −jκω • The expected value of the Blackman-Tukey estimate can be
Φ̂vv (e ) = ϕ̂vv (κ) w(κ) e , (6.38)
derived for M ≪ N as
κ=−M

n
(BT ) jω 1
o
jω jω
where w(κ) is a lag window being applied to the autocorrelation E Φ̂vv (e ) Φvv (e )
= ∗ W (e )

estimate and extending from −M to M for M < N − 1.
(6.41)
⇒ Estimates of ϕvv (κ) having the largest variance are set to zero jω
where W (e ) is the Fourier transform of the lag window.
by the lag window → the power spectrum estimate will have a
smaller variance. • The spectral resolution of the Blackman-Tukey estimate
depends on the used window.
The Blackman-Tukey power spectrum estimate from (6.38) may • It can be shown that the variance can be approximated as
also be written as
1 (per) jω M
(BT ) jω jω
n
(BT ) jω
o
2 jω 1 X 2
Φ̂vv (e ) = Φ̂ (e ) ∗ W (e ), (6.39) Var Φ̂vv (e ) ≈ Φvv (e ) w (κ).
2π vv N κ=−M

1 (per) ju j(ω−u) (6.42)
= Φ̂vv (e ) W (e ) du (6.40)
2π • 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
with W (ejω ) denoting the Fourier transform of the lag window. minimize the width of the main lobe of W (ejω ), whereas M
⇒ Blackman-Tukey estimate smooths the periodogram by should be small to minimize the sum term in (6.42). As a
convolution with W (ejω ). general rule of thumb, M is often chosen as M = N/5.

Choice of a suitable window: Examples:


• The power spectrum of a white noise Gaussian process with σv2 = 1 of
• w(κ) should be conjugate symmetric, such that W (ejω ) (and length N = 256 is estimated with the Blackman-Tukey method, where a
also the power spectrum) is real-valued. Bartlett window with M = 51 is used.

231 232
6.1.5 Performance comparisons
Overlay of 30 Blackman-Tukey Approximated variance of the Performance of the discussed estimators is assessed in terms of
(BT )
estimates Φ̂vv (ejω ) Blackman-Tukey estimates
two criteria:
10 0.5

5 0.4 1. Variability V of the estimate,


Magnitude [dB] →

Variance →
0 0.3 n o
Var Φ̂vv (ejω )
−5 0.2
V = n o, (6.43)
−10 0.1 E2 Φ̂vv (ejω )
−15 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π → ω/π →
which can be regarded as a normalized variance.
Blackman-Tukey estimate ensemble average
10 2. Overall figure of merit, which is defined as the product of the
5
variability and the spectral resolution ∆ω ,
Magnitude [dB] →

0
M = V ∆ω. (6.44)
−5

−10
Results for the periodogram-based spectrum estimation tech-
−15
0 0.2 0.4 0.6 0.8 1
niques:
ω/π →

• In a second example we use two sinusoids in white Gaussian noise ((6.29), Variability Resolution Figure of merit
2 V ∆ω M
σn = 1, ω1 = 0.2π , ω2 = 0.25π ) for N = 512 samples. The
window is a Bartlett window with M = 102. 2π 2π
Periodogram 1 0.89 0.89
Overlay plot of 30 Blackman- Blackman-Tukey estimate ensem- N N
Tukey estimates ble average 1 2π 2π
Bartlett 0.89 K 0.89
30 30
K N N
20 20 Welch (50% overlap, 9 2π 2π
Magnitude [dB] →

Magnitude [dB] →

1.28 0.72
Bartlett window) 8K L N
10
10

0 Blackman-Tukey 2M 2π 2π
0 (Bartlett window of length 0.64 0.43
3N M N
−10 2M , 1 ≪ M ≪ N )
−10
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π → ω/π →

233 234
• Each technique has a figure of merit being approximately the difference equation is
same, figures of merit are inversely proportional to the length
q p
N of the data sequence. X X
v(n) = bi w(n − i) − ai v(n − i), (6.46)
• ⇒ Overall performance is fundamentally limited by the i=0 i=1
amount of data being available!
where v(n) denotes the output and w(n) the input sequence
6.2 Parametric methods for power spectrum estimation If w(n) represents a stationary random process, then v(n) is also
Disadvantages of the periodogram-based (nonparametric) stationary and the power spectrum can be given as (Wiener-Lee
methods: relation)
jω jω 2 jω
Φvv (e ) = |H(e )| Φww (e ). (6.47)
• Long data records are required for sufficient performance,
windowing of the autocorrelation sequence limits spectral Parametric power spectrum estimation:
resolution.
model process
• Spectral leakage effects due to windowing. white noise w(n)
H(ejω ) v(n)
source, µ = 0 !
= received process
• A-priori information about the generating process is not
exploited. stationary random process σw
ai , bi
Φvv (ejω ) = σw
2
· |H(ejω )|2
Disadvantages are removed by using parametric estimation
approaches, where an appropriate model for the input process is In order to estimate the power spectrum Φvv (ejω ) we assume in
applied. our model that Φww (ejω ) comes from a zero-mean white noise
2
process with variance σw . By inserting Φww (ejω ) = σw 2
into
Parametric methods are based on modeling the data sequence as
(6.47) the power spectrum of the observed data is
the output of a linear system with the transfer function (IIR filter!)

q jω 2 jω 2 2 |B(ejω )|2
P Φvv (e ) = σw |H(e )| = σw . (6.48)
bi z −i |A(ejω )|2
i=0
H(z) = p
, (6.45)
P Goal: Make the model process v(n) as similar as possible to
1+ ai z −i
i=1 the unknown received process in the mean-square error sense by
adjusting the parameters ai, bi, and σw ⇒ the power spectrum
where the ai and bi are the model parameters. The corresponding Φvv (ejω ) can then be obtained via (6.48).

235 236
In the following we distinguish among three specific cases for 6.2.1 Relationship between the model parameters and the
H(z) leading to three different models: autocorrelation sequence
Autoregressive (AR) process In the following it is shown that the model parameters ai, bi can
The linear filter H(z) = 1/A(z) is an all-pole filter, leading to be obtained from the autocorrelation sequence of the observed
b0 = 1, bi = 0 for n > 0 in the difference equation (6.46): process v(n). These values are then inserted into (6.45) yielding
H(ejω ), which is then inserted into (6.48) leading to the power
p
X spectrum Φvv (ejω ) of our observed process.
v(n) = w(n) − ai v(n − i). (6.49)
i=1 In a first step the difference equation (6.46) is multiplied by
Moving average (MA) process v ∗(n − κ) and the expected value is taken on both sides
Here, H(z) = B(z) is an all-zero (FIR!) filter, and the
q
difference equation becomes with an = 0 for n ≥ 0 ∗
X ∗
E{v(n) v (n − κ)} = bi E{w(n − i) v (n − κ)}−
q
X i=0
v(n) = bi w(n − i). (6.50) p
X ∗
i=0
− ai E{v(n − i) v (n − κ)},
Autoregressive, moving average (ARMA) process i=1

In this case the filter H(z) = B(z)/A(z) has both finite poles
which leads to
and zeros in the z-plane and the corresponding difference equation
is given by (6.46). q
X p
X
Remarks: ϕvv (κ) = bi ϕwv (κ − i) − ai ϕvv (κ − i). (6.51)
i=0 i=1
• The AR model is most widely used, since the AR model is
suitable of modeling spectra with narrow peaks (resonances) The crosscorrelation sequence ϕwv (κ) depends on the filter
by proper placement of the poles close to the unit circle. impulse response:
• MA model requires more coefficients for modeling a narrow

spectrum, therefore it is rarely used as a model for spectrum ϕwv (κ) = E{v (n) w(n + κ)},
estimation. ( ∞ )
X ∗ 2
• By combining poles and zeros the ARMA model has a more =E h(k) w (n − k) w(n + κ) = σw h(−κ).
efficient spectrum representation as the MA model concerning k=0
the number of model parameters. (6.52)

237 238
In the last step we have used our prerequisite from above that the may also be expressed in matrix notation according to
process w(n) is assumed to be a zero-mean white random process     
ϕvv (0) ϕ∗vv (1) ... ϕ∗vv (p − 1) a1 ϕvv (1)
with E{w(n − k)w∗(n + κ)} = δ(κ + k)σw 2
and known  ϕ (1)
 vv ϕvv (0) ... ϕ∗vv (p − 2)  
  a2 
 ϕ (2)
 vv 
2
variance σw . Thus we have from (6.52)  .. .. ... ..   ..  = −  .. 
 . . .  .   . 
ϕvv (p − 1) ϕvv (p − 2) ... ϕvv (0) ap ϕvv (p)
(
0 for κ > 0, (6.56)
ϕwv (κ) = 2
(6.53) which is in short-hand notation R a = r. Once the ai have been
σw h(−κ) for κ ≤ 0. 2
obtained by solving for the coefficient vector a, the variance σw
can be calculated from
By combining (6.51) and (6.53) we obtain the desired relationship
p
for the general ARMA case: 2
X
σw = ϕvv (0) + aiϕvv (−i). (6.57)
 i=1
Pp

 − ai ϕvv (κ − i) for κ > q,


 i=1
 Since the matrix R has a special structure (Toeplitz structure) there
ϕvv (κ) = q−κ p
 2 P
σw h(i) bi+κ −
P
ai ϕvv (κ − i) for 0 ≤ κ ≤ q exist efficient algorithms for solving the system of linear equations



 i=0 i=1 in (6.55) and (6.56), respectively (Levison-Durbin algorithm
 ∗
ϕvv (−κ) for κ < 0.
(1947, 1959), Schür recursion (1917)).
(6.54)
→ nonlinear relationship between the parameters ϕvv (κ) and 6.2.2 Yule-Walker method
ai, bi
In the Yule-Walker method (also called autocorrelation method)
In the following we only consider the AR model case, where we simply estimate the autocorrelation sequence from the
(6.54) simplifies to observed data v(n), where the autocorrelation estimate in (6.2)

is used:
p
P


 − ai ϕvv (κ − i) for κ > 0, N −1−κ


 i=1 1 X ∗
ϕvv (κ) = p
(6.55)
ϕ̂vv (κ) = v(n + κ) v (n), κ = 0, . . . , p.

2
σw −
P
ai ϕvv (κ − i) for κ = 0 N n=0



 i=1 (6.58)
 ∗
ϕvv (−κ) for κ < 0.
In the matrix version of the Yule-Walker equations (6.56) we
replace ϕvv (κ) with ϕ̂vv (κ). The resulting linear equation
These equations are also called Yule-Walker equations and denote system is solved for the parameter vector a, which now contains
a system of linear equations for the parameters ai. Equation (6.55) the estimated AR parameters âi, i = 1, . . . , p. Finally, we

239 240
2 overlay of 30 Blackman-Tukey estimates Blackman-Tukey ensemble average
obtain σw via (6.57) from the âi and the estimated autocorrelation
40 40
sequence ϕ̂vv (κ).
30 30
The corresponding power spectrum estimate can now be stated

Magnitude [dB] →

Magnitude [dB] →
from (6.48) as 20 20

10 10

2
(AR) jω σw 0 0
Φ̂vv (e ) = 2 . (6.59)
p
P
−jkω −10 −10
1 + âk e 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π → ω/π →
k=1
• Length of observed process N = 100 (Blackman-Tukey: LB = 41):
overlay of 30 Yule-Walker estimates Yule-Walker ensemble average
MATLAB-command: paryule 40 40

30 30
6.2.3 Examples and comparisons to nonparametric methods

Magnitude [dB] →

Magnitude [dB] →
20 20
In the following we compute power spectrum estimates obtained
with the Yule-Walker method and for comparison purposes also 10 10

with the Blackman-Tukey method (Bartlett window of length 0 0

LB ).
−10 −10
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
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 overlay of 30 Blackman-Tukey estimates Blackman-Tukey ensemble average
model order of the Yule-Walker method is chosen as p = 50. 40 40

• Length of observed process N = 512 (Blackman-Tukey: LB = 205): 30 30

Magnitude [dB] →

Magnitude [dB] →
overlay of 30 Yule-Walker estimates Yule-Walker ensemble average 20 20
40 40
10 10
30 30
Magnitude [dB] →

Magnitude [dB] →

0 0
20 20
−10 −10
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
10 10 ω/π → ω/π →
• We can see that only for the longer data sequence with N = 512 the
0 0
resolution of the estimates are comparable. Clearly, for N = 100 the
−10 −10
estimate based on an AR-model provides much better frequency resolution
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π → ω/π → for the sinusoidal components than the Blackman-Tukey method.

241 242
Remark: Use of a certain model generally requires a-priori
knowledge about the process. In case of a model mismatch
(e.g. MA process and AR model) using a nonparametric approach
may lead to a more accurate estimate.
Example:
Consider the MA process (length N = 512)

v(n) = w(n) − w(n − 2),


2
where w(n) is again a white-noise zero-mean process with variance σw = 1.
The power spectrum of v(n) is

Φvv (e ) = 2 − 2 cos(2ω).

Ensemble average over 30 power spectrum estimates for the Yule-Walker


method (AR model of order p = 4) and the Blackman-Tukey method (Bartlett
window, LB = 205):
10

5
Magnitude [dB] →

−5

−10

Yule−Walker (AR(4) model)


−15 Blackman−Tukey
exact power spectrum

−20
0 0.2 0.4 0.6 0.8 1
ω/π →
→ Blackman-Tukey estimate, which makes no assumption about the process,
yields a better estimate of the power spectrum compared to the model-based
Yule-Walker approach.

243

You might also like