06/06/22 By Akshaya Srivatsa and Aji th J Kocheri 1 Fast Fourier Transform Algorithms
Nov 14, 2014
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri1
Fast Fourier Transform Algorithms
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri2
Overview Definition and need for FFT Principle behind the algorithms Direct computation of FFT Radix 2 FFT algorithm Goertzel algorithm Chirp Z transform FFT in Matlab and Applications of FFT
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri3
Given a sequence of N complex valued numbers x(n), the DFT X(k) is defined as
And the inverse DFT is given by the equation
Definition
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri4
Need for FFT The direct computation of FFT requires N2 complex
multiplications and N(N-1) complex additions, which has polynomial complexity.
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri5
Some Examples Speech can be sampled “Adequately” with a
sampling rate of 8kHz (N=8000). Digital audio sampling rate is about 44.1 kHz
(N=44100). This sampling rate is employed in Digital Audio CD’s
Video sampling rate is much higher than audio sampling rates.
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri6
Principle behind the Algorithms
Essentially all these algorithms use symmetry and periodicity property to their advantages to make sure that smaller number of steps are used to computer the DFT.
Where WN= e-j2π/N
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri7
Radix 2 Approach V[k] = Σn even WN
kn v[n] + Σ n odd WNkn v[n]
V[k] = Σr=0,1,…N-1 WNkr v[2r] + Σr=0,1,…N-1WN
k(2r+1) v[2r+1]
V[k] = Σr=0,1,…N-1 WNkr v[2r] + WN
kΣr=0,1,…N-1WNk(2r) v[2r+1]
V[k] =F1(k) + WNk F2(k) where F1(k) and F2(k) are N/2 point
DFT’s for even and odd number sequences. But WN
k+(N/2) = -WNk
Hence V[k] =F1(k) + WNk F2(k) and
V[k+(N/2)] =F1(k) - WNk F2(k) k=0,1,2,…(N/2)-1
We can further “Decimate” the even and odd sequences to give smaller and smaller divisions.
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri8
Butterfly Calculations Three stages in computation when N=8
V[0] = W20 v[0] + W2
0 v[1] = v[0] + W20 v[1]
V[1] = W20 v[0] + W2
1 v[1] = v[0] + W21 v[1]
Note that the V(k) is not in the same sequence as v(n).It can be observed that v(k) is in bit reversed order.
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri9
Decimation in Time This is a special case of Divide and Conquer approach. Here N is represented be the equation N=2γ So we need to decimate X(n) γ= log2N times. This will give us decimation where
each butterfly computation involves only 2 inputs at a time.
-Total number of complex multiplications---(N/2)log2N-Total number of complex additions----------Nlog2N
Here we see that we need only2N computer registers as these 2N registers which initially storedx(n) will finally hold X(k).
Hence we say that the Computation is in place.
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri10
Decimation in Frequency
This is the reverse process of Decimation in time. Here we decimate X(k) successively to get x(n).
Here we choose M=2 and L=N/2
Unlike decimation in time, here we split x(n) as first N/2 number and the next N/2 numbers.
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri11
How good is the Algorithm??
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri12
Efficient Computing DFT of Two Real sequences
Fact: DFT computation is the same whether we handle real numbers of complex numbers.
If the two real sequences are x1(n) and x2(n) then let x(n) = x1(n) + jx2(n)
So x1(n) = [x(n) + x*(n)]/2 and x2(n) =[x(n) – x*(n)]/2j Also DFT of x*(n) = X*(N-k) Therefore X1(k) = [X(k) + X*(N-k)]/2 and
X1(k) = [X(k) - X*(N-k)]/2j
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri13
Goertzel Algorithm This algorithm uses linear filtering operation where the linear filter
takes the form of N parallel resonators where each resonators selects one of the N frequencies in the DFT.
We know that WN-kN=1, we can rewrite X(k) as
X(k)=Σ0N-1 x(m) WN
–k(N-m)
This is of the form of circular convolution where hk(n)=WN-knu(n)
Lets take the z transform of hk(n), we get
Hk(z) = 1/[1-WN-kz-1] which has a single pole at ω = 2πk/N
From this, we get yk(n)=wN-kyk(n-1) + x(n). This makes evaluation
of yk(n) an iterative process. Hence for values of M<log2N, this makes DFT evaluation highly efficient. {Given yk(-1)}
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri14
Goertzel Algorithm (Continued)
For the system having two pole filters, Hk(z) is of the form
Hk(z) = [1-WN-k]/[1-2cos(2πk/N)z-1 +z-2]
Given yk(-1) and yk(-2)
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri15
Chirp-z Transform Approach
Z transform of x(n) is same as the DFT of x(n)r-n as DFT is obtained by setting r=1 in the Z transform of x(n)
More generally speaking, in the z-plane, if we chose zk=roejθ(RoejØ)k where the first complex number is a point in the z plane and the second complex number is a circle or radius Ro, and if Ø=2π/N,θ=0,ro=0, we obtain the frequencies as points on the z plane.
nk=[1/2][n2+k2-(n-k)2]
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri16
So we have transformed Z transform into convolution which can be easily obtained using convolution theorem where
h(n)=ejπ/n(k-n)2
For the convolution, we got go consider an M point sequence of h(n) where M=L+N-1
Let n vary such that –(N-1)<n<(L-1). So to make math easier,
let h1(n)=h(n-N+1) n=0,1,2,….M-1
Compute the M point DFT of h1(n) and M point DFT of an(After padding with zeros). Therefore Y1(k)=An(k)H1(k)
Take IDFT of Y1(k); We know that the first N-1 points are corrupted by aliasing. So discard the first N-1 point and consider the rest.
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri17
FFT in Matlab Y = fft(X)
It returns FFT of the matrix X given Y = fft(X,n)
It returns FFT of X taking only n points
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri18
Applications
x(n)=sin(2*50πt)+sin(2*150πt) + random normalized noise
04/08/23 By Akshaya Srivatsa and Ajith J Kocheri19
Calculation of DTFS = [fft(x(n),N)]/N Frequency response of LTI filter is given by DTFT of its
impulse response. This can be obtained by zero padding x(n) upto ∞ (Very large) and the DFT of it will give us the DTFT.