Download - Discrete Fourier Transform
1
Discrete Fourier Transform
2
Multiply element-by-element
3
Cumulative sum shows:
4
2 signals of same frequency and phase
5
Multiply element-by-element
6
Non-zero cumulative sum
7
Same frequency but /2 phase difference
8
Element-by element product with both sine and cosine waves
9
Cumulative sums
10
Wave: partly sine, partly cosine
11
Element-by-element multiplication
12
Cumulative sum
13
dftsimp2demo(f, fs, timelen, amp)dftsimp2demo(200, 1000, 0.02, 1)
0 100 200 300 400 500 600 700 800 900 10000
2
4
6
8
10
12
14
dftsimp2demo(f, fs, timelen, amp)dftsimp2demo(200, 1000, 0.05, 1)
0 100 200 300 400 500 600 700 800 900 10000
5
10
15
20
25
30
15
dftsimp2demo(f, fs, timelen, amp)dftsimp2demo(200, 10000, 0.05, 1)
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000
50
100
150
200
250
300
160 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02-8
-6
-4
-2
0
2
4
6
8
dftcomplex2demo(f1, f2, fs, timelen, a1, a2)dftcomplex2demo(200, 400, 10000, 0.02, 5, 4)
170 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000
100
200
300
400
500
600
dftcomplex2demo(f1, f2, fs, timelen, a1, a2)dftcomplex2demo(200, 400, 10000, 0.02, 5, 4)
18
dftspeech2demo(wavfile, timelen)dftspeech2demo('atest.wav', 0.04)
2 2.005 2.01 2.015 2.02 2.025 2.03 2.035 2.04 2.045
x 104
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
19
dftspeech2demo(wavfile, timelen)dftspeech2demo('atest.wav', 0.04)
0 2000 4000 6000 8000 10000 120000
5
10
15
20
25
20
Use dB scale and frequencies to Fs /2
0 1000 2000 3000 4000 5000 6000-40
-30
-20
-10
0
10
20
30
21
dftspeech2demo(wavfile, timelen)dftspeech2demo(‘itest.wav', 0.04)
2 2.005 2.01 2.015 2.02 2.025 2.03 2.035 2.04 2.045
x 104
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
22
dftspeech2demo(wavfile, timelen)dftspeech2demo(‘itest.wav', 0.04)
0 1000 2000 3000 4000 5000 6000-50
-40
-30
-20
-10
0
10
20
30
40
23
DFT Procedure• Given the window (frame) length, decide the
base frequency• Multiply by sine wave at each multiple of base
frequency• Multiply by cosine wave at each multiple of
base frequency• Calculate magnitude and phase spectra using
but....,component cosinecomponent sinetan
component cosinecomponent sine
1
22
X
X
24
Complex Exponential• Given the window (frame) length, decide the
base frequency• Multiply by sine wave at each multiple of base
frequency• Multiply by cosine wave at each multiple of
base frequency• Calculate magnitude and phase spectra using
but....,component cosinecomponent sinetan
component cosinecomponent sine
1
22
X
X
25
Compact Formulae• DFT
1,,2,1,02 1
0
2
NkexNkX
N
n
Nknjn
• IDFT
1,,2,1,021 1
0
2
NneNkX
Nx
N
k
Nknjn