Download presentation
Presentation is loading. Please wait.
1
Discrete Fourier Transform (DFT)
Jyh-Shing Roger Jang (張智星) MIR Lab (多媒體資訊檢索實驗室) CSIE, NTU (台灣大學 資訊工程系)
2
Discrete Fourier Transform
Goal Decompose a given vector of discrete signals into sinusoidal components whose amplitudes can be view as energy distribution over a range of frequencies Applications Speech recognition Digital filtering Many many more... Due to sampling
3
Decomposition How to decompose xn=x(n/fs), n=0~N-1 into a linear combination of sinusoidal functions? Magnitude spectrum Phase spectrum Remaining problems To determine no. of terms and their frequencies
4
How to Select Frequencies
Signals of N points with sample rate fs Total duration d=N/fs (sec) Periods = d, d/2, d/3, … Freq. of sinusoids (bin frequencies) Total count = N/2+1
5
No. of Terms for Decomposition
Curve fitting for a parabola # of unknowns = # of equations (= # of points) Curve fitting view for sinusoidal decomp. How many terms do we need if there are N points? N/2+1!
6
Example When N=4
7
Example When N=8
8
Sinusoidal Basis Functions (1/2)
Can be converted into sin & cos Phase is necessary
9
Sinusoidal Basis Functions (2/2)
10
Decompose x(t) into Basis Functions
n=0,1,2,…, N-1 # of terms = # of bin freq = N/2+1 # of fitting parameters = N
11
Decomposition into Basis Functions
Overall expression: No. of parameters is 1+2*(N/2-1)+1=N, which is equal to the no. of data points Exact solution is likely to exist. Amplitude Freq= Phase
12
Parameter Identification
How to identify coefficients of the basis functions: Solving simultaneous linear equations Integration (which take advantage of the orthogonality of the basis functions) Fast Fourier transform (FFT) A fast algorithm with a complexity of O(N log N)
13
From Time-domain to Freq-domain
Many animation over the web 3D animation Please post on FB if you find more.
14
Frequencies of Basis Functions
Due to Euler identity, we can express the k-th term shown on the right. Quiz!
15
Frequencies of Basis Functions
Plug in the simplified k-th term: Include the first and last terms:
16
Representations of DFT: Two-side
Characteristics General representation If x is complex, then c is not conjugate symmetric MATLAB command: c=fft(x) Usually complex numbers
17
Representations of DFT: One-side
Characteristics When x is real, c is conjugate symmetric and we only have to look at one-side of FFT result. MATLAB command: magSpec=fftOneside(x) Real Real In SAP toolbox Complex conjugate
18
Representations of DFT: One-side
Formulas
20
Example: Conjugate Symmetric
Conjugate symmetric of DFT for real x fftSym01.m
21
Example: Two-side FFT Two-side FFT of a pure sinusoid at one of the bin freqency fft01.m
22
Example: Two-side FFT Two-side FFT of a pure sinusoid NOT at one of the bin frequencies fft02.m
23
Example: One-side FFT One-side FFT of a pure sinusoid NOT at one of the bin frequencies fft03.m
24
Example: One-side FFT One-side FFT of a frame of audio signals fft04.m
25
Example: FFT for Data Compression
Use partial coefficients to reconstruct the original signals fftApproximate01.m High-frequency components are not so important
26
Example: FFT for Data Compression
Use low-freq components to reconstruct a frame fftApproximate01.m
27
Example: FFT for Periodic Signals
Quiz! FFT on periodic signals fftRepeat01.m Useful for pitch tracking Interpretation of harmonics from viewpoints of Approximation by basis functions Integration for obtaining the coefficients
28
Why Harmonic Structures?
29
Example: Zero-padding for FFT
Purpose N’=N+a=2^n, easier for FFT computation Interpolation to have better resolution Example fftZeroPadding01.m Quiz!
30
Example: Down-sampling
High-frequency components are missing fftResample01.m
31
Harmonics Why do we have harmonic structures in a power spectrum?
Since the original frame is quasi-periodic… If we want to use the spectrum for pitch tracking, we need to enhance the harmonics. How?
32
How to Enhance Harmonics?
Goal Enhance harmonics for pitch tracking Approach Take an integer number of fundamental periods Hard! Use windowing Use zero-padding for better resolution
33
Example: Harmonics Enhancement (1)
fftHarmonics01.m
34
Example: Harmonics Enhancement (2)
fftHarmonics02.m
35
Example: Harmonics Enhancement (3)
fftHarmonics03.m
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.