dsp long report 2.doc
TRANSCRIPT
-
8/14/2019 DSP long report 2.doc
1/25
TITLE: TMS320C6713 Fast Fourier Transform (FFT)
OBECTI!ES
i) To implement FFT using TMS320C6713 DSK
ii) To visualize the fe!uen"# "ontent of signal $# implementing FFT on the tagete% DSK
though a %igital os"illos"ope&
"#$%$E O$ SOFT$E LIST:'
i) TMS320C6713 Digital Signal 'o"esso
ii) Signal (eneato
iii) Digital s"illos"ope
iv) 'C*+o,station- installe% +ith Co%e Compose Stu%io an% .eal Time DS' Taining
S#stem Soft+ae&
T"EO$ E*L#+#TIO+:'
I+T$O%,CTIO+/ Fast Fouie Tansfom FFT) is an effi"ient algoithm to "ompute the %is"ete Fouie
tansfoms DFT) an% invese& The esults of the FFT ae the same as +ith the DFT an% onl#
%iffeen"e is that the algoithm is optimize% to emove e%un%ant "al"ulations& n geneal the
FFT "an ma,e these optimizations +hen the num$e of samples to $e tansfome% is an ea"t
po+e of t+o fo +hi"h it "an eliminate man# unne"essa# opeations& Thee ae man# %istin"t
FFT algoithms involving a +i%e ange of mathemati"s fom simple "omple4num$e aithmeti"
to goup theo# an% num$e theo#& The most +ell ,no+n FFT algoithms %epen% upon the
fa"toization of 5 $ut "onta# to popula mis"on"eption) thee ae FFTs +ith 5 log 5)
"ompleit# fo all 5 even fo pime 5& Man# FFT algoithm onl# %epen% on the fa"t that e
Ni2 is an 5th pimitive oof of unit# an% thus "an $e applie% to analogous tansfoms ove
an# finite fiel% su"h as num$e4theoeti" tansfoms& Sin"e the invese DFT is the same as the
DFT $ut +ith the opposite sign the eponent an% a N1 fa"to an# FFT algoithm "an easil# $e
a%opt it&
1
-
8/14/2019 DSP long report 2.doc
2/25
et 0X
1NX $e "omple num$es& The DFT is %efine% $# the fomula
The Fast Fouie Tansfom FFT) is essentiall# the high spee% implementation of the
DFT& The t+o appoa"hes fo implementing the FFT ae %e"imation in time DT) an%
%e"imation in fe!uen"# DF)& The DT is-
= =
+=evenn odd n N
knjnx
N
knjnxkX )
2ep))
2ep))
The DF is-
=
=
+=12
0
12
0
)2
ep))2
ep))N
n
N
n N
knjnx
N
knjnxkX
The fe!uen"# esolution of the FFT an% DFT) "an $e "al"ulate% $# using the e!uation-
N
fsres
f =
8hee resf is the fe!uen"# esolution of FFT sf is the sampling fe!uen"# an% 5 is the FFT
sample size&
Com-arison of .om-utationa/ .osts
The ta$le $elo+ illustates the "omputational "osts asso"iate% +ith the DFT an% the FFT
algoithms in tems of the num$e of eal4value% multipli"ations an% a%%itions fo %iffeent
values of 5& 5ote that +hile fo small values of 5 the "omputational savings of the FFT ae
elativel# mo%est fo lage values of 5 the "omputational savings $e"ome enomous& t is
%iffi"ult to ovestate the impotan"e of the FFT algoithm in the %evelopment of mo%en DS'
appli"ations9 +ithout it man# of the te"hni!ues that have $een %evelope% in the DS' fiel% +oul%not $e "omputationall# ta"ta$le fo long %is"ete4time se!uen"es&
2
-
8/14/2019 DSP long report 2.doc
3/25
The follo+ing %iagams sho+ the elationship $et+een the seies in%e an% the fe!uen"#
%omain sample in%e& 5ote the fun"tions hee ae onl# %iagammati"9 in geneal the# ae $oth
"omple value% seies&
Fo eample if the seies epesents a time se!uen"e of length T then the follo+ing illustates the
values in the fe!uen"# %omain&
The fist sample :0) of the tansfome% seies is the DC "omponent moe "ommonl#
,no+n as the aveage of the input seies&
3
-
8/14/2019 DSP long report 2.doc
4/25
The DFT of a eal seies eample-4 imagina# pat of ,) ; 0 esults in a s#mmeti" seies
a$out the 5#!uist fe!uen"#& The negative fe!uen"# samples ae also the invese of the
positive fe!uen"# samples&
The highest positive o negative) fe!uen"# sample is "alle% the 5#!uist fe!uen"#& This is
the highest fe!uen"# "omponent that shoul% eist in the input seies fo the DFT to #iel%
-
8/14/2019 DSP long report 2.doc
5/25
>
-
8/14/2019 DSP long report 2.doc
6/25
S#M*LE T$#+SFO$M *#I$S #+% $EL#TIO+S"I*S
The Fouie tansfom is linea that is
a ft) ? $ gt) 444@ a Ff) ? $ (f)
a ,? $ #,444@ a :,? $ A,
S"aling elationship
ft * a) 444@ a Fa f)
fa t) 444@ Ff * a) * a
Shifting
ft ? a) 444@ Ff) e4B 2 pi a f
Mo%ulation
ft) eB 2 pi a t444@ Ft 4 a)
Dualit#
:,444@ 1*5) 54,
/ppl#ing the DFT t+i"e esults in a s"ale% time evese% vesion of the oiginal seies&
The tansfom of a "onstant fun"tion is a DC value onl#&
The tansfom of a %elta fun"tion is a "onstant
6
-
8/14/2019 DSP long report 2.doc
7/25
The tansfom of an infinite tain of %elta fun"tions spa"e% $# T is an infinite
tain of %elta fun"tions spa"e% $# 1*T&
The tansfom of a "os fun"tion is a positive %elta at the appopiate positive
an% negative fe!uen"#&
The tansfom of a sin fun"tion is a negative "omple %elta fun"tion at the
appopiate positive fe!uen"# an% a negative "omple %elta at the appopiate
negative fe!uen"#&
The tansfom of a s!uae pulse is a sin" fun"tion
7
-
8/14/2019 DSP long report 2.doc
8/25
Moe pe"isel# if ft) ; 1 fo t 0&> an% ft) ; 0 othe+ise then Ff) ; sinpi f) * pi f)
Convolution
ft) gt) 444@ Ff) (f)
Ff) (f) 444@ ft) gt)
,#,444@ 5 :,A,
,#,444@ 1*5) :,A,
Multipli"ation in one %omain is e!uivalent to "onvolution in the othe %omain
an% visa vesa& Fo eample the tansfom of a tun"ate% sin fun"tion ae t+o
%elta fun"tions "onvolve% +ith a sin" fun"tion a tun"ate% sin fun"tion is a sin
fun"tion multiplie% $# a s!uae pulse&
The tansfom of a tiangula pulse is a sin"2fun"tion& This "an $e %eive%
fom fist pin"iples $ut is moe easil# %eive% $# %es"i$ing the tiangula
pulse as the "onvolution of t+o s!uae pulses an% using the "onvolution4
multipli"ation elationship of the Fouie Tansfom&
S#M*LI+ T"EO$EMThe sampling theoem often "alle%
-
8/14/2019 DSP long report 2.doc
9/25
5omall# the signal to $e %igitize% +oul% $e appopiatel# filtee% $efoe sampling to emove
highe fe!uen"# "omponents& f the sampling fe!uen"# is not high enough the high fe!uen"#
"omponents +ill +ap aoun% an% appea in othe lo"ations in the %is"ete spe"tum thus
"oupting it& The ,e# featues an% "onse!uen"es of sampling a "ontinuous signal "an $e sho+n
gaphi"all# as follo+s-4
Consi%e a "ontinuous signal in the time an% fe!uen"# %omain&
Sample this signal +ith a sampling fe!uen"# fs time $et+een samples is 1*fs& This is e!uivalent
to "onvolving in the fe!uen"# %omain $# %elta fun"tion tain +ith a spa"ing of fs&
f the sampling fe!uen"# is too lo+ the fe!uen"# spe"tum ovelaps an% $e"ome "oupte%&
/nothe +a# to loo, at this is to "onsi%e a sine fun"tion sample% t+i"e pe peio% 5#!uist
ate)& Thee ae othe sinusoi% fun"tions of highe fe!uen"ies that +oul% give ea"tl# the same
samples an% thus "anGt $e %istinguishe% fom the fe!uen"# of the oiginal sinusoi%&
H
-
8/14/2019 DSP long report 2.doc
10/25
*$OCE%,$ES OF E*E$IME+T:'
"arare Conne.ti4it5:'
1) The steeo*I5C "onne"to +as "onne"te% fom the signal geneato to the ine4n of the
DSK&
2) The I5C*I5C "onne"to "a$le is "onne"te% in paallel fom signal geneato to "hannel
1 of the %igital os"illos"ope&
3) The steeo*I5C "onne"to "a$le is "onne"te% fom ine4ut of DSK to "hannel 2 of the
%igital os"illos"ope&
=) The signal geneato is set to 1000 Jz 2 p4p an% the input signal in "hannel 1 is
o$seve%&
>) The DSK is "onne"te% to the 'C an% the DSK is po+e on&
Softare *roram:'
Code Composer Studio:-
1) The DSK CCStu%io on the 'C %es,top is %ou$le4"li",e%&
2) To esta$lish "onne"tion to the DSK $oa% %e$ug is "li",e% an% then "onne"t is "li",e%&
3) The "o%e "ompose poBe"t is opene% $# "hoosing poBe"t4open an% fast Fourier
transform (FFT).pjt+as "li",e%&
Reviewing the Source Code:-
1) n the poBe"t vie+ +in%o+ the Fast Fourier Transform (FET).pjt(Debug)+as "li",e%
an% the sou"e fol%e +as sele"te%&
2) The fft.c file in the poBe"t vie+ +as %ou$le "li",e% to open the sou"e "o%e of the
pogam
Building and Running the program:-
10
-
8/14/2019 DSP long report 2.doc
11/25
1) 'oBe"t L .e$uil% /ll +as "hosen so that the pogam e"ompiles eassem$les an% elin,s
all the files in the poBe"t& The $uil% fame at the $ottom of the +in%o+ %ispla#s
messages a$out this po"ess&
2) The fft.outfile +as loa%e% $# sele"ting File4 oa% pogam& t opens a file $o+se&
fft.outfile +as sele"te% in the %e$ug %ie"to# to loa% the ee"uta$le file&
3) Then De$ug4un option +as sele"te% to un the pogam&
=) The output in eal time "omes out in "hannel 2 of the os"illos"ope +hi"h is sho+n in the
FFT po+e spe"tum&
>) The fe!uen"# of the signal geneato +as a%Buste% an% the FFT output +as o$seve% in
the %igital os"illos"ope&
6) 8hen all the esults +ee o$taine% as in the ta$le the pogam +as halt in the tool$a
$utton&
$ES,LT
FFT sample size 5 ; 102= samples
Fe!uen"# esolution f ; sizesampleFFT
fe!uen"#sampling
;102=
000
; 7&12> Jz&
Sampling fe!uen"# fs ; 000Jz
Sampling nteval Ts ; fs
1
;000
1
;0&12>ms
11
-
8/14/2019 DSP long report 2.doc
12/25
For in-ut sina/ freuen.5 of 1 8"9
In-ut Sina/ Out-ut Sina/
#m-/itue: 1&0=
Freuen.5: 1&00=, ,Jz
Time uration eteen 2 -ea8
; > %ivision 20ms ; 0&1s
Sam-/e si9e eteen 2 -ea8; n
; nTs * Ts ; 100ms*0&12>ms ; 00samples&
Sam-/e si9e for
-
8/14/2019 DSP long report 2.doc
13/25
; 7> Jz&
For in-ut sina/ freuen.5 of 2 8"9
In-ut Sina/ Out-ut Sina/
13
-
8/14/2019 DSP long report 2.doc
14/25
#m-/itue: 1&0=Freuen.5: 2&00 ,Jz
Time uration eteen 2 -ea8; 3&1 %ivision 20ms ; 62ms
Sam-/e si9e eteen 2 -ea8; n
; nTs * Ts ; 62ms*0&12>ms ; =H6 samples&
Sam-/e si9e for
-
8/14/2019 DSP long report 2.doc
15/25
#m-/itue: 1&0= Freuen.5: =&016 ,Jz
Time uration eteen 2 -ea8; 0 %ivision 20ms ; 0ms
Sam-/e si9e eteen 2 -ea8; n
; nTs * Ts ; 0ms*0&12>ms ; 0 samples&
Sam-/e si9e for
-
8/14/2019 DSP long report 2.doc
16/25
#nser:
The fun%amental fe!uen"# fo +hi"h the aliasing phenomenon stats to o""u is = ,Jz& This
is $e"ause the sampling fe!uen"# of the Digital Signal 'o"essing $oa% is set to ,Jz&
/""o%ing to 5#!uist theoem the sampling fe!uen"# must moe o e!ual to t+o times of
the maimum fe!uen"# of the signal to avoi% aliasing phenomenon&
ma32 ff
s +hee ma3f ;=,Jz
EE$CISES
16
-
8/14/2019 DSP long report 2.doc
17/25
1?/ "ontinuous time signal is %efine% as )20002"os2
1)10002"os) tttx +=
i)f the signal is sample% at 000Jz +hat is the suita$le size fo DFT that "an epesent $othsignal "omponents
/ns+ef1; 1000Jzf2; 2000Jz
10002000=resf
; 1000Jz
res
s
f
fN=
1000
000
=
=
ii) For +A16
For +A32
17
-
8/14/2019 DSP long report 2.doc
18/25
1
-
8/14/2019 DSP long report 2.doc
19/25
2) / %is"ete4time signal is %efine% as )=
"os) n
nx =
i) Cal"ulate the DFT fo 5; an% 5;16&
For +A;
)=
"os) n
nx
=
:,);
=
1
0
2
)N
n
N
knj
enx
)17
0
F
2)17
0
F
2
F
2
==
7
0
2
1
2
1
)2
1
2
1
knjknj
knjnjnj
ee
eee
+
+=
+=
,;141 +ill $e the ma point of ,
==
2
F
2
F
=
=
For +A16
)=
"os) n
nx =
:,);
=
1
0
2
)N
n
N
knj
enx
)2
11>
0
2)2
11>
0
2
16
2
==
1>
0
2
1
2
1
)2
1
2
1
knj
knj
knjnjnj
ee
eee
+
+=
+=
,;242 +ill $e the ma point of ,
FF
2
16
2
16
=
=
ii) 'lot the DFT $# using Matla$&
For +A
1H
-
8/14/2019 DSP long report 2.doc
20/25
F
20
-
8/14/2019 DSP long report 2.doc
21/25
For +A16
21
-
8/14/2019 DSP long report 2.doc
22/25
3) / "ontinuous time signal is %efine% as )12>02sin2
1)10002"os) tttx +=
i& f the signal is sample% at 000Jz +hat is the suita$le sample size fo DFT that "an
epesent $oth signal "omponents
/ns+e-
f1;1000Jz
f2;12>0Jz
100012>0=resf
; 2>0Jz
res
s
f
fN=
32
2>0
000
=
=
ii& 'lot the DFT of the signal $# using Matla$&
22
-
8/14/2019 DSP long report 2.doc
23/25
%ISC,SSIO+
1& /liasing is an effe"t that "auses %iffeent signals to $e"ome in%istinguisha$le +hen sample%&
t also efes to the %istotion that esulte% +hen the signal e"onstu"te% fom samples is
%iffeent than the oiginal "ontinuous signal&
2& /t the input fe!uen"# of = ,Jz the sampling fe!uen"# is e!ual to the 5#!uist sampling
fe!uen"#& The output signal is foun% that %iffe fom the epe"te% output signal as othe
input fe!uen"#& The output signal %oes not sho+ the up+a% pat +avefom& The pea, to
pea, spe"tum of the output +avefom is a"tuall# ovelappe% +ith ea"h so the %istan"e
$et+een the pea, to pea, spe"tums is e!ual to zeo& This is the phenomenon +hen the
sampling fe!uen"# e!ual to t+o times of the maimum fe!uen"# of the signal an% the
aliasing effe"t is state% to o""u&
3& The Digital signal po"esso $oa% TMS320C6713 has the pefie% sampling fe!uen"# an%
FFT sample size +hi"h ae 000 ,Jz an% 102= samples espe"tivel#& The "o%ing $eing
uploa%e% to the %igital signal po"esso $oa% instu"ts the FFT po"ess $eing pefome%& FFT
is a po"ess of fouie tansfom that give the same esult as Dis"ete Fouie Tansfom $ut
FFT have a faste "omputational po"essing&
=& 8hen the input fe!uen"# is 1000 ,Jz the output +avefom has t+o pea,s sho+n at the
os"illos"ope an% the pea, is sepaate% $# a gap& Jo+eve as the fe!uen"# of the input signal
is in"ease% to = ,Jz the gap $et+een the pea,s +as foun% to $e e%u"e%& This is $e"ause as
fe!uen"# is in"ease% the peio% +ill $e"ome smalle& The fe!uen"# esolution "al"ulate% in
the esult pat in%i"ate that the %iffeen"e $et+een t+o su""essive sample in the signal&
>& Fo Ne"ise pat !uestion 1 the simulate% output is epe"te% $e"ause the signal is
summation of "osine signal an% sinusoi%al signal an% ea"h of them +ill po%u"e t+o
spe"tums so the total spe"tum epe"te% is fou spe"tums& Jo+eve this epe"te% output is
%ue to the sample size is suita$le& Fom the e!uation the %iffeen"e $et+een the fe!uen"ies
of the t+o signals is a"tuall# the fe!uen"# esolution& Fom thee the sample size "an $e
"al"ulate% so all the spe"tums "an $e sho+n at the output&
23
http://en.wikipedia.org/wiki/Sampling_(signal_processing)http://en.wikipedia.org/wiki/Distortionhttp://en.wikipedia.org/wiki/Distortionhttp://en.wikipedia.org/wiki/Sampling_(signal_processing)http://en.wikipedia.org/wiki/Distortion -
8/14/2019 DSP long report 2.doc
24/25
6& Fo Ne"ise !uestion 1 as the sample size is in"ease% all of the spe"tums still "an $e
sho+n at the output& This is $e"ause as sample size in"eases the fe!uen"# esolution +ill $e
%e"ease an% the s"ale of the gaph as if $e"ome moe sensitive to %ete"t eve# pea, +hi"h
ma# o""u& T+o pea,s ae foun% o""u at fe!uen"# 6000 Jz an% 7000 Jz& This also un%e
epe"tation $e"ause the sample size is onl# %efine% fom zeo to infinite& Thee +ill $e
sample $eing "al"ulate% to $e negative value an% this is invali% so this pea, +ill $e efle"te%
to ight han% si%e of the gaph&
7& Fo eample Fo 5; if the pea, is "al"ulate% to o""u at ,;42 instea% of sho+ing the pea,
at ,;42 the pea, +ill $e %ispla#e% at ,;42 +hi"h is ,;6&
& f in "ase the sample size "hosen is too small some of the pea, +ill not sho+n in the
spe"tum $e"ause the fe!uen"# esolution $e"ome lage&
H& The simulate% output of !uestion 1 an% 2 is the spe"tum is epesente% +ith its 4ais ae
fe!uen"# an% sample espe"tivel#&
2=
-
8/14/2019 DSP long report 2.doc
25/25
CO+CL,SIO+
/fte "omplete% this la$ session +e leane% to implement the FFT using the DS'
po"esso TMS320C6713& ts output is un%e epe"tation as the %es"iption $eing $ief $#
le"tue& Fom this la$ the fe!uen"# "ontent of the signal "an $e visualize% $# implementing
FFT on the tagete% DSK though a %igital os"illos"ope&
Iesi%es the DFT po"ess also $eing implemente% using M/T/I soft+ae& The esult
o$taine% also un%e epe"tation& /s a "on"lusion the o$Be"tive of this la$ session +as met&
$EFE$E+CES
a) http-**en&+i,ipe%ia&og*+i,i*FastOFouieOtansfom
) http-**$eige&u"s&in%iana&e%u*I673*no%e12&html
.) http-**"as&ensmp&f*P"haplais*8avetouOpesentation*tansfomees*Fouie*FFTQS&html
) http-**gus&$e,ele#&e%u*PBg*ngst*fft*fft&html
e) e"tue
2>
http://en.wikipedia.org/wiki/Fast_Fourier_transformhttp://beige.ucs.indiana.edu/B673/node12.htmlhttp://cas.ensmp.fr/~chaplais/Wavetour_presentation/transformees/Fourier/FFTUS.htmlhttp://grus.berkeley.edu/~jrg/ngst/fft/fft.htmlhttp://en.wikipedia.org/wiki/Fast_Fourier_transformhttp://beige.ucs.indiana.edu/B673/node12.htmlhttp://cas.ensmp.fr/~chaplais/Wavetour_presentation/transformees/Fourier/FFTUS.htmlhttp://grus.berkeley.edu/~jrg/ngst/fft/fft.html