You are on page 1of 14

The Fourier transform

X. Serra 1

Index

• Introduction
• Basic mathematics
• Continuous Fourier transform
• Discrete Fourier transform (DFT)
• Understanding the DFT: Frequency Shifting
and Filtering
• DFT properties
• DFT examples
X. Serra 2

1
Recommended readings:

• A Digital Signal Processing Primer, Ken Steiglitz.


Addison-Wesley, 1996.

• The Computer Music Tutorial, Curtis Roads. MIT Press,


1995.

• DSP First: A Multimedia Approach, J. H. McClelland, R.


W. Schafer, M. A. Yoder. Prentice Hall, 1998.

X. Serra 3

Basic Mathematics

• Complex numbers
( x + jy ) where x : real part
y : imaginary part
j : −1
y
• Complex plane
x-axis (real part)
y-axis (imaginary part) x

X. Serra 4

2
(...basic mathematics)

• Rectangular co-ordinates
ordinate
( x1 , y1 )
y1 *

x1 abscissa

• Polar co-ordinates
magnitude : x 2 + y 2
phase : tan −1 ( y x )

itude
magn *
phase
X. Serra 5

(...basic mathematics)

• number e n
 1
e= lim 1 +  = 2.718281...
n→ ∞ n

• Complex exponential
e ( x + jy )
• Sine function
sin (x)

X. Serra 6

3
(...basic mathematics)

• Euler’s identity
e jx = cos( x) + j sin( x )
e jθ + e − jθ e jθ − e − jθ
cosθ = sin θ =
2 2j

• linear magnitude and dB


dB = 20 log( A )
A0
X. Serra 7

(...basic mathematics)

Complex exponential:
x (t ) = Ae j (ω 0t +φ ) = A cos (ω 0 t + φ ) + jA sin (ω 0 t + φ )

Real sinewave:
j (ω 0 t +φ )
e + e − j (ω 0t +φ ) 
x(t ) = A cos(ω 0 t + φ ) = A 

 2 
1 1 1 1
= Xe jω 0t + X * e − jω 0t = x (t ) + x * (t )
2 2 2 2
= Re{x (t )}
X. Serra 8

4
Continuous Fourier transform

+∞
X (ω ) = ∫ x(t )e − jωt dt
−∞

t : Continuous time index in seconds


ω : Continuous frequency index in radians per second

inverse transform:
1 +∞
x(t ) =
2π ∫−∞
X (ω )e jωt dω

X. Serra 9

Discrete Fourier transform (DFT)


N −1
X ( k ) = ∑ x ( n ) e − jω k n
n =0
ω k = 2π k N , N even, k = 0,1,..., N − 1
ω : discrete radian frequency,
n : discrete time index in samples,
k : discrete frenquency index in bins.

Hertz-Radian relationship: f = f s ω 2π
f : frequency in Hz , f s : sampling rate, ω : radian frequency.

X. Serra 10

5
(... DFT)

a few periods
of a piano sound
x(n)

magnitude
spectrum
20 log 10 ( X (k ) ) 20 log 10 ( X (k ) )

phase
spectrum
∠X (k )

X. Serra 11

Inverse DFT:
N −1
1
x (n) =
N
∑ X ( k )e ω
k =0
j kn

FFT implementation of the DFT: divide-and-conquer

DFT: proportional to N2
FFT: proportional to N log N

X. Serra 12

6
Frequency shifting March-2001

xωˆ s [n] = x[n]e − jωˆ s n

∑ (X e + X e )e
N
 jωˆ k n * − jωˆ k n − jωˆ s n
= X 0 + k k
 k =1 

+ ∑ (X e )
N
j (ωˆ k −ωˆ s )n
= X 0 e − jωˆ s n k + X k* e − j (ωˆ k +ωˆ s )n
k =1

X. Serra 13

Channel Filters

X. Serra 14

7
Running-Sum Filtering
Difference equation:

∑ x[n − l ]
L −1
y[n] =
l =0

Frequency response:

(ωˆ L 2) e − jωˆ ( L −1) 2



L −1
 sin
H (ωˆ ) = e − jωˆm = 
 L sin (ωˆ 2 ) 

m =0

The zeros of H (ω̂ ) are equally spaced at ωˆ = 2πk L


X. Serra 15

March-2001
(… running-sum filtering)

X. Serra 16

8
Spectral Analysis

∑ X [l ]e
N −1
x[n] =
1 j ( 2π N ) ln
periodic signal
N l =0

after the multiplier:

∑ X [l ]e
N −1
1
xk [n] = j ( 2π N ) ln − j ( 2π N )kn
e
N l =0

X. Serra 17

(…spectral analysis) March-2001

y k [n] = ∑
1 N −1
N l =0
( )
H e j 2π (l −k ) N X [l ]e j ( 2π N )(l −k )n

1
( )
= H e j 0 X [k ]
N
+
1 N −1
N l =0
∑ ( )
H e j 2π (l −k ) N X [l ]e j (2π N )(l − k )n
l ≠k

since ( )
H e j 0 = N and H (e j 2π (l −k ) N ) = 0 when (l − k ) ≠ 0

y k [n ] = X [k ]

X. Serra 18

9
(…spectral analysis)

X. Serra 19

(…spectral analysis)

∑ x [n − l ]
N −1
y k [n ] = k
l =0

= ∑ x [m] = ∑ x[m]e
n n
− j ( 2π N )km
k
m = n − N +1 m = n − N +1

using n = N −1

K, N − 1
N −1
X [k ] = ∑ x[m]e − j ( 2π N )km
k = 0,1,2,
m=0

X. Serra 20

10
(…spectral analysis)

X. Serra 21

(…spectral analysis)

the DFT:

K, N − 1
N −1
1
x[n] = ∑ X [k ]e ( π
j 2 N )kn
n = 0,1,2,
N k =0

k = 0,1,2, K, N − 1
N −1
X [k ] = ∑ x[n]e − j ( 2π N )kn

n=0

X. Serra 22

11
DFT properties
x ↔ X (transform pairs)
X = DFT ( x), x = IDFT ( X )
• Linearity:
ax1 + bx 2 ↔ aX 1 + bX 2 (mixing commutes with the DFT)

• Convolution:
convolutio n ↔ point - by - point multiplica tion

• Shift:
shift ↔ multiplica tion by a complex exponentia l

X. Serra 23

(... DFT properties)

• Evenness:
even ↔ real - valued
(even function : for every k , x k = x − k )

• Zero padding:
zero padding ↔ interpolat ion

• Power:

∑ x(n) ∑ X (k )
N −1 N −1
2 1 2
= (Rayleigh)
n=0 N k =0

X. Serra 24

12
DFT examples

x1 [n] = e j ( 2πk0 N )n
for n = 0,1,2, K, N − 1
∑ x [n]e
N −1
X 1 [k ] = 1
− j ( 2π N )kn

n =0

= ∑e
N −1
j ( 2πk 0 N )n
e − j (2π N )kn

n =0

= ∑e
N −1
− j ( 2π N )( k − k0 )n

n =0

= 1 + e − j (2π N )( k − k0 )
+ e − j (2π N )( k − k 0 )2
+ K+ e − j ( 2π N )( k − k0 )( N −1)

1 − e − j (2π N )(k − k0 )N
= = Nδ [k − k 0 ]
X. Serra
1 − e − j (2π N )(k −k0 ) 25

(…DFT examples)

x3 [n] = e j (ωˆ 0 n +φ ) for n = 0,1,2, K, N − 1


∑e
N −1
X 3 [k ] = j (ωˆ 0 n +φ ) − j ( 2π N ) kn
e
n =0

= e ∑e
N −1
jφ − j ( 2πk N −ωˆ 0 )n

n =0

(
= e jφ e − j (0 ) + e − j ( 2πk N −ωˆ 0 ) + K+ e − j ( 2πk N −ωˆ 0 )( N −1)
)
1 − e − j (2πk N −ωˆ 0 ) N

=e
1 − e − j ( 2πk N −ωˆ 0 )
sin ((2πk N − ωˆ 0 ) N 2 )
= e jφ e − j (2πk N −ωˆ 0 )( N −1) 2
sin ((2πk N − ωˆ 0 ) 2 )
X. Serra 26

13
(…DFT examples)

X. Serra 27

14

You might also like