You are on page 1of 35

Discrete Fourier Transform

Dr D. Banda

1
DT systems these
Can be used

DFT
can be
used to
approx.
these
CT systems these
Were covered

• Summary of direct and inverse Fourier transforms and the key computational
operations required for their evaluation.
•The presence of an infinite sum or integral prevents exact numerical computation
of the corresponding transform
12/04/2022 EEE 4221 2
From DTFT to DFT

(1)

2 problems:
1) Sums over infinity not possible for infinite duration signals.
2) Frequency is continuous but can only process discrete frequencies

12/04/2022 EEE 4221 3


Dealing with the 1st problem:

Approximate by taking N samples from x[n]

(2)

•This approximation will be reasonable if the values of x[n] outside the interval 0 ≤
n ≤ N −1 are either zero or negligibly small
•Performing a windowing operation and has greatest effect on accuracy.

12/04/2022 EEE 4221 4


Dealing with the 2nd problem:

Substitute continuous frequency variable with discrete frequencies:

For convenience we set:

Substituting into (2):

(3)

This can be computed on a digital processor.

12/04/2022 EEE 4221 5


Ho do we synthesis x[n] from X[k]:

Compare (3) to DTFS coefficients formula:


DTFS IDTFS

Can then use the IDTFS to get x[n]:

12/04/2022 EEE 4221 6


DTF IDTF

Computes N-point DFT Computes N-point IDFT


Of periodic or aperiodic sequence Of N DFT coefficients

•These are known as the DFT and IDFT (they form a DFT pair)
•Similar exercise can be used on CTFT, CTFS,
•therefore DFT can be used to compute exactly or approximately all fourier
decompositions (DTFS, CTFS, DTFT, CTFT).

12/04/2022 EEE 4221 7


Making our lives simpler:
Lets introduce what we call the twiddle factor:

substituting into DFT and IDFT:

•This reduces the computational complexity of calculating DFT and IDFT


•Important in the Fast Fourier transform (FFT) algorithms that calculates the
DFT/IDFT efficiently

12/04/2022 EEE 4221 8


Making our lives simpler (DFT Matrix Formulation):

XN = WN xN

12/04/2022 EEE 4221 9


Making our lives simpler (DFT Matrix Formulation):
XN = WN xN

• WN is linear transformation that maps the signal vector xN to DFT coefficients


vector XN

12/04/2022 EEE 4221 10


Example:

12/04/2022 EEE 4221 11


Zero-padding:
• Until now, for x[n], with 0 ≤ n ≤ N − 1, to determine X(ejω) we approximated using an
N-point DFT.
• That is we evaluated X(ejω) at a set of N equispaced frequencies ωk = (2π/N)k by

• However, we usually choose K much larger than N, so that the plot of X(ej(2π/K)k)
appears to be continuous.
• This is achieved by padding the signal with zeros resulting in a “zero-padded”
sequence:

• Applying the DFT to this yields:

12/04/2022 EEE 4221 12


Zero-padding: Example rectangular pulse

• Using the DTFT the spectral composition of x[n] is given by:

12/04/2022 EEE 4221 13


Zero-padding: Example rectangular pulse
•DTFT the spectral composition of x[n]:

(BUT remember DTFT difficult to implement on Hardware.)

• K-point DFT we make the substitution ωk = (2π/N)k

DFT: DFT:
For K = N = 4 N=4
ω0 = 0
ω1 = π/2
ω2 = π
ω3 = 3π/2 X[0] X[1] X[2] X[3]

12/04/2022 EEE 4221 14


Zero-padding: Example rectangular pulse
ωk = (π/2)k

ωk = (π/4)k

ωk = (π/8)k

Zero-padding helps to make the shape of the DTFT more evident by evaluating
samples at a denser frequency grid.
12/04/2022 EEE 4221 15
Zero-padding:

• The N-point DFT is sufficient to uniquely represent the N-samples of the original
sequence.

• However, it does not provide a “good picture” of the spectral composition of x[n].

• This better picture is obtained by padding the N-point sequence x[n] by (K − N)


zeros and computing the K-point DFT.

• The result is a better representation of X(ejω) for display purposes; there is no


additional information that can be exploited by signal processing algorithms.

12/04/2022 EEE 4221 16


Effects of time-windowing :

• Selecting a finite number of samples is equivalent to multiplying x[n], defined in the


range −∞ < n < ∞, by a finite-length w[n] called a window.

Therefore in spectral analysis, the DFT provides samples of the DTFT of the windowed
signal ˆx[n] = w[n]x[n], not of the original signal x[n]

12/04/2022 EEE 4221 17


Effects of time-windowing :
The application of DFT requires three steps:
i) sample the continuous-time signal,
ii) select a finite number of samples for analysis, and
iii) compute the spectrum at a finite number of frequencies

•To understand how time-windowing changes the spectrum of the original signal we
interchange the order of sampling and windowing operations (as long as w[n] = wc(nT)).

12/04/2022 EEE 4221 18


Effects of time-windowing :

• Understand effects of a finite observation interval, in terms of the physical time and
frequency variables,
• Without interference from the subsequent time and frequency sampling operations.
• Avoid the complications of dealing with periodic spectra.

12/04/2022 EEE 4221 19


Effects of time-windowing: Single frequency sinusoidal signal

The effect of time windowing is to replace each line of the discrete spectrum with a
scaled copy of Wc(jΩ) centred at the frequency of the line.

12/04/2022 EEE 4221 20


Effects of time-windowing: Single frequency sinusoidal signal

2π/T0

12/04/2022 EEE 4221 21


Effects of time-windowing: Single frequency sinusoidal signal

• Mainlobe has zero-crossings at multiples of 2π/T0 (window bandwidth).


• We note that sidelobes adding in (out of) phase can increase (reduce) the heights of
the peaks
•Spectral lines of Xc(jΩ), which have zero width, have been “spread out” or “smeared” in
ˆXc(jΩ) (spectral spreading or smearing)
• The spectrum of ˆxc(t) is zero nowhere because of the sidelobes (leakage)
• Leakage creates “false” peaks, that is, peaks at wrong frequencies, nonexisting peaks,
or changes the amplitude of existing peaks

12/04/2022 EEE 4221 22


Effects of time-windowing: Single frequency sinusoidal signal

• Smearing or blurring introduced by the time-windowing operation reduces the ability


to pick out peaks (resolvability) in the spectrum.

Cannot resolve the 2 spectra

12/04/2022 EEE 4221 23


Effects of time-windowing: Single frequency sinusoidal signal

• Smearing or blurring introduced by the time-windowing operation reduces the ability


to pick out peaks (resolvability) in the spectrum.

12/04/2022 EEE 4221 24


Effects of time-windowing: Signals with continuous spectra
• Single frequency observations can be easily extended to an arbitrary number of
sinusoidal signals.
Spectrum of ideal
bandpass signal

Spectrum of
Rectangular window

Spectrum of signal convolved


with Rectangular window

Spectrum of windowed
signal

12/04/2022 EEE 4221 25


Effects of time-windowing: Signals with continuous spectra

12/04/2022 EEE 4221 26


Effects of time-windowing: Windows

12/04/2022 EEE 4221 27


DFT closing remarks: Effects of Windowing and DFT spectral sampling
• We next illustrate the effects of windowing and DFT spectral sampling by means of
some examples.
DFT DTFT

We consider discrete-time signals:

Example 1:
8 8
Frequencies coincide
With DFT sample points

Example 2:
Frequencies in between
DFT sample points

(32-point DFT ωk = (2π/N)k = (π/16)k )

12/04/2022 EEE 4221 28


DFT closing remarks: Effects of Windowing and DFT spectral sampling
1) Spectrum analysis of the sum of two sinusoids whose frequencies coincide with the
sampling points (bins) of the DFT.
8 8

DFT ω4,8
peak same
as DTFT
DFT correctly gives zero DTFT
Rectangular
window DFT

Spectral spread but no


sidelobes
Hann window

12/04/2022 EEE 4221 29


DFT closing remarks: Effects of Windowing and DFT spectral sampling
2) Spectrum analysis of the sum of two sinusoids whose frequencies do not coincide
with the sampling points (bins) of the DFT.

DFT no longer gives zero


Rectangular
window

Spectral spread but still


no sidelobes
Hann window

12/04/2022 EEE 4221 30


DFT closing remarks: Effects of Windowing and DFT spectral sampling
Example 1: Frequencies coincide Example 2: Frequencies in between
With DFT sample points DFT sample points

•Mismatch between the zero crossings of the rectangular window and the DFT bins
all samples of the DFT are nonzero in Example 2 as opposed to Example 1.
•In contrast, the DFTs for the Hann windowed signals are remarkably similar.
To avoid misleading conclusions we should always use a Hann window and a
DFT with large zero-padding.

12/04/2022 EEE 4221 31


DFT closing remarks: Things to remember
To successfully use the DFT in spectral analysis, keep in mind the following
observations:

12/04/2022 EEE 4221 32


DFT closing remarks: Things to remember

12/04/2022 EEE 4221 33


DFT closing remarks: Operational Properties

12/04/2022 EEE 4221 34


THE END

12/04/2022 EEE 4221 35

You might also like