View
223
Download
0
Category
Preview:
Citation preview
8/8/2019 DSP projects Call 9952749533
1/84
EXPERT SYSTEMS AND SOLUTIONS
Email: expertsyssol@gmail.com
expertsyssol@yahoo.com
Cell: 9952749533www.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 theprojects.
8/8/2019 DSP projects Call 9952749533
2/84
Discrete Fourier Transform
&Fast Fourier Transform
8/8/2019 DSP projects Call 9952749533
3/84
8/8/2019 DSP projects Call 9952749533
4/84
Review To use Matlab, we have to truncate sequences and
then evaluate the expression at finitely many points.
The evaluation were obviously approximations to theexact calculations.
In other words, the DTFT and the z-transform are not
numerically computable transform.
8/8/2019 DSP projects Call 9952749533
5/84
Introduction Therefore we turn our attention to a numerically computable
transform.
It is obtained bysamplingthe DTFT transform in the
frequency domain (or the z-transform on the unit circle).
We develop this transform by analyzingperiodic sequences.
From FT analysis we know that aperiodic 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.
8/8/2019 DSP projects Call 9952749533
6/84
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 isprohibitively time consuming.
Therefore several algorithms have been developed to
efficiently compute the DFT.
These are collectively calledfast Fourier transform
(or FFT) algorithms.
8/8/2019 DSP projects Call 9952749533
7/84
The Discrete Fourier Series Definition: Periodic sequence
N: thefundamental periodof the sequences
From FT analysis we know that theperiodic functions can besynthesized as a linear combination of complex exponentialswhose frequencies are multiples (orharmonics) of the
fundamental frequency (2pi/N). From the frequency-domain periodicity of the DTFT, we
conclude that there are a finite number of harmonics; thefrequencies are {2pi/N*k,k=0,1,,N-1}.
knkNnxnx ,),(~)(~ !
8/8/2019 DSP projects Call 9952749533
8/84
The Discrete Fourier Series A periodic sequence can be expressed as
.,1,0,)(1
)(1
0
2
s!!
!
nekXnxk
knj T
},1,0),(~
{ .s!kK are called the discrete Fourier seriescoefficients, which are given by
.,1,0,)(~)(~ 1
0
2
s!!
!
kenxk
N
n
knjNT
The discrete Fourier series representation of periodic sequences
8/8/2019 DSP projects Call 9952749533
9/84
The Discrete Fourier Series X(k) is itself a (complex-valued)periodic
sequence with fundamental period equal to N.
!
!
!!
!!
!
1
0
1
0
)(1)]([I FS)(
)()]([DFS)(
Let2
N
k
nk
N
N
n
nk
N
j
N
WkXN
kXnx
WnxnxkX
eW NT
Example 5.1
8/8/2019 DSP projects Call 9952749533
10/84
To perform frequency analysis on a discrete-time signal,x(n),
need to convert the time-domain to an equivalent frequency-domainrepresentation. In order to this, need to use a powerful computationaltool 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 toperform 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.
DFT : DEFINATION
8/8/2019 DSP projects Call 9952749533
11/84
8/8/2019 DSP projects Call 9952749533
12/84
DFT : PROPERTIES
The are 4 properties ofDFT:
1. Periodicity
If X(k) is the N-point DFT ofx(k),
x(n+N) =x(n), for all nX(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 DFTofx1(n) andx2(n),
ax1(n) + bx2(n)DFT aX1(k) + bX2(k)
8/8/2019 DSP projects Call 9952749533
13/84
3. Circular ShiftingLetx(n) be a sequence of length N and X(k) is N
-point DFT, thus the sequence,x,
(n) obtained from
x(n) by shiftingx(n) cyclically by m units. Then,
x,(n) DFT X(k)e-j2Tkm/N
4. Parsevals Theorem
ifx(n)DFT
X(k) andy(n) DFT Y(k)
thus, y*(n) = 1/N Y*(k)
!
1
0
)(N
n
nx
!
1
0
)(N
k
k
8/8/2019 DSP projects Call 9952749533
14/84
DFT : RELATIONSHIP WITH z-TRANSFORM
The z-transform of the sequence,x(n) is given by:
X(z) = z-n
, ROC include unit circle
by defining zk= ej2Tk/N, k = 0,1, 2,, N-1
X(k) = X(z)|zk = e
j2Tk/N , k = 0,1,2,, N-1
= e-j2Tnk/N
where k= 2Tk/N, k = 0,1,2,,N-1
g
g!n nx )(
g
g!n
nx )(
8/8/2019 DSP projects Call 9952749533
15/84
DFT : EXAMPLES
EXAMPLE 1:EXAMPLE 1:
Find the DFT for the following finite length sequence,
x(n) = { , , }
Solution :Solution :
1. Determine the sequence length, NN = 3, k = 0,1,2
2. Use DFT formula to determine X(k)
X(k) = e-j2Tnk/N , k = 0,1, 2
X(0) = + + =
X(1) = + e-j2T/3 + e-j4T/3
= + [cos (2T/3) jsin(2T/3) + [cos (4T/3) jsin(4T/3)= + [-0.5 j0.866] + [ -0.5 + j0.866]
= + [-1] = 0
!
1
0
)(N
n
nx
8/8/2019 DSP projects Call 9952749533
16/84
Continued from Examples 1:Examples 1:
X(2) = + e-j4T/3 + e-j8T/3
= + [cos (4T/3) jsin(4T/3)] + [cos (8T/3) jsin(8T/3)]
= + [-0.5 +j0.866] + [-0.5
j0.866]
= 0
Thus,
X(k) = { , 0, 0}
8/8/2019 DSP projects Call 9952749533
17/84
Examples 2:Examples 2:
Given the following the finite length sequences,
x(n) = {1,1,2,2,3,3}
Perform DFT for this sequences.
Solution :Solution :1. Determine the sequence length, N = 6.
2. Use DFT formula to determine X(k).
X(k) = e-j2Tnk/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}
!
1
0
)(N
n
nx
8/8/2019 DSP projects Call 9952749533
18/84
Examples 3:Examples 3:
Find the DFT for the convolution of 2 sequences :
x1(n) = {2,1, 2,1} &x2(n) = {1, 2, 3, 4}
Solution :Solution :
1. Determine the sequence length for eachsequence, 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-j2X2(k) = {10,-2+j2,-2,-2-j2}
3. Perform Convolution by :
X3(k) = X1(k) X2(k)
= {60, 0, -4, 0}
8/8/2019 DSP projects Call 9952749533
19/84
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 :
x(n) = 1/N e-j2Tnk/N,
where n = 0,1,, N-1
!
1
0
)(N
k
kX
8/8/2019 DSP projects Call 9952749533
20/84
8/8/2019 DSP projects Call 9952749533
21/84
IDFT :EXAMPLES
EXAMPLES 5:EXAMPLES 5:
Obtain the finite length sequence,x(n) from the DFT sequence inExample 3.
Solution :
1. The sequence in Example 3 is :
X3(k) = {60, 0, -4, 0}
2. Use IDFT formula to obtainx(n):
x3(n) = 1/4 e-j2Tnk/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}
!
3
0
)(
k
kX
8/8/2019 DSP projects Call 9952749533
22/84
DFT & IDFT : COMPLEXITY OF DFT
A Large number of multiplications and additions are required to compute
DFT.
To compute the 8-point ofDFT of the sequence,x(n),
The X(k) will be the summation ofx(0)e-j2T(0)k/8 untilx(7)e-j2T(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 N2 multiplication and N(N-1)
addition.
8/8/2019 DSP projects Call 9952749533
23/84
Thus, need one algorithm to reduce the number of calculation and
speeds up the computation ofDFT. The algorithm is called Fast
Fourier Transform (FFT). It utilizes special properties of the DFT to
construct a computational procedure that requires Nlog2N 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 () - forIDFT
8/8/2019 DSP projects Call 9952749533
24/84
FFT : DEFINATION
FFT is the algorithm that efficiently computes theDFT.
In applying FFT, the DFT expression can bewritten as :
X(k) = WNnk , k = 0,1,,N-1
where,WN = e-j2T/N
!
1
0
)(N
n
nx
8/8/2019 DSP projects Call 9952749533
25/84
IFFT :DEFINATION
The FFT forIDFT can be defined as:
x(n) = 1/N WNnk
WWNN22
= (e= (e--j2j2TT/N/N
))22
= e= e--j2j2TT2/N2/N
= W= WN/2N/2
!
1
0
)(N
k
kX
8/8/2019 DSP projects Call 9952749533
26/84
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
8/8/2019 DSP projects Call 9952749533
27/84
Ex5.2 DFS of square wave seq.
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;
ss!
!
)/sin(
)/sin(
,2,,0,
)( /)1(
Nk
NkL
e
NNkL
kXNLj
T
TT
.
8/8/2019 DSP projects Call 9952749533
28/84
Relation to the z-transform
!
! ee
!1
0
)()(else here,0
10,Nonzero)(
N
n
nznxzXNn
nx
? A
!
! ee
!1
0
2
)()(else here,0
10),()(
N
n
nkj
NenxkXNnnx
nxT
kNjezzX
kX T
2|)()(
~
!!
The DFS X(k) represents N evenly spaced samples of the z-transform X(z) around the unit circle.
8/8/2019 DSP projects Call 9952749533
29/84
Relation to the DTFT
k
j
N
n
j nN
n
j nj
NeXkX
enxenxeX
T2|)()(
)()()(1
0
1
0
!
!
!
!
!!
)()()(
2,
2
1
11
jkj
k
eXeXkX
kkN
wandN
wLet
k
!!
!!!TT
The DFS is obtained by evenly sampling the DTFT at w1 intervals.
The interval w1 is thesampling intervalin the frequency domain. It is called
frequency resolutionbecause it tells us how close are the frequency samples.
8/8/2019 DSP projects Call 9952749533
30/84
Sampling and construction in the
z-domain
g
g!
g
g!
!
!!
ss!!
m
km
N
m
kmj
ez
Wmxemx
kzXkX
N
kN
j
)()(
,2,1,0,|)()(~
2
2
T
T .
g
g!
g
g!
g
g!
g
g!
g
g!
g
g!
!
!
g
g!
!
!!
!!
!!
rr
r
N
k
nkN
N
k
kn
N
m
km
N
N
k
kn
N
rNnxrNmnmx
rNmnmxWN
mx
WWmxN
WkXN
nx
)()()(
)()(1)(
)(1
)(1
)(
1
0
)(
1
0
1
0
H
H
DFS & z-transform
IDFS
8/8/2019 DSP projects Call 9952749533
31/84
Comments
When wesample X(z) on the unit circle, we
obtain aperiodic sequence in the time domain.
This sequence is a linear combination of theoriginal x(n) and its infinite replicas, each
shifted by multiples of N or N.
If x(n)=0 for n=N, then there will beno overlap or aliasingin the time domain.
8/8/2019 DSP projects Call 9952749533
32/84
Comments
ee
!!
ee!
else
NnnxnRnxnx
Nnfornxnx
N
0
101)()()()(
10)()(
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.
8/8/2019 DSP projects Call 9952749533
33/84
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).
!
!
!
!
!
!
!
!
!
!
!
!
!!!
1
01
1
0
1
0
11
0
1
0
1
0
1
0
1
0
1
0
1
1
)(
~1
)(~1
)(~1
)(
~1
)(~
)()(
N
kk
N
NkN
N
N
k
N
n
nk
N
N
k
N
n
nkn
N
N
n
nN
k
kn
N
N
n
nN
n
n
zW
zW
kX
N
zWkXN
zWkXN
zW
kX
NznxznxzX
WN-kN
=1
!
!
1
011
)(~
1)(
N
kk
N
N
zW
kX
N
zzX
8/8/2019 DSP projects Call 9952749533
34/84
The DTFT Interpolation Formula
!
!
!
!
1
0/2
1
0/2 1
1)(
1
)(1)(
N
kjwNkj
jwNN
kjwNkj
jwNjw
eeN
ekX
ee
kX
N
eeX
TT
2
1
2
2
sin
sin)(
!*Njw
w
wN
eN
w An interpolation polynomial
!
*!1
0
2
)()(
N
kN
kjww
kXeX
TThis is the DTFT interpolation
formula to reconstruct X(e
jw
) fromits samples X~(k)
Since , we have that X(ej2pik/N)=X~(k), whichmeans that the interpolation is exact at sampling points.
1)0( !*
8/8/2019 DSP projects Call 9952749533
35/84
The Discrete Fourier Transform
The discrete Fourier series provided us a mechanismfornumerically computingthe discrete-time Fouriertransform.
It also alert us to a potential problem ofaliasingin thetime domain.
Mathematics dictates that the sampling of the discrete-time Fourier transform result in aperiodic sequences
x~(n).
But most of the signals in practice are not periodic.They are likely to be offinite duration.
8/8/2019 DSP projects Call 9952749533
36/84
The Discrete Fourier Transform
Theoretically, we can take care of this problem bydefining aperiodic signal whoseprimary shape is thatof the finite duration signal and then using the DFS on
this periodic signal. Practically, we define a new transform called theDiscrete Fourier Transform (DFT), which is theprimary period of the DFS.
This DFT is the ultimate numerically computableFourier transform for arbitrary finite durationsequences.
8/8/2019 DSP projects Call 9952749533
37/84
The Discrete Fourier Transform
First we define a finite-duration sequence x(n) that has N
samples over 0
8/8/2019 DSP projects Call 9952749533
38/84
The Discrete Fourier Transform
The Discrete Fourier Transform of an N-point sequence isgiven by
10,)()(
)()(0
10)()]([)(
1
0
ee!
!
ee
!!
!
NkWnxkX
nRkXelse
NkkXnxDkX
N
n
nk
N
N
Note that the DFT X(k) is also an N-point sequence, that is, it is notdefined outside of 0
8/8/2019 DSP projects Call 9952749533
39/84
Matlab Implementation
XW
N
x
xWX
N
N
*1!
!
? A
-
!ee!
2)1()1(
)1(1
1
1
111
1,0
N
N
N
N
N
NNkn
NN
WW
WWNnkWW
.
/1//
.
.
8/8/2019 DSP projects Call 9952749533
40/84
8/8/2019 DSP projects Call 9952749533
41/84
8/8/2019 DSP projects Call 9952749533
42/84
Properties of the DFT
3. Conjugation:N
kXnxD ))(()]([** !
4. Symmetry properties for real sequences:
Letx(n) be a real-valued N-point sequence
NkXkX ))(()(* !
N
N
N
N
kXkX
kXkX
sequenceoddcircularkNXkX
sequenceevencircularkXkX
))(()(
|))((||)(|
:]))((Im[)](Im[
:]))((e[)](e[
!
!!
!
8/8/2019 DSP projects Call 9952749533
43/84
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:
]))(()([2
1)(
]))(()([21)(
Noc
Nec
nxnxnx
nxnxnx
!
!
The real-valued signals
]))((Im[)](Im[)]([
]))((Re[)](Re[)]([
Noc
Nec
kXkXnxDFT
kXkXnxDFT
!!
!!
Function, p143
8/8/2019 DSP projects Call 9952749533
44/84
Properties
5. Circular shift of a sequence
)()]())(([ kXWnRmnxD kmNNN
!
6. Circular shift in the frequency domain
)())(()]([ kRlkXnxWDNN
nl
N!
7. Circular convolution**
10,))(()()()(1
02121 ee!
!
NnmnxmxnxnxN
mN
)()()]()([ 2121 kXkXnxnxDFT !
8/8/2019 DSP projects Call 9952749533
45/84
Properties
8. Multiplication: )()(1
)]()([ 2121 kXkXN
nxnxD !
9. Parsevals relation:
!
!
!!1
0
21
0
2 |)(|1
|)(|N
k
N
nx kX
NnxE
Energy spectrumPower spectrum 2
2
)(
|)(|
N
kX
N
kX
8/8/2019 DSP projects Call 9952749533
46/84
Linear convolution using the DFT
In general, the circular convolution is an aliasedversion 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 identicalto the linear convolution.
)()()()()(
)()()(
)())(()()()()(
3
1
021
1
021
1
021214
1
nrNnxnrNknxkx
nrNknxkx
nknxkxnxnxnx
Nr
Nr
N
m
N
N
m r
N
N
mN
-
!
-
!
-
!
-
!!
g
g!
g
g!
!
!
g
g!
!
8/8/2019 DSP projects Call 9952749533
47/84
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).
10)(
)()]()([)(
),max()()(
)()()()(
3
33
210
3
3334
ee!
!
u
-
!
-
!!
{
g
g!
NnNnx
nNnxNnxne
NNNnrNnx
nxnrNnxxxne
N
Nr
Nr
X3(n) is also causaln=0,1,(N1+N2-1)-N
8/8/2019 DSP projects Call 9952749533
48/84
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
8/8/2019 DSP projects Call 9952749533
49/84
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
asfast Fourier transform (FFT) algorithms.
8/8/2019 DSP projects Call 9952749533
50/84
The FFT
Using the Matrix-vector multiplication toimplement DFT:
X=WNx (WN: N*N, x: 1*N, X: 1*N) takes NN multiplications and (N-1)N
additions of complex number.
Number ofcomplex mult. CN=O(N2)
A complex multiplication requires 4 realmultiplications and 2 real additions.
8/8/2019 DSP projects Call 9952749533
51/84
Goal of an Efficient computation
The total number of computations should be linearrather than quadratic with respect to N.
Most of the computations can be eliminated using the
symmetry and periodicityproperties
CN=Nlog2N
If N=2^10, CN=will reduce to 1/100 times.
kn
N
Nkn
N
nNk
N
Nnk
N
kn
N
WW
WWW
!
!!
2/
)()(
Decimation-in-time: DIT-FFT, decimation-in-frequency: DIF-FFT
8/8/2019 DSP projects Call 9952749533
52/84
8/8/2019 DSP projects Call 9952749533
53/84
A4-point DFTFFT example
neededationmultiplicnoWAorAWso
WW
WW
Wwhere
Wxx
xxW
j
Whh
gg
jW
jhh
gg
XX
XX
22
1*12
0*12
1*0
2
0*0
22
22
221
212
21
21
**
1111
*)3()2(
)1()0(**.
1
11
**.1
11*
)3()2(
)1()0(
-
!
-
!
-
-
!
-
-
!
-
!
-
8/8/2019 DSP projects Call 9952749533
54/84
Divide-and-combine approach
To reduce the DFT computations quadratic dependence on N,
one must choose a composite numberN=LM since L2+M2
8/8/2019 DSP projects Call 9952749533
55/84
Divide-and-combine approach
DFTpoM
M
m
mq
M
DFTpoL
L
l
lp
L
mp
N
M
m
Lmq
N
L
l
Mlp
N
mp
N
M
m
L
l
LqpmMl
N
WWmlxW
WWmlx
W
WmlxqpX
int
1
0
int
1
0
1
0
1
0
1
0
1
0
))((
),(
),(
),(),(
!
!
!
!
!
!
-
!
-
!
!
Three-step procedure: P155
Twiddle factor
8/8/2019 DSP projects Call 9952749533
56/84
Divide-and-combine approach
The total number of complex multiplications
for this approach can now be given by
CN=ML2+N+LM2
8/8/2019 DSP projects Call 9952749533
57/84
A 8-point DFTFFT example
1. two 4-point DFT for m=1,2
-
-
!
-
!
-
-
!
vvvv
vvvv
vvvv
vvvv
!
! !
)1,3()0,3(
)1,2()0,2(
)1,1()0,1(
)1,0()0,0(
*),(
),(),(
334
234
134
034
324
224
124
024
314
214
114
014
304
204
104
004
3
0
2
1
0
3
0
48
xx
xx
xx
xx
WWWW
WWWW
WWWW
WWWW
mp
WmlxWWqpX
l
mq
m l
plpm
/
8/8/2019 DSP projects Call 9952749533
58/84
? A
-
-
!
!
v
!
vv
vv
!
112
012
10
2
00
2
2
1
0
8
8
*
)1,3()0,3(
)1,2()0,2()1,1()0,1(
)1,0()0,0(
),(),(
2.3
8.24
),(),(.2
WW
WW
GG
GG
GG
GG
WmpFWqp
withDFTXntpoi
multnscplxofmultdotmatrixais
mpFWmpG
mq
m
pm
pm
8/8/2019 DSP projects Call 9952749533
59/84
Number of multiplications
A 4-point DFT is divided into two 2-point
DFTs, with one intermedium matrix mult.
number of multiplications=
44cplx 21+ 14 cplx 16 6
A 8-point DFT is divided into two 4-point
DFTs, with one intermedium matrix mult.
8826 + 24 64 20
For16-point DFT:
1616220 + 28 256 56
8/8/2019 DSP projects Call 9952749533
60/84
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 repeatedagain and again. At each stage
the sequences are decimatedand the smallerDFTs combined.This decimation ands afterv 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 complexmultiplications is: CN=Nv= N*log2N;
using additional symmetries: CN=Nv= N/2*log2N
Signal flowgraph in Figure 5.19
8/8/2019 DSP projects Call 9952749533
61/84
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
8/8/2019 DSP projects Call 9952749533
62/84
Matlab Implementation
Function: X = fft(x,N)
If length(x)
8/8/2019 DSP projects Call 9952749533
63/84
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
Compare the linear convolution and the high-speed conv.
)1(log 2122! NNN
8/8/2019 DSP projects Call 9952749533
64/84
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.
8/8/2019 DSP projects Call 9952749533
65/84
Discrete Fourier transform
DFT
110 ,...,, Nxxx
110
,...,,
NXXX
!
!1
0
2N
i
ikN
j
ik
exXT
Maps a set of input
points to anotherset of outputpoints.The operation isreversible.
8/8/2019 DSP projects Call 9952749533
66/84
Roots of the unity
real
imaginary
(1, 0)
(0, j)
(-1, 0)
(0, -j)
What are the Nth roots of unity?If N = 8 then we have
78
26
8
2
58
24
8
2
38
22
8
2
1
8
20
8
2
,
,
,
,
TT
TT
TT
TT
jj
jj
jj
jj
ee
ee
ee
ee
Define Nj
N eW
T2
!
8/8/2019 DSP projects Call 9952749533
67/84
Calculating the DFT
!
!
!!1
0
1
0
2 N
i
ik
i
N
i
ikN
j
ikN
WxexX
T
!
1
3
2
1
0
321
3963
2642
1321
1
3
2
1
0
.
...1
...
...1
...1
...1
1...1111
...
N
N
N
N
N
N
N
N
NNNN
N
NNNN
N
NNNN
N x
x
x
x
x
WWWW
WWWW
WWWW
WWWW
X
X
X
X
X
How many arithmetic (+ and *) operations do we need to
calculate the DFT?
8/8/2019 DSP projects Call 9952749533
68/84
E l h N 8
8/8/2019 DSP projects Call 9952749533
69/84
Example when N=8Objective: Compute X0, X1, X7 given x0, x1, , x7
magicbox
magicbox
x0
x2
x4
x6
x1
x3
x5
x7
eX0eX1eX2eX3
oX0oX1o
X2oX3
1
8W
0
8WX0
2
8W
38W
4
8W
5
8W
6
8W
7
8W
X1
X2
X3
X4
X5
X6
X7
k
N
Nk
N WW ! 2/Note
that
8/8/2019 DSP projects Call 9952749533
70/84
Now lets apply the idea recursively
x0
x4
x2
x6
x1
x5
x3
x7
eX0
eX1
eX
2e
X3
oX0
oX
1o
X2
oX3
1
8W
0
8WX0
2
8W
3
8W
4
8W
5
8W6
8W
7
8W
X1
X2
X3
X4
X5
X6
X7
eeX0
eeX1
eoX0
eoX1
oeX0
oeX1
ooX0
ooX1
0
4W
1
4W
2
4W
3
4W
0
4W
1
4W
2
4W
3
4W
8/8/2019 DSP projects Call 9952749533
71/84
One more timex0
x4
x2
x6
x1
x5
x3
x7
eX0e
X1e
X2
eX
3
oX0
oX1
oX
2o
X3
1
8W
0
8WX0
2
8W
3
8W
4
8W
5
8W
6
8W
7
8W
X1
X2
X3
X4
X5
X6
X7
ee
X0
eeX1
eoX0
eoX1
oeX0
oeX1
ooX
0
ooX1
0
4W
1
4W
2
4W
3
4W
0
4W
1
4W
2
4W
3
4W
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?
8/8/2019 DSP projects Call 9952749533
72/84
Another way to visualize FFT computations
How can we determine the order of the first inputs?
x0
x4
x2
x6
x1
x5
x3
x7
Butter
flyButte
rfly
Butterfly
Butter
fly
Butter
flyButter
fly
Butter
flyButter
fly
Butter
flyButter
fly
Butter
flyButte
r
fly
X0X4
X1X5
X2X6
X3X7
8/8/2019 DSP projects Call 9952749533
73/84
Savings so far We have split the DFT computation into two halves:
Have we gained anything? Consider the nominal number of multiplications
for
Original form produces multiplications
New form produces multiplications
So were already ahead .. Lets keep going!!
X[k] !
k!0
N1
x[n]WNnk
!n!0
(N/ 2 )1
x[2r]WN / 2rk
WNk
n!0
(N/ 2 )1
x[2r1]WN / 2rk
N! 8
2(42 ) 8 ! 40
82 ! 4
8/8/2019 DSP projects Call 9952749533
74/84
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
Multiplication by a constant
Delay
x[n]
y[n]x[n]+y[n]
x[n]a
ax[n]
x[n] x[n-1]z-1
Si l fl h t ti
8/8/2019 DSP projects Call 9952749533
75/84
Signal flowgraph representation
of 8-point DFT
Recall that the DFT is now of the form
The DFT in (partial) flowgraph notation:
X[k] ! G[k] WN
kH[k]
8/8/2019 DSP projects Call 9952749533
76/84
The complete decomposition into
8/8/2019 DSP projects Call 9952749533
77/84
The complete decomposition into
2-point DFTs
Now lets take a closer look at
8/8/2019 DSP projects Call 9952749533
78/84
Now lets take a closer look at
the 2-point DFT
The expression for the 2-point DFT is:
Evaluating for we obtain
which in signal flowgraph notation looks like ...
X[k] !
n!0
1
x[n] 2nk!
n!0
1
x[n]ej 2Tnk/ 2
k! 0,
X[0] ! x[0] x[1]
X[1] ! x[0] ej2T1 / 2x[1] ! x[0] x[1]
This topology is referred to as the
basic butterfly
The complete 8 point
8/8/2019 DSP projects Call 9952749533
79/84
The complete 8-point
decimation-in-time FFT
8/8/2019 DSP projects Call 9952749533
80/84
Comparing processing with and
8/8/2019 DSP projects Call 9952749533
81/84
Slow DFT requiresNmults; FFT requiresNlog2(N) mults
Filtering using FFTs requires 3(Nlog2(N))+2Nmults
Let
N E1
E
216 .25 .8124
32 .156 .50
64 .0935 .297
128 .055 .171256 .031 .097
1024 .0097 .0302
Comparing processing with and
without FFTs
Note: 1024-point FFTs
accomplish speedups of 100
for filtering, 30 for DFTs!
E1 ! Nlog2 (N) / N2; E2 ! [ (Nlog2 (N)) N] / N
2
8/8/2019 DSP projects Call 9952749533
82/84
Additional timesavers: reducing
multiplications in the basic butterfly
As we derived it, the basic butterfly is of the form
Since we can reducing computation by 2 by
premultiplying by
W/
! 1
WNr
WNr
WN
rN /
WNr
1
1
8/8/2019 DSP projects Call 9952749533
83/84
8/8/2019 DSP projects Call 9952749533
84/84
Recommended