06 D Fourier Transform C

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 90

1 / 66

Signals and Systems II

Prof. Dr. Björn Lange

Winter term 2023-24

2 / 66
Outline

Discrete Fourier transform


Motivation
Discrete-time Fourier transform
Discrete Fourier transform - DFT
Properties of the DFT
DFT of some important signals
Practical implementation of DFT
Fast Fourier transform - FFT

3 / 66
Outline

Discrete Fourier transform


Motivation
Discrete-time Fourier transform
Discrete Fourier transform - DFT
Properties of the DFT
DFT of some important signals
Practical implementation of DFT
Fast Fourier transform - FFT

4 / 66
How do you like our lecture?

https://k10777.evasys.de/evasys/online.php?pswd=TUE16

5 / 66
Review

The Z-transform turns the time-domain convolution

(yn )n = (hn )n ∗ (xn )n

into a z-domain product

Y (z) = H(z) · X (z).

Advantage: This equation can be easily solved for either


Y (z), H(z) or X (z).

6 / 66
Review: Z-transforms of oscillations
Unfortunately, the Z-transforms of frequently used standard
signals are not particularly handy:
z
e jωnT · σn
 
n
❞ t |z| > 1
z − e jωT
 z sin(ωT ) 
sin(ωnT ) · σn n
❞ t
2
|z| > 1
z − 2z cos(ωT ) + 1
 z 2 − z cos(ωT ) 
cos(ωnT ) · σn ❞ t |z| > 1
n z 2 − 2z cos(ωT ) + 1

For these signals, the Z-transform is not first choice!

7 / 66
Review: Z-transforms of oscillations
Unfortunately, the Z-transforms of frequently used standard
signals are not particularly handy:
z
e jωnT · σn
 
n
❞ t |z| > 1
z − e jωT
 z sin(ωT ) 
sin(ωnT ) · σn n
❞ t
2
|z| > 1
z − 2z cos(ωT ) + 1
 z 2 − z cos(ωT ) 
cos(ωnT ) · σn ❞ t |z| > 1
n z 2 − 2z cos(ωT ) + 1

For these signals, the Z-transform is not first choice!


For continuous-time signals, we found that the Fourier
transform is more suitable. Today, we will do the same for
discrete-time signals.

7 / 66
Review: Pseudo-continuous signal

xs (t)

0 1 2 t

A discrete-time signal can be viewed to be continuous-time by


regarding it as the product of the corresponding
continuous-time signal with an impulse comb:

X
xs (t) = x(t) · XTs (t) = x(t) · δ(t − kTs ).
k=−∞

8 / 66
Review: Fourier transform of sampled signal

For such a pseudo-continuous sampled signal we had already


determined the Fourier transform in lecture 2:
  1
Xs (jω) = F xs (t) = F x(t) · XTs (t) = · X (jω) ∗ ωs Xωs (ω)

∞ ∞
ωs X ωs X 
= X (jω) ∗ δ(ω − nωs ) = X j(ω − nωs )
2π n=−∞ 2π n=−∞

(using the convolution theorem in step 3). From this it was easy to
see that a discrete signal has a periodic spectrum.

9 / 66
Review: Fourier transform of sampled signal

For such a pseudo-continuous sampled signal we had already


determined the Fourier transform in lecture 2:
  1
Xs (jω) = F xs (t) = F x(t) · XTs (t) = · X (jω) ∗ ωs Xωs (ω)

∞ ∞
ωs X ωs X 
= X (jω) ∗ δ(ω − nωs ) = X j(ω − nωs )
2π n=−∞ 2π n=−∞

(using the convolution theorem in step 3). From this it was easy to
see that a discrete signal has a periodic spectrum.
A drawback of this form is that knowledge of the complete
continuous-time signal x(t) is required – or at least its spectrum.
In practice, only samples xn of the signal are known.

9 / 66
Fourier transform of sampled signal
As an alternative, the Fourier transform of the sampled signal can be
calculated directly, without using the convolution theorem:

Xs (jω) =
Fourier transform of sampled signal
As an alternative, the Fourier transform of the sampled signal can be
calculated directly, without using the convolution theorem:
Z ∞

Xs (jω) = F xs (t) = e −jωt xs (t) dt
−∞
Z ∞ ∞
X
= e −jωt x (t) δ(t − nTs ) dt
−∞ n=−∞
∞ Z
X ∞ ∞
X
= e −jωt x (t) δ(t − nTs ) dt = e −jωnTs xn .
n=−∞ −∞ n=−∞

Comparing this to the Z-transform



X
Xs (z) = z −n xn
n=0

reveals that the discrete Fourier transform is nothing but a (two-sided)


Z-transform evaluated at z = e jωTs .
10 / 66
Analogy

Laplace transform Fourier transform


Z ∞ Z ∞
s→jω
X (s) = e −st x (t) dt −→ X (jω) = e −jωt x (t) dt
0 −∞

discrete-time
Z-transform
Fourier transform

X ∞
X (z) = z −n xn z→e jωTs
X
−→ Xs (jω) = e −jωnTs xn
k=0
n=−∞

11 / 66
Outline

Discrete Fourier transform


Motivation
Discrete-time Fourier transform
Discrete Fourier transform - DFT
Properties of the DFT
DFT of some important signals
Practical implementation of DFT
Fast Fourier transform - FFT

12 / 66

X ∞ 
X −n
Xs (jω) = e −jωnTs
xn = e jωTs xn
n=−∞ n=−∞

The exponential e jωTs is periodic with ωTs = 2π. The Fourier


transform Xs (jω) thus is periodic with ω = 2π
Ts . It is completely
characterized by the basic period − Tπs ≤ ω < Tπs .
Since the combination ωTs repeatedly occurs, it has been given its
own name:

Definition (discrete angular frequency)


The unit-free product Ω = ωTs is called discrete angular frequency.

With the discrete angular frequency, the spectrum X (jΩ) of a


sequence (xn )n is expressed independent of the sampling rate.
Its basic period is −π ≤ Ω < π.

13 / 66
Definition (discrete-time Fourier transform DTFT)
The mapping

X
e −jΩn xn = X (jΩ)

F : (xn )n∈Z 7−→ F (xn )n∈Z =
n=−∞

which maps a discrete signal (xn )n∈Z to the complex frequency


domain spectrum X (jΩ), Ω ∈ R is called discrete-time Fourier
transform (DTFT). A common notation is

(xn )n ❝ s X (jΩ).

14 / 66
Definition (discrete-time Fourier transform DTFT)
The mapping

X
e −jΩn xn = X (jΩ)

F : (xn )n∈Z 7−→ F (xn )n∈Z =
n=−∞

which maps a discrete signal (xn )n∈Z to the complex frequency


domain spectrum X (jΩ), Ω ∈ R is called discrete-time Fourier
transform (DTFT). A common notation is

(xn )n ❝ s X (jΩ).

In polar coordinates, X (jΩ) can be written as

X (jΩ) = |X (jΩ)| · e jϕ(X (jω))


where

|X (jΩ)| is named amplitude density spectrum and



ϕ X (jΩ) is named phase spectrum of x(t).

14 / 66
DTFT: unit impulse (δn )n Proof

(δn )n ❞ t 1

15 / 66
DTFT: constant signal (1)n Proof

(1)n ❞ t 2π X2π (Ω)

16 / 66
Index-shifting Proof

(xn−m )n ❞ t e −jΩm · X (jΩ)

Since the Fourier transform is two-sided, there is no need to distinguish


between incrementing and decrementing the index (m ∈ Z).

17 / 66
DTFT: causal exponential signal (σn an )n Proof

e jΩ

(σn a n )n ❞ t
e jΩ −a
|a| < 1

18 / 66
DTFT: complex oscillation (e jΩ0 n )n Proof

(e jΩ0 n )n ❞ t 2π X2π (Ω − Ω0 )

19 / 66
 
DTFT: real oscillations sin(Ω0n) n
and cos(Ω0n) n
Proof

π
 
sin(Ω0 n) n
❞ t
j
· X2π (Ω − Ω0 ) − X2π (Ω + Ω0 )

 
cos(Ω0 n) n
❞ t π · X2π (Ω − Ω0 ) + X2π (Ω + Ω0 )

20 / 66
◮ In accordance with the duality principle:

21 / 66
◮ In accordance with the duality principle:

periodic, discrete signal ❞ t discrete, periodic spectrum

21 / 66
◮ In accordance with the duality principle:

periodic, discrete signal ❞ t discrete, periodic spectrum

◮ Because the spectrum is periodic, the Nyquist-criterion must


always be observed.

21 / 66
◮ In accordance with the duality principle:

periodic, discrete signal ❞ t discrete, periodic spectrum

◮ Because the spectrum is periodic, the Nyquist-criterion must


always be observed.

◮ If (xn )n∈Z is a discrete-time signal and its z-transform X (z) exists


on the unit circle, then

X (jΩ) = X (z) z=e jΩ


.

21 / 66
The inverse discrete-time Fourier transform can be defined
straight-forward:

Definition (inverse discrete-time Fourier transform)


The mapping
 
1 π
Z
jΩn
−1 −1

F : X (jΩ) 7−→ F X (jΩ) = e · X (jΩ) dΩ = (xn )n∈Z
2π −π n∈Z

which maps a complex spectrum X (jΩ), Ω ∈ R to the


discrete-time domain signal (xn )n∈Z is called inverse
discrete-time Fourier transform.

22 / 66
Inverse discrete-time Fourier transform
Applying the inverse DTFT to a spectrum yields the original signal:

F −1 F ((xn )n ) =
Inverse discrete-time Fourier transform
Applying the inverse DTFT to a spectrum yields the original signal:
 Z π 
−1
 −1
 1 jΩn
F F ((xn )n ) = F X (jΩ) = e X (jΩ) dΩ
2π −π n∈Z

!
1
Z π X
= e jΩn e −jΩk xk dΩ
2π −π
k=−∞ n∈Z

!
1
Z π
(∗) X
= xk · e jΩ·(n−k)dΩ
2π −π
k=−∞ n∈Z

!
X
= xk δn−k = (xn )n∈Z .
k=−∞ n∈Z

(∗)
In the step marked with ,
1 π
Z
e jΩ·(n−k)dΩ = δn−k
2π −π

(see next page...) was used.


23 / 66
1 π
Z
e jΩ·(n−k)dΩ = δn−k
2π −π

Proof:

24 / 66
1 π
Z
e jΩ·(n−k)dΩ = δn−k
2π −π

Proof:

Case n = k

1 1 1 1
Z π Z π Z π
e jΩ·(n−k) dΩ = e jΩ·0 dΩ = dΩ = · 2π = 1.
2π −π 2π −π 2π −π 2π

Case n 6= k ⇒ n − k = m ∈ Z
 jΩm π
1 π
1 1 e jπm − e −jπm 2j sin(πm)
Z
jΩm e
e dΩ = · = · = · = 0.
2π −π 2π jm −π 2π jm 2π jm

24 / 66
Convolution Proof

(xn )n ∗ (yn )n ❞ t X (jΩ) · Y (jΩ)

25 / 66
, The discrete-time Fourier transform corresponds to the known
continuous-time Fourier transform in all relevant aspects.

26 / 66
, The discrete-time Fourier transform corresponds to the known
continuous-time Fourier transform in all relevant aspects.

, It is well suited for theoretical considerations.

26 / 66
, The discrete-time Fourier transform corresponds to the known
continuous-time Fourier transform in all relevant aspects.

, It is well suited for theoretical considerations.

/ Practically, it has limited use because:


– Exact solutions are known only for a few special signals.
– An infinite number of samples (xn )n∈Z is needed as input.
– The result is frequency-continuous.
This makes the discrete-time Fourier transform practically useless for
computer applications.

26 / 66
, The discrete-time Fourier transform corresponds to the known
continuous-time Fourier transform in all relevant aspects.

, It is well suited for theoretical considerations.

/ Practically, it has limited use because:


– Exact solutions are known only for a few special signals.
– An infinite number of samples (xn )n∈Z is needed as input.
– The result is frequency-continuous.
This makes the discrete-time Fourier transform practically useless for
computer applications.

For use on limited-memory computers, a Fourier transform would need to


work on a finite number of time-domain samples and output a finite
number of frequency-domain samples.

26 / 66
Outline

Discrete Fourier transform


Motivation
Discrete-time Fourier transform
Discrete Fourier transform - DFT
Properties of the DFT
DFT of some important signals
Practical implementation of DFT
Fast Fourier transform - FFT

27 / 66
Discrete spectrum

Signals that are periodic in the time domain have discrete (in
other words: sampled) spectra.

In the following, we consider discrete signals that are defined


for a limited number N of indices only, written as

(xn )n=0,1,2,...,N−1.

Such sequences are intentionally repeated to form periodic


signals (x̃n )n∈Z that then have discrete spectra.

The periodic repetition is expressed with the help of discrete


impulse combs.

28 / 66
X4,n
2

1 b b b b b

0 b b b b b b b b b b b b b

n
−1
−9 −8 −7 −6 −5 −4 −3 −2 −1 0 1 2 3 4 5 6 7 8 9

Definition (discrete impulse comb)


The infinite series of discrete unit impulses (δn−kN )n∈Z with
elements ∞ 
X 1 for n = kN
XN,n = δn−kN =
0 else
k=−∞
is called discrete impulse comb (XN,n )n∈Z .


(XN,n )n ❝ s
N X 2π (Ω) Proof
N

29 / 66
Periodically repeated signal

A periodic discrete signal (x̃n )n with period N is obtained by


the convolution

(x̃n )n = (xN,n )n ∗ (XN,n )n

of a discrete impulse comb (XN,n )n with suitable period N


and the non-periodic signal (xN,n )n with elements

xn for 0 ≤ n ≤ N − 1
xN,n =
0 else.

30 / 66
Fourier transform of a periodically repeated signal
The Fourier transform of the periodically repeated signal (x̃n )n
can then be determined using the convolution theorem:

(x̃n )n = (xN,n )n ∗ (XN,n )n



s
Fourier transform of a periodically repeated signal
The Fourier transform of the periodically repeated signal (x̃n )n
can then be determined using the convolution theorem:

(x̃n )n = (xN,n )n ∗ (XN,n )n



s

X̃ (jΩ) = XN (jΩ) · · X 2π (Ω)
N N

2π X 2π
= XN (jΩ) · δ(Ω − k)
N N
k=−∞

X 2π 2π
= XN (jΩ) · · δ(Ω − k)
N N
k=−∞

X 2π 2π 2π
= XN (j k) · · δ(Ω − k).
N N N
k=−∞

31 / 66
Fourier transform of periodic signal

X 2π 2π 2π
(x̃n )n ❝ s X̃ (jΩ) = XN (j k) · · δ(Ω − k)
N N N
k=−∞

The spectrum X̃ (jΩ) is discrete because the δ sequence makes it zero


everywhere except for Ωk = 2πN k.

32 / 66
Fourier transform of periodic signal

X 2π 2π 2π
(x̃n )n ❝ s X̃ (jΩ) = XN (j k) · · δ(Ω − k)
N N N
k=−∞

The spectrum X̃ (jΩ) is discrete because the δ sequence makes it zero


everywhere except for Ωk = 2πN k.

All spectral information is contained in a sequence (XN,k )k with elements


N−1
2π X 2π
XN,k = XN ( k) = e −j N kn xn .
N
n=0

32 / 66
Fourier transform of periodic signal

X 2π 2π 2π
(x̃n )n ❝ s X̃ (jΩ) = XN (j k) · · δ(Ω − k)
N N N
k=−∞

The spectrum X̃ (jΩ) is discrete because the δ sequence makes it zero


everywhere except for Ωk = 2πN k.

All spectral information is contained in a sequence (XN,n )n with elements


N−1
2π X 2π
XN,n = XN ( n) = e −j N nk xk .
N
k=0

32 / 66
Fourier transform of periodic signal

X 2π 2π 2π
(x̃n )n ❝ s X̃ (jΩ) = XN (j k) · · δ(Ω − k)
N N N
k=−∞

The spectrum X̃ (jΩ) is discrete because the δ sequence makes it zero


everywhere except for Ωk = 2πN k.

All spectral information is contained in a sequence (XN,n )n with elements


N−1
2π X 2π
XN,n = XN ( n) = e −j N nk xk .
N
k=0

Just like all the factors XN ( 2π


N n), the spectrum X̃ (jΩ) is periodic with N.
N values are thus sufficient to fully characterize the spectrum.

32 / 66
Definition (discrete Fourier transform DFT)
The mapping
N−1
!

X
nk
e −j

F : (xn )n 7−→ F (xn )n = N xk = (Xn )n ,
k=0 n
which for N ∈ N and n = 0, . . . , N − 1 maps a discrete signal
(xn )n to the discrete complex spectrum (Xn )n is called discrete
Fourier transform (DFT).

33 / 66
Discrete Fourier transform DFT

N−1
!
−j 2π
X
nk
(Xn )n = e N xk for n = 0, . . . , N − 1
k=0 n

Only N samples of both signal and spectrum are known.


Beyond that, both are considered to be periodic with N.

34 / 66
Discrete Fourier transform DFT

N−1
!
−j 2π
X
nk
(Xn )n = e N xk for n = 0, . . . , N − 1
k=0 n

Only N samples of both signal and spectrum are known.


Beyond that, both are considered to be periodic with N.
, The DFT is great for implementation on computers.

34 / 66
Discrete Fourier transform DFT

N−1
!
−j 2π
X
nk
(Xn )n = e N xk for n = 0, . . . , N − 1
k=0 n

Only N samples of both signal and spectrum are known.


Beyond that, both are considered to be periodic with N.
, The DFT is great for implementation on computers.
/ The spectrum is only known at the discrete angular
frequencies Ωn = 2πN
· n.

This means it is sampled with a resolution of ∆Ω = N
.
Ωn
In frequencies: The spectrum is known at fn = 2π·T s
= Nn · fs .
fs
That means it is sampled with a resolution of ∆f = N .

34 / 66
Definition (complex rotation factor)
The expression

WN = e −j N

is called complex rotation factor.

35 / 66
Definition (complex rotation factor)
The expression

WN = e −j N

is called complex rotation factor.

It has the property


N−1 N−1

X X
WNnk = e −j N ·nk = N δn . Proof

k=0 k=0

35 / 66
Discrete Fourier transform and its inverse

With the rotation factor, the nth element of the discrete


Fourier transform can be written a bit shorter:
N−1 N−1

X X
Xn = e −j N nk xk = WNnk xk .
k=0 k=0

This equation can be inverted and solved for the nth element
of the discrete signal
N−1
1 X −kn
xn = WN Xk . Proof
N
k=0

36 / 66
Definition (inverse discrete Fourier transform)
The mapping
N−1
!
1 X 2π
F −1 : (Xn )n 7−→ F −1 (Xn )n = e j N nk Xk

= (xn )n ,
N
k=0 n
which for N ∈ N and n = 0, . . . , N − 1 maps a discrete
spectrum (Xn )n to the discrete signal (xn )n is called inverse
discrete Fourier transform.

37 / 66
Properties of the DFT

The following properties of the DFT are only listed here. All of
them are either clear from the definition or can be proved by
shifting indices, reversing the order of summation and / or
using the periodicity of both signal and spectrum.

38 / 66
Properties of the DFT
linearity: (a x n )n + (b x n )n ❝ s a (Xn )n + b (Yn )n

index-shifting (time): (x(n−n0 )modN )n ❝ s (Xn · W n n0 )n


N
index-shifting (frequency): (WN−n0 n xn )n ❝ s (X
(n−n0 )modN )n

time-mirroring: (xN−n )n ❝ s (X
N−n )n

complex conjugation: (x ∗ n )n ❝ s (X ∗
N−n )n
 1 ∗
real part: ℜ(xn ) n ❝ s · (Xn + XN−n )n
2
s 1 · (Xn − X ∗ )n

imaginary part: ℑ(xn ) n ❝
N−n
2j
periodic convolution: (xn )n ⊗ (yn )n ❝ s (Xn )n · (Yn )n
1
multiplication: (xn · yn )n ❝ · (Xn )n ⊗ (Yn )n
s
N
(An example for the convolution will be presented later to explain
the meaning of the special symbol ⊗.)
39 / 66
DFT of selected signals Proof

δ impulse: (δn )n ❝ s (1)n

constant: (1)n ❝ s (N δ )
n n


exponential: (e j N ·n0 n )n ❝ s (N δ
(n−n0 )modN )n

n0  N 
sine: sin(2π n) n ❝ s · (δ(n−n0 )modN − δ(n+n0 )modN ) n
N 2j

n0  N 
cosine: cos(2π n) n ❝ s · (δ(n−n0 )modN + δ(n+n0 )modN ) n
N 2

40 / 66
Practical implementation of DFT
Since both the signal and its spectrum consist of only N samples,
the discrete Fourier transform
N−1
X
Xn = WNnk xk
k=0

can be expressed as a multiplication with a N × N matrix:


  0
WN0 WN0 WN0
 
WN ···
 
X0 x0
 X1   WN0 WN1 WN2 · · · WNN−1    x1 
   2(N−1)   
 X2   WN 0 WN 2 WN 4 · · · WN
 = · x2  .
 ..   .. .. .. ..

  . 
 .   . 
. . ··· . .
  . 
 

XN−1 0 N−1 2(N−1) (N−1)2 xN−1


WN WN WN · · · WN

41 / 66
Inverse matrix

Luckily, this matrix is a special case that has an easy-to-calculate inverse:


 0
WN0 WN0 WN0 WN0 WN0 WN0 WN0
−1
WN
 
··· ···
W 0
 N WN1 WN2 ··· WNN−1  
W 0
 N WN−1 WN−2 ···
−(N−1) 
WN 
 0 2(N−1) 
WN2 WN4 1 WN0
 −2(N−1) 
WN ··· WN  WN−2 WN−4 ··· WN 

 .
 = · 
 . . . . 
N
 . . . . 
. . . 
 .

. . .

 . . . .  . . . .
  
···  ··· 
2(N−1) (N−1)2 −(N−1)2
WN0 WNN−1 WN ··· WN WN0
−(N−1)
WN
−2(N−1)
WN ··· WN

(the elements of the inverted matrix simply are reciprocals of the original
matrix).

The inverse transform can therefore also be expressed as a matrix


multiplication.

42 / 66
Examples with N = 4

Let us consider two examples with N = 4 ⇒ n = 0, 1, 2, 3.


First, the appropriate complex rotation factor must be
determined
2π π
W4 = e −j 4 = e −j 2 = −j.

The required matrix can then be set up


 0
W40 W40 W40

W4
W40 W41 W42 W43 
 0 =
W4 W42 W44 W46 
W40 W43 W46 W49
Examples with N = 4

Let us consider two examples with N = 4 ⇒ n = 0, 1, 2, 3.


First, the appropriate complex rotation factor must be
determined
2π π
W4 = e −j 4 = e −j 2 = −j.

The required matrix can then be set up


 0
W40 W40 W40
  
W4 1 1 1 1
W40 W41 W42 W43  1 −j −1 j 
 0 =  
W4 W42 W44 W46  1 −1 1 −1
W40 W43 W46 W49 1 j −1 −j

43 / 66
Example 1 xn
4
3 b b

2
1 b b

0
−1 0 1 2 3 4n

The signal (xn )n = (3, 1, 3, 1) has the spectrum


   
1 1 1 1 3
1 −j −1 j  1 
(Xn )n = 
1
· = .
−1 1 −1 3
1 j −1 −j 1

For N = 4, the frequency resolution is ∆Ω = N = π2 . The
spectrum thus belongs to a signal

(xn )n =

44 / 66
Example 1 xn
4
3 b b

2
1 b b

0
−1 0 1 2 3 4n

The signal (xn )n = (3, 1, 3, 1) has the spectrum


     
1 1 1 1 3 8
1 −j −1 j  1  0
(Xn )n = 
1
· =  .
−1 1 −1 3 4
1 j −1 −j 1 0

For N = 4, the frequency resolution is ∆Ω = N = π2 . The
spectrum thus belongs to a signal

(xn )n =

44 / 66
Example 1 xn x (t)
4
3 b b

2
1 b b

t
0
−1 0 1 2 3 4n

The signal (xn )n = (3, 1, 3, 1) has the spectrum


   
1 1 1 1 3
1 −j −1 j  1 
(Xn )n = 
1
· = .
−1 1 −1 3
1 j −1 −j 1
For N = 4, the frequency resolution is ∆Ω = 2π π
N = 2 . The
spectrum thus belongs to a signal
1  π 3π

(xn )n = · 8 · e j·0·n + 0 · e j· 2 ·n + 4 · e j·π·n + 0 · e j· 2 ·n
N
1
= · (8 · 1 + 4 · e j·π·n ) = 2 + cos(π · n) + j sin(π · n)
4
= 2 + cos(π · n) 44 / 66
Example 2: convolution

Be cautious with operations whose results exceed the DFT length:

The convolution of the rectangular pulse (1, 1, 1) with itself is

(1, 1, 1) ∗ (1, 1, 1) = (1, 2, 3, 2, 1)

Alternatively, we should be able to obtain the same result by

1. discrete Fourier transforming (xn )n to obtain (Xn )n

2. multiplying (Xn )n · (Xn )n in the frequency domain

3. inverse discrete Fourier transforming (Xn )n · (Xn )n to obtain


(xn )n ∗ (xn )n

45 / 66
Example 2

For re-using the N = 4 transformation matrix, the signal is


zero-padded to form (xn )n = (1, 1, 1, 0). Its discrete Fourier
transform is
   
1 1 1 1 1
1 −j −1 j  1
(Xn )n 
1 −1 1 −1 · 1 =
  

1 j −1 −j 0
Example 2

For re-using the N = 4 transformation matrix, the signal is


zero-padded to form (xn )n = (1, 1, 1, 0). Its discrete Fourier
transform is
     
1 1 1 1 1 3
1 −j −1 j  1 −j 
(Xn )n 
1 −1 1 −1 · 1 =  1  .
    

1 j −1 −j 0 j

This multiplied by itself yields (Xn )2n = (9, −1, 1, −1).

46 / 66
Example 2
Inverse discrete Fourier transforming (Xn )2n = (9, −1, 1, −1) yields
   
1 1 1 1 9
1  1 j −1 −j  −1
(xn )n = ·  · =
4 1 −1 1 −1  1 
1 −j −1 j −1
Example 2
Inverse discrete Fourier transforming (Xn )2n = (9, −1, 1, −1) yields
     
1 1 1 1 9 2
1  1 j −1 −j  −1 2
(xn )n = ·   ·  =  ,
4 1 −1 1 −1  1  3
1 −j −1 j −1 2

which is not the result (1, 2, 3, 2, 1) that we expected!

Because the fifth entry has no space in the N = 4 signal, the DFT
adds it to the first entry, resulting into

xn = (1 + 1, 2, 3, 2) = (2, 2, 3, 2).

This is what the ⊗ symbol warns about!

To avoid this, always zero-pad the signals sufficiently so that all of


the result’s samples fit into the resulting vector.
47 / 66
Fast Fourier transform - FFT
To save computation time, the required number of floating point
operations must be kept as small as possible.
An extremely efficient algorithm is the so-called Fast Fourier
Transform (FFT) for signal lengths that are powers of 2. These
signals can be recursively split into even and odd index halves
which allows for re-use of interim calculation results.
This reduces the computational effort from N 2 to N · log2 N
floating point operations.

data volume 1 kB 1 MB 1 GB
N2 0.6 ms 10.4 min 20 years
N · log2 N 20 µs 45 ms 1.2 min
Computation time for a 100 Mflops computer

48 / 66
Example: FFT

For N = 4, the discrete Fourier transform of an arbitrary signal


(xn )n is
     
X0 x0 + x1 + x2 + x3 (x0 + x2 ) + (x1 + x3 )
X1  x0 − jx1 − x2 + jx3  (x0 − x2 ) − j · (x1 − x3 )
 =
X2   x0 − x1 + x2 − x3  =  (x0 + x2 ) − (x1 + x3 )  .
  

X3 x0 + jx1 − x2 − jx3 (x0 − x2 ) + j · (x1 − x3 )

Notice that only the combinations x0 ± x2 and x1 ± x3 occur.


These are calculated in a first step and stored for re-use.

49 / 66
Butterfly graphs

The algorithm can be visualized in a so-called butterfly graph.


x0 x0 + x2 = x02 X0 = x02 + x13

x2 x0 − x2 = x20 X1 = x20 − jx31

x1 x1 + x3 = x13 X2 = x02 − x13

x3 x1 − x3 = x31 X3 = x20 + jx31

50 / 66
Butterfly graph for N = 16

For two real signals, additional effort can be saved by


combining them into a complex signal, then transforming this
complex signal and finally isolating the individual Fourier
transforms from it (see exercise 24 for example).
51 / 66
FFT is has *numerous* applications ...

52 / 66
What you should remember from this lecture ...
◮ discrete-time Fourier transform (DTFT)
– definition (incl. inverse)
– for signals
(δn )n , (1)n , (σn a−n )n , (e jΩ0 n )n , (sin(Ω0 n))n , (cos(Ω0 n))n
– convolution theorem
◮ discrete Fourier transform (DFT)
– definition (incl. inverse)
– complex rotation factor
– general properties and DFT of selected signals
– problems connected to finite-length convolution
– zero-padding
◮ general idea of Fast Fourier Transform (FFT) algorithm

Thank you for your attention!


53 / 66
Appendix: proof of Fourier transform
formulas

54 / 66
DTFT: unit impulse (δn )n back

(δn )n ❞ t 1

Proof:

X

F (δn )n = e −jΩn δn = e −jΩ0 = 1.
n=−∞

55 / 66
DTFT: constant signal (1)n back

(1)n ❞ t 2π X2π (Ω)

Proof:

X ∞
X
 −jΩn
F (1)n = e 1= e −jΩn
n=−∞ n=−∞

= 2π X2π (Ω).
In the last step, the formula

X 2π
e −jωkT = · X 2π (ω)
T T
k=−∞

known from last semester’s lecture 9 was applied, which for ω = Ω, k = n


and T = 1 reads

X
e −jΩn = 2π X2π (Ω).
n=−∞

56 / 66
Index-shifting back

(xn−m )n ❞ t e −jΩm · X (jΩ)

Proof:

X ∞−m
X

F (xn−m )n = e −jΩn xn−m = e −jΩ·(n+m) xn
n=−∞ n=−∞−m
X∞ ∞
X
−jΩ·(n+m) −jΩm
= e xn = e e −jΩn xn
n=−∞ n=−∞

= e −jΩm · F (xn )n = e −jΩm · X (jΩ)

57 / 66
DTFT: causal exponential signal (σn an )n back

e jΩ

(σn an )n ❝ s
e jΩ −a |a| < 1

Proof:
∞ ∞ 
X X a n
F (σn an )n = e −jΩn σn an =

n=−∞ n=0
e jΩ
(∗) 1 e jΩ
= a = jΩ for |a| < 1.
1 − e jΩ e −a
(∗)
In the step marked with , the geometric series formula

X 1
rn = for constant r ∈ C with |r | < 1
n=0
1−r
can be employed, but only for the case |a| < 1 which implies
a |a|
|r | = jΩ
= jΩ = |a| < 1.
e |e |
For |a| ≥ 1, the sum diverges and the discrete-time Fourier transform
does not exist. 58 / 66
DTFT: complex oscillation (e jΩ0 n )n back

(e jΩ0 n )n ❞ t 2π X2π (Ω − Ω0 )

Proof:

X ∞
X
F (e jΩ0 n )n = e −jΩn e jΩ0 n = e −j(Ω−Ω0 )n = 2π X2π (Ω − Ω0 ).

n=−∞ n=−∞

In the last step, the formula



X 2π
e −jωkT = X 2π (ω)
T T
k=−∞

known from last semester’s lecture 9 was applied, which for ω = Ω, k = n


and T = 1 reads

X
e −jΩn = 2π X2π (Ω).
n=−∞

59 / 66

DTFT: real oscillations sin(Ω0n) n
back

π
 
sin(Ω0 n) n
❞ t
j
· X2π (Ω − Ω0 ) − X2π (Ω + Ω0 )

Proof:
1
· (e jΩ0 n − e −jΩ0 n )n
 
F (sin(Ω0 n))n = F
2j
1 
= · 2π X2π (Ω − Ω0 ) − 2π X2π (Ω + Ω0 )
2j
π 
= · X2π (Ω − Ω0 ) + X2π (Ω + Ω0 ) .
j

(see next page for cosine)

60 / 66

DTFT: real oscillations cos(Ω0n) n
back

 
cos(Ω0 n) n
❞ t π · X2π (Ω − Ω0 ) + X2π (Ω + Ω0 )

Proof:
1
· (e jΩ0 n + e −jΩ0 n )n
 
F (cos(Ω0 n))n = F
2
1 
= · 2π X2π (Ω − Ω0 ) + 2π X2π (Ω + Ω0 )
2 
= π · X2π (Ω − Ω0 ) + X2π (Ω + Ω0 ) .

(see previous page for sine)

61 / 66
Convolution back

(xn )n ∗ (yn )n ❞ t X (jΩ) · Y (jΩ)

Proof:
 
1 π
Z
jΩn
−1

F X (jΩ)Y (jΩ) = e · X (jΩ) · Y (jΩ) dΩ
2π −π n∈Z
∞ ∞
!
π
1
Z X X
jΩn −jΩk −jΩl
= e e xk e yl dΩ
2π −π k=−∞ l=−∞ n∈Z
∞ ∞
!
1 π
X X Z
= xk yl · e jΩ·(n−k−l)dΩ
2π −π
k=−∞ l=−∞ n∈Z
∞ ∞
!
X X
= xk yl δn−k−l
k=−∞ l=−∞ n∈Z

!
X
= xk yn−k = (xn ∗ yn )n∈Z
k=−∞ n∈Z
62 / 66
DTFT: Discrete impulse comb back


(XN,n )n ❝ s
N X 2π
N
(Ω)

Proof:

X ∞
X ∞
X

F (X N,n )n = e −jΩn X N,n = e −jΩn δn−kN
n=−∞ n=−∞ k=−∞

X ∞
X ∞
X
= e −jΩn δn−kN = e −jΩkN
k=−∞ n=−∞ k=−∞

= · X 2π (Ω),
N N

In the last step, the formula



X 2π
e −jωkT = X 2π (ω)
k=−∞
T T

known from last semester’s lecture 9 was applied, which for ω = Ω and T = N reads

X 2π
e −jΩkN = · X 2π (Ω).
n=−∞
N N

63 / 66
Complex rotation factor property back

N−1 N−1 
X X
−j 2π N for n = 0
WNnk = e N
·nk
= N δn =
0 else
k=0 k=0

Proof:

Case n = 0:
N−1 N−1 N−1

X X X
WN0 = e −j N ·0 = 1 = N.
k=0 k=0 k=0

Case n 6= 0:

N−1 N−1 2πN


X X 2πk 1 − e −j N ·n
1 − e −j2πn 1−1
WNnk = e −j N ·n
= 2π = 2π = 2π = 0.
k=0 k=0
1− e −j N ·n 1− e −j N n 1 − e −j N n

64 / 66
Inverse discrete Fourier transform back

N−1
1 X −kn
xn = WN Xk
N
k=0

Proof:
N−1 N−1 N−1 N−1 N−1
1 X −kn 1 X −kn X km 1 X X k·(m−n)
WN Xk = WN WN xm = xm WN
N N m=0
N m=0
k=0 k=0 k=0
N−1
1 X 1
= xm N δm−n = · xn · N = xn .
N m=0
N

65 / 66
DFT of selected signals back

Proof δ impulse:

 N−1
X 2π
N−1
X
F (δn )n = e −j N nk δk = WNnk δk = WN0 = 1.
k=0 k=0

Proof constant:

 N−1
X 2π
N−1
X N−1
X
F (1)n = e −j N nk 1 = WNnk 1 = WNnk = Nδn .
k=0 k=0 k=0

Proof complex exponential:

2π  N−1
X 2π 2π
N−1
X
F (e j N ·n0 n
)n = e −j N nk e j N ·n0 k = WNnk WN−n0 k
k=0 k=0
N−1
(n−n0 )·k
X
= WN = Nδ(n−n0 )modN .
k=0

Proof sine and cosine: take imaginary and real part of complex exponential.
66 / 66

You might also like