You are on page 1of 37

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

DIGITAL SIGNAL PROCESSING LAB MANUAL IV YEAR I SEMESTER (ECE)

JNTU COLLEGE OF ENGINEERING (AUTONOMOUS)::ANANTAPUR JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY ANANTAPUR ANANTAPUR-515 002. (A.P) INDIA

DIGITAL SIGNAL PROCESSING LAB (IV-I SEM) INDEX 1. Architecture of DSP chips-TMS 320C 6713 DSP Processor 2. Linear convo ution 3. Circu ar convo ution !. "#$ "i ter %LP&'P( )sin* +in,o-in* techni.ue a. $ectan*u ar -in,o/. Trian*u ar -in,oc. 0aiser -in,o1. ##$ "i ter %LP&'P( on DSP processors 6. 2-point ""T a *orith3 7. Po-er Spectra Densit4 of a sinusoi,a si*na 5. ""T of 1-D si*na p ot 6. MATLA7 pro*ra3 to *enerate su3 of sinusoi,a si*na s 10. MATLA7 pro*ra3 to fin, fre.uenc4 response of ana o* %LP&'P(

1. ARCHITECTURE OF DSP PROCESSOR- TMS 320C 6713 1.1. INTRODUCTION A si*na can /e ,efine, as a function that conve4s infor3ation8 *enera 4 a/out the state or /ehavior of a ph4sica s4ste3. There are t-o /asic t4pes of si*na s vi9 Ana o* %continuous ti3e si*na s -hich are ,efine, a on* a continuu3 of ti3es( an, Di*ita %,iscrete-ti3e(.

$e3ar:a/ 48 un,er reasona/ e constraints8 a continuous ti3e si*na can /e a,e.uate 4 represente, /4 sa3p es8 o/tainin* ,iscrete ti3e si*na s. Thus ,i*ita si*na processin* is an i,ea choice for an4one -ho nee,s the perfor3ance a,vanta*e of ,i*ita 3anipu ation a on* -ith to,a4;s ana o* rea it4. 'ence a processor -hich is ,esi*ne, to perfor3 the specia operations %,i*ita 3anipu ations( on the ,i*ita si*na -ithin ver4 ess ti3e can /e ca e, as a Di*ita si*na processor. The ,ifference /et-een a DSP processor8 conventiona 3icroprocessor an, a 3icrocontro er are iste, /e o-. Microproce or or <enera Purpose Processor such as #nte ==56 or Motoro a 650== fa3i 4 Contains - on 4 CP) -2o $AM -2o $>M -2o #&> ports -2o Ti3er Microco!"ro##er such as 5011 fa3i 4 Contains - CP) - $AM - $>M -#&> ports - Ti3er - #nterrupt circuitr4 So3e Micro Contro ers a so contain A&D8 D&A an, " ash Me3or4 DSP Proce or such as Te=as instru3ents an, Ana o* Devices Contains - CP) - $AM -$>M - #&> ports - Ti3er >pti3i9e, for ? fast arith3etic - @=ten,e, precision - Dua operan, fetch - Aero overhea, oop - Circu ar /ufferin*

The /asic features of a DSP Processor are Feature Use "ast-Mu tip 4 accu3u ate Most DSP a *orith3s8 inc u,in* fi terin*8 transfor3s8 etc. are 3u tip ication- intensive Mu tip e ? access 3e3or4 Man4 ,ata-intensive DSP operations re.uire rea,in* a pro*ra3 architecture instruction an, 3u tip e ,ata ite3s ,urin* each instruction c4c e

Specia i9e, a,,ressin* 3o,es Specia i9e, pro*ra3 contro >n-chip periphera s an, #&> interfaces

for /est perfor3ance @fficient han, in* of ,ata arra4s an, first-in8 first-out /uffers in 3e3or4 @fficient contro of oops for 3an4 iterative DSP a *orith3s. "ast interrupt han, in* for fre.uent #&> operations. >n-chip periphera s i:e A&D converters a o- for s3a ocost s4ste3 ,esi*ns. Si3i ar 4 #&> interfaces tai ore, for co33on periphera s a o- c ean interfaces to off-chip #&> ,evices.

1.2 ARCHITECTURE OF 6713 DSP PROCESSOR This chapter provi,es an overvie- of the architectura structure of the TMS320C67== DSP8 -hich co3prises the centra processin* unit %CP)(8 3e3or48 an, on-chip periphera s. The C67=@ DSPs use an a,vance, 3o,ifie, 'arvar, architecture that 3a=i3i9es processin* po-er -ith ei*ht /uses. Separate pro*ra3 an, ,ata spaces a o- si3u taneous access to pro*ra3 instructions an, ,ata8 provi,in* a hi*h ,e*ree of para e is3. "or e=a3p e8 three rea,s an, one -rite can /e perfor3e, in a sin* e c4c e. #nstructions -ith para e store an, app ication-specific instructions fu 4 uti i9e this architecture. #n a,,ition8 ,ata can /e transferre, /et-een ,ata an, pro*ra3 spaces. Such Para e is3 supports a po-erfu set of arith3etic8 o*ic8 an, /it3anipu ation operations that can a /e perfor3e, in a sin* e 3achine c4c e. A so8 the C67== DSP inc u,es the contro 3echanis3s to 3ana*e interrupts8 repeate, operations8 an, function ca in*. $% S"r%c"%re The C67== DSP architecture is /ui t aroun, ei*ht 3aBor 16-/it /uses %four pro*ra3&,ata /uses an, four a,,ress /uses(C - The pro*ra3 /us %P7( carries the instruction co,e an, i33e,iate operan,s fro3 pro*ra3 3e3or4. - Three ,ata /uses %C78 D78 an, @7( interconnect to various e e3ents8 such as the CP)8 ,ata a,,ress *eneration o*ic8 pro*ra3 a,,ress *eneration o*ic8 on-chip periphera s8 an, ,ata 3e3or4. - The C7 an, D7 carr4 the operan,s that are rea, fro3 ,ata 3e3or4. - The @7 carries the ,ata to /e -ritten to 3e3or4. - "our a,,ress /uses %PA78 CA78 DA78 an, @A7( carr4 the a,,resses nee,e, for instruction e=ecution. The C67== DSP can *enerate up to t-o ,ata-3e3or4 a,,resses per c4c e usin* the t-o au=i iar4 re*ister arith3etic units %A$A)0 an, A$A)1(. The P7 can carr4 ,ata operan,s store, in pro*ra3 space %for instance8 a coefficient ta/ e( to the 3u tip ier an, a,,er for 3u tip 4&accu3u ate operations or to a ,estination in ,ata space for ,ata 3ove instructions %MDPD an, $@ADA(. This capa/i it48 in conBunction -ith the feature of ,ua -operan, rea,8 supports the e=ecution of sin* e-c4c e8 3-operan, instructions such as the "#$S instruction. The C67== DSP a so has an on-chip /i,irectiona /us for accessin* on-chip periphera s. This /us is connecte, to D7 an, @7 throu*h the /us e=chan*er in the CP) interface. Accesses that use this /us can re.uire t-o or 3ore c4c es for rea,s an, -rites8 ,epen,in* on the periphera ;s structure.

"i* 1 .1 7L>C0 D#A<$AM >" TMS 320DC 6713 Ce!"r&# Proce i!' U!i" (CPU) The CP) is co33on to a C67=@ ,evices. The C67= CP) containsC -!0-/it arith3etic o*ic unit %AL)( - T-o !0-/it accu3u ators - 7arre shifter - 17 E 17-/it 3u tip ier - !0-/it a,,er - Co3pare8 se ect8 an, store unit %CSS)( - Data a,,ress *eneration unit - Pro*ra3 a,,ress *eneration unit Ari"*+e"ic ,o'ic U!i" (A,U) The C67= DSP perfor3s 2s-co3p e3ent arith3etic -ith a !0-/it arith3etic o*ic unit %AL)( an, t-o !0-/it accu3u ators %accu3u ators A an, 7(. The AL) can a so perfor3 7oo ean operations. The AL) uses these inputsC - 16-/it i33e,iate va ue -16-/it -or, fro3 ,ata 3e3or4

- 16-/it va ue in the te3porar4 re*ister8 T -T-o 16-/it -or,s fro3 ,ata 3e3or4 -32-/it -or, fro3 ,ata 3e3or4 - !0-/it -or, fro3 either accu3u ator. The AL) can a so function as t-o 16-/it AL)s an, perfor3 t-o 16-/it operations si3u taneous 4.

"i* 1 .2 AL) )2#T Acc%+%#&"or Accu3u ators A an, 7 store the output fro3 the AL) or the 3u tip ier&a,,er / oc:. The4 can a so provi,e a secon, input to the AL)F accu3u ator A can /e an input to the 3u tip ier&a,,er. @ach accu3u ator is ,ivi,e, into three partsC -<uar, /its %/its 3632( -'i*h-or,er -or, %/its 3116( -Lo--or,er -or, %/its 110( #nstructions are provi,e, for storin* the *uar, /its8 for storin* the hi*h- an, the o- or,er accu3u ator -or,s in ,ata 3e3or48 an, for transferrin* 32-/it accu3u ator -or,s in or out of ,ata 3e3or4. A so8 either of the accu3u ators can /e use, as te3porar4 stora*e for the other. $&rre# S*i-"er The C67= DSP /arre shifter has a !0-/it input connecte, to the accu3u ators or to ,ata 3e3or4 %usin* C7 or D7(8 an, a !0-/it output connecte, to the AL) or to ,ata 3e3or4 %usin* @7(. The /arre shifter can pro,uce a eft shift of 0 to 31 /its an, a ri*ht shift of 0 to 16 /its on the input ,ata. The shift re.uire3ents are ,efine, in the shift count fie , of the instruction8 the shift count fie , %ASM( of status re*ister ST18 or in te3porar4 re*ister T %-hen it is ,esi*nate, as a shift count re*ister(.The /arre shifter an, the e=ponent enco,er nor3a i9e the va ues in an accu3u ator in a sin* e c4c e. The LS7s of the output are fi e, -ith 0s8 an, the MS7s can /e either 9ero fi e, or si*n e=ten,e,8 ,epen,in* on the state of the si*n-e=tension 3o,e /it %SGM( in ST1. A,,itiona shift capa/i ities ena/ e the processor to perfor3 nu3erica sca in*8 /it e=traction8 e=ten,e, arith3etic8 an, overf o- prevention operations. M%#"ip#ier.A//er U!i"

The 3u tip ier&a,,er unit perfor3s 178 17-/it 2s-co3p e3ent 3u tip ication -ith a !0- /it a,,ition in a sin* e instruction c4c e. The 3u tip ier&a,,er / oc: consists of severa e e3entsC a 3u tip ier8 an a,,er8 si*ne,&unsi*ne, input contro o*ic8 fractiona contro o*ic8 a 9ero ,etector8 a roun,er %2s co3p e3ent(8 overf o-&saturation o*ic8 an, a 16-/it te3porar4 stora*e re*ister %T(. The 3u tip ier has t-o inputsC one input is se ecte, fro3 T8 a ,ata-3e3or4 operan,8 or accu3u ator AF the other is se ecte, fro3 pro*ra3 3e3or48 ,ata 3e3or48 accu3u ator A8 or an i33e,iate va ue. The fast8 on-chip 3u tip ier a o-s the C1!= DSP to perfor3 operations efficient 4 such as convo ution8 corre ation8 an, fi terin*. #n a,,ition8 the 3u tip ier an, AL) to*ether e=ecute 3u tip 4&accu3u ate %MAC( co3putations an, AL) operations in para e in a sin* e instruction c4c e. This function is use, in ,eter3inin* the @uc i,ian ,istance an, in i3p e3entin* s433etrica an, LMS fi ters8 -hich are re.uire, for co3p e= DSP a *orith3s.

"i* 1.3 M)LT#PL#@$&ADD@$ )2#T These are the so3e of the i3portant parts of the processor an, 4ou are instructe, to *o throu*h the ,etai e, architecture once -hich he ps 4ou in ,eve opin* the opti3i9e, co,e for the re.uire, app ication.

2. ,INEAR CON0O,UTION AIM1 To verif4 Linear Convo ution E2UIPMENTS1 >peratin* S4ste3 +in,o-s GP

Constructor - Si3u ator Soft-are - CCStu,io H MATLA7 5 THEOR31 Convo ution is a for3a 3athe3atica operation8 Bust as 3u tip ication8 a,,ition8 an, inte*ration. A,,ition ta:es t-o numbers an, pro,uces a thir, number8 -hi e convo ution ta:es t-o signals an, pro,uces a thir, signa . Convo ution is use, in the 3athe3atics of 3an4 fie ,s8 such as pro/a/i it4 an, statistics. #n inear s4ste3s8 convo ution is use, to ,escri/e the re ationship /et-een three si*na s of interestC the input si*na 8 the i3pu se response8 an, the output si*na . y %n( = x1 %k ( x 2 %n k ( 0InI2-1
k =0 N 1

%1(

#n this e.uation8 =1%:(8 =2%n-:( an, 4%n( represent the input to an, output fro3 the s4ste3 at ti3e n. 'ere -e cou , see that one of the inputs is shifte, in ti3e /4 a va ue ever4 ti3e it is 3u tip ie, -ith the other input si*na . Linear Convo ution is .uite often use, as a 3etho, of i3p e3entin* fi ters of various t4pes. PROGRAM
&& Linear convo ution pro*ra3 in c an*ua*e usin* CCStu,io

Jinc u,eIst,io.hK int =L11M8hL11M84L11MF 3ain%( N int i8B838nF printf%OPn @nter va ue for 3O(F scanf%OQ,O8H3(F printf%OPn @nter va ue for nO(F scanf%OQ,O8Hn(F printf%O@nter va ues for i&p =%n(CPnO(F for%iR0FiI3FiSS( scanf%OQ,O8H=LiM(F printf%O@nter Da ues for i&p h%n( PnO(F for%iR0FiInF iSS( scanf%OQ,O8HhLiM(F && pa,,in* of 9eors for%iR3FiIR3Sn-1FiSS( =LiMR0F for%iRnFiIR3Sn-1FiSS( hLiMR0F &T convo ution operation T& for%iR0FiI3Sn-1FiSS( N

4LiMR0F for%BR0FBIRiFBSS( N 4LiMR4LiMS%=LBMThLi-BM(F U U &&,isp a4in* the o&p for%iR0FiI3Sn-1FiSS( printf%OPn The Da ue of output 4LQ,MRQ,O8i84LiM(F U
Resu!t

@nter va ue for 3! @nter va ue for n! @nter va ues for i&p 123! @nter Da ues for n 123! The Da ue of output 4L0MR1 The Da ue of output 4L1MR! The Da ue of output 4L2MR10 The Da ue of output 4L3MR20 The Da ue of output 4L!MR21 The Da ue of output 4L1MR2! The Da ue of output 4L6MR16

Q MATLA7 pro*ra3 for inear convo ution Q inear convo ution pro*ra3 c cF c ear a F c ose a F

,isp%V inear convo ution pro*ra3V(F =Rinput%Venter i&p =%n(CV(F 3R en*th%=(F hRinput%Venter i&p h%n(CV(F nR en*th%h(F =RL=89eros%18n(MF su/p ot%28281(8 ste3%=(F tit e%Vi&p se.uence =%n(isCV(F = a/e %V----KnV(F 4 a/e %V----K=%n(V(F*ri,F hRLh89eros%183(MF su/p ot%28282(8 ste3%h(F tit e%Vi&p se.uence h%n(isCV(F = a/e %V----KnV(F 4 a/e %V----Kh%n(V(F*ri,F ,isp%Vconvo ution of =%n( H h%n( is 4%n(CV(F 4R9eros%183Sn-1(F for iR1C3Sn-1 4%i(R0F for BR1C3Sn-1 if%BIiS1( 4%i(R4%i(S=%B(Th%i-BS1(F en, en, en, 4 su/p ot%2828L38!M(8ste3%4(F tit e%Vconvo ution of =%n( H h%n( is CV(F = a/e %V----KnV(F 4 a/e %V----K4%n(V(F*ri,F $@S)LTC

3. CIRCU,AR CON0O,UTION
AIM To verif4 Circu ar Convo ution. E2UIPMENTS1 >peratin* S4ste3 ? +in,o-s GP Constructor - Si3u ator Soft-are - CCStu,io H MATLA7 5 THEOR3

Circu ar convo ution is another -a4 of fin,in* the convo ution su3 of t-o input si*na s. #t rese3/ es the inear convo ution8 e=cept that the sa3p e va ues of one of the input si*na s is fo ,e, an, ri*ht shifte, /efore the convo ution su3 is foun,. A so note that circu ar convo ution cou , a so /e foun, /4 ta:in* the D"T of the t-o input si*na s an, fin,in* the pro,uct of the t-o fre.uenc4 ,o3ain si*na s. The #nverse D"T of the pro,uct -ou , *ive the output of the si*na in the ti3e ,o3ain -hich is the circu ar convo ution output. The t-o input si*na s cou , have /een of var4in* sa3p e en*ths. 7ut -e ta:e the D"T of hi*her point8 -hich ever si*na s eve s to. "or e*. #f one of the si*na s is of en*th 216 an, the other spans 11 sa3p es8 then -e cou , on 4 ta:e 216 point D"T. So the output of #D"T -ou , /e containin* 216 sa3p es instea, of 306 sa3p es8 -hich fo o-s 21S22 1 -here 21 H 22 are the en*ths 216 an, 11 respective 4 of the t-o inputs. Thus the output -hich shou , have /een 306 sa3p es on* is fitte, into 216 sa3p es. The 216 points en, up /ein* a ,istorte, version of the correct si*na . This process is ca e, circu ar convo ution. PRO4RAM1 &T pro*ra3 to i3p e3ent circu ar convo ution in c an*ua*e usin* CCStu,io T& Jinc u,eIst,io.hK int 38n8=L30M8hL30M84L30M8i8B8 :8=2L30M8aL30MF voi, 3ain%( N printf%O @nter the en*th of the first se.uencePnO(F scanf%OQ,O8H3(F printf%O @nter the en*th of the secon, se.uencePnO(F scanf%OQ,O8Hn(F printf%O @nter the first se.uencePnO(F for%iR0FiI3FiSS( scanf%OQ,O8H=LiM(F printf%O @nter the secon, se.uencePnO(F for%BR0FBInFBSS( scanf%OQ,O8HhLBM(F if%3-nWR0( &T#f en*th of /oth se.uences are not e.ua T& N if%3Kn( &T Pa, the s3a er se.uence -ith 9eroT& N for%iRnFiI3FiSS( hLiMR0F nR3F U for%iR3FiInFiSS( =LiMR0F 3RnF U 4L0MR0F aL0MRhL0MF

for%BR1FBInFBSS( &Tfo ,in* h%n( to h%-n(T& aLBMRhLn-BMF &TCircu ar convo utionT& for%iR0FiInFiSS( 4L0MSR=LiMTaLiMF for%:R1F:InF:SS( N 4L:MR0F &Tcircu ar shiftT& for%BR1FBInFBSS( =2LBMRaLB-1MF =2L0MRaLn-1MF for%iR0FiInFiSS( N aLiMR=2LiMF 4L:MSR=LiMT=2LiMF U U &T,isp a4in* the resu tT& printf%O The circu ar convo ution isPnO(F for%iR0FiInFiSS( printf%OQ, PtO84LiM(F U >)TP)TC@nter the en*th of the first se.uence ! @nter the en*th of the secon, se.uence 3 @nter the first se.uence 123! @nter the secon, se.uence 123 The circu ar convo ution is 15 16 10 16 Mo,e <raphC-

Q MATLA7 pro*ra3 for circu ar convo ution pro*ra3 c cF c ear a F c ose a F ,isp%Vcircu ar convo ution pro*ra3V(F =Rinput%Venter i&p =%n(CV(F 3R en*th%=(F hRinput%Venter i&p se.uence h%n(V(F nR en*th%h(F su/p ot%28281(8 ste3%=(F tit e%Vi&p se.uencce =%n(isCV(F = a/e %V----KnV(F 4 a/e %V----K=%n(V(F*ri,F su/p ot%28282(8 ste3%h(F tit e%Vi&p se.uencce h%n(isCV(F = a/e %V----KnV(F 4 a/e %V----Kh%n(V(F*ri,F ,isp%Vcircu ar convo ution of =%n( H h%n( is 4%n(CV(F if%3-nXR0( if%3Kn( hRLh89eros%183-n(MF nR3F en, =RL=89eros%18n-3(MF 3RnF

en, 4R9eros%18n(F 4%1(R0F a%1(Rh%1(F for BR2Cn a%B(Rh%n-BS2(F en, Qciruc ar conv for iR1Cn 4%1(R4%1(S=%i(Ta%i(F en, for :R2Cn 4%:(R0F Q circu ar shift for BR2Cn =2%B(Ra%B-1(F en, =2%1(Ra%n(F for iR1Cn if%iInS1( a%i(R=2%i(F 4%:(R4%:(S=%i(Ta%i(F en, en, en, 4 su/p ot%2828L38!M(8ste3%4(F tit e%Vconvo ution of =%n( H h%n( isCV(F = a/e %V----KnV(F 4 a/e %V----K4%n(V(F*ri,F

$@S)LTC

5. FIR FI,TERS

AIM To verif4 "#$ fi ters. E2UIPMENTS1 >peratin* S4ste3 ? +in,o-s GP Constructor - Si3u ator Soft-are - CCStu,io 3 H MATLA7 7.1 THEOR31 A "inite #3pu se $esponse %"#$( fi ter is a ,iscrete inear ti3e-invariant s4ste3 -hose output is /ase, on the -ei*hte, su33ation of a finite nu3/er of past inputs. An "#$ transversa fi ter structure can /e o/taine, ,irect 4 fro3 the e.uation for ,iscrete-ti3e convo ution. y % n ( = x % k ( h% n k (
k =0 N 1

0 I n I 2-1

%1(

#n this e.uation8 =%:( an, 4%n( represent the input to an, output fro3 the fi ter at ti3e n. h%n-:( is the transversa fi ter coefficients at ti3e n. These coefficients are *enerate, /4 usin* "DS %"i ter Desi*n Soft-are or Di*ita fi ter ,esi*n pac:a*e(. "#$ fi ter is a finite i3pu se response fi ter. >r,er of the fi ter shou , /e specifie,. #nfinite response is truncate, to *et finite i3pu se response. P acin* a -in,o- of finite en*th ,oes this. T4pes of -in,o-s avai a/ e are $ectan*u ar8 7ar ett8 'a33in*8 'annin*8 7 ac:3ann -in,oetc. This "#$ fi ter is an a 9ero fi ter. PRO4RAM1 &T pro*ra3 to i3p e3ent "#$ "i ter in c an*ua*e usin* CCStu,io T& Jinc u,eIst,io.hK Jinc u,eI3ath.hK J,efine pi 3.1!11 int n828cF f oat -rL6!M8-tL6!MF voi, 3ain%( N printf%OPn enter no. of sa3p es82R CO(F scanf%OQ,O8H2(F printf%OPn enter choice of -in,o- functionPn 1.rect Pn 2. trian* Pn cR CO(F scanf%OQ,O8Hc(F printf%OPn e e3ents of -in,o- function areCO(F s-itch%c( N case 1C for%nR0FnIR2-1FnSS( N -rLnMR1F printf%O Pn -rLQ,MRQfO8n8-rLnM(F U /rea:F case 2C for%nR0FnIR2-1FnSS( N -tLnMR1-%2T%f oat(n&%2-1((F

printf%OPn -tLQ,MRQfO8n8-tLnM(F U /rea:F U U $@S)LTC

P$><$AMC Q MATLA7 pro*ra3 for "#$ fi ter ,esi*n usin* -in,o- techni.ues c cF c ear a F c ose a F rpRinput%Venter pass/an, ripp eV(F rsRinput%Venter the stop/an, ripp eV(F fpRinput%Venter pass/an, fre.V(F fsRinput%Venter stop/an, fre.V(F fRinput%Venter sa3p in* fre. V(F -pR2Tfp&fF -sR2Tfs&fF nu3R-20T o*10%s.rt%rpTrs((-13F ,e3R1!.6T%fs-fp(&fF nRcei %nu3&,e3(F n1RnS1F if%re3%n82(XR0( n1RnF nRn-1F en, cRinput%Venter 4our choice of -in,o- function 1. rectan*u ar 2. trian*u ar 3.:aiserC Pn V(F if%cRR1( 4Rrect-in%n1(F ,isp%V$ectan*u ar -in,o- fi ter responseV(F en,

if %cRR2( 4Rtrian*%n1(F ,isp%VTrian*u ar -in,o- fi ter responseV(F en, if%cRR3( 4R:aiser%n1(F ,isp%V:aiser -in,o- fi ter responseV(F en, QLP" /Rfir1%n8-p84(F Lh8oMRfre.9%/818216(F 3R20T o*10%a/s%h((F su/p ot%28281(Fp ot%o&pi83(F tit e%VLP"V(F 4 a/e %V<ain in ,7--KV(F = a/e %V%a( 2or3a i9e, fre.uenc4--KV(F Q'P" /Rfir1%n8-p8Vhi*hV84(F Lh8oMRfre.9%/818216(F 3R20T o*10%a/s%h((F su/p ot%28282(Fp ot%o&pi83(F tit e%V'P"V(F 4 a/e %V<ain in ,7--KV(F = a/e %V%/( 2or3a i9e, fre.uenc4--KV(F Q7P" -nRL-p -sMF /Rfir1%n8-n84(F Lh8oMRfre.9%/818216(F 3R20T o*10%a/s%h((F su/p ot%28283(Fp ot%o&pi83(F tit e%V7P"V(F 4 a/e %V<ain in ,7--KV(F = a/e %V%c( 2or3a i9e, fre.uenc4--KV(F Q7S" /Rfir1%n8-n8VstopV84(F Lh8oMRfre.9%/818216(F 3R20T o*10%a/s%h((F su/p ot%2828!(Fp ot%o&pi83(F tit e%V7S"V(F 4 a/e %V<ain in ,7--KV(F = a/e %V%,( 2or3a i9e, fre.uenc4--KV(F

$@S)LTC

5. IIR FI,TERS AIM To ,esi*n an, i3p e3ent ##$ %LP"&'P"(fi ters. E2UIPMENTS1 >peratin* S4ste3 +in,o-s GP Constructor - Si3u ator Soft-are - CCStu,io 3 H MATLA7 7.1 THEOR31 The ##$ fi ter can rea i9e /oth the po es an, 9eroes of a s4ste3 /ecause it has a rationa transfer function8 ,escri/e, /4 po 4no3ia s in 9 in /oth the nu3erator an, the ,eno3inatorC

H % z( =

b Z a
k =1
M

k =0 N

%1(
k

The ,ifference e.uation for such a s4ste3 is ,escri/e, /4 the fo o-in*C y % n( = bk x%n k ( + a k y %n k (
k =0 k =1 N

%2(

M an, 2 are or,er of the t-o po 4no3ia s. / : an, a: are the fi ter coefficients. These fi ter coefficients are *enerate, usin* "DS %"i ter Desi*n soft-are or Di*ita "i ter ,esi*n pac:a*e(. ##$ fi ters can /e e=pan,e, as infinite i3pu se response fi ters. #n ,esi*nin* ##$ fi ters8 cutoff fre.uencies of the fi ters shou , /e 3entione,. The or,er of the fi ter can /e esti3ate, usin* /utter -orth po 4no3ia . Thats -h4 the fi ters are na3e, as /utter -orth fi ters. "i ter coefficients can /e foun, an, the response can /e p otte,. PRO4RAMC &T pro*ra3 to i3p e3ent ##$ "i ters in c an*ua*e usin* CCStu,io T& Jinc u,eIst,io.hK Jinc u,eI3ath.hK int i8-8-c8c82F f oat 'L100MF f oat 3u %f oat8 int(F voi, 3ain%( N printf%OPn enter or,er of fi ter O(F scanf%OQ,O8H2(F printf%OPn enter the cutoff fre. O(F scanf%OQ,O8H-c(F printf%OPn enter the choice for ##$ fi ter 1. LP" 2.'P" O(F scanf%OQ,O8Hc(F s-itch%c( N case 1C for%-R0F-I100F-SS( N 'L-MR1&s.rt%1S3u %%-&%f oat(-c(82T2((F

printf%O'LQ,MRQfPnO8-8'L-M(F U /rea:F case 2C for%-R0F-IR100F-SS( N 'L-MR1&s.rt%1S3u %%f oat(-c&-82T2((F printf%O'LQ,MRQfPnO8-8'L-M(F U /rea:F UU f oat 3u %f oat a8int =( N for%iR0FiI=-1FiSS( aTRaF return%a(F U $@S)LTC

P$><$AM C Q Q MATLA7 pro*ra3 for ##$ fi ters LP" H 'P" ,esi*n c cF c ear a F c ose a F ,isp%Venter the ##$ fi ter ,esi*n specificationsV(F rpRinput%Venter the pass/an, ripp eV(F rsRinput%Venter the stop/an, ripp eV(F -pRinput%Venter the pass/an, fre.V(F -sRinput%Venter the stop/an, fre.V(F fsRinput%Venter the sa3p in* fre.V(F -1R2T-p&fsF-2R2T-s&fsF Ln8-nMR/uttor,%-18-28rp8rs8VsV(F cRinput%Venter choice of fi ter 1. LP" 2. 'P" Pn V(F if%cRR1( ,isp%V"re.uenc4 response of ##$ LP" isCV(F L/8aMR/utter%n8-n8V o-V8VsV(F en, if%cRR2( ,isp%V"re.uenc4 response of ##$ 'P" isCV(F L/8aMR/utter%n8-n8Vhi*hV8VsV(F en, -R0C.01CpiF

Lh8o3MRfre.s%/8a8-(F 3R20T o*10%a/s%h((F anRan* e%h(F fi*ure8su/p ot%28181(Fp ot%o3&pi83(F tit e%V3a*nitu,e response of ##$ fi ter isCV(F = a/e %V%a( 2or3a i9e, fre.. --KV(F 4 a/e %V<ain in ,7--KV(F su/p ot%28182(Fp ot%o3&pi8an(F tit e%Vphase response of ##$ fi ter isCV(F = a/e %V%/( 2or3a i9e, fre.. --KV(F 4 a/e %VPhase in ra,ians--KV(F $@S)LTC

6. FAST FOURIER TRANSFORM


AIM1 To verif4 "ast "ourier Transfor3. E2UIPMENTS1 >peratin* S4ste3 ? +in,o-s GP Constructor - Si3u ator Soft-are - CCStu,io 3 H MATLA7 7.1 THEOR31 The "ast "ourier Transfor3 is usefu to 3ap the ti3e-,o3ain se.uence into a continuous function of a fre.uenc4 varia/ e. The ""T of a se.uence N=%n(U of en*th 2 is *iven /4 a co3p e=-va ue, se.uence G%:(.
X % k ( = x % n(e
nk j 2 N

0I:I2-1

%1(

The a/ove e.uation is the 3athe3atica representation of the D"T. As the nu3/er of co3putations invo ve, in transfor3in* a 2 point ti3e ,o3ain si*na into its correspon,in* fre.uenc4 ,o3ain si*na -as foun, to /e 22 co3p e= 3u tip ications8 an a ternative a *orith3 invo vin* esser nu3/er of co3putations is opte,. +hen the se.uence =%n( is ,ivi,e, into 2 se.uences an, the D"T perfor3e, separate 48 the resu tin* nu3/er of co3putations -ou , /e 22&2 %i.e.(
N2 2 N 1 n =0

x%k ( =

x%2n(W

2 nk N

N2 2 N 1 n =0

x%2n + 1(W

% 2 n +1( k N

%2(

Consi,er =%2n( /e the even sa3p e se.uences an, =%2nS1( /e the o,, sa3p e se.uence ,erive, for3 =%n(.
N2 2 N 1 n =0

x%2n(W
N2 2 N 1 n =0

2 nk N

%3(

-ou , resu t in %3( %2&2(2 3u tip ications


2

x%2n +1(W

% 2 n +1( k N

%!(

an other %2&2( 3u tip icationVs fina 4 resu tin* in %2&2(2 S %2&2(2


= N2 N2 N2 + = ! ! 2 co3putations

"urther so vin* @*. %2(

x%k ( = x%k ( =

N2 2 N 1 n =0

x%2n(W
n =0

2 nk N

N2 2 N 1 n =0

x%2n + 1(W
N2 2 N 1 n =0

2 nk N

k WN

%1(

N2 2 N 1

x%2n(W

2 nk N

k + WN

x%2n +1(W

2 nk N

%6(

Divi,in* the se.uence =%2n( into further 2 o,, an, even se.uences -ou , re,uce the co3putations. +2 is the t-i,, e factor = e W
nk N

j 2 n

=e
N ( 2

j 2 ( nk n %K + N ( 2

WN

%K +

%7(

= WN WN e
j 2 n n 2
j 2 k n

=e

j 2 k n

k = WN e

k = WN %cos j sin (

= WN

%K +

N ( 2 N ( 2

k = WN %1( k = WN

= WN

%K +

%5(

@3p o4in* this e.uation8 -e ,e,uce

x% k ( =

N2 2 N 1 n =0

x%2n(W
N2 2 N 1 n =0

2 nk N

N2 2 N 1 n =0

x%2n + 1(W
k

2 nk N

%6(

N x%k + ( = 2 %10(

x%2n(W

2 nk N

2 nk W x%2n + 1(W N N

The ti3e /ur,en create, /4 this ar*e nu3/er of co3putations i3its the usefu ness of D"T in 3an4 app ications. Tre3en,ous efforts ,evote, to ,eve op 3ore efficient -a4s of co3putin* D"T resu te, in the a/ove e=p aine, "ast "ourier Transfor3 a *orith3. This 3athe3atica shortcut re,uces the nu3/er of ca cu ations the D"T re.uires ,rastica 4. The a/ove 3entione, ra,i=-2 ,eci3ation in ti3e ""T is e3p o4e, for ,o3ain transfor3ation. Divi,in* the D"T into s3a er D"Ts is the /asis of the ""T. A ra,i=-2 ""T ,ivi,es the D"T into t-o s3a er D"Ts8 each of -hich is ,ivi,e, into s3a er D"Ts an, so on8 resu tin* in a co3/ination of t-o-point D"Ts. The Deci3ation -#n-Ti3e %D#T( ""T ,ivi,es the input %ti3e( se.uence into t-o *roups8 one of even sa3p es an, the other of o,, sa3p es. 2&2 point D"T are perfor3e, on these su/-se.uences an, their outputs are co3/ine, to for3 the 2 point D"T.

"i*. %6.1( 7utterf 4 Structure.

The a/ove sho-n 3athe3atica representation for3s the /asis of 2 point ""T an, is

ca e, the $%""er-#6 S"r%c"%re.

"i*. %6.2( 5-Point ""T

P$><$AM1 QMATLA7 Pro*ra3 to fin, "ast "ourier Transfor3 c cF

c ear a F c ose a F ticF =Rinput%Venter the se.uenceV(F nRinput%Venter the en*th of fftV(F Qco3pute fft ,isp%Vfourier transfor3e, si*na V(F GRfft%=8n( su/p ot%18281(Fste3%=(F tit e%Vi&p si*na V(F = a/e %Vn ---KV(F 4 a/e %V=%n( --KV(F*ri,F su/p ot%18282(Fste3%G(F tit e%Vfft of i&p =%n( isCV(F = a/e %V$ea a=is ---KV(F 4 a/e %V#3a*inar4 a=is --KV(F*ri,F $@S)LTC

7. PO7ER SPECTRA, DENSIT3


AIM1 To verif4 Po-er Spectra Densit4

E2UIPMENTS1 >peratin* S4ste3 ? +in,o-s GP Constructor - Si3u ator Soft-are - CCStu,io 3 H MATLA7 7.1 THEOR31 The po-er spectra ,ensit4%P.S.D( is a 3easure3ent of the ener*4 at various fre.uencies. P$><$AMC QMATLA7 Pro*ra3 to fin, Po-er spectra ,ensit4 t R 0C0.001C0.6F = R sin%2TpiT10Tt(Ssin%2TpiT120Tt(F 4 R = S 2Tran,n%si9e%t((F fi*ure8 p ot%1000Tt%1C10(84%1C10(( tit e%VSi*na Corrupte, -ith Aero-Mean $an,o3 2oiseV( = a/e %Vti3e %3i isecon,s(V(F Y R fft%48112(F QThe po-er spectra ,ensit48 a 3easure3ent of the ener*4 at various fre.uencies8 isC P44 R Y.T conB%Y( & 112F f R 1000T%0C216(&112F fi*ure8 p ot%f8P44%1C217(( tit e%V"re.uenc4 content of 4V(F = a/e %Vfre.uenc4 %'9(V(F $@S)LTC

8. SUM OF SINUSOIDA, SI4NA,S


AIM1 To verif4 Su3 of Sinusoi,a Si*na s usin* MATLA7

E2UIPMENTS1 >peratin* S4ste3 ? +in,o-s GP Constructor - Si3u ator Soft-are - CCStu,io 3 H MATLA7 7.1 THEOR31 To *enerate fourier series of a si*na /4 o/servin* su3 of sinusoi,a si*na s H o/servin* *i//s pheno3enon effect. PRO4RAM1 Q MATLA7 Pro*ra3 to fin, su3 of sinusoi,a si*na s c cF c ear a F c ose a F ticF Q*ivin* inear spaces tR0C.01CpiF Q tR inspace%08pi820(F Q*eneration of sine si*na s 41Rsin%t(F 42Rsin%3Tt(&3F 43Rsin%1Tt(&1F 4!Rsin%7Tt(&7F 41Rsin%6Tt(&6F 4 R sin%t( S sin%3Tt(&3 S sin%1Tt(&1 S sin%7Tt(&7 S sin%6Tt(&6F p ot%t848t8418t8428t8438t84!8t841(F e*en,%V4V8V41V8V42V8V43V8V4!V8V41V(F tit e%V*eneration of su3 of sinusoi,a si*na sV(F*ri,F 4 a/e %V---K A3p itu,eV(F = a/e %V---K tV(F tocF

$@S)LTC

9. FRE2UENC3 RESPONSE OF ANA,O4 ,PF : HPF

AIM1 To verif4 response of ana o* LP" H 'P" usin* MATLA7 E2UIPMENTS1 >peratin* S4ste3 ? +in,o-s GP Constructor - Si3u ator Soft-are - CCStu,io 3 H MATLA7 7.1 THEOR31 Ana o* Lo- pass fi ter H 'i*h pass fi ter are o/taine, /4 usin* /utter-orth or che/4shev fi ter -ith coefficients are *iven. The fre.uenc4 ? 3a*nitu,e p ot *ives the fre.uenc4 response of the fi ter. PRO4RAM1 Q MATLA7 Pro*ra3 to fin, fre.uenc4 response of ##$ fi ters LP" H 'P" c cF c ear a F c ose a F -arnin* offF ,isp%Venter the ##$ fi ter ,esi*n specificationsV(F rpRinput%Venter the pass/an, ripp eV(F rsRinput%Venter the stop/an, ripp eV(F -pRinput%Venter the pass/an, fre.V(F -sRinput%Venter the stop/an, fre.V(F fsRinput%Venter the sa3p in* fre.V(F -1R2T-p&fsF-2R2T-s&fsF Ln8-nMR/uttor,%-18-28rp8rs8VsV(F cRinput%Venter choice of fi ter 1. LP" 2. 'P" Pn V(F if%cRR1( ,isp%V"re.uenc4 response of ##$ LP" isCV(F L/8aMR/utter%n8-n8V o-V8VsV(F en, if%cRR2( ,isp%V"re.uenc4 response of ##$ 'P" isCV(F L/8aMR/utter%n8-n8Vhi*hV8VsV(F en, -R0C.01CpiF Lh8o3MRfre.s%/8a8-(F 3R20T o*10%a/s%h((F anRan* e%h(F fi*ure8su/p ot%28181(Fp ot%o3&pi83(F tit e%V3a*nitu,e response of ##$ fi ter isCV(F = a/e %V%a( 2or3a i9e, fre.. --KV(F 4 a/e %V<ain in ,7--KV(F

su/p ot%28182(Fp ot%o3&pi8an(F tit e%Vphase response of ##$ fi ter isCV(F = a/e %V%/( 2or3a i9e, fre.. --KV(F 4 a/e %VPhase in ra,ians--KV(F $@S)LTC

You might also like