EXPERT SYSTEMS AND SOLUTIONS
Project Center For Research in Power Electronics and Power Systems
IEEE 2010 , IEEE 2011 BASED PROJECTS FOR FINAL YEAR STUDENTS OF B.E
Email: expertsyssol@gmail.com,
Cell: +919952749533, +918608603634
www.researchprojects.info
OMR, CHENNAI
IEEE based Projects For
Final year students of B.E in
EEE, ECE, EIE,CSE
M.E (Power Systems)
M.E (Applied Electronics)
M.E (Power Electronics)
Ph.D Electrical and Electronics.
Training
Students can assemble their hardware in our Research labs. Experts will be guiding the projects.
EXPERT GUIDANCE IN POWER SYSTEMS POWER ELECTRONICS
We provide guidance and codes for the for the following power systems areas.
1. Deregulated Systems,
2. Wind power Generation and Grid connection
3. Unit commitment
4. Economic Dispatch using AI methods
5. Voltage stability
6. FLC Control
7. Transformer Fault Identifications
8. SCADA - Power system Automation
we provide guidance and codes for the for the following power Electronics areas.
1. Three phase inverter and converters
2. Buck Boost Converter
3. Matrix Converter
4. Inverter and converter topologies
5. Fuzzy based control of Electric Drives.
6. Optimal design of Electrical Machines
7. BLDC and SR motor Drives
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Dft
1. EXPERT SYSTEMS AND SOLUTIONS
Email: expertsyssol@gmail.com
expertsyssol@yahoo.com
Cell: 9952749533
www.researchprojects.info
PAIYANOOR, OMR, CHENNAI
Call For Research Projects Final
year students of B.E in EEE, ECE,
EI, M.E (Power Systems), M.E
(Applied Electronics), M.E (Power
Electronics)
Ph.D Electrical and Electronics.
Students can assemble their hardware in our
Research labs. Experts will be guiding the
projects.
3. Review
The DTFT provides the frequency-domain (w)
representation for absolutely summable sequences.
The z-transform provides a generalized frequency-
domain (z) representation for arbitrary sequences.
Two features in common:
Defined for infinite-length sequences
Functions of continuous variable (w or z)
From the numerical computation viewpoint, these two
features are troublesome because one has to evaluate
infinite sums at uncountably infinite frequencies.
4. Review
To use Matlab, we have to truncate sequences and
then evaluate the expression at finitely many points.
The evaluation were obviously approximations to the
exact calculations.
In other words, the DTFT and the z-transform are not
numerically computable transform.
5. Introduction
Therefore we turn our attention to a numerically computable
transform.
It is obtained by sampling the DTFT transform in the
frequency domain (or the z-transform on the unit circle).
We develop this transform by analyzing periodic sequences.
From FT analysis we know that a periodic function can
always be represented by a linear combination of
harmonically related complex exponentials (which is form of
sampling).
This give us the Discrete Fourier Series representation.
We extend the DFS to finite-duration sequences, which leads
to a new transform, called the Discrete Fourier Transform.
6. Introduction
The DFT avoids the two problems mentioned above
and is a numerically computable transform that is
suitable for computer implementation.
The numerical computation of the DFT for long
sequences is prohibitively time consuming.
Therefore several algorithms have been developed to
efficiently compute the DFT.
These are collectively called fast Fourier transform
(or FFT) algorithms.
7. The Discrete Fourier Series
Definition: Periodic sequence
~ (n) = ~ (n + kN ), ∀n, k
x x
N: the fundamental period of the sequences
From FT analysis we know that the periodic functions can be
synthesized as a linear combination of complex exponentials
whose frequencies are multiples (or harmonics) of the
fundamental frequency (2pi/N).
From the frequency-domain periodicity of the DTFT, we
conclude that there are a finite number of harmonics; the
frequencies are {2pi/N*k,k=0,1,…,N-1}.
8. The Discrete Fourier Series
A periodic sequence can be expressed as
N −1
~ ( n) = 1 ~
∑ X (k )e , n = 0,±1,
π
j 2N kn
x
N k =0
~
{ X ( K ), k = 0,±1, } called the discrete Fourier series
are
coefficients, which are given by
N −1
~ ~ (n)e − j 2Nπ kn , k = 0,±1,
X (k ) = ∑ x
n =0
The discrete Fourier series representation of periodic sequences
9. The Discrete Fourier Series
X(k) is itself a (complex-valued) periodic
sequence with fundamental period equal to N.
π
− j 2N
Let WN = e
N −1
~ ~ (n)] = ~ (n)W nk
X (k ) = DFS[ x ∑x N
n =0
N −1
~ (n) = IDFS[ X (k )] = 1
~ ~
x
N
∑ −
X (k )WN nk
k =0
Example 5.1
10. DFT : DEFINATION
To perform frequency analysis on a discrete-time signal, x(n),
need to convert the time-domain to an equivalent frequency-domain
representation. In order to this, need to use a powerful computational
tool to perform frequency analysis called
Discrete Fourier Transform or DFT.
The continuous Fourier Transform is defined as below:
However, this integral equation of Fourier Transform is not suitable to
perform frequency analysis due to this 2 reasons:
Continuous nature can be handled by Computer
The limits of integration cannot be from minus infinity to infinity.
There should be a finite length sequences that can be handled by
computer.
11. DFT : DEFINATION
Let x(n) be a finite length sequences.
Thus, the N-point DFT of x(n) defined as X(k) is :
N −1
X(k) = ∑ x(n) e-j2πnk/N, k = 0,1, …, N-1
n =0
k represent the harmonic number of the transform
component.
n is the finite length sequence interval defined as
0 ≤ n ≤ N-1, N is the sequence length
Thus X(k) being complex and has real & imaginary
component, so that the kth harmonic of X(k) is:
X(k) = R(k) + jI(k)
12. DFT : PROPERTIES
The are 4 properties of DFT:
1. Periodicity
If X(k) is the N-point DFT of x(k),
x(n+N) = x(n), for all n
X(k+N) = X(k), for all k
It shows that DFT is periodic with period N, also known
as Cyclic property of the DFT
2. Linearity
If X1(k) and X2(k) are the N-point DFT
of x1(n) and x2(n),
ax1(n) + bx2(n) DFT
aX1(k) + bX2(k)
13. 3. Circular Shifting
Let x(n) be a sequence of length N and X(k) is N
,
-point DFT, thus the sequence, x (n) obtained from
x(n) by shifting x(n) cyclically by m units. Then,
,
x (n) DFT
X(k)e-j2πkm/N
4. Parseval’s Theorem
if x(n) DFT
X(k) and
y(n) N −1
DFT
Y(k) N −1
thus, ∑ x(*n)
y (n) = 1/N ∑X(
Y0*(k)k )
k=
n=0
14. DFT : RELATIONSHIP WITH z-TRANSFORM
The z-transform of the sequence, x(n) is given by:
∞
X(z) = ∑ x ( n) z
n = −∞
-n
, ROC include unit circle
by defining zk = ej2πk/N, k = 0, 1, 2, …, N-1
X(k) = X(z)| zk = ej2πk/N , k = 0,1,2, …, N-1
∞
= ∑ x ( n )e
n = −∞
-j2πnk/N
where ωk = 2πk/N, k = 0,1,2,…,N-1
15. DFT : EXAMPLES
EXAMPLE 1:
Find the DFT for the following finite length sequence,
x(n) = { ¼, ¼, ¼ }
Solution :
1. Determine the sequence length, N
N = 3, k = 0,1,2
2. Use DFT formula to determine X(k)
N −1
X(k) = ∑ x ( n) e
n =0
-j2πnk/N
, k = 0, 1, 2
X(0) = ¼ + ¼ + ¼ = ¾
X(1) = ¼ + ¼e-j2π/3 + ¼e-j4π/3
= ¼ + ¼ [cos (2π/3) – jsin(2π/3) + ¼ [cos (4π/3) –jsin(4π/3)
= ¼ + ¼ [-0.5 – j0.866] + ¼ [ -0.5 + j0.866]
= ¼ + ¼ [-1] = 0
17. Examples 2:
Given the following the finite length sequences,
x(n) = {1,1,2,2,3,3}
Perform DFT for this sequences.
Solution :
1. Determine the sequence length, N = 6.
2. Use DFT formula to determine X(k).
N −1
X(k) = ∑ x ( n) e
n =0
-j2πnk/N
, k = 0,1,2,3,4,5
X(0) = 12, X(1) = -1.5 + j2.598
X(2) = -1.5 + j0.866, X(3) = 0
X(4) = -1.5 – j0.866, X(5) = -1.5 – j2.598
Thus,
X(k) = {12, -1.5 + j2.598, -1.5 + j0.866, 0, -1.5 – j0.866,
-1.5 – j2.598}
18. Examples 3:
Find the DFT for the convolution of 2 sequences :
x1(n) = {2, 1, 2, 1} & x2(n) = {1, 2, 3, 4}
Solution :
1. Determine the sequence length for each
sequence, N = 4. Thus, k = 0,1,2,3
2. Perform DFT for each sequences,
(i) X1(0) = 6, X1(1) = 0, X1(2) = 2, X2(3) = 0
X1(k) = {6,0,2,0}
(ii) X2(0) = 10, X2(1) = -2+j2, X2(2) = -2, X2(3) = -2-j2
X2(k) = {10,-2+j2,-2,-2-j2}
3. Perform Convolution by :
X3(k) = X1(k) X2(k)
= {60, 0, -4, 0}
19. IDFT : DEFINATION
IDFT is the inverse Discrete Fourier Transform.
The finite length sequence can be obtained from the Discrete Fourier
Transform by performing IDFT.
The IDFT is defined as :
N −1
x(n) = 1/N∑ X (k ) e-j2πnk/N,
k =0
where n = 0,1, …, N-1
20. EXAMPLES 4:
Determine the IDFT for the following DFT sequence,
X(k) = {1, 2, 3, 4}
SOLUTION :
1. Determine the length of the sequence, N = 4
2. Calculate the IDFT by the IDFT formula:
3
x(n) = 1/4∑ X (k ) e
k =0
,
-j2πnk/4
x(0) = ¼(1 + 2 + 3 + 4) = 5/2
x(1) = -0.5 – j0.5, x(2) = -0.5
x(3) = -0.5 + j0.5
3. Thus the finite length sequence, x(n) is:
x(n) = {2.5, -0.5-j0.5, -0.5, -0.5+j0.5}
21. IDFT : EXAMPLES
EXAMPLES 5:
Obtain the finite length sequence, x(n) from the DFT sequence in
Example 3.
Solution :
1. The sequence in Example 3 is :
X3(k) = {60, 0, -4, 0}
2. Use IDFT formula to obtain x(n):
3
x3(n) = 1/4 ∑ X (k )e
k =0
,
-j2πnk/4
x3(0) = 14, x3(1) = 16, x3(2) = 14, x3(3) = 16
Thus the finite length sequences are :
x3(k) = {14, 16, 14, 16}
22. DFT & IDFT : COMPLEXITY OF DFT
A Large number of multiplications and additions are required to compute
DFT.
To compute the 8-point of DFT of the sequence, x(n),
The X(k) will be the summation of x(0)e-j2π(0)k/8 until x(7)e-j2π(7)k/8 For the eight
terms, there will be 64 multiplication (82) and 56 addition (8 x (8-1))
Hence, for N-point DFT, there will be N 2 multiplication and N(N-1)
addition.
23. Thus, need one algorithm to reduce the number of calculation and
speeds up the computation of DFT. The algorithm is called Fast
Fourier Transform (FFT). It utilizes special properties of the DFT to
construct a computational procedure that requires Nlog 2N complex
multiplication and Nlog2N complex addition to carry out N-point DFT.
The MATLAB command use to perform DFT & IDFT is:
1. fft2 () - for DFT
2. ifft2 () - for IDFT
24. FFT : DEFINATION
FFT is the algorithm that efficiently computes the
DFT.
In applying FFT, the DFT expression can be
written as :
N −1
X(k) =∑ x(n)W
n =0
N
nk
, k = 0, 1,…,N-1
where, WN = e-j2π/N
25. IFFT : DEFINATION
The FFT for IDFT can be defined as:
N −1
x(n) = 1/N∑ X (k )WNnk
k =0
WN2 = (e-j2π/N)2 = e-j2π2/N = WN/2
26. DFT & IDFT : SUMMARY
The DFT & IDFT can be summarized below:
1. It is a powerful method to perform frequency
analysis which are used widely in digital
image processing including blurring and enhancing.
2. Since the DFT & IDFT will become tedious
when the length of the sequence become
big, one algorithm is develop to overcome
this problem.
3. The algorithm can be found in MATLAB. The function
are :
1. FFT2 = to perform DFT
2. IFFT2 = to perform IDFT
27. Ex5.2 DFS of square wave seq.
L, k = 0,± N ,±2 N ,
~
X (k ) = − jπ ( L −1) / N sin(πkL / N )
e
sin(πk / N )
Note
1. Envelope like the sinc function;
2. Zeros occur at N/L (reciprocal of duty cycle);
3. Relation of N to density of freq. Samples;
28. Relation to the z-transform
Nonzero, 0 ≤ n ≤ N − 1 N −1
x ( n) = X ( z ) = ∑ x ( n) z − n
0, elsewhere n =0
~ (n), 0 ≤ n ≤ N − 1 ~
x ( n) =
x N −1
X ( k ) = ∑ x ( n) e [ ]π
j 2N k −n
0, elsewhere n =0
~
X (k ) = X ( z ) | j 2π k
z =e N
The DFS X(k) represents N evenly spaced samples of the
z-transform X(z) around the unit circle.
29. Relation to the DTFT
N −1 N −1
X (e ) = ∑ x ( n ) e
jw − jwn ~ (n)e − jwn
= ∑x
n =0 n =0
~
X ( k ) = X (e ) | w = 2 π k
jw
N
2π 2π
Let w1 = , and wk = k = kw1
N N
X (k ) = X (e jwk ) = X (e jkw1 )
The DFS is obtained by evenly sampling the DTFT at w1 intervals.
The interval w1 is the sampling interval in the frequency domain. It is called
frequency resolution because it tells us how close are the frequency samples.
30. Sampling and construction in the
z-domain
~
X (k ) = X ( z ) | j 2π k
, k = 0,±1,±2,
DFS & z- z =e N
+∞ +∞
transform
∑ x ( m)e ∑
π
− j 2N km
= = km
x(m)WN
m = −∞ m = −∞
~ ( n) = 1 ~ N −1
1 N −1 +∞ km
IDFS x ∑ X (k )WN = ∑ ∑ x(m)WN WN kn
− kn
N k =0 m = −∞
−
Nk =0
+∞
1 N −1 − k ( n − m ) +∞ +∞
= ∑ x ( m ) ∑ WN = ∑ x(m) ∑ δ (n − m − rN )
m = −∞ N k =0 m = −∞ r = −∞
+∞ +∞ +∞
= ∑ ∑ x(m)δ (n − m − rN ) = ∑ x(n − rN )
m = −∞ r = −∞ r = −∞
31. Comments
When we sample X(z) on the unit circle, we
obtain a periodic sequence in the time domain.
This sequence is a linear combination of the
original x(n) and its infinite replicas, each
shifted by multiples of N or –N.
If x(n)=0 for n<0 and n>=N, then there will be
no overlap or aliasing in the time domain.
32. Comments
x(n) = ~ (n) for 0 ≤ n ≤ N − 1
x
~ (n) R (n) = ~ (n)1 0 ≤ n ≤ N − 1
x (n) = x x
N
0 else
RN(n) is called a rectangular window of length N.
THEOREM1: Frequency Sampling
If x(n) is time-limited (finite duration) to [0,N-1], then N
samples of X(z) on the unit circle determine X(z) for all z.
33. Reconstruction Formula
Let x(n) be time-limited to [0,N-1]. Then from Theorem 1 we should be able
to recover the z-transform X(z) using its samples X~(k).
~ ( n) z − n = 1 −
N −1 N −1 N −1 N −1
~
X ( z ) = ∑ x ( n) z = ∑ x
−n
∑N ∑ X (k )WN kn z − n
n =0 n =0 n =0 k =0
1 N −1 ~ N −1 − kn − n 1 N −1 ~ N −1 − k −1 n
= ∑ X ( k ) ∑ W N z = ∑ X ( k ) ∑ WN z
N k =0
( )
n =0 N k =0 n=0
1 N −1 ~ 1 − WN kN z − N
−
= ∑ X (k ) − k −1 WN-kN=1
N k =0 1 − WN z
− N N −1 ~
1− z X (k )
X ( z) =
N
∑ 1 − W −k z −1
k =0 N
34. The DTFT Interpolation Formula
~
1 − e − jwN N −1
X (k ) N −1
~ 1 − e − jwN
X (e ) =
jw
N
∑ 1 − e j 2πk / N e − jw = ∑ X (k )
N (1 − e j 2πk / N e − jw )
k =0 k =0
sin ( wN ) − jw ( N2−1 ) An interpolation polynomial
Φ ( w) = 2
e
N sin ( 2 )
w
N −1
~ This is the DTFT interpolation
X (e ) = ∑ X (k )Φ ( w − 2Nk )
jw π
formula to reconstruct X(ejw) from
k =0 its samples X~(k)
Since Φ (0) = 1, we have that X(ej2pik/N)=X~(k), which means
that the interpolation is exact at sampling points.
35. The Discrete Fourier Transform
The discrete Fourier series provided us a mechanism
for numerically computing the discrete-time Fourier
transform.
It also alert us to a potential problem of aliasing in the
time domain.
Mathematics dictates that the sampling of the discrete-
time Fourier transform result in a periodic sequences
x~(n).
But most of the signals in practice are not periodic.
They are likely to be of finite duration.
36. The Discrete Fourier Transform
Theoretically, we can take care of this problem by
defining a periodic signal whose primary shape is that
of the finite duration signal and then using the DFS on
this periodic signal.
Practically, we define a new transform called the
Discrete Fourier Transform (DFT), which is the
primary period of the DFS.
This DFT is the ultimate numerically computable
Fourier transform for arbitrary finite duration
sequences.
37. The Discrete Fourier Transform
First we define a finite-duration sequence x(n) that has N
samples over 0<=n<=N as an N-point sequence
+∞ ∆
~ ( n) =
x ∑ x(n − rN ) ~(n) = x(n mod N ) = x((n)) N
x
r = −∞
The compact relationships between x(n) and x~(n) are
~ (n) = x((n))
x ( Periodic extension)
N
x(n) = ~ (n) R (n) (Window operation)
x N
The function rem(n,N) can be used to implement our
modulo-N operation.
38. The Discrete Fourier Transform
The Discrete Fourier Transform of an N-point sequence is
given by ~
X (k ) 0 ≤ k ≤ N − 1 ~
X (k ) = DFT [ x(n)] = = X ( k ) RN ( n)
0 else
N −1
X (k ) = ∑ x(n)WN , 0 ≤ k ≤ N − 1
nk
n =0
Note that the DFT X(k) is also an N-point sequence, that is, it is not
defined outside of 0<=n<=N-1.
DFT X(k) is the primary interval of X~(k).
N −1
~ ( n) R ( n) = 1
x(n) = IDFT [ X (k )] = x N
N
∑ X (k )WN−kn ,0 ≤ n ≤ N − 1
k =0
39. Matlab Implementation
X = WN x
1 *
x = WN X
N
1 1 1
1 W 1 WN N −1)
(
[
W N = WN
kn
]
0 ≤ k, n ≤ N −1 =
N
( N −1) 2
1 WN N −1)
(
WN
40. Zero-padding is an operation in which more zeros are appended
to the original sequence. The resulting longer DFT provides
closely spaced samples of the discrete-times Fourier transform
of the original sequence.
The zero-padding gives us a high-density spectrum and
provides a better displayed version for plotting. But it does not
give us a high-resolution spectrum because no new information
is added to the signal; only additional zeros are added in the
data.
To get high-resolution spectrum, one has to obtain more data
from the experiment or observations.
41. Properties of the DFT
1. Linearity: DFT[ax1(n)+bx2(n)]=aDFT[x1(n)]+bDFT[x2(n)]
N3=max(N1,N2): N3-point DFT
2. Circular folding:
x(0) k =0
x((− n)) N =
x( N − k ) 1 ≤ k ≤ N − 1
X ( 0) k =0
DFT [ x((−n)) N ] = X ((− k )) N =
X (N − k ) 1 ≤ k ≤ N −1
Matlab: x=x(mod(-n,N)+1)
42. Properties of the DFT
3. Conjugation: DFT [ x* (n)] = X * ((− k )) N
4. Symmetry properties for real sequences:
Let x(n) be a real-valued N-point sequence
X (k ) = X * ((−k )) N
Re[ X (k )] = Re[ X ((−k )) N ] : circular − even sequence
Im[ X (k )] = − Im[ X (( N − k )) N ] : circular − odd sequence
| X (k ) |=| X ((− k )) N |
∠X (k ) = −∠X ((− k )) N
43. Comments:
Circular symmetry
Periodic conjugate symmetry
About 50% savings in computation as well as in storage.
X(0) is a real number: the DC frequency
X(N/2)(N is even) is also real-valued: Nyquist component
Circular-even and circular-odd components:
1
xec (n) = [ x(n) + x((−n)) N ] DFT [ xec (n)] = Re[ X (k )] = Re[ X ((−k )) N ]
2
1
xoc (n) = [ x(n) − x((−n)) N ] DFT [ xoc (n)] = Im[ X (k )] = Im[ X ((−k )) N ]
2
The real-valued signals Function, p143
44. Properties
5. Circular shift of a sequence
DFT [ x((n − m)) N RN (n)] = WN X (k )
km
6. Circular shift in the frequency domain
−
DFT [WN ln x(n)] = X ((k − l )) N RN (k )
7. Circular convolution**
N −1
x1 (n) ⊗ x2 (n) = ∑ x1 (m) x2 ((n − m)) N , 0 ≤ n ≤N − 1
m=0
DFT [ x1 (n) ⊗ x2 (n)] = X 1 (k ) X 2 (k )
45. Properties
1
8. Multiplication: DFT [ x1 ( n) ⋅ x2 (n)] = X 1 (k ) ⊗ X 2 (k )
N
9. Parseval’s relation:
N −1 N −1
1
E x = ∑ | x (n) | = 2
∑ | X ( k ) |2
n =0 N k =0
Energy spectrum | X ( k ) |2
N
Power spectrum X (k )
2
N
46. Linear convolution using the DFT
In general, the circular convolution is an aliased version of the
linear convolution.
If we make both x1(n) and x2(n) N=N1+N2-1 point sequences by
padding an appropriate number of zeros, then the circular
convolution is identical to the linear convolution.
N −1
x4 (n) = x1 (n) ⊗ x2 (n) = ∑ x1 (k ) x2 ((n − k )) N RN (n)
m =0
N −1 +∞
= ∑ x1 (k ) ∑ x2 (n − k − rN ) RN (n)
m =0 r = −∞
+∞ N1 −1 +∞
= ∑ ∑ x1 (k ) x2 (n − k − rN ) RN (n) = ∑ x3 (n − rN ) RN (n)
r = −∞ m =0 r = −∞
47. Error Analysis
When N=max(N1,N2) is chosen for circular convolution, then
the first (M-1) samples are in error, where M=min(N1,N2).
+∞
e(n) = x4 − x3 = ∑ x3 (n − rN ) RN (n) − x3 (n)
r = −∞
= ∑ x3 (n − rN ) RN (n) N ≥ max( N1 , N 2 )
r ≠0
e(n) = [ x3 (n − N ) + x3 (n + N )]RN (n)
= x3 (n + N ) 0 ≤ n ≤ N − 1
n=0,1,…(N1+N2-1)-N
X3(n) is also causal
48. Block Convolution
Segment the infinite-length input sequence into smaller sections (or blocks),
process each section using the DFT, and finally assemble the output
sequence from the outputs of each section. This procedure is called a block
convolution operation.
Let us assume that the sequence x(n) is sectioned into N-point sequence and
that the impulse response of the filter is an M-point sequence, where M<N.
We partition x(n) into sections, each overlapping with the previous one by
exactly (M-1) samples, save at last (N-M+1) output samples, and finally
concatenate these outputs into sequence.
To correct for the first (M-1) samples in the first output block, we set the
first (M-1) samples in the first input blocks to zero.
49. The Fast Fourier Transform
Although the DFT is computable transform, the
straightforward implementation is very inefficient,
especially when the sequence length N is large.
In 1965, Cooley and Tukey showed the a procedure to
substantially reduce the amount of computations
involved in the DFT.
This led to the explosion of applications of the DFT.
All these efficient algorithms are collectively known
as fast Fourier transform (FFT) algorithms.
50. The FFT
Using the Matrix-vector multiplication to
implement DFT:
X=WNx (WN: N*N, x: 1*N, X: 1*N)
takes N×N multiplications and (N-1)×N
additions of complex number.
Number of complex mult. CN=O(N2)
A complex multiplication requires 4 real
multiplications and 2 real additions.
51. Goal of an Efficient computation
The total number of computations should be linear
rather than quadratic with respect to N.
Most of the computations can be eliminated using the
symmetry and periodicity properties
k ( n+ N ) (k + N )n
W kn
N =W N =W N
WN + N / 2 = −WN
kn kn
CN=N×log2N
If N=2^10, CN=will reduce to 1/100 times.
Decimation-in-time: DIT-FFT, decimation-in-frequency: DIF-FFT
53. A 4-point DFT→FFT example
X (0) X (1) g1 g 2 1 1 g1 g 2
X (2) X (3) = h − jh *W2 = 1 − j . * h h *W2
1 2 1 2
1 1 x(0) x(1)
= . *W2 * x(2) x(3) *W2
1 − j
W2 0*0 W2 0*1 1 1
where W2 = =
1*0
W2 W2 1*1 1 − 1
so W2 * A or A *W2 no multiplic ation needed
54. Divide-and-combine approach
To reduce the DFT computation’s quadratic dependence on N,
one must choose a composite number N=LM since L2+M2<<N2
for large N.
Now divide the sequence into M smaller sequences of length L,
take M smaller L-point DFTs, and combine these into a large
DFT using L smaller M-point DFTs. This is the essence of the
divide-and-combine approach.
n = Ml + m, 0 ≤ l ≤ L − 1, 0 ≤ m ≤ M − 1
k = p + Lq, 0 ≤ p ≤ L − 1, 0 ≤ q ≤ M − 1
55. Divide-and-combine approach
M −1L −1
X ( p, q ) = ∑∑ x(l , m)WN Ml + m )( p + Lq )
(
m=0 l =0
M −1
mp L −1 Mlp
= ∑ WN ∑ x(l , m)WN WNLmq
m=0 l =0
M −1 mq
mp L −1 lp
Twiddle factor = ∑ WN ∑ x(l , m)WL WM
m=0 l =
0
L −int DFT
po
M − po int DFT
Three-step procedure: P155
56. Divide-and-combine approach
The total number of complex multiplications
for this approach can now be given by
CN=ML2+N+LM2<o(N2)
This procedure can be further repeat if M or L
are composite numbers.
When N=Rv, then such algorithms are called
radix-R FFT algorithms.
58. pm
2. G ( p, m) = W8 F ( p, m)
is a 4 × 2 matrix dot mult. of 8 cplx multns
3. 2 − poi nt DFTX with
∑ [W8 ]
1
pm mq
( p, q ) = F ( p, m) W2
m =0
G (0,0) G (0,1)
G (1,0) G (1,1) W 0×0 W 0×1
= * 2 2
G (2,0) G (2,1) W 1×0 W 1×1
2 2
G (3,0) G (3,1)
59. Number of multiplications
A 4-point DFT is divided into two 2-point
DFTs, with one intermedium matrix mult.
number of multiplications=
4×4cplx→ 2 ×1+ 1 ×4 cplx 16 →6
A 8-point DFT is divided into two 4-point
DFTs, with one intermedium matrix mult.
8×8→2 ×6 + 2×4 64 →20
For 16-point DFT:
16×16→2 ×20 + 2×8 256 →56
60. Radix-2 FFT Algorithms
Let N=2v; then we choose M=2 and L=N/2 and divide x(n) into
two N/2-point sequence.
This procedure can be repeated again and again. At each stage
the sequences are decimated and the smaller DFTs combined.
This decimation ands after v stages when we have N one-point
sequences, which are also one-point DFTs.
The resulting procedure is called the decimation-in-time FFT
(DIF-FFT) algorithm, for which the total number of complex
multiplications is: CN=Nv= N*log2N;
using additional symmetries: CN=Nv= N/2*log2N
Signal flowgraph in Figure 5.19
61. Decimation-in-frequency FFT
In an alternate approach we choose L=2, M=N/2 and
follow the steps in (5.49).
We can get the decimation-frequency FFT (DIF-FFT)
algorithm.
Its signal flowgraph is a transposed structure of the
DIT-FFT structure.
Its computational complexity is also equal to CN=Nv=
N/2*log2N
62. Matlab Implementation
Function: X = fft(x,N)
If length(x)<N, x is padded with zeros.
If the argument N is omitted, N=length(x)
If x is matrix, fft computes the N-point DFT of each
column of x
It is written in machine languag and not use the
Matlab command. Therefore, it executes very fast.
It is written as a mixed-radix algorithm.
N=2v; N=prime number, it is reduced to the raw DFT.
63. Fast Convolutions
Use the circular convolution to implement the linear
convolution and the FFT to implement the circular
convolution.
The resulting algorithm is called a fast convolution algorithm.
If we choose N=2v and implement the radix-2 FFT, then the
algorithm is called a high-speed convolution.
If x1(n) is N1-point, x2(n) is N2-point, then
log 2 ( N1 + N 2 −1)
N =2
Compare the linear convolution and the high-speed conv.
64. High-speed Block Convolution
Overlap-and-save method
We can now replace the DFT by the radix-2
FFT algorithm to obtain a high-speed overlap-
and-save algorithm.
65. Discrete Fourier transform
x0 , x1 ,..., x N −1
Maps a set of input
points to another
set of output points.
DFT The operation is
N −1 2π reversible.
− j ik
X k = ∑ xi e N
i =0
X 0 , X 1 ,..., X N −1
66. Roots of the unity
• What are the Nth roots of unity? (0, j) imaginary
If N = 8 then we have
2π 2π
j 0 j 1
e 8
,e 8
2π 2π
j 2 j 3 real
e 8
,e 8
2π 2π (-1, 0) (1, 0)
j 4 j 5
e 8
,e 8
2π 2π
j 6 j 7
e 8
,e 8
2π (0, -j)
−j
Define WN = e N
67. Calculating the DFT
N −1 2π N −1
−j ik
X k = ∑ xi e N
= ∑ xiW N ik
i =0 i =0
X0 1 1 1 1 ... 1 x0
X 1 W1 WN 2
WN 3
... N −1
WN x1
1 N
X 2 1 WN 2
WN 4
WN 6
... WNN − 2 x2
= N −3
X 3 1 WN 3
WN 6
WN 9
... WN x3
... ... .
X
N −1 1 WNN −1 WNN − 2 WNN −3
... W x N −1
How many arithmetic (+ and *) operations do we need to
calculate the DFT?
68. Computing the DFT using the FFT
How can we do better? Fast Fourier Transform (FFT)
N −1 2π
−j ik
X k = ∑ xi e N
i =0
N / 2 −1 2π ( 2 i ) k N / 2 −1 2π ( 2 i +1) k
−j −j
Xk = ∑
i =0
x2 i e N
+ ∑i =0
x2i +1e N
N / 2 −1 2πik N / 2 −1 2πik 2πk
−j −j −j
Xk = ∑
i =0
x2 i e N /2
+ ∑
i =0
x2i +1e N /2
e N
N / 2 −1 2πik N / 2 −1 2πik
−j −j
Xk = ∑i =0
x2 i e N /2
+WN
k
∑ i =0
x2i +1e N /2
X k = X ke + WN X ko
k The sum of N point DFT
DFT of odd indices has been broken into
DFT of even indices two N/2 point DFTs
69. Example when N=8
Objective: Compute X0, X1, … X7 given x0, x1, …, x7
e
x0 X0 X0
W80
x2 magic X 1e X1
W81
x4 box X 2 e
X2
W82
x6 X 3e X3
W83
x1 o W84
X 0 X4
5
o W
x3 magic X
8
1 X5
W86
x5 box X o
2 X6
7
x7 o W
X 3
8
X7
Note
WN + N / 2 = −WN
k k
that
70. Now let’s apply the idea recursively
e
ee X0
x0 X0 X0
W40 X 1e W80
x4 X 1ee X1
W41 X2 e
W81
x2 eo
X 0 W42 X2
X e W82
x6 X 1eo 3
3
3
X3
W 4 W 8
o
X0 W84
x1 X0 oe
X4
W40 X 1o W 5
x5 X 1oe 8
W41 o
X2 X5
W86
x3 X0 oo
X6
W42 o
x7 X W 7
X 1oo 3 8
X7
W43
71. One more time
ee
x0 X0 X0 e
X0
x4 X ee
1
W40 X 1e W80
eo W41 X2 e
W81 X1
x2 X 0
W42 X2
x6 X e W82
3
eo X3
X 1 W 4
3
W 8
3
oe o
x1 X 0 X0 W84
X4
x5 X oe
1
W40 X 1o W8
5
X oo W41 o
X2 X5
x3 0 W86
W42 X6
x7 X o
W 7
3
oo 3
8
X7
X 1
W 4
• How many operations do we need now?
• What is the execution time on a general purpose CPU?
• What is the execution time on a FPGA? How many resources u need?
72. Another way to visualize FFT computations
How can we determine the order of the first inputs?
x0 Butte X0
Butte Butte
X4
x4 r r r
x2 fly fly
Butte fly
Butte X2
Butte
x6 r r X6
r
fly fly fly
x1
Butte Butte Butte X1
x5 r r r X5
x3 fly fly fly
Butte Butte Butte X3
x7 r r r X7
fly fly fly
73. Savings so far …
We have split the DFT computation into two halves:
N −1
X[k] = ∑ x[n]WN nk
k =0
( N/ 2)−1 ( N/ 2)−1
= ∑ rk k
x[2r]WN / 2 + WN ∑ rk
x[2r + 1]WN / 2
n=0 n=0
Have we gained anything? Consider the nominal number of multiplications
for N = 8
Original form produces 8 2 = 64 multiplications
2
New form produces 2(4 ) + 8 = 40 multiplications
So we’re already ahead ….. Let’s keep going!!
74. Signal flowgraph notation
In generalizing this formulation, it is most convenient to adopt a graphic
approach …
Signal flowgraph notation describes the three basic DSP operations:
Addition
x[n]
x[n]+y[n]
y[n]
Multiplication by a constant a
x[n] ax[n]
Delay
z-1
x[n] x[n-1]
75. Signal flowgraph representation
of 8-point DFT
k
X[k] = G[k] + WN H[k]
Recall that the DFT is now of the form
The DFT in (partial) flowgraph notation:
76. Continuing with the
decomposition …
So why not break up into additional DFTs? Let’s take the
upper 4-point DFT and break it up into two 2-point DFTs:
78. Now let’s take a closer look at
the 2-point DFT
The expression for the 2-point DFT is:
1 1
X[k] = ∑ x[n]W2nk = ∑ x[n]e − j 2πnk / 2
n=0 n=0
Evaluating for k = 0,1 we obtain
which in signal flowgraph notation looks like ...
X[0] = x[0] + x[1]
X[1] = x[0] + e − j 2π1 / 2 x[1] = x[0] − x[1]
This topology is referred to as the
basic butterfly
80. Number of multiplys for N-point
FFTs
N = 2ν where ν = log 2 (N)
Let
(log2(N) columns)(N/2 butterflys/column)(2 mults/butterfly)
or ~ N log 2 (N) multiplys
81. Comparing processing with and
without FFTs
“Slow” DFT requires N mults; FFT requires N log2(N) mults
Filtering using FFTs requires 3(N log2(N))+2N mults
α1 = N log2 (N) / N 2 ; α 2 = [3(N log2 (N)) + N] / N 2
Let
N α1 α2
Note: 1024-point FFTs
16 .25 .8124 accomplish speedups of 100
32 .156 .50 for filtering, 30 for DFTs!
64 .0935 .297
128 .055 .171
256 .031 .097
1024 .0097 .0302
82. Additional timesavers: reducing
multiplications in the basic butterfly
As we derived it, the basic butterfly is of the form
r
WN
WN N / 2
r+
N /2
Since WN = −1 we can reducing computation by 2 by
premultiplying by
r
WN 1
r
WN −1
83. Bit reversal of the input
first stages of the 8-point FFT:
Consider the binary representation of the
indices of the input:
0 000 If these binary indices are
4 100 time reversed, we get the
2 010 binary sequence representing
6 110 0,1,2,3,4,5,6,7
1 001
Hence the indices of the FFT
5 101 inputs are said to be in
3 011 bit-reversed order
7 111
84. Some comments on bit reversal
In the implementation of the FFT that we discussed, the input is bit
reversed and the output is developed in natural order
Some other implementations of the FFT have the input in natural order
and the output bit reversed (to be described Thursday)
In some situations it is convenient to implement filtering applications
by
Use FFTs with input in natural order, output in bit-reversed order
Multiply frequency coefficients together (in bit-reversed order)
Use inverse FFTs with input in bit-reversed order, output in
natural order
Computing in this fashion means we never have to compute bit
reversal explicitly