0% found this document useful (0 votes)
143 views49 pages

Review Notes: Digital Signal Processing ELEC96010 (EE3-07)

This document provides review notes on digital signal processing. It covers topics such as sampling, z-transforms, discrete Fourier transforms, convolution, digital filters, and multirate signal processing. The notes were last updated on May 31, 2021 and were written by Aidan O. T. Hogg of Imperial College London for the course ELEC96010 (EE3-07) on digital signal processing. The document contains detailed explanations and examples within its five modules.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views49 pages

Review Notes: Digital Signal Processing ELEC96010 (EE3-07)

This document provides review notes on digital signal processing. It covers topics such as sampling, z-transforms, discrete Fourier transforms, convolution, digital filters, and multirate signal processing. The notes were last updated on May 31, 2021 and were written by Aidan O. T. Hogg of Imperial College London for the course ELEC96010 (EE3-07) on digital signal processing. The document contains detailed explanations and examples within its five modules.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

Review Notes: Digital Signal Processing

ELEC96010 (EE3-07)
Aidan O. T. Hogg {[email protected]}
Imperial College London, (last updated: May 31, 2021)

Please email Aidan O. T. Hogg {[email protected]} if you have any suggestions or comments
about this document.

Contents

1 Module 1 - Sampling, Z-Transforms and System Functions 3

1.1 Types of Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.2 Effect of Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.3 Time Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.4 Sampling Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.5 Recovery of the Analog Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.6 Z-Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.7 Inverse Z-Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.8 Energy and Power for Discrete-Time Signals . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.9 Linear Time-Invariant Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.10 BIBO Stability Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2 Module 2 - Discrete Fourier Transform 11

2.1 Different Types of Fourier Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.2 Convergence of the DTFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.3 Properties of the DTFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.4 DFT & DTFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.5 Symmetries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.6 Parseval’s Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.7 Zero-Padding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.8 Matrix Interpretation of the FFT Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.9 Data Flow Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3 Module 3 - Convolution 19
Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

3.1 Types of Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.2 Convolution Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.3 Calculating the Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.4 Overlap Add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.5 Overlap Save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

4 Module 4 - Digital Filters: Implementation and Design 23

4.1 Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

4.2 FIR Digital Filter Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

4.3 IIR Digital Filter Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

4.4 Digital Filter Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5 Module 5 - Multirate Signal Processing 39

5.1 Multirate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5.2 Noble Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

5.3 Upsampled z-transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.4 Downsampled z-transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

5.5 Perfect Reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

5.6 Polyphase Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

5.7 Resampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

5.8 2-band Filterbank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5.9 Quadrature Mirror Filterbank (QMF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

5.10 Polyphase QMF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

Aidan O. T. Hogg Page 2


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

1 Module 1 - Sampling, Z-Transforms and System Functions


1.1 Types of Signals
There are a small number of special sequences that are worth taking note of:
(
1, n=0
• Unit impulse: δ[n] = u[n] − u[n − 1] =
0, otherwise
(
P∞ 1, n≥0
• Unit step: u[n] = k=0 δ[n − k] =
0, otherwise
• Right-sided: x[n] = 0 for n < Nmin
• Left-sided: x[n] = 0 for n > Nmax
• Finite length: x[n] = 0 for n 6∈ [Nmin , Nmax ]
• Causal: x[n] = 0 for n < 0
• Anticausal: x[n] = 0 for n > 0
P∞ 2
• Finite Energy: n=−∞ |x[n]| < ∞
P∞
• Absolutely Summable: n=−∞ |x[n]| < ∞ =⇒ Finite Energy

1.2 Effect of Sampling

Analog Analog Analog-to- Digital-to- Analog Analog


Sample- Digital
Low-pass Digital Analog Low-pass
input and-hold Processor output
Filter Converter Converter Filter

It is now common practice to process analog signals digitally due to the many advantages of digital
signal processing. This process is shown above. First an analog low-pass filter is used to remove any
frequencies that could cause aliasing and thus is aptly named the ‘anti-aliasing filter’. Secondly the anolog
signal is sampled and held to allow time for the analog-to-digital conversion to take place. The output
analog-to-digital converter is then a digital signal that can be processed using different digital signal
processing techniques including: delaying, multiplying and adding to extract the desired information from
the signal. This desired signal can then be converted back into an analog signal using a digital-to-analog
converter. The ouput of the digital-to-analog converter is then passed through a low-pass filter to remove
higher frequency components that are created by the sampling process; this filter is normally referred to
as the reconstruction filter due to the fact that it reconstructs the analog signal at the output.

Let xa (t) be a analog signal that is sampled at internals of T , creating a signal xs (t) where:

xs (t) = xa (nT ), −∞ < n < ∞, T >0

with the reciprocal of T being the sampling frequency Fs .

Now let xa (t) have the Fourier transform Xa (jΩ), where Ω denotes the analog radian frequency (Ω =
2πF ), defined by: Z ∞
Xa (jΩ) = xa (t)e−jΩt dt
−∞

So in order to discover the interrelationship between Xa (jΩ) and Xs (jΩ), we need to idealize the sampling
waveform to a sequence of impulses, given by sT (t):

X
sT (t) = δ(t − nT )
n=−∞

Aidan O. T. Hogg Page 3


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Therefore xs (t) = xa (t)sT (t) which is illustrated in the figure below.

xa (t) × xs (t)

sT (t)

To get a better conceptual understanding of this sampling process it has been visualised below.

(a) xa (t): continuous-time signal (b) sT (t): impluse train (c) xs (t): sampled signal

Since ST (t) is a periodic waveform it can be written as a Fourier series:


∞ ∞
X 1 X jkΩs t
sT (t) = δ(t − nT ) = e
n=−∞
T
k=−∞

This result comes from the compact representation of the Fourier Series which uses complex exponentials:

1 T /2 1 T /2
Z Z
X 1
sT (t) = ck ejkΩs t , where ck = sT (t)e−jkΩs t dt = δ(t)e−jkΩs t dt =
T −T /2 T −T /2 T
k=−∞

This means that xs (t) can be rewritten in the following way:


∞ ∞ ∞
X 1 X jkΩs t 1 X
xs (t) = xa (t)sT (t) = xa (t)δ(t − nT ) = xa (t) e = xa (t)ejkΩs t
n=−∞
T T
k=−∞ k=−∞

By taking the Fourier Transform of both sides it is shown that:



1 X
Xs (jΩ) = Xa (j(Ω + kΩs ))
T
k=−∞

Thus it can be seen that Xs (jΩ) is a periodic function of frequency Ω, consisting of the sum of shifted
and scaled replicas of Xa (jΩ), shifted by integer multiples of Ωs and scaled by T1 .

|Xa (jΩ)|
1


−Ωm Ωm
(a) Spectrum of the original continuous-time signal xa (t)

1
|ST (jΩ)|
T


−Ωs Ωs 2Ωs 3Ωs
(b) Spectrum of the sequence of impulses sT (t)

1
|Xs (jΩ)|
T


−Ωs −Ωm Ωm Ωs 2Ωs 3Ωs
(c) Spectrum of the sampled signal xs (t)

Aidan O. T. Hogg Page 4


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

1.3 Time Scaling


It is normal to scale the time so that Fs = 1 which results in dividing all real frequencies and angular
frequencies by Fs and dividing all real times by T.

For example, instead of designing a 1 kHz low-pass filter for fs = 44.1 kHz it would often be easier to
design a 0.0227 kHz filer for fs = 1 kHz.

It is common to use F for ‘real’ frequencies and Ω for ‘real’ angular frequencies. The scaled versions being
f for normalised frequency and ω for normalised angular frequency where the units of ω are ‘radians per
sample’ and f are ‘cycles per sample’. Therefore:
Ω 2πΩ 2πF F
ω= = = = 2πf, where f =
Fs Ωs Fs Fs
thus

1 X
Xs (jΩ) = Xa (j(Ω + kΩs ))
T
k=−∞

can be written as
∞   

 1 X ω 2πk ω 2π
X e = Xa j + where Ω = and Ωs = 2πFs =
T T T T T
k=−∞

Warning: several MATLAB routines scale time so that fs = 2 Hz. Non-standard, weird and irritating.

1.4 Sampling Theorem


Sampling has the effect of creating spectral images every Ωs and, therefore, to avoid information loss
due to overlapping images (aliasing) the following condition must be met:

Definition:
Ωs
|Ωm | ≤ , where Ωs = 2πFs = 2π/T =⇒ |ω| ≤ π
2

The frequency 2Ωm is called the Nyquist rate. Sampling above this frequency is called oversampling,
conversely, sampling below this frequency is called undersampling. Lastly sampling at a frequency exactly
equal to the Nyquist rate is called critical sampling.

1.5 Recovery of the Analog Signal

It can be seen earlier that the continuous-time signal xa (t) can be recovered by passing the signal xs (t)
through an ideal low-pass filter H(jΩ) with cuffoff frequency Ωc , where Ωm < Ωc < (Ωs − Ωm ) to avoid
aliasing.

The impulse response of h(t) of this low-pass filter can be obtained by taking the inverse Fourier transform
of its frequency response H(jΩ):
(
T, |Ω| ≤ Ωc
H(jΩ) =
0, |Ω| > Ωc

Aidan O. T. Hogg Page 5


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

which is given by
Z ∞ Z Ωc
1 T T h 1 jΩt iΩc T h 1 jΩc t i h 1 −jΩc t i
h(t) = H(jΩ)ejΩt dΩ = ejΩt dΩ = e = e − e
2π −∞ 2π −Ωc 2π jt −Ωc 2π jt jt

T  jΩc t  T sin(Ωc t)
= e − e−jΩc t = sin(Ωc t) = , −∞ < t < ∞
j2πt πt Ωs t/2

see also that xs (t) is given by



X
xs (t) = x[n]δ(t − nT ), where x[n] = xa (nT )
n=−∞

Therefore the output of the low-pass filter x̂a (t) is given by xs (t) ∗ h(t), which can be written as

X
x̂a (t) = x[n]h(t − nT )
n=−∞

Assuming for simplicity that Ωc = Ωs /2 = (2πFs )/2 = π/T by substitution of h(t) we arrive at
∞ ∞
sin[π(t − nT )/T ] (t − nT )
X X  
x̂a (t) = x[n] = x[n] sinc
n=−∞
π(t − nT )/T n=−∞
T

as a result, x̂a (nT ) = x[n] = xa (nT ) for n ∈ Z in the range −∞ < n < ∞, whether or not the Nyquist
theorem has been satisfied, however, x̂a (t) = xa (t) is only true if Ωs ≥ 2Ωm (Nyquist condition).

(a) x[n]: sampled signal (b) sinc interpolation (c) x̂a (t): reconstructed signal

1.6 Z-Transform
The z-transform converts a discrete-time signal, x[n], into a function, X(z), of an arbitrary
complex-valued variable z.

Definition:

X
Z{x[n]} = X(z) = x[x]z −1 (1)
n=−∞

which only exists for particular values of z for which the series converges

The values of z for which X(z) converges is called the ‘Region of Convergence (ROC)’. X(z) will always
converge absolutely inside the ROC and may converge on some, all, or none of the boundary.
P∞
• Converge absolutely ⇔ n=−∞ |x[n]z n | < ∞
• Absolutely summable ⇔ X(z) converges for |z| = 1
• Causal ⇒ X(∞) converges
• Anticausal ⇒ X(0) converges

Aidan O. T. Hogg Page 6


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Geometric series:
1
1 + r + r2 + r3 + · · · = , for |r| < 1
1−r
Proof:

s = 1 + r + r2 + r3 + · · ·
rs = r + r2 + r3 + r4 + · · ·
s − rs = 1, given |r| < 1
1
s= , for |r| < 1
1−r

Examples:

Z-transform of a causal sequence

Consider the causal signal x[n] = αn u[n] then



X ∞
X ∞
X
X(z) = Z{x[n]} = x[n]z −n = αn u[n]z −n = αn z −n
n=−∞ n=−∞ n=0

The above power series converges to


1
X(z) = , for |αz −1 | < 1 ⇒ |z| > |α|
1 − αz −1

Z-transform of an anticausal sequence

Consider the anticausal signal x[n] = −αn u[−n − 1]



X ∞
X −1
X ∞
X
X(z) = Z{x[n]} = x[n]z −n = −αn u[−n − 1]z −n = − αn z −n = − α−m z m
n=−∞ n=−∞ n=−∞ m=1

The above power series converges to


α−1 z 1
X(z) = − −1
= , for |α−1 z| < 1 ⇒ |z| < |α|
1−α z 1 − αz −1

Z-transform of a rational polynomial

8 − 12z −1 8z 2 − 12z z(z − 1.5) Zeros at z = {0, +1.5}


H(z) = −1 −2
= 2 = ⇒
8 − 6z − 5z 8z − 6z − 5 (z + 0.5)(z − 1.25) Poles at z = {−0.5, +1.25}

16/7 4/7 8 1 1 1
Partial Fractions: H(z) = − = × − ×
(2 + z −1 ) (4 − 5z −1 ) 7 (1 + 12 z −1 ) 7 (1 − 54 z −1 )

Warning: The zeros at z = 0 can be easily missed when H(z) is written as a function of z −1 .

1 1 1

(a) Right-sided and unstable (b) Left-sided and unstable (c) Two-sided and stable

Aidan O. T. Hogg Page 7


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

(a) For the ROC defined by |z| > |1.25|, the impulse response is a right-sided sequence given by the
sum of two causal sequences which is given by:
8  1 n 1  5 n
h[n] = − u[n] − u[n]
7 2 7 4
Since the second sequence on the right-hand side in the above equation is not absolutely summable
the LTI system is unstable.
(b) For the ROC defined by |z| < |0.5|, the impulse response is a left-sided sequence given by the sum
of two anticausal sequences which is given by:
8  1 n 1  5 n
h[n] = − − u[−n − 1] + u[−n − 1]
7 2 7 4
Since the first sequence on the right-hand side in the above equation is not absolutely summable
the LTI system is unstable.
(c) For the ROC defined by |0.5| < |z| < |1.25|, the impulse response is a two-sided sequence given by
the sum of a causal sequence and an anticausal sequence which is given by:
8  1 n 1  5 n
h[n] = − u[n] + u[−n − 1]
7 2 7 4
Both of the sequences in the above equation are absolutely summable so, therefore, the LTI system
is stable. Note that the ROC contains the unit circle.

1.7 Inverse Z-Transform

Definition: I
1
x[n] = X(z)z n−1 dz (2)
2πj
where the integral is anti-clockwise around a circle within the ROC, z = Rejθ

Proof:
I ∞
I  X
1 1 
X(z)z n−1
dz = x[m]z −m z n−1 dz
2πj 2πj m=−∞
∞ I
(i) X 1
= x[m] z n−m−1 dz
m=−∞
2πj

(ii) X
= x[m]δ[n − m] = x[n]
m=−∞

(i) Depends on the circle with radius R lying within the ROC
I
(ii) Cauchy’s theorem: 1
z k−1 dz = δ[k] for z = Rejθ anti-clockwise
2πj
I Z 2π
dz jθ 1 k−1 1
= jRe ⇒ z dz = Rk−1 ej(k−1)θ × jRejθ dθ
dθ 2πj 2πj θ=0
Rk 2π jkθ
Z
= e dθ
2π θ=0
= Rk δ(k) = δ(k) [R0 = 1]

In practice the inverse z-transform is found using a combination of partial fractions and a table of
z-transforms.

Aidan O. T. Hogg Page 8


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

1.8 Energy and Power for Discrete-Time Signals


The energy of discrete-time signal , x[n], is given by

X N
X
E= |x[n]|2 and if the signal is finite equals EN = |x[n]|2
n=−∞ n=−N

The power of discrete-time signal , x[n], is the average of x2 [n] in ‘energy per sample’
N
1 X 1
P = lim |x[n]|2 = lim EN
N →∞ (2N + 1) N →∞ (2N + 1)
n=−N

Note: P is same value as the power of pre-sampled signal x(t) in ‘energy per second’ provided there is
no aliasing.

A discrete-time energy signal is defined as one for which 0 < E < ∞ and a discrete-time power signal
is defined as one for which 0 < P < ∞ . It is possible for a discrete-time signal to be neither an energy
signal nor a power signal.

1.9 Linear Time-Invariant Systems

x[n] y[n] = H (x[n])


H

A linear time-invariant system can be defined by two properties:

Linear: H (αu[n] + βv[n]) = αH (u[n]) + βH (v[n])


Time Invariant: y[n] = H (x[n]) ⇒ y[n − r] = H (x[n − r])∀r

Note: The behaviour of an LTI system is completely defined by its impulse response: h[n] = H (δ[n])

Proof:

X
x[n] = x[r]δ[n − r]
r=−∞
  ∞
 X  ∞
X
H x[n] = H x[r]δ[n − r] = x[r]H (δ[n − r])
r=−∞ r=−∞

X
= x[r]h[n − r]
r=−∞

= x[n] ∗ h[n]

Aidan O. T. Hogg Page 9


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

1.10 BIBO Stability Condition


BIBO Stability: Bounded Input, x[n] ⇒ Bounded Output, y[n].

These statements are equivalent:

(a) An LTI system is BIBO stable


P∞
(b) The impulse response, h[n], is absolutely summable, that is to say, n=−∞ |h[n]| < ∞
(c) The region of absolute convergence of the transfer function, H(z), includes the unit circle

Proof (a) ⇒ (b)

Suppose the output y[n] corresponding to the input x[n] is given by the convolution sum:

X
y[n] = x[n − r]h[r]
r=−∞

Suppose that the input is bounded with bound M , then:



X ∞
X
|y[n]| ≤ |x[n − r]||h[r]| ≤ M |h[r]|
r=−∞ r=−∞

If (a) is true then the output is bounded with a bound N :



X
|y[n]| ≤ M |h[r]| = N < ∞
r=−∞

Thus the impulse response, h[r], has to be absolutely summable.

Proof (b) ⇒ (a)

Let’s again suppose the output y[n] is given by the convolution sum:
∞ ∞
X X
|y[n]| = x[n − r]h[r] ≤ |x[n − r]||h[r]|
r=−∞ r=−∞

Suppose the impulse response is bounded by S and the input is bounded by M :



X
|y[n]| ≤ M |h[r]| = M S < ∞
r=−∞

Aidan O. T. Hogg Page 10


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

2 Module 2 - Discrete Fourier Transform


2.1 Different Types of Fourier Transforms

Definitions:

• CTFT (Continuous-Time Fourier Transform): x(t) → X(jΩ)


R∞ R∞
Forward Transform: X(jΩ) = −∞
x(t)e−jΩt dt, Inverse Transform: x(t) = 1
2π −∞
X(jΩ)ejΩt dΩ

• DTFT (Discrete-Time Fourier Transform): x[n] → X(ejω )


P∞ Rπ
Forward Transform: X(ejω ) = −∞ x[n]e−jωn , Inverse Transform: x[n] = 1
2π −π
X(ejω )ejωn dω

• DFT (Discrete Fourier Transform): x[n] → X[k]


PN −1 2πk PN −1 2πk
Forward Transform: X[k] = 0 x[n]e−j N n , Inverse Transform: x[n] = 1
N 0 X[k]ej N n

2.2 Convergence of the DTFT


P∞
The DTFT, X(ejω ) = −∞ x[n]e−jωn , does not converge for all x[n].
PN
Consider the finite sum: XN (ejω ) = −N x[n]e−jωn

Strong convergence:

x[n] absolutely summable ⇒ X(ejω ) converges uniformly:


X∞
|x[n]| < ∞ ⇒ lim supω |X(ejω ) − XN (ejω )| = 0

N →∞
−∞

Weaker convergence:

x[n] finite energy ⇒ X(ejω ) converges in the mean square:


X∞ Z π
2
|x[n]| < ∞ ⇒ lim |X(ejω ) − XN (ejω )|2 dω = 0
N →∞ −π
−∞

2.3 Properties of the DTFT

1. The DTFT is periodic in ω


X ej(ω+2mπ) = X(ejω ) ∀ m


2. The DTFT is just the z-transform evaluated on the unit circle, i.e. z = ejω

X
X(z) = x[n]z −n
n=−∞

3. The DTFT is the same as the CTFT of a signal comprising of impulses at the sample times

X ∞
X
xs (t) = x[n]δ(t − nT ) = xa (t) × δ(t − nT )
n=−∞ n=−∞

Aidan O. T. Hogg Page 11


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Proof:
∞ ∞ Z ∞
t
X X
−jωn

X(e ) = x[n]e = x[n] δ(t − nT )e−jω T dt
n=−∞ n=−∞ −∞
Z ∞ ∞ ∞
t
X X
= x[n]δ(t − nT )e−jω T dt, allowed if |x[n]| < ∞
−∞ n=−∞ n=−∞
Z ∞
= xs (t)ejΩt dt, due to ω = ΩT
−∞

2.4 DFT & DTFT


PN −1 2πk
It is helpful to note that the DFT, X[k] = 0 x[n]e−j N n , is the same as DTFT in certain cases:


Case 1: x[n] = 0 for n ∈
/ [0, N − 1] DFT is the same as DTFT at ωk = N k

Case 2: x[n] is periodic with period N DFT equals the normalised DTFT

2.5 Symmetries
It is useful to note that if a signal x[n] has a special property in the time domain then there will be a
corresponding property in the frequency domain, X(ejω ) and X[k].

One Domain Other Domain


Discrete Periodic
Symmetric Symmetric
Antisymmetric Antisymmetric
Real Conjugate Symmetric
Imaginary Conjugate Antisymmetric
Real & Symmetric Real & Symmetric
Real & Antisymmetric Imaginary & Antisymmetric

Symmetric: x[n] = x[−n]


X(ejω ) = X(e−jω )
X[k] = X[(−k)modN ] = X[N − k] for k > 0

Conjugate Symmetric: x[n] = x∗ [−n]


Conjugate Antisymmetric: x[n] = −x∗ [−n]

2.6 Parseval’s Relation


Parseval’s relation states that all Fourier transforms preserve ‘energy’.
R∞ 1
R∞
• CTFT −∞
|x(t)|2 dt = 2π −∞
|X(jΩ)|2 dΩ
P∞ 1

• DTFT −∞ |x[n]|2 = 2π −π
|X(ejω )|2 dω
PN −1 1
PN −1
• DFT 0 |x[n]|2 = N 0 |X[k]|2

More generally, these transforms actually preserve complex inner products:


PN −1 PN −1
0 x[n]y ∗ [n] = N1 0 X[k]Y ∗ [k]

Aidan O. T. Hogg Page 12


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

2.7 Zero-Padding
Zero padding is the process of added extra zeros onto the end of x[n] before performing the DFT.

Windowed Signal x[n] |X[k]|

• Zero-padding causes the DFT


to evaluate the DTFT at
more values of ωk . Denser
frequency samples.

• Width of the peaks remains 0


constant as they are
determined by the length |X[k]|
With Zero-Padding x[n]
and shape of the window.

• Smoother graph but


the increased frequency
resolution is an illusion.

2.8 Matrix Interpretation of the FFT Algorithm

This is only for additional insight into how matrices play a very important role in DSP. It will also
hopefully give you a better understanding of the FFT.
2π 2π
Here is the DFT matrix of FN for N = 4. Where w = e−j N (i.e w = e−j = −j)
4

   
1 1 1 1 1 1 1 1
1 w w2 w3  1 −j −1 j 
DFT Matrix: F4 =  1 w2
= 
w4 w6  1 −1 1 −1
1 w3 w6 w9 1 j −1 −j

The columns of F4 are all orthogonal, this means the inner product of any column with any other column
should be zero.

In the case of column 0 and 1 this is true: (column 0)T (column 1) = 1 − j − 1 + j = 0

However, the inner product of column 1 and 3 apears to be 4: (column 1)T (column 3) = 1 + 1 + 1 + 1 = 4

But this is wrong. These vectors are complex vectors, therefore, to get the correct inner product we must
take the complex conjugate of one of the vectors: (column 1)T (column 3) = 1 + (j · j) + 1 + (−j · −j) = 0

The
√ inner product of every vector with itself is: 1 + 1 + 1 + 1 = 4. All the vectors of F4 have length
4=2

Multiplying F4 times 14 F 4 produces I:


     
1 1 1 1 1 1 1 1 1 0 0 0
1 (−j) (−j)2 (−j)3  1 1 j j2 j3 0 1 0 0
1 (−j)2 (−j)4 (−j)6  × 4 1
   = 
j2 j4 j 6  0 0 1 0
1 (−j)3 (−j)6 (−j)9 1 j3 j6 j9 0 0 0 1
T
Thus F4−1 is 41 F 4 also written as 14 F4∗

Aidan O. T. Hogg Page 13


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

General rule for FN :

The columns of √1 FN are orthogonal. Their inner products produce I.


N

T T
( √1N F N )( √1N FN ) = I means that the inverse is FN−1 = N1 F N = N1 FN∗ (Note: the DFT matrix is
symmetric, so transposing has no effect. The inverse matrix just divides by N and replaces j by −j)

Fast Fourier Transform (FFT)

To reconstruct X[k] we want to multiply by FN times x as quickly as possible. The matrix has N 2
entries so we would normally have to perform N 2 separate multiplications. However, we can do better!
The key to the idea is to connect FN with the half-size DFT matrix FN/2 .

Assume N is a power of 2 (say N = 210 = 1024). we can connect F1024 to F512 or rather two copies of
F512 . When N = 4:
   
1 1 1 1 1 1
(−j)2 (−j)3 
 
1 (−j) F2 0 1 −1 
F4 =   and = 
1 (−j)2 (−j)4 (−j)6  0 F2  1 1
1 (−j)3 (−j)6 (−j)9 1 −1

Key idea:
   
1 1 1 1 1
 1 −j  1 −1  1 
F4 =    
1 −1  1 1  1 
1 j 1 −1 1

The permutation matrix on the right puts x0 and x2 (evens) ahead of x1 and x3 (odds). The matrix in
the middle performs separate half-size transforms on the even and odds. The matrix on the left combines
the two half-size outputs to get the correct full-size out X[k] = F4 x[n].

You should check the result yourself by multiplying the three matrices together to get F4 .

The same idea applies when N = 1024:


   
I D512 F512 0 even-odd
F1024 = 512
I512 −D512 0 F512 permutations

I512 is the identity matrix. D512 is the diagonal matrix with entries (1, w, ..., w511 ). The two copies of
F512 are what we expected, which use the 512th root of unity, which is just (w1024 )2 .

FFT Recursion

We reduced for FN to FN/2 . So lets keep going to FN/4 . The two copies of F512 lead to four copies of
F256 . This is the recursion.
   
  I256 D256 F256 pick 0,4,8...
F512 0 I256 −D256  F256  pick 2,6,10...
=   
0 F512  I256 D256   F256   pick 1,5,9... 
I256 −D256 F256 pick 3,7,11...

We can count how many multiplications we have saved. When using the DFT we had N 2 = (1024)2 .
This is about a million multiplications.

The final count for N = 2L is reduced from N 2 to 21 N L. The saving is therefore large.

When N = 1024 = 210 , therefore L = 10. The original count of (1024)(1024) is reduced to (5)(1024).

Aidan O. T. Hogg Page 14


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

FFT Complexity Reasoning

The reasoning behind 21 N L. There are L levels, going from N = 2L down to N = 1. Each level has 21 N
multiplications from the diagonal D to reassemble the half-size outputs.

1 1
This yields the final count 2 N L, which is 2N log2 N .

The exact same idea gives rise to the fast inverse transform.

2.9 Data Flow Diagrams


The previous section demonstrates that the FFT consists of three parts: split the incoming signal into
odd and even components; transform them separately and then perform a reconstruction. It is sometimes
helpful to visualise this process using data flow diagrams. In this section a decimation in time example
is given using data flow diagrams as an aid.

Decimation in Time

The radix-2 decimation in time algorithm starts by splitting x[n] into two sequences:
N
fe [n] = x[2n] (even samples) and fo [n] = x[2n + 1] (odd samples), for n = 0, . . . , −1
2
Therefore: N −1
X
kn
X[k] = x[n]wN
n=0
N/2−1 N/2−1
k(2m+1)
X X
k2m
= x[2m]wN + x[2m + 1]wN
m=0 m=0
N/2−1 N/2−1
X X
km k km 2
= fe [m]wN/2 + wN fo [m]wN/2 (remember wN = wN/2 )
m=0 m=0
k
= Fe [k] + wN Fo [k] for k = 0, 1, · · · , N − 1
where:
N/2−1 N/2−1
X X
kn kn
Fe [k] = fe [n]wN/2 and Fo [k] fo [n]wN/2
n=0 n=0

This result can now be visualised by a data flow diagram in the following way:

Fe [0]
x[0] 0
X[0]
wN
Fe [1]
x[2] 1
X[1]
N/2 = 4 wN
DFT Fe [2]
x[4] 2
X[2]
wN
Fe [3]
x[6] 3
X[3]
wN

Fo [0] 4
wN
x[1] X[4]
Fo [1] 5
wN
x[3] X[5]
N/2 = 4
DFT Fo [2] 6
wN
x[5] X[6]
Fo [3] 7
wN
x[7] X[7]

Aidan O. T. Hogg Page 15


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

To calculate X[4], X[5]X[6], X[7] recall that F[k] repeats every N/2 samples:

k
X[k] = Fe [k mod N/2] + wN Fo [k mod N/2], k = 0, . . . , N − 1.

But why stop here... the process can now be repeated for the shorter (N/2) DFTs:

x[0] 0 0
X[0]
N/4 = 2 wN wN
DFT
x[4] 2 1
X[1]
wN wN

4
wN
x[2] 2
X[2]
N/4 = 2 wN
6
DFT wN
x[6] 3
X[3]
wN

4
wN
x[1] 0
X[4]
N/4 = 2 wN
5
DFT wN
x[5] 2
X[5]
wN

4 6
wN wN
x[3] X[6]
N/4 = 2
6 7
DFT wN wN
x[7] X[7]

Again this process can be repeated for the shorter (N/4) DFTs:

x[0] 0
X[0]
wN
0
0
wN
wN
4
wN
x[4] 2
X[1]
wN
1
wN
4
wN
x[2] X[2]

2
0
wN
wN
4 6
wN wN
x[6] X[3]

3
wN
4
wN
x[1] 0
X[4]
wN

0
wN
4 5
wN wN
x[5] 2
X[5]
wN

4 6
wN wN
x[3] X[6]

0
wN
4 6 7
wN wN wN
x[7] X[7]

Aidan O. T. Hogg Page 16


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Now at each of these stages it is possible to see a pattern:

r
wN

r+(N/2)
wN

r+(N/2) r N/2 r
Notice that wN = wN wN = −wN and, therefore, this ‘butterfly’ can be simplified in the following
way:

r
wN

⇒ r
r
−wN wN −1

It can be seen that this approach now saves a factor of N/2 complex multiplications at each stage. Thus
the 8-point decimation in time FFT algorithm can be visualised in the following way:

Stage 1 Stage 2 Stage 3


x[0] X[0]

w80 −1
x[4] X[1]

w80 −1
x[2] X[2]

w80 −1 w82 −1
x[6] X[3]

w80 −1
x[1] X[4]

w80 −1 w81 −1
x[5] X[5]

w80 −1 w82 −1
x[3] X[6]

w80 −1 w82 −1 w83 −1


x[7] X[7]

FFT Computational Niceties

N
1. The FFT only contains 2 log2 N complex multiplications.
2. The FFT input is ordered by bit-reversed addressing (when the decimation happens in time).
3. The FFT computation can be done ‘in place’ and, therefore, requires no extra storage.

Aidan O. T. Hogg Page 17


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Decimation in Frequency

The radix-2 decimation in frequency algorithm splits the discrete Fourier transform into two parts:

PN −1 2kn
X[2k] = n=0 x[n]wN
PN/2−1 2kn
PN/2−1 2k(n+N/2)
= n=0 x[n]wN + n=0 x[n + N/2]wN
PN/2−1 2kn
PN/2−1 2kn
= n=0 x[n]wN + n=0 x[n + N/2]wN ×1
PN/2−1 kn
= n=0 (x[n] + x[n + N/2])wN/2
PN/2−1 kn
= n=0 g1 [n]wN/2 g1 [n] = x[n] + x[n + N/2]

PN −1 (2k+1)n
X[2k + 1] = n=0 x[n]wN
PN/2−1 N/2 (2k+1)n
= n=0 (x[n] + wN x[n + N/2])wN
PN/2−1 n kn
= n=0 ((x[n] − x[n + N/2])wN )wN/2
PN/2−1 kn n
= n=0 g2 [n]wN/2 g2 [n] = (x[n] − x[n + N/2])wN

The signal flow graph follows as:

x[0] X[0]

−1 w40
x[1] X[2]

−1 w40
x[2] X[1]

−1 w41 −1 w40
x[3] X[3]

It is interesting to compare this approach against a radix-2 decimation in time 4-point FFT algorithm:

x[0] X[0]

w40 −1
x[2] X[1]

w40 −1
x[1] X[2]

w40 −1 w41 −1
x[3] X[3]

Aidan O. T. Hogg Page 18


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

3 Module 3 - Convolution
3.1 Types of Convolution

Definitions:
∆ P∞
• Linear Convolution: y[n] = x[n] ∗ h[n] = k=−∞ x[k]h[n − k]
∆ PN −1
• Circular Convolution: y[n] = x[n] ~N h[n] = k=0 x[k]h[(n − k)mod N ]

DTFT

• Convolution → Product

X
y[n] = x[n] ∗ h[n] = x[k]h[n − k] ⇒ Y (ejω ) = X(ejω )H(ejω )
k=−∞

• Product → Circular Convolution ÷ 2


Z π
jω1 1
y[n] = x[n]h[n] ⇒ Y (e ) = X(ejω ) ~π H(ejω ) = X(ejω )H(ej(ω−θ) )dθ
2π 2π −π

DFT

• Circular Convolution → Product


N
X −1
y[n] = x[n] ~N h[n] = x[k]h[(n − k)mod N ] ⇒ Y [k] = X[k]H[k]
k=0

• Product → Circular Convolution ÷ N


1
y[n] = x[n]h[n] ⇒ Y [k] = X[k] ~N H[k]
N

3.2 Convolution Properties


Thankfully convolution obeys the normal arithmetic rules for multiplication.

1. Associative: x[n] ∗ (h[n] ∗ v[n]) = (x[n] ∗ h[n]) ∗ v[n] therefore x[n] ∗ h[n] ∗ v[n] is not ambiguous

P∞ P∞ (i) P∞ P∞
Proof: k=−∞ r=−∞ x[n − k]h[k − r]v[r] = p=−∞ q=−∞ x[p]h[q − p]v[n − q]
(i) substitute p = n − k, q = n − r

2. Commutative: x[n] ∗ h[n] = h[n] ∗ x[n]

P∞ (i) P∞
Proof: k=−∞ x[k]h[n − k] = p=−∞ x[n − p]h[p]
(i) substitute p = n − k

3. Distributive over addition: x[n] ∗ (αh[n] + βv[n]) = (x[n] ∗ αh[n]) + (x[n] ∗ βv[n])
P∞ P∞ P∞
Proof: k=−∞ x[n − k](αh[k] + βv[k]) = α k=−∞ x[n − k]h[k] + β k=−∞ x[n − k]v[k]

4. Identity: x[n] ∗ δ = x[n]

P∞ (i)
Proof: k=−∞ δ[k]x[n − k] = x[n]
(i) all terms are zero except when k = 0

Aidan O. T. Hogg Page 19


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

3.3 Calculating the Convolution


Step By Step Method

It is possible to compute convolution step by step:

−2 −1 0 1 2 k
x[−1] x[0] x[1] x[2] x[k]
h[−2] h[−1] h[0] h[1] h[k]
h[1] h[0] h[−1] h[−2] h[−k]
y[0] = x[−1]h[1]+ x[0]h[0]+ x[1]h[−1]+ x[2]h[−2]
h[1] h[0] h[−1] h[1 − k]
y[1] = x[0]h[1]+ x[1]h[0] + x[2]h[−1]
h[0] h[−1] h[−2] h[−1 − k]
y[−1] = x[−1]h[0]+ x[0]h[−1] + x[1]h[−2]
h[1] h[0] h[2 − k]
y[2] = x[1]h[1] + x[2]h[0]
h[−1] h[−2] h[−2 − k]
y[−2] = x[−1]h[−1] + x[0]h[−2]
h[1] h[3 − k]
y[3] = x[2]h[1]
h[−2] h[−3 − k]
y[−3] = x[−1]h[−2]

Simple Trick Method

This is a laborious process, however, there is a very simple trick that can be used to calculate the
convolution:

−2 −1 0 1 2 k
x[−1] x[0] x[1] x[2] x[k]
h[−2] h[−1] h[0] h[1] h[k]
h[1]x[−1] h[1]x[0] h[1]x[1] h[1]x[2]
h[0]x[−1] h[0]x[0] h[0]x[1] h[0]x[2] ×
h[−1]x[−1] h[−1]x[0] h[−1]x[1] h[−1]x[2] ×
h[−2]x[−1] h[−2]x[0] h[−2]x[1] h[−2]x[2] ×
y[−3] y[−2] y[−1] y[0] y[1] y[2] y[3]

Aidan O. T. Hogg Page 20


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Circulant Matrix Method

The last way to calculate the convolution is using a circulant matrix, where the circular convolution
y[n] = x[n] ~ h[n] is the equivalent to:
    
x[0] x[3] x[2] x[1] h[0] y[0]
x[1] x[0] x[3] x[2]
 h[1] = y[1]
   

x[2] x[1] x[0] x[3] h[2] y[2]
x[3] x[2] x[1] x[0] h[3] y[3]

Where h[n] and x[n] are made up of 4 samples.

Remember you can zero pad the signals to get the linear convolution:

x[k] = {x[−1], x[0], x[1], x[2], 0, 0, 0}


h[k] = {h[−2], h[−1], h[0], h[1], 0, 0, 0}

    
x[−1] 0 0 0 x[2] x[1] x[0] h[−2] y[−3]
 x[0] x[−1] 0 0 0 x[2] x[1] 
 h[−1] y[−2]
   

 x[1] x[0] x[−1] 0 0 0 x[2]   h[0]  y[−1]
   
 
 x[2] x[1] x[0] x[−1] 0 0 0    h[1]  =  y[0] 
   

 0 x[2] x[1] x[0] x[−1] 0 0   0   y[1] 
   
 
 0 0 x[2] x[1] x[0] x[−1] 0   0   y[2] 
0 0 0 x[2] x[1] x[0] x[−1] 0 y[3]

3.4 Overlap Add

K
x[n]
If N is very large:
K +M −1
N
1. chop x[n] into K chunks of x[n] ∗ h[n]
length K
2. convolve each chunk with h[n]
y[n]
3. add up the results
4K + M − 1

Each output chunk is of length K + M − 1 and overlaps the next chunk


N
Number of operations: ≈ K × 8(M + K) log2 (M + K)
Computational saving if ≈ 100 < M  K  N

Other advantages:

(a) Is able to handle N = ∞


(b) The DFT needed is shorter (if the DFT is used to perform circular convolution which is more
computationally efficient)
(c) Can calculate y[0] as soon as x[K − 1] has been read, however, there is a algorithmic delay of K − 1
samples.

Aidan O. T. Hogg Page 21


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

3.5 Overlap Save

If N is very large: K +M −1

x[n]
N
1. chop x[n] into K overlapping
K +M −1
chunks of length K + M − 1
x[n] ~ h[n]
2. ~K+M −1 each chunk with h[n]
3. discard first M − 1 from each
chunk y[n]
4. concatenate to make y[n]
4K

The first M − 1 points of each output chunk are invalid.

Number of operations: slightly less than overlap-add due to the fact that no additions are needed to create
y[n]. The advantages are the same as with overlap add, however, much less popular than overlap-add
which is strange.

Aidan O. T. Hogg Page 22


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

4 Module 4 - Digital Filters: Implementation and Design


4.1 Filters

Difference Equations
x[n] y[n]
A difference equation is way of describing most useful LTI
H(z)
systems:
PM PN
y[n] = r=0 b[r]x[n − r] − r=1 a[r]y[n − r]
PN PM
⇔ r=0 a[r]y[n − r] = r=0 b[r]x[n − r], where a[0] = 1
⇔ a[n] ∗ y[n] = b[n] ∗ x[n]
B(z)
⇔ Y (z) = X(z)
A(z)
B(ejω )
⇔ Y (ejω ) = X(ejω )
A(ejω )
(a) Always causal
(b) Order of system is max(M, N ), the highest r with a[r] 6= 0 or b[r] 6= 0
(c) We assume that a[0] = 1; if not, divide A(z) and B(z) by a[0]
(d) Filter is BIBO stable if roots of A(z) all lie within the unit circle

Note the negative sign in the first equation. In [4] the authors reverse the sign of the a[n], however, this
is actually a bad idea.

Recursive and Non Recursive

A digital system in general is described by a difference equation. Here are two examples:

y[n] = x[n] + x[n − 1] + · · · + x[n − 50]


y[n] = y[n − 1] + x[n] − x[n − 51]

The first one is a non recursive difference equation while the second one is recursive. The important
point to notice is that both these equations implement the same system.

Proof

y[n] = x[n] + x[n − 1] + · · · + x[n − 50] (a)


y[n − 1] = x[n − 1] + x[n − 2] + · · · + x[n − 51] (b)
y[n] − y[n − 1] = x[n] − x[n − 51] (a) - (b)
y[n] = y[n − 1] + x[n] − x[n − 51] Requires less additions than (a)

Note:

(a) FIR filters are normally implemented non recursively but can be implemented recursively.
(b) IIR filters can only be implemented recursively in practice becauseP
an infinite number of coefficients

would be required to realise them non recursively (recall: y[n] = k=−∞ x[k]h[n − k]).

Aidan O. T. Hogg Page 23


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

FIR Filters

A Finite Impulse Response (FIR) filter is one where A(z) = 1, and therefore, Y (z) = B(z)X(z).

The impulse response being b[n] with a length of M + 1 and the frequency response being B(ejω ) which
is just the DTFT of b[n].

Note: If M is small then the frequency response only contains low ‘quefrencies’ (‘quefrencies’ is not
jM ω
a typographical error). Also if b[n] is symmetric then H(ejω )e 2 consists of M
2 cosine waves plus a
constant.

M =4 M =16 M =32

1.0 1.0 1.0


|B|

|B|

|B|
0.5 0.5 0.5
0.0 0.0 0.0
0 1 2 3 0 1 2 3 0 1 2 3
ω ω ω


Rule of thumb: The fastest possible transition is ∆ω ≤ M (the marked double arrow)

FIR Symmetries
PM
B(ejω ) is determined by the zeros of z M B(z) = r=0 b[M − r]z r

It is advantageous to note some symmetric properties:


Real b[n] ⇒ conjugate zero pairs: z ⇒ z ∗

Symmetric: b[n] = b[M − n] ⇒ reciprocal zero pairs: z ⇒ z −1


Real & Symmetric b[n] ⇒ conjugate and reciprocal groups of four (else pairs on the real axis)

Real Symmetric Real & Symmetric


[1, -1.28, 0.64] [1, -1.64 + 0.27j, 1] [1,-3.28, 4.7625, -3.28, 1]

1 1 1
=(z)

=(z)

=(z)

0 0 0

−1 −1 −1

−1 0 1 −1 0 1 −1 0 1
<(z) <(z) <(z)

3
3
10
2
|H|

|H|
|H|

1 5
1

0 0 0
−2 0 2 −2 0 2 −2 0 2
ω ω ω

Aidan O. T. Hogg Page 24


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

IIR Frequency Response

B(z)
An Infinite Impulse Response (IIR) filter is one where Y (z) = X(z).
A(z)

Factorise QM
jωB(z) b[0]z −M i=1 (1 − qi z −1 )
H(e ) = = QN
A(z) i=1 (1 − pi z
−1 )

The poles pi are the roots of A(z) and B(z). The zeros qi are the zeros of H(z). Note that there are
additional N − M zeros at the origin (which affects only the phase)
QM
jω |b[0]| z −M i=1 |1 − qi z −1 |
|H(e )| = for z = ejω
z −N QN |1 − pi z −1 |

i=1

Example

2 + 2.5z −1 2(1 + 1.25z −1 )


H(z) = −1 −2
=
1 − 0.9z + 0.5 (1 − (0.45 − 0.55j)z −1 )(1 − (0.45 + 0.55j)z −1 )
2 ∗ 1.23
At ω = 2 : |H(ejω )| = = 1.6
1.69 ∗ 0.94
∠H(ejω ) = (0.83 + 2.0) − (2.11 + 2.74) = −2.02

10.0
1 0.94 1
2.74
7.5 1.23
1.69 2.0
=(z)

=(z)

0.83
|H|

0 0
5.0
2.11
2.5 −1 −1
0.0
0 1 2 3 −1 0 1 −1 0 1
ω <(z) <(z)

Scaling z

z

Given the filter H(z) it is possible to form a new filter HS (z) = H α , which is equivalent to multiplying
a[n] and b[n] by αn .

2 + 2.5z −1
Example: H(z) =
1 − 0.9z −1 + 0.5−2

10.0
1
7.5
=(z)

|H|

0
5.0

−1 2.5

0.0
−1 0 1 0 1 2 3
<(z) ω

Aidan O. T. Hogg Page 25


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

 z  2 + 2.75z −1
Scale z: HS (z) = H =
1.1 1 − 0.99z −1 + 0.605−2

1
10
=(z)

|H|
0
5
−1
0
−1 0 1 0 1 2 3
<(z) ω

Pole and zero positions are multiplied by α, α > 1 ⇒ peaks sharpened.


Pole at z = p gives peak bandwidth ≈ 2| log |p|| ≈ 2(1 − |p|)
For pole near unit circle, decrease bandwidth by ≈ 2 log α

Negating z

Given the filter H(z) it is possible to form a new filter HR (z) = H(−z), which is equivalent to negating
all odd power of z, that is, negating alternate a[n] and b[n].

2 + 2.5z −1
Example: H(z) =
1 − 0.9z −1 + 0.5−2

10.0
1
7.5
=(z)

|H|

0
5.0

−1 2.5

0.0
−1 0 1 0 1 2 3
<(z) ω

2 − 2.5z −1
Negate z: HR (z) = H(−z) = Negate odd coefficients
1 + 0.9z −1 + 0.5−2

10.0
1
7.5
=(z)

|H|

0
5.0

−1 2.5

0.0
−1 0 1 0 1 2 3
<(z) ω

Pole and zero positions are negated, response is flipped and conjugated.

Aidan O. T. Hogg Page 26


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Cubing z

Given the filter H(z) it is possible to form a new filter HC (z) = H(z 3 ), which is equivalent to inserting
two zeros between each a[n] and b[n] term.

2 + 2.5z −1
Example: H(z) =
1 − 0.9z −1 + 0.5−2

10.0
1
7.5
=(z)

|H|
0
5.0

−1 2.5

0.0
−1 0 1 −2 0 2
<(z) ω

2 + 2.5z −3
Cube z: Hc (z) = H(z 3 ) = Insert 2 zeros between coefficients
1 − 0.9z −3 + 0.5−6

10.0
1
7.5
=(z)

|H|

0
5.0

−1 2.5

0.0
−1 0 1 −2 0 2
<(z) ω

Pole and zero positions are replicated. Magnitude response is also replicated.

Group Delay

The group delay is defined τH (ejw ) = − d∠H(e

)
= delay of the modulation envelope.

One trick to get at the phase is: ln H(ejω ) = ln |H(ejω )| + j∠H(ejω )


−d = ln H(ejω ) −1 dH(ejω )  −z dH(z) 
 
τH = == =<

dω H(ejω ) dω H(z) dz

z=e


X
H(ejω ) = h[n]e−jnω = F (h[n]), where F denotes the DTFT.
n=0

dH(ejω ) X
= −jnh[n]e−jnω = −jF (nh[n])
dω n=0

−1 dH(ejω )
  F (nh[n])   F (nh[n]) 
τH = = = < = = j
H(ejω ) dω F (h[n]) F (h[n])

Aidan O. T. Hogg Page 27


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Example:
1  −pe−jω 
H(z) = ⇒ τH = −τ[1−p] = −<
1 − pz −1 1 − pe−jω

0.0 1.5
p = 0.6
1 p = 0.6 p = 0.6
−0.2 1.0
=(z)

τH
0 0.5

6
−0.4
0.0
−1
−0.6
−1 0 1 0 1 2 3 0 1 2 3
<(z) ω ω

Minimum Phase
3
Average group delay over ω equals the (#poles - #zeros) within
the unit circle where zeros on the unit circle count for 12 2

|H|
Reflecting an interior zero to the exterior multiplies |H(ejω )| by a 1
constant and increases the average group delay by 1 sample.
0
0 1 2 3
ω

0
1

−5
=(z)

0
6

−1 −10

−1 0 1 0 1 2 3
<(z) ω

1 4
=(z)

2
τH

0
−1

−1 0 1 0 1 2 3
<(z) ω

A filter with all its zeros inside the unit circle is a minimum phase filter:

1. The lowest possible group delay for a given magnitude response


2. The energy in h[n] is concentrated towards n = 0

In contrast a filter with all its zeros outside the unit circle is a maximum phase filter

Aidan O. T. Hogg Page 28


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Linear Phase Filters

The phase of a linear phase filter is: ∠H(ejω ) = θ0 − αω



This is equivalent to the group delay being constant: τH = − d∠H(e

)

A filter has linear phase, if and only if, its impulse response h[n] is symmetric or antisymmetric:

h[n] = h[M − n] ∀n or else h[n] = −h[M − n] ∀n

M can be even (⇒3 mid point) or odd (⇒63 mid point)

Important: This is not the same symmetry that is needed to make the signal real in the frequency
domain, which is when h[n] = h[−n] where M = N − 1.

4.2 FIR Digital Filter Design

The frequency response for any BIBO stable filter can be denoted by H(ejω ). Since H(ejω ) is a periodic
function with period 2π, it can be expressed as a Fourier series:

X
H(ejω ) = h[n]e−jωn
n=−∞

Where the Fourier coefficients h[n] are equal to the impulse response samples which are given by:
Z π
1
h[n] = H(ejω )ejωn dω, ∞ < n < ∞
2π −π

Thus given we know H(ejω ), we can compute h[n] using the IDTFT.

Example: Impulse Response of Ideal Low-pass Filter


(
1, |ω| ≤ ωc sin(ωc n)

H(e ) = ⇔ h[n] =
0, |ω| > ωc πn

1.0 2π/ωc

2ωc
0.5
H

0.0
−2 0 2 0
ω

Note: Width in ω is 2ωc , width in n is 2π/ωc where the product is always 4π.

The problem is h[n] is infinite and non-causal which makes it unreliable To solve this problem we
multiply h[n] by a window (truncating the coefficients) and then shift this new windowed signal to the
right appropriately.

Aidan O. T. Hogg Page 29


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Windowing Method

We therefore truncate h[n] to ± M


2 to make it finite, so hT [n] is now of length M + 1.

hT [n] 1.0 M = 12
M = 12 M = 24

|H|
0.5

0.0
0 0 1 2 3
ω

M M
It would then be normal to delay by hT [n] by 2 to make it causal. Which multiplies H(ejω ) by ej 2 ω
.

Gibbs Phenomenon

This type of truncation is optimal in terms of mean square error. If we define the mean squared error in
the frequency domain to be:
Z π
1
E= |H(ejω ) − HT (ejω )|2 dω
2π −π
Z π
1 PM
= |H(ejω ) − −2 M hT [n]e−jωn |2 dω
2π −π 2


In this case E is minimised when hT [n] = h[n]. Proof: E = −π |h[n] − hT [n]|2 + |n|>π |h[n]|2
P

From this result it would be easy to assume that a rectangular window is therefore the best choice,
however, this is almost never true due to the fact that no matter how large you make M , there will,
always be a 9% overshoot at any discontinuity. This behaviour is often referred to as ‘Gibbs phenomenon’.
Thus other windows are often used over the rectangular window to introduce a smooth transition in the
filter specification and thus eliminate ‘Gibbs phenomenon’.

Dirichlet Function

The reason behind Gibbs phenomenon can be explained by considering the truncation process which can
be expressed as the multiplication of h[n] by a rectangular window w[n] = δ− M ≤n≤ M .
2 2

This can be alternatively expressed as a circular convolution due to the modulation theorem.
1
HM +1 (ejω ) = H(ejω ) ~ W (ejω )

where
P M2 (i) P M2 (ii) sin([M +1]ω/2)
W (ejω ) = −M
e−jωn = 1 + 2 1 cos(nω) = sin(0.5ω)
2

The proof being: (i) e−jω(−n) + e−jω(+n) = 2 cos(nω) (ii) Sum of a geometric progression

Aidan O. T. Hogg Page 30


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

This has the effect of convolving the ideal frequency response with an aliased sinc function, which is
normally called the ‘Dirichlet function’.

1.0 1.0 1.0

0.5 4/π(M + 1) 0.5 0.5

0.0 0.0 0.0

−2 0 2 −2 0 2 −2 0 2
ω ω ω

These figures give an illustration of the effect of windowing in the frequency domain.

4π 2π
Provided that M +1  2ωc ⇔ M + 1  ω :
1.0
4π 2π
Passband ripple: ∆ω ≈ M +1 , stopband M +1
0.5

H
Transition peak-to-peak: ∆ω ≈ M4π
+1

Transition gradient: d|H| ≈ M2π+1 0.0


ω=ωc
−2 0 2
ω
Window Relationships

Relationships when you multiply an impulse response h[n] by a window w[n] that is M + 1 long
1
HM +1 (ejω ) = H(ejω ) ~ W (ejω )

1.0 24 M =24
1.0

12
W

0.5
H

0.5

0
0.0
0.0
−2 0 2 −2 0 2 −2 0 2
ω ω ω

w[0] 0.5
W (ejω )dω
R
(a) Passband gain ≈ w[n]; peak ≈ 2 + 2π mainlobe
rectangular window : passband gain = 1; peak gain = 1.09

(b) Transition bandwidth, ∆ω = width of the main lobe


Transition amplitude, ∆H = integral of main lobe divide by 2π

rectangular window : ∆ω = M +1 , ∆H ≈ 1.18

(c) Stopband gain is an integral over oscillating sidelobes of W (ejω )


M +1
rectangular window : | min H(ejω )| = 0.09  | min W (ejω )| = 1.5π

(d) The features that are narrower than the main lobe will be broadened and attenuated

Aidan O. T. Hogg Page 31


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Common Windows

0.37
Rectangular: 0
-13.0 dB
w[n] = δ− M ≤n≤ M

|W | (dB)
2 2

Main lobe width: 4π/(M + 1) −50

Relative sidelobe level: 13.0dB


Never use
−100
0 0 1 2 3
Rectangular ω

0.79
Hanning: 0

2πn -31.5 dB
w[n] = 0.5 + 0.5 cos M

|W | (dB)
+1

Main lobe width: 8π/(M + 1) −50


Relative sidelobe level: 31.5dB
Rapid sidelobe decay
−100
0 0 1 2 3
Hanning ω

0.87
Hamming: 0
2πn
w[n] = 0.54 + 0.46 cos M

|W | (dB)
+1 -40.0 dB
Main lobe width: 8π/(M + 1) −50
Relative sidelobe level: 40.0dB
Best peak sidelobe
−100
0 0 1 2 3
Hamming ω

1.19
Blackman-Harris (3-term): 0
2πn 4πn
w[n] = 0.42 + 0.5 cos M +1 + 0.08 cos M +1
|W | (dB)

Main lobe width: 12π/(M + 1) −50 -58.0 dB


Relative sidelobe level: 58.0dB
Best peak sidelobe
−100
0 0 1 2 3
Blackman-Harris ω

FIR Filter Order Estimation

H(ejω )
Several formulae estimate the required order M of a filter.
1+δ
One that is often used is the ‘Fred Harris approximation’: 1
1−δ
A
M≈ , where A = 20 log10 ()
20(ω2 − ω1 )/2π

This is, of course, of only approximate.
0
0 ω1 ω2 π
For example:

Specifications: 1.00

Bandpass: 0.5 ≤ |ω| ≤ 1 0.75


Transition bandwidth: ∆ω = 0.1 0.50
H

Ripple: δ =  = 0.01
0.25
20 log10 () = −40 dB
20 log10 (1 + 0.01) = 0.09 dB 0.00
0 1 2 3
ω

Aidan O. T. Hogg Page 32


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Order:
A 40
M≈ = = 126
20(ω2 − ω1 )/2π 20(0.1)/2π

Ideal Impulse Response:


Difference of two low-pass filters: M = 126

sin ω2 n sin ω1 n
h[n] = πn − πn

A Hanning window will be used where M is set to 126


The figures below show the result of this type of filter design.
0

1.0 0 M = 126
M = 126

0.8 −20

0.6 H (dB) −40


H

0.4 −60

0.2
−80

0.0
−100
0.0 0.5 1.0 1.5 2.0 2.5 3.0 0 1 2 3
ω ω

Frequency Sampling

In the windowing method we truncate h[n] to ± M2 to make it finite, however, another approach could
be to take the IDFT of M + 1 equally spaced samples of H(ejω ).

On the surface, this appears to be a good idea due to the fact that it has the advantage of giving an
exact match at the sample points.

However, it unfortunately has one big disadvantage which is that the intermediate approximation is poor
if the spectrum varies rapidly.

This can be seen if we design the previous filter using the frequency sampling method with the same
value of M as before. It is clear from the result below, that this is not a great design and clearly worse
than the windowing method.

1.0 1.50
M + 1 = 127 M + 1 = 127

0.8 1.25

1.00
0.6
H

0.75
0.4
0.50
0.2
0.25

0.0 0.00
−3 −2 −1 0 1 2 3 0.0 0.5 1.0 1.5 2.0 2.5 3.0
ω ω

Aidan O. T. Hogg Page 33


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

It is possible to improve the frequency sampling method in the following ways:

(a) Make the filter transitions smooth over ∆ω width


(b) Oversample and do least squares fit (Now can’t use IDFT)
(c) Use non-uniform points with more points near the transition (Now can’t use IDFT)

4.3 IIR Digital Filter Design


Continuous Time Filters

Classical continuous-time filters optimise tradeoff: passband ripple v stopband ripple v transition width.
This means there are explicit formulae for pole/zero positions.

Butterworth Filter 1.0


1 0.8 N =4
G2 (Ω) = |H(jΩ)|2 =
1 + Ω2N 0.6

|H|
(1) Monotonic ∀Ω 0.4
1 2N 3 4N
(2) G(Ω) = 1 − 2Ω + 8Ω + ··· 0.2

Maximally flat: 2N − 1 derivatives are zero 0.0


0.10 1.00 10.00
Frequency (rad/s)

Bilinear Transform

The bilinear transform is a widely used one-to-one invertible mapping. It involves a change variable:
α+s z−1
z= ⇔s=α
α−s z+1

(a) < axis (s) ↔ < axis (z)


(b) = axis (s) ↔ Unit circle (z)
Proof: ω ω
ejω − 1 ej 2 − e−j 2 ω
z = ejω ⇔ s = α = α jω ω = jω tan = jΩ

e +1 e 2 + e−j 2 2
(c) Left half plane (s) ↔ inside of unit circle (z)
Proof:
|(α + x) + jy|2 α2 + 2αx + x2 + y 2 4αx
s = x + jy ⇔ |z|2 = = 2 = 1+ , x < 0 ↔ |z| < 1
|(α + x) − jy|2 α − 2αx + x2 + y 2 (α − x)2 + y 2

(d) Unit circle (s) ↔ = axis (z)

3.0
2 s-plane 2 z-plane
α=1 α=1
2.5
1 1
2.0

0 0 1.5
ω

−1 −1 1.0

0.5
−2 −2
0.0
−2 0 2 −2 0 2 0.0 2.5 5.0 7.5 10.0
Ω/α

Aidan O. T. Hogg Page 34


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Example:
1
H(s) = and α = 1
s2 + 0.2s + 4
Substitute: s = α z−1
z+1

1 (z + 1)2
H(z) = =
z−1 2 z−1 (z − 1)2 + 0.2(z − 1)(z + 1) + 4(z + 1)2
 
z+1 + 0.2 z+1 +4

z 2 + 2z + 1 1 + 2z −1 + z −2
= = 0.19
5.2z 2 + 6z + 4.8 1 + 1.15z −1 + 0.92z −2

Frequency response is identical in both magnitude and phase, however, the frequency axis has been
distorted.

Frequency mapping: ω = 2 tan−1 Ω


α

Ω = [α 2α 3α 4α 5α] → ω = [1.6 2.2 2.5 2.65 2.75]

Choosing α:
Ωc
Set α = to map Ωc → ωc
tan 12 ωc
2
Set α = 2fs = to map low frequencies to themselves.
T
Impulse Invariance

Bilinear transform works well for a low-pass filter but the non-linear compression of the frequency distorts
any other response. The impulse invariance transformation is an alternative method that obtains the
discrete-time filter by sampling the impulse response of the continuous-time filter.

L −1 sample Z
H(s) −−−→ h(t) −−−−→ h[n] = T × h(nT ) −→ H(z)
Properties:

Advantages: Impulse response is correct with no distortion of frequency axis.


Disadvantages: The frequency response is aliased.

Example:

Standard telephone (300 to 3400 Hz bandpass) filter

1.00 1.00 1.00

0.75 0.75 0.75


|H|

|H|

|H|

0.50 0.50 0.50


Analog Filter Bilinear (fs = 8 kHz) Impulse Invariance
Matched at 3.4 kHz (fs = 8 kHz)
0.25 0.25 0.25

0.00 0.00 0.00


0 10 20 0 1 2 3 0 1 2 3
Frequency (krad/s) ω (rad/sample) ω (rad/sample)

Aidan O. T. Hogg Page 35


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

4.4 Digital Filter Structures


Direct Forms

If an IIR filter has a transfer function:

P (z) p[0] + p[1]z −1 + p[2]z −2 + · · · + p[M − 1]z −(M −1) + p[M ]z −M


H(z) = =
D(z) 1 + d[1]z −1 + d[2]z −2 + · · · + d[N − 1]z −(N −1) + d[N ]z −N

Then direct forms use coefficients d[k] and p[k] directly. This can be implemented as a cascade of two
filter sections where:

W (z)
H1 (z) = = P (z) = p[0] + p[1]z −1 + p[2]z −2 + · · · + p[M − 1]z −(M −1) + p[M ]z −M
X(z)
and
Y (z) 1 1
H2 (z) = = =
W (z) D(z) 1 + d[1]z + d[2]z + · · · + d[N − 1]z −(N −1) + d[N ]z −N
−1 −2

Note that H1 (z) can be seen as an FIR filter and the time-domain representation of H2 (z) is given by:
y[n] = w[n] − d[1]y[n − 1] − d[2]y[n − 2] − · · · − d[N ]y[n − N ]

So the filter section H1 (z) and H2 (z) can be realised as shown :

p[0]
x[n] w[n] w[n] y[n]
−1 −1
z z
p[1] −d[1]
x[n − 1] y[n − 1]

z −1 z −1
p[2] −d[2]
x[n − 2] y[n − 2]

p[M − 1] −d[N − 1]
x[n − M + 1] y[n − N + 1]

z −1 z −1
p[M ] −d[N ]
x[n − M ] y[n − N ]

Direct Form I

1
Direct form I can be viewed as P (z) followed by D(z) . This leads to the realisation of the original IIR
transfer function:
p[0]
x[n] y[n]

z −1 z −1
p[1] −d[1]
x[n − 1] y[n − 1]
−1 −1
z z
p[2] −d[2]
x[n − 2] y[n − 2]

p[M − 1] −d[N − 1]
x[n − M + 1] y[n − N + 1]
−1 −1
z z
p[M ] −d[N ]
x[n − M ] y[n − N ]

Aidan O. T. Hogg Page 36


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Direct Form II

1
Direct form II implements D(z) followed by P (z):

p[0]
x[n] y[n]

z −1 z −1
−d[1] p[1]

z −1 z −1
−d[2] p[2]

−d[N − 1] p[M − 1]

z −1 z −1
−d[N ] p[M ]

We observe that it is possible to share the delays which gives us the cononic structure below (also called
direct form II):
p[0]
x[n] y[n]

z −1
−d[1] p[1]

z −1
−d[2] p[2]

−d[N − 1] p[M − 1]

z −1
−d[N ] p[M ]

The diagram above shows the case where M = N

So direct form II saves on delays (storage).

Transposed Forms

It is also possible to convert any structure into an equivalent transposed form. This is achieved in the
following way:

1. Reverse direction of each interconnection


2. Reverse direction of each multiplier
3. Change junctions to adders and vice-versa
4. Interchange the input and output signals

Check: A valid structure must never have any feedback loops that don’t go through a delay (z −1 block).

Aidan O. T. Hogg Page 37


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Direct Form I Transposed


p[0]
x[n] y[n]
−1 −1
z z
−d[1] p[1]

z −1 z −1
−d[2] p[2]

−d[N − 1] p[M − 1]

z −1 z −1
−d[N ] p[M ]

Direct Form II Transposed


p[0]
x[n] y[n]

z −1
p[1] −d[1]

z −1
p[2] −d[2]

p[M − 1] −d[N − 1]

z −1
p[M ] −d[N ]

The diagram above shows the case where M = N


Precision Issues

If all computations were exact, it would not make any difference which of the equivalent structures were
used, however, this is never the case. There are two types of precision errors which are, coefficient
precision and arithmetic precision.
• Coefficient precision:

Coefficients can only be stored to finite precision and, therefore, are not exact. This means
that the filter actually implemented is not correct. This is due to the fact that changes to the
coefficients results in movment of the poles and zeros.

The roots of high order polynomials can be very sensitive to small changes in coefficient values.

A famous example being the Wilkinson’s polynomial. In 1984, he described the personal impact
of this discovery: “Speaking for myself I regard it as the most traumatic experience in my career
as a numerical analyst”

• Arithmetic precision:

It is also not possible to implement exact arithmetic calculations. These errors become
particularly bad when calculating differences between two similar values:

1.234567891.23456678 = 0.00000111 : 9 s.f. → 3 s.f.


Errors in arithmetic calculations have the effect of creating noise that is then filtered by the transfer
function from the point of creation to the output.

Aidan O. T. Hogg Page 38


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

5 Module 5 - Multirate Signal Processing


5.1 Multirate Systems
Building Blocks

x[n] y[m]
Downsampling ↓K y[m] = x[Km]

( hni
u[m] v[n] u , n|K
Upsampling ↑K v[n] = K
0, else

Note: a | b means that a divides into b exactly

Example

Downsample by 2 and then upsample by 3:

w[n] x[m] y[r]

w[n] x[m] y[r]


↓2 ↑3
0 0 0

Notice the synchronisation, all signals have a sample at n = 0

Resampling Cascades

Successive downsamplers can be combined ↓P ↓Q = ↓ PQ

Successive upsamplers can be combined ↑P ↑Q = ↑ PQ

Upsampling can be inverted exactly ↑P ↓P =

Downsampling permanently destroys


↓P ↑P 6=
information and thus is non invertible

If and, only if, P and Q are coprime then x w y x u v


↓P ↑Q = ↑Q ↓P
resampling can be interchanged

Aidan O. T. Hogg Page 39


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Proof:
h i h i
1 P
Left side: y[n] = w Qn =x Qn if Q | n else y[n] = 0
h i
P
Right side: v[n] = u[P n] = x Qn if Q | P n

But {Q | P n ⇒ Q|n} iff P and Q are coprime

5.2 Noble Identities

lQ

Resamplers commute with addition + lQ = +

lQ

Resamplers commute with multiplication × lQ = lQ ×

Note: l Q could be either ↑ Q or ↓ Q

Delays must be multiplied by the


↓Q z −1 = z −Q ↓Q
resampling ratio

z −1 ↑Q = ↑Q z −Q

Noble identities: Exchange resamplers


= H zQ

↓Q H(z) ↓Q
and filters

H(z) ↑Q = ↑Q H(z Q )

Corrollary: H zQ =

↑Q ↓Q H(z)

Example: H(z) = h[0] + h[1]z −1 + h[2]z −2 + · · · and H(z 4 ) = h[0] + h[1]z −4 + h[2]z −8 + · · ·

Aidan O. T. Hogg Page 40


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Noble identities proof

Downsampled Noble Identity


x[n] u[r] y[r] x[n]  v[n] w[r]
↓Q H(z) = H zQ ↓Q
If hQ [n] is defined to be the impulse
response of H(z Q ).

Let’s assume that h[r] is of length M + 1 so that hQ [n] is of length QM + 1. Note that hQ [n] = 0 except
when Q | n and that h[r] = hQ [Qr].
PQM
w[r] = v[Qr] = s=0 hQ [s]x[Qr − s]
PM PM
= m=0 hQ [Qm]x[Qr − Qm] = m=0 h[m]x[Q(r − m)]
PM
= m=0 h[m]u[r − m] = y[r]

Upsampled Noble Identity


x[r] u[r] y[n] x[r] v[n] w[n]
H(z) ↑Q = ↑Q H(z Q )
Note that v[n] = 0 except when Q | n
and that v[Qr] = x[r].
PQM PM
w[n] = s=0 hQ [s]v[n − s] = m=0 hQ [Qm]v[n − Qm]
PM
= m=0 h[m]v[n − Qm]
if Q - n, then v[n − Qm] = 0 ∀ m so w[n] = 0 = y[n]
PM PM
if Q | n = Qr, then w[Qr] = m=0 h[m]v[Qr − Qm] = m=0 h[m]x[r − m] = u[r] = y[Qr]

5.3 Upsampled z-transform

v[n]z −n = n −n
u[m]z −Km = U (z K )
P P P
V (z) = n n s.t. K|n u[ K ]z = m
u[m] v[n]

Spectrum: V (e ) = U (e jKω
) ↑K

The spectrum is horizontally shrunk and replicated K times. U (z) U (z k )


↑K
Total energy unchanged and power (energy/sample) multiplied by k1 .
Upsampling normally followed by a low-pass filter to remove images.

Example:

If K =R3 then three images R of the original spectrum are generated and the energy remains unchanged
1 1
i.e. 2π |U (ejω )|2 dω = 2π |V (ejω )|2 dω.

|U (ejω )| |V (ejω )|
1 1

−2 2 ω −2 2 ω

Aidan O. T. Hogg Page 41


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

5.4 Downsampled z-transform

1
PK−1 j2πkn x[n] y[m] xK [n]
Define cK [n] = δK|n = K k=0 e K
↓K ↑K

(
x[n], K|n
Define xK [n] = = cK [n]x[n]
0, K-n

P PK−1 j2πkn PK−1 P j2πkn


xk [n]z −n = K1
x[n]z −n = K
1
x[n]z −n
P
XK (z) = n n k=0 e
K
k=0 ne
K

PK−1 P −j2πk −n PK−1 −j2πk 


1 1
= K k=0 n x[n] e
K z =K k=0 X e
K z

PK−1 −j2πk 1
1 PK−1 −j2πk 1 1
XK (z) = Y (z K ) ⇒ Y (z) = XK (z K ) = 1
X(e K zK) X(z) K k=0 X(e K zK)
K k=0
↓K

Spectrum:

PK−1 j(ω−2πk)
 jω jω j2π jω j4π

Y (ejω ) = 1
K k=0 X(e K )= 1
K X(e K ) + X(e K − K ) + X(e K − K ) + ···

Average of K aliased versions, each expanded in ω by a factor of K. This is why downsampling is normally
preceded by a low-pass filter to prevent aliasing.

Example 1:
1 X Y
1
K=3
π
Not quite limited to ± K . The shaded
region highlights the resulting aliasing.
Energy decreases:
1 jω 2 1 1 −2 2 ω −2 2 ω
|X(ejω )|2 dω
R R
2π |Y (e )| dω ≈ K × 2π

Example 2: X Y
1 1
K=3
π π
All engergy between K ≤ |ω| < 2 K .
Therefore no aliasing.
−2 2 ω −2 2 ω

No aliasing

π π
There is no aliasing if all the energy is between r K ≤ |ω| < (r + 1) K for some integer r.

π π
The normal case being when r = 0 where all the energy is between K ≤ |ω| < K.

Effects of downsampling

1 1
1. Total energy multiplied by ≈ K (= K if no aliasing).
2. The average power (energy/sample) ≈ is unchanged.

Aidan O. T. Hogg Page 42


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

5.5 Perfect Reconstruction


It is possible to achieve perfect reconstruction after downsampling, for example, if a given input sequence
x[n] is split into three streams at 13 of the sample rate:

u[m] = x[3m], v[m] = x[3m − 1], w[m] = x[3m − 2]

And then if all the following sequences are upsampled and aligned by delays then, they can be added
together to give:
y[n] = x[n − 2]

x[n] u[m]
↓3 ↑3

z −1 z −1
x[n] c d e f g h i j k l m n
u[m] c f i l p[n]
v[m]
p[n] - c - - f - - i - - l ↓3 ↑3 +
v[m] b e h k
q[n] - b c - e f - h i - k l
w[m] a d g j z −1 z −1
y[n] a b c d e f g h i j k l q[n]
w[m] y[n]
↓3 ↑3 +

Therefore the output y[n] in this case is just a delayed replica of the input x[n].

5.6 Polyphase Filters


Maximum Frequency Decimation

If the bandpass of a filter only occupies a small fraction of [0, π], it is possible to downsample then
upsample without losing any information.

x[n] y[n]
H(z) ↓K ↑K
K

To avoid aliasing in the passband:


2π 2π
− ω2 ≥ ⇒ K≤
K ω1 − ω2

π
Centre of the transition band must be ≤ intermediate Nyquist freq, K

x[n] y[n]
H(z) ↓4 ↑4
4

1 |H| 1 |Y /X| K=4 1 |Y /X| K=7

ω1 ω2 3 2π/4 3 2π/7 3

Aidan O. T. Hogg Page 43


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing


The images spaced at K can be removed using another low-pass filter.

x[n] y[n]
H(z) ↓7 ↑7 LPF
7

Note: the passband noise is equal to the noise floor at output of H(z) plus 10 log10 (K − 1) dB.

Polyphase Decomposition

The general case of a K-branch polyphase


decomposition of the transfer function H(z) of x[n]
H0 (z K )
order N is of the form:
PK−1
H(z) = m=0 z −m Hm (z K ) z −1

Proof:
PM H1 (z K ) +
H(z) = m=0 h[m]z −m
PK−1 PK−1
= h[m]z −m + m=0 h[m + K]z −(m+K) + · · ·
m=0
PR−1 PK−1
= r=0 m=0 h[m + Kr]z −(m+Kr) z −1
PK−1 PR−1
= m=0 z −m r=0 hm [r]z −Kr
y[n]
where hm [r] = h[m + Kr] HK−1 (z K ) +
PK−1
= m=0 z −m Hm (z K )

Polyphase Downsampler

If H(z) is low-pass so that it is possible to downsample its output by K without the problem of aliasing.
x[n] v[i]
H(z) ↓K

By decomposing H(z) into a a polyphase representation, it is possible to take advantage of the Noble
identities. It is therefore possible to move the downsampling back through the adders and filters. Thus
Hm (z K ) turns into Hm (z) at the lower sample rate. This has the effect of massively reducing the
computation.

x[n] x[n]
H0 (z K ) ↓K H0 (z)

z −1 z −1

H1 (z K ) + ↓K H1 (z) +

z −1 z −1

v[i] v[i]
HK−1 (z K ) + ↓K ↓K HK−1 (z) +

The sample rate at v[i] is now lower, however, it is possible to restore the original sample rate by
upsampling.

Aidan O. T. Hogg Page 44


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Polyphase Upsampler

Upsampling is always followed by a low-pass filter to remove the images


v[i] y[n]
↑K H(z)

It is possible to use the same low-pass filter, H(z), in polyphase form. In this case the delay z −m after
the filters. By taking advantage of the Noble identities, it is possible to move the upsampling forward
through the filters. Thus Hm (z K ) turns into Hm (z) at the lower sample rate. This again has the effect
of massively reducing the computation.

v[i] y[n]
v[i] y[n] H0 (z) ↑K +
K +
↑K H0 (z )

z −1
z −1

H1 (z) ↑K +
H1 (z K ) +

z −1
z −1

HK−1 (z) ↑K
HK−1 (z K )

Complete Filter

The overall system implements:


x[n] v[i] y[n]
H(z) ↓K ↑K H(z)
K

The extra gain of K is needed to compensate for the downsampling energy loss.

5.7 Resampling
The conditions required to change the sampling rate while preserving information:

Downsample:
π
x[n] y[i]
LPF to new Nyquist bandwidth: ωc = K LPF ↓K

Upsample:
x[i] y[n]
π
LPF to old Nyquist bandwidth: ωc = K ↑K LPF

P
Rational ratio: fs × Q
x[n] y[i]
LPF to lower of old and new Nyquist ↑P LPF ↓Q
π
bandwidth: ωc = max(P,Q)

(a) Polyphase decomposition reduces computation by K = max(Q, P )


π
(b) The transition band centre should be at the Nyquist frequency ωc = K

Aidan O. T. Hogg Page 45


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

5.8 2-band Filterbank

x[n] x0 [n] v0 [n] y0 [n]


H0 (z) ↓2 ↑2 F0 (z)

x1 [n] v1 [n] y1 [n] x̂[n]


H1 (z) ↓2 ↑2 F1 (z) +

Xm (z) = Hm (z)X(z), where m ∈ {0, 1}


K−1
1 X −j2πk 1 1n 1 1
o
Vm (z) = Xm (e K z k ) = Xm (z 2 ) + Xm (−z 2 )
K 2
k=0

1 1
Ym (z) = Vm (z 2 ) = {Xm (z) + Xm (−z)} = {Hm (z)Xm (z) + Hm (−z)Xm (−z)}, where k = 2
2 2

 
  F0 (z)
X̂(z) = Y0 (z) Y1 (−z)
F1 (z)
  
1  H0 (z) H1 (z) F0 (z)
= X(z) X(−z)
2 H0 (−z) H1 (−z) F1 (z)
 
  T (z)
= X(z) X(−z) , where X(−z)A(z) is the ’aliased’ term.
A(z)

we want:
1
T (z) = {H0 (z)F0 (z) + H1 (z)F1 (z)} = z −d
2
1
A(z) = {H0 (−z)F0 (z) + H1 (−z)F1 (z)} = 0
2

For perfect reconstruction without aliasing, we require:


    −d 
1 H0 (z) H1 (z) F0 (z) z
=
2 H0 (−z) H1 (−z) F1 (z) 0

Hence:    −1  −d 
F0 (z) H0 (z) H1 (z) 2z
=
F1 (z) H0 (−z) H1 (−z) 0
2z −d
  
H1 (−z) −H1 (z) 1
=
H0 (z)H1 (−z) − H1 (z)H0 (−z) −H0 (−z) H0 (z) 0
2z −d
 
H1 (−z)
=
H0 (z)H1 (−z) − H1 (z)H0 (−z) −H0 (−z)
For all filters to be FIR, we need the denominator to be

H0 (z)H1 (−z) − H1 (z)H0 (−z) = cz −k (scaling factor and delay)

which implies:      
F0 (z) 2 H1 (−z) d=k 2 H1 (−z)
= z k−d =
F1 (z) c −H0 (−z) c −H0 (−z)
1 1
Hi (z) is scaled by c 2 and Fi (z) is scaled by c− 2

Aidan O. T. Hogg Page 46


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

5.9 Quadrature Mirror Filterbank (QMF)

x[n] x0 [n] v0 [n] y0 [n]


H0 (z) ↓2 ↑2 F0 (z)

x1 [n] v1 [n] y1 [n] x̂[n]


H1 (z) ↓2 ↑2 F1 (z) +

QMF satisfies:

(a) H0 (z) is real and causal


π
(b) H1 (z) = H0 (−z): i.e. |H0 (ejω )| is reflected around ω = 2

(c) F0 (z) = H1 (−z) = H0 (z)


(d) F1 (z) = −H0 (−z) = −H1 (z)

QMF is alias-free:

1
A(z) = {H0 (−z)F0 (z) + H1 (−z)F1 (z)}
2
1
= {H1 (z)H0 (z) − H0 (z)H1 (z)} = 0
2

QMF Transfer Function:

T (z) = H0 (z)F0 (z) + H1 (z)F1 (z)

= H02 (z) − H12 (z) = H02 (z) − H02 (−z)

5.10 Polyphase QMF


Polyphase decomposition:

H0 (z) = E0 (z 2 ) + z −1 E1 (z 2 )

H1 (z) = H0 (−z) = E0 (z 2 ) − z −1 E1 (z 2 )

F0 (z) = H0 (z) = E0 (z 2 ) + z −1 E1 (z 2 )

F1 (z) = −H0 (−z) = −E0 (z 2 ) + z −1 E1 (z 2 )

The matrix form of the analysis side:

E0 (z 2 )
    
H0 (z) 1 1
=
H1 (z) 1 −1 z −1 E1 (z 2 )

Can be written in this way:


 
   2 −1 2
 1 1
H0 (z) H1 (z) = E0 (z ) z E1 (z )
1 −1

The matrix form of the synthesis side:


  −1
z E1 (z 2 )
   
F0 (z) 1 1
=
F1 (z) 1 −1 E0 (z 2 )

Aidan O. T. Hogg Page 47


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

Therefore  
  F0 (z)
X̂(z) = X(z) H0 (z) H1 (z)
F1 (z)
By substitution can be written in this way:

E0 (z 2 )
   
 2 −1 2
 1 1 1 1
X̂(z) = X(z) E0 (z ) z E1 (z )
1 −1 1 −1 z −1 E1 (z 2 )

x[n]
E0 (z 2 ) + ↓2 ↑2 + E1 (z 2 )

z −1 z −1

x̂[n]
E1 (z 2 ) − + ↓2 ↑2 − + E0 (z 2 ) +

This reduces the computational complexity by a factor of 2 as the processing is now performed on half
the samples.

By applying the Noble identities, it is possible to obtain the following structure in which all filtering is
carried out efficiently at the lowest possible sampling rate

x[n]
↓2 E0 (z) + + E1 (z) ↑2

z −1 z −1

x̂[n]
↓2 E1 (z) + + E0 (z) ↑2
− −

This reduces the computational complexity again by a factor of 2 and, therefore, the polyphase QMF
reduces the overall computational complexity by a factor of 4.

Aidan O. T. Hogg Page 48


Imperial College London ELEC96010 (EE3-07) - Digital Signal Processing

References
[1] Patrick A. Naylor, lecture slides. Course: ELEC96010 (EE3-07) Digital Signal Processing.
Imperial College London
[2] Mike Brookes, lecture slides. Course: ELEC97023 (EE4-12) Digital Signal Processing and Digital
Filters.
Imperial College London
[3] Roy S. C. Dutta, lecture slides Course: Digital Signal Processing.
Indian Institute of Technology
[4] John G. Proakis and Dimitris G. Manolakis, Digital Signal Processing: Principles, Algorithms, and
Applications, 1996.
Prentice-Hall, Inc

[5] Sanjit K. Mitra, Digital Signal Processing: A Computer-Based Approach, 2001.


McGraw-Hill School Education Group
[6] Strang, Gilbert, Computational Science and Engineering, 2007.
Wellesley, MA: Wellesley-Cambridge Press
[7] M. Vetterli and J. Kovacevic, Wavelets and Subband Coding, 1995.
Prentice-Hall, Inc

Aidan O. T. Hogg Page 49

You might also like