You are on page 1of 16

Signals and Systems, 2009 1

Discrete Fourier Transform

Discrete Time Fourier Series and Transforms

The goal of this section is to develop methods of representing periodic discrete-time


signals in the form of a finite Fourier series.

These methods are to replace the continuous-time methods when one only has
discrete-time samples of the continuous-time signal.

Some material is taken from Prof. J. Pauly’s notes (Stanford University) and is used with his permission
Signals and Systems, 2009 2

Discrete Fourier Transform as an approximation to the CTFS


Recall that a periodic continuous-time signal x(t), with a fundamental period T0 , can
be represented in the form of Fourier series
∞ T0
1
X Z
x(t) = Xk e2πjkt/T0 , Xk = x(t)e−2πjkt/T0 dt.
T0 0
k=−∞

Suppose we only know samples of x(t), taken every by Ts seconds, i.e, we take
Ns = T0 /Ts samples of x(t) per period.

We still can compute the Fourier series using


numerical integration.
Let us approximate x(t) between the samples
using the Zero Order Hold:

x(t) = x(nTs ) for nTs ≤ t < (n+1)Ts .


Signals and Systems, 2009 3

Then we can compute the harmonic coefficients approximately,


T0
1
Z
−j2πk Tt
Xk = x(t)e 0 dt
T0 0
NX
s −1 Z (n+1)Ts
1 −j2πk Tt
≈ x(nTs )e 0 dt
T0 n=0 nTs
³ ´
−jπ Nks k
e sinc Ns
NX
s −1
n
= x(nTs )e−j2πk Ns
Ns n=0

Ns −1
1 X −j2πk Nns
≈ x(nTs )e for |k| ¿ Ns .
Ns n=0

The expression in the box is called the Discrete Fourier Transform of the periodic
sequence x[n] = x(nTs ).

• The term ‘Fourier Transform’ could be confusing, since the DFT is a finite series.
Signals and Systems, 2009 4

Discrete Fourier Transform


• The DFT of a periodic sequence x[n], with fundamental period N , is defined as
N −1
n
X
DF T (x) = X[k] = x[n]e −j2πk N
, k = 0, . . . , N − 1.
n=0

• The DFT takes a finite sequence of numbers representing one period of x[n], and
produces another periodic sequence, with the same period N .

• Conversely, given the DFT of a periodic sequence x[n], X[k] , the corresponding
time-domain sequence x[n] is obtained from X[k] using the inverse DFT, or IDFT:

N −1
1 X k
j2πn N
x[n] = X[k] e .
N
k=0

• In Matlab, the name of the DFT function is fft, which stands for Fast Fourier
Transform, with reference to one particular algorithm for computing the DFT. The
name of the IDFT function is ifft.
Signals and Systems, 2009 5

Discrete Time Fourier Series and DFT


Textbooks define Discrete Time Fourier Series (DTFS) as a counterpart of the
Continuous Time Fourier Series, as follows

DTFS DFT

N −1 N −1
1 X n
X n
Direct X[k] = x[n]e X[k] = x[n]e
−j2πk N −j2πk N
N n=0 n=0

N −1 N −1
X k
j2πn N 1 X k
Inverse x[n] = X[k]e x[n] = X[k] ej2πn N
N
k=0 k=0

• When using the Matlab fft function be sure to normalize the result, because
1 1
X[k] = X[k] , DT F S(x[n]) = DF T (x[n]).
N N
Signals and Systems, 2009 6

Properties of Discrete Fourier Transform


• The DFT is the discrete Fourier series, its properties are similar to that of Fourier
series and Fourier Transform

• Linearity Let x and y be two periodic signals, and let N be the least common
multiple of their periods. Then

DF T (ax[n] + by[n]) = aX[k] + bY[k] , k = 0, . . . , N − 1.

• Time shifting (Circular shifting, since we are looking at periodic sequences):


m
DF T (x[n − m]) = DF T (x[n])e−j2πk N

• Duality If X[k] = DF T (x[n]), then DF T (X[k] ) = N x[−n], i.e., we recover


the original sequence but scaled by a factor of N and flipped, since
x[−n] = x[N − n].
• Parseval Theorem
N −1 N −1 N −1
1 X 1 X X
Px = |x[n]|2 = 2 |X[k] |2 = |X[k]|2 .
N n=0 N n=0 n=0
Signals and Systems, 2009 7

Circular (Periodic) Convolution


Let x and y be two periodic signals, and let N be the least common multiple of their
periods.

The circular convolution (periodic convolution) is defined as


N
X −1
z[n] = y°
∗ x= y[m]x[n − m]
m=0

The sequences are of infinite length, but the summation is over one common period of
the two sequences. The result is the same as using linear convolution with one of the
sequences padded with 0 beyond the fundamental period.

• Circular (Periodic) convolution


DF T (x[n]°
∗ y[n]) = Y[k] · X[k] , DF T S(x[n]°
∗ y[n]) = Y [k] · X[k].

• Multiplication
1
DF T (x[n]·y[n]) = Y[k] °
∗ X[k] , DF T S(x[n]·y[n]) = N ·Y [k]°
∗ X[k].
N
Signals and Systems, 2009 8

Common DFT problems: spectrum leakage and aliasing


The DFT algorithm is implemented in Matlab (function fft), it is commonly used in
signal processing of periodic sampled continuous-time and discrete time sequences.

Commonly occurring problems in using DFT are due to aliasing and spectrum leakage

To illustrate these problems consider PSfrag of infinite


cos ω0 treplacements
length. |X(jω)|
ejω0 t + e−jω0 t π
cos(ω0 t) =
2
Its Fourier transform was found
−ω0 ω0 ω
X(jω) = π [δ(ω − ω0 ) + δ(ω + ω0 )]
To apply the DFT (i.e., to compute the spectrum numerically), the signal of infinite
length such as cos(ω0 t) must be truncated.

Truncation effectively introduces a time window WT (t) = rectT (t) during which the
continuous-time signal is observed. The DFT then generates the approximate
spectrum of the truncated signal xT (t) = rectT (t) cos(ω0 t),

XT (jω) = X(jω) ∗ [T sinc(ωT /(2π))] , assuming a rectangular window.


Signals and Systems, 2009 9

Signal x(t) Amplitude Spectrum of x(t)


1

0.5
0.8
cos(5]pi t), t ∈ [−1,1]
cos(5π t), t ∈ [−.5,.5]
0.6
cos(5π t), with Hanning Window
0.4
0.4

0.2
0.3

|X(f)|
x(t)

0.2
−0.2

−0.4
0.1
−0.6

−0.8
0

−1
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 −10 −8 −6 −4 −2 0 2 4 6 8 10
Time, sec Frequency (Hz)

• The convolution produces two overlapping (to a various degree) main lobes around
±ω0 and many smaller side lobes. This effect is known as spectrum leakage -
small spectrum peaks appear everywhere.

• To reduce leakage
(a) Use wider windows (longer signals), sinc gets compressed as T → ∞, hence
less leakage.
(b) Use non-rectangular windows.
Signals and Systems, 2009 10

• The windowed signal xT (t) has a finite duration, hence it is no longer band-limited.
Sampling such a signal within the window will produce aliases in the spectrum by
creating multiple replicas of XT (jω) repeated periodically, and the adjacent
replicas will overlap.

• To reduce aliasing
(a) Oversample! A high sampling rate helps to reduce overlapping of aliases of
XT (jω). In the example, a sampling rate of 64kHz was used for the signal of
2.5Hz.
(b) Use antialiasing (low-pass) filter to narrow the bandwidth of the signal.
Signals and Systems, 2009 11

Windowing
1

Using nonrectangular windows alleviates spectrum leakage 0.9

0.8

problems. For example, Hanning window 0.7

0.6

1 2πn
0.5

w[n] = (1 − cos( )),


0.4

0.3

2 L−1 0.2

n = 0, . . . , L − 1, 0.1

0
0 5 10 15 20 25

Time, sec

L is the number of signal samples within the Amplitude Spectrum of x(t)

window. 0.5

cos(5]pi t), t ∈ [−1,1]


cos(5π t), t ∈ [−.5,.5]
cos(5π t), with Hanning Window
0.4

0.3

|X(f)|
Using nonrectangular windows, suppresses 0.2

sidelobes. 0.1

Several most common windows are listed in 0

Roberts, Chapter 14, Problem 22.


−10 −8 −6 −4 −2 0 2 4 6 8 10
Frequency (Hz)
Signals and Systems, 2009 12

Connections between various Fourier techniques

Discrete Frequency Continuous Frequency


Periodic in time Aperiodic in time

Continuous CTF Series CTF Transform


ta +T
1 ∞
Z Z
−j2πk Tt
Time Xk = x(t)e dt, X(jω) = x(t)e−jωt dt,
T ta −∞

1 ∞
Z
j2πk Tt
X
x(t) = Xk e x(t) = X(jω)ejωt dω
n=−∞
2π −∞

Discrete DTF Series, DFT DTF Transform



X
Time X(jω) = x[n]e−jnω ,
n=−∞
ωa +2π
1
Z
x[n] = X(jω)ejnω dω
2π ωa
Signals and Systems, 2009 13

(see Roberts, Chapter 11.6)


Signals and Systems, 2009 14

Multiplication-Convolution duality for the four Fourier methods

Discrete Frequency, Continuous Frequency

Continuous Time x(t)y(t) CTFS


←→ X[k] ∗ Y [k] x(t)y(t) CTFT
←→ X(f ) ∗ Y (f )

Discrete Time x[n]y[n] DTFS


←→ X[k]°
∗ Y [k] x[n]y[n] DTFT
←→ X(f )°
∗ Y (f )

Continuous Time ∗ y(t) CTFS


x(t)° ←→ T0 X[k]Y [k]
F
x(t) ∗ y(t) ←→ X(f )Y (f )

Discrete Time ∗ y[n] DTFS


x[n]° ←→ N0 X[k]°
∗ Y [k] x[n] ∗ y[n] DTFT
←→ X(f )Y (f )

Multiplication in one domain transforms into convolution in other domain. Convolution


of periodic signals (spectra) is a circular convolution, i.e, integrals/sums are taken over
a least common period.
Signals and Systems, 2009 15
Signals and Systems, 2009 16

Conclusion
• In addition to formal mathematical similarities, similarities and differences between
various Fourier operations are related to the nature of signals and systems
analyzed.
– If signal is discrete in one domain, it is periodic in another domain. In particular,
periodic signals have discrete spectra, they are are power signals.
– Time-domain sampling of continuous time signals causes signal spectra to
become periodic by generating aliases. Yet, aperiodic sampled signals will
generally have continuous spectrum and must be analyzed using Discrete-Time
Fourier Transform.
– Continuous time periodic signals have a discrete frequency spectrum, and
therefore, can be resolved in to a sum of complex sinusoids rather than an
integral (i.e. can be analyzed using CTFS).
– Bandlimited signals have infinite duration. Finite duration signals have infinite
spectra. Sampling such signals produces overlapping aliases. One side effect
of aliasing due to finite signal capture is spectrum leakage.

• Each method has its own version of Parseval Theorem to facilitate calculations of
signal power/energy, and its own version of convolution to facilitate calculations of
zero-state response.

You might also like