dsp laboratory experiments

Upload: nava-krishnan

Post on 04-Jun-2018

236 views

Category:

Documents


1 download

TRANSCRIPT

  • 8/13/2019 DSP Laboratory Experiments

    1/53

  • 8/13/2019 DSP Laboratory Experiments

    2/53

  • 8/13/2019 DSP Laboratory Experiments

    3/53

  • 8/13/2019 DSP Laboratory Experiments

    4/53

  • 8/13/2019 DSP Laboratory Experiments

    5/53

  • 8/13/2019 DSP Laboratory Experiments

    6/53

    n &-:-8%x & ,a ;n%a&gca, %a.thic5ness & 2%

    plot2d3,4gnn4#n#xxtitle,46raphical $epresentation of Exponentially "ncreasing Signal4#4n4#4x*n/4 %

    esult

    Ex.pt.No'! inear an *ircular *on+olution of t,o sequencesAim: To perform Linear

  • 8/13/2019 DSP Laboratory Experiments

    7/53

    clc%clear all%close %x & inp t,4enter x seq4 %h & inp t,4enter h seq4 %m & length,x %n & length,h %((?ethod - !sing Direct

  • 8/13/2019 DSP Laboratory Experiments

    8/53

    (($es lt((enter x seq *- - - -/((enter h seq *- 2 3/((

  • 8/13/2019 DSP Laboratory Experiments

    9/53

    x2 & *-#2#3#'/% //Second sequencem & length,x- % //length of first sequencen & length,x2 % //length of second sequence

    //To make length of x1 and x are !qualif ,m Fn for i & n7-:m x2,i & 8% endelseif ,nFm for i & m7-:n x-,i & 8% endend

    N & length,x- %

    x3 & +eros,-#N % //x" # Circular convolution result initiali$ed to $erosa,- & x2,- %for & 2:N a, & x2,N) 72 %endfor i &-:N x3,- & x3,- 7x-,i Ca,i %endG,-#: &a%

    //Calculation of circular convolutionfor 5 & 2:N for &2:N x2, & a, )- % end x2,- & a,N % G,5#: & x2% for i & -:N a,i & x2,i % x3,5 & x3,5 7x-,i Ca,i %

    endenddisp,G#4

  • 8/13/2019 DSP Laboratory Experiments

    10/53

    // 1( )( "( ( // ( 1( )( "( // "( ( 1( )( // )( "( ( 1( // // Circular Convolution %esult x"&n' # // // 1)( 1*( 1)( 1*(

    Ex.pt.No'" *ircular con+olution using

    Aim: To perform circ lar con=ol tion of t>o seq ences sing @@T)"@@T method.

    //Caption: Performing Circular Convolution +sing FFT,-FFT method clear%clc%close%L & '% //.ength of the Sequence

    N & '% // ,point 0FT 10

  • 8/13/2019 DSP Laboratory Experiments

    11/53

    x- & *2#-#2#-/%x2 & *-#2#3#'/%

    //Computing 0FTG- & fft,x-#)- %G2 & fft,x2#)- %disp,G-#4D@T of x-*n/ is G-,5 &4disp,G2#4D@T of x-*n/ is G2,5 &4

    //Multiplication of 0FTsG3 & G-.CG2%disp,G3#4D@T of x3*n/ is G3,5 &4

    //Circular Convolution %esult x3 &abs,fft,G3#-disp,x3#4

  • 8/13/2019 DSP Laboratory Experiments

    12/53

    h & *-#2#3/% //-mpulse %esponse of .T- S6stemx & *-#2#2#-/% //-nput %esponse of .T- S6stem

    N- & length,x % N2 & length,h % N & N-7N2)-disp,N#4Length of tp t $esponse y,n 4

    //Padding $eros to Make .ength of 7h7 and 7x7 //!qual to length of output response 767 h- & *h#+eros,-#N)N2 /%x- & *x#+eros,-#N)N- /%

    //Computing FFTH & fft,h-#)- %G & fft,x-#)- %

    //Multiplication of 0FTs

    I & G.CH //.inear Convolution %esult y &abs,fft,I#-disp,G#4D@T of i(p G,5 &4disp,H#4D@T of imp lse seq ence H,5 &4disp,I#4D@T of Linear @ilter o(p I,5 &4disp,y#4Linear

  • 8/13/2019 DSP Laboratory Experiments

    13/53

    // .inear Convolution result 6&n'# // // 1( )( >( 11(

  • 8/13/2019 DSP Laboratory Experiments

    14/53

    x & *-#2#3#'/% //Computing 0FTG & fft,x#)- %disp,G#4@@T of x*n/ is G,5 &4x &abs,fft,G#-disp,x#4"@@T of G,5 is x*n/&4

    //Plotting the spectrum of 0iscrete Sequences bplot,2#-#-a&gca, %a.data0bo nds&*8#8% #-8/%

    plot2d3,4gnn4#8:length,x )-#x b & gce, % b.children,- .thic5ness &3%xtitle,46raphical $epresentation of Discrete Seq ence4#4n4#4x*n/4 %

    s bplot,2#-#2a&gce, %a.data0bo nds&*8#8% #-8/%

    plot2d3,4gnn4#8:length,G )-#abs,G b & gce, % b.children,- .thic5ness &3%xtitle,46raphical $epresentation of Discrete Spectr m4#454#4G,5 4 %

    //%esult //FFT of x&n' is 2k3# // 14( , ( 5 (i , ( , ( , (i // //-FFT of 2k3 is x&n'# // 1( ( "( )(

    esult

    14

  • 8/13/2019 DSP Laboratory Experiments

    15/53

    Ex.pt.No'/ ime an requenc$ esponse of & s$stems

    15

  • 8/13/2019 DSP Laboratory Experiments

    16/53

    Aim: To >rite a scilab program in order to generate and plot the imp lse responseand freq ency response of a first order Linear

  • 8/13/2019 DSP Laboratory Experiments

    17/53

    s bplot,2#-#- %a & gca, %a.y0location & 1origin1%

    plot,J#HJ0?ag %xlabel,4@req ency in $adians(Seconds)))F J4 %ylabel,4abs,H, J 4title,4?agnit de $esponse4

    //Plotting Phase %eponses bplot,2#-#2 %a & gca, %a.y0location & 1origin1%a.x0location & 1origin1%

    plot,J#HJ0PhaseCKpi(-M8 %xlabel,4 @req ency in $adians(Seconds)))F J4 %

    ylabel,4 9H, J 4title,4Phase $esponse in $adians4

    esult

    17

  • 8/13/2019 DSP Laboratory Experiments

    18/53

    18

  • 8/13/2019 DSP Laboratory Experiments

    19/53

    Ex.pt.No' Sampling2 3erification of Sampling an Effect ofaliasing

    Aim: To >rite a scilab program in order to con=ert a contin o s time signal ,

  • 8/13/2019 DSP Laboratory Experiments

    20/53

    s bplot,2#-#- %a &gca, %a.x0location & 1origin1%a.y0location & 1origin1%

    plot,t#xa %xlabel,4t in sec.4 %ylabel,4xa,t 4title,4 riginal Analog Signal4s bplot,2#-#2 %a &gca, %a.x0location & 1origin1%a.y0location & 1origin1%xlabel,4t in sec.4 %ylabel,4xa,t 4

    title,4$econstr cted Signal sing sinc f nction# @s & -88H+4 % plot,t#Ga %

    Sinc unction

    f nction * $/&sinc0ne>, xi&find, x&&8 %x,i & -% // don7t need this is /4 Darning is off$ & sin,KpiC x .(,KpiCx %

    $,i & -%

    endf nction

    esult

    20

  • 8/13/2019 DSP Laboratory Experiments

    21/53

    21

  • 8/13/2019 DSP Laboratory Experiments

    22/53

    22

  • 8/13/2019 DSP Laboratory Experiments

    23/53

    Ex.pt.No'? Design of & ilters (@in o, Design anrequenc$ Sampling)

    (?).a & ilter -@in o, Base Design

    Aim: To design Jindo>)based @"$ Lo> Pass @ilter# High Pass @ilter# and Pass@ilter and and Stop @ilter sing gi=en desired freq ency response.

    Program 1' & o, Pass ilter

    //Caption: Program to 0esign F-% .oD Pass Filter clc%close%

    ? & inp t,4Enter the dd @ilter Length &4 % //Filter lengthJc & inp t,4Enter the Digital < toff freq ency &4 % //0igital Cutoff frequenc6T o & ,?)- (2 //Center Galuefor n & -:? if ,n && T o7- hd,n & Jc(Kpi% else hd,n & sin,JcC,,n)- )T o (,,,n)- )T o CKpi % endend

    //%ectangular EindoDfor n & -:? J,n & -%end

    //EindoDing Filter Coefficientsh & hd.CJ%disp,h#4@ilter

  • 8/13/2019 DSP Laboratory Experiments

    24/53

    plot,2Cfr#h+m0dxlabel,4Normali+ed Digital @req ency J4 %ylabel,4?agnit de in d 4 %title,4@req ency $esponse 8f @"$ LP@ sing $ectang lar >indo>4xgrid,-

    //%esult //!nter the 8dd Filter .ength # ; //!nter the 0igital Cutoff frequenc6 # Hpi/ // // Filter Coefficients are // // , 4(14*14"" // 1(>)>0,1; # 4(4 // 4("1

  • 8/13/2019 DSP Laboratory Experiments

    25/53

    Program !' & ;ig8 Pass ilter

    //Caption: Program to 0esign F-% 9igh Pass Filter clear%clc%close%? & inp t,4Enter the dd @ilter Length &4 % //Filter lengthJc & inp t,4Enter the Digital < toff freq ency &4 % //0igital Cutoff frequenc6T o & ,?)- (2 //Center Galuefor n & -:? if ,n && T o7- hd,n & -)Jc(Kpi% else hd,n & ,sin,KpiC,,n)- )T o )sin,JcC,,n)- )T o (,,,n)- )T o CKpi % endend

    //%ectangular EindoD

    for n & -:? J,n & -%end

    //EindoDing Fitler Coefficientsh & hd.CJ%disp,h#4@ilter

  • 8/13/2019 DSP Laboratory Experiments

    26/53

  • 8/13/2019 DSP Laboratory Experiments

    27/53

    Program "' & Ban Pass ilter

    //Caption: Program to 0esign F-% Iand Pass Filter clear%clc%close%? & inp t,4Enter the dd @ilter Length &4 % //Filter length

    //0igital Cutoff frequenc6 &.oDer Cutoff@ +pper Cutoff'Jc & inp t,4Enter the Digital < toff freq ency &4 %Jc2 & Jc,2

    27

  • 8/13/2019 DSP Laboratory Experiments

    28/53

    Jc- & Jc,-T o & ,?)- (2 //Center Galuehd & +eros,-#? %J & +eros,-#? %for n & -:-- if ,n && T o7- hd,n & ,Jc2)Jc- (Kpi% else n hd,n & ,sin,Jc2C,,n)- )T o )sin,Jc-C,,n)- )T o (,,,n)- )T o CKpi % end if,abs,hd,n 9,8.8888- hd,n &8% end

    endhd%

    //%ectangular EindoDfor n & -:? J,n & -%end

    //EindoDing Fitler Coefficientsh & hd.CJ%disp,h#4@ilter indo>4xgrid,-

    //%esult //!nter the 8dd Filter .ength # 11 //!nter the 0igital Cutoff frequenc6 # &Hpi/)@ "?Hpi/)'

    28

  • 8/13/2019 DSP Laboratory Experiments

    29/53

    //Filter Coefficients are // 4( 4( 4( , 4("1

  • 8/13/2019 DSP Laboratory Experiments

    30/53

    T o & ,?)- (2 //Center Galuehd & +eros,-#? %J & +eros,-#? %for n & -:? if ,n && T o7- hd,n & -),,Jc2)Jc- (Kpi % elsehd,n &,sin,KpiC,,n)- )T o )sin,Jc2C,,n)- )T o 7sin,Jc-C,,n)- )T o (,,,n)

    - )T o CKpi % end if,abs,hd,n 9,8.8888- hd,n &8% endend

    //%ectangular EindoDfor n & -:? J,n & -%end

    //EindoDing Fitler Coefficientsh & hd.CJ%disp,h#4@ilter indo>4xgrid,-

    //%esult //!nter the 8dd Filter .ength # 11 //!nter the 0igital Cutoff frequenc6 #&Hpi/"@ ?Hpi/"' //Filter Coefficients are //column 1 to >

    30

  • 8/13/2019 DSP Laboratory Experiments

    31/53

    // 4( , 4(1"; Pass @ilter singgi=en desired freq ency response.

    Program' & o, Pass ilter

    //Caption: 0esign of F-% .PF Filter using Frequenc6 Sampling Techniqueclear%clc%close%? &- %

    31

  • 8/13/2019 DSP Laboratory Experiments

    32/53

    Hr & *-#-#-#-#8.'#8#8#8/%for 5 &-:length,Hr 6,5 &,,)- ;,5)- CHr,5 %endh & +eros,-#? %! & ,?)- (2for n & -:? h- & 8% for 5 & 2:!7- h- &6,5 Ccos,,2CKpi(? C,5)- C,,n)- 7,-(2 7h-%

    end h,n & ,-(? C ,6,- 72Ch- %enddisp,h#4@ilter ith? & - >ith < toff @req ency & 8.' 4xgrid,2

    //%esult

    //Filter Coefficients are h2n3# //column 1 to ; // // ,4(41)1 ,4(441>) " 4(4) 4(41 ") ,4(4>1") " // //column 1 // // , 4(41)1

    32

  • 8/13/2019 DSP Laboratory Experiments

    33/53

    esult

    Ex.pt.No' Design of && ilters (Butter,ort8 C *8e0$c8e+)

    ( ).a. Design of Digital && Butter,ort8 ilters

    Aim: To design ilinear Transform method based Digital ""$ tter>orth Lo>Pass @ilter and con=erting into High Pass @ilter# and Pass @ilter and andStop @ilter sing Digital @req ency Transformation techniq e.

    Program 1' && Butter,ort8 P

    //Caption: To design a digital --% First 8rder IutterDorth .PF Filter //+sing Iilinear Transformationclear all%clc%

    33

  • 8/13/2019 DSP Laboratory Experiments

    34/53

    close%s & poly,8#4s4 %

    megac & 8.2CKpi% // Cutoff frequenc6H & megac(,s7 megac % //Analog first order IutterDorth filter tranfer functionT &-% //Sampling period T # 1 Second + & poly,8#4+4 %H+ & horner,H#,2(T C,,+)- (,+7- //Iilinear TransformationHJ &frmag,H+,2 #H+,3 # -2 % //Frequenc6 response for 1 pointsJ & 8:Kpi( --:Kpi%a&gca, %a.thic5ness & -%

    plot,J(Kpi#HJ#4r4a.foregro nd & -%a.font0style & O%

    xgrid,-xtitle,4?agnit de $esponse of Single pole LP@ @ilter < toff freq ency &8.2Cpi4#4Normali+ed Digital @req ency)))F4#4?agnit de4 %

    esult

    34

  • 8/13/2019 DSP Laboratory Experiments

    35/53

    Program !' && Butter,ort8 ;P

    //Caption: To design First 8rder IutterDorth .oD Pass Filter and convert it into35

  • 8/13/2019 DSP Laboratory Experiments

    36/53

    // 9PF +sing 0igital Filter Transformationclear all%clc%close%s & poly,8#4s4 %

    megac & 8.2CKpi% //Filter cutoff frequenc6H & megac(,s7 megac % //First order IutterDorth --% filter T &-% //Sampling period T # 1 Second + & poly,8#4+4 %H+0LP@ & horner,H#,2(T C,,+)- (,+7- % //Iilinear Transformationalpha & ),cos,, megac7 megac (2 (,cos,, megac) megac (2 %H 0HP@&horner,H+0LP@#),+7alpha (,-7alphaC+ //.PF to 9PF digitaltransformationHJ &frmag,H 0HP@,2 #H 0HP@,3 # -2 % //Frequenc6 response for 1 points

    J & 8:Kpi( --:Kpi%a&gca, %a.thic5ness & -%

    plot,J(Kpi#HJ#4r4a.foregro nd & -%a.font0style & O%xgrid,-xtitle,4?agnit de $esponse of Single pole HP@ @ilter < toff freq ency &8.2Cpi4#4Normali+ed Digital @req ency J(pi)))F4#4?agnit de4 %

    esult

    36

  • 8/13/2019 DSP Laboratory Experiments

    37/53

    Program "' && Butter,ort8 BP

    37

  • 8/13/2019 DSP Laboratory Experiments

    38/53

    ///Caption:To 0esign a 0igital --% IutterDorth .PF Filter from Analog --% //IutterDorth Filter and .PF to IPF using 0igital Transformationclear all%clc%close%omegaP & 8.2CKpi% //Filter cutoff frequenc6omegaL & ,-( CKpi% //.oDer Cutoff frequenc6 for ISFomega! & ,3( CKpi% //+pper Cutoff frequenc6 for ISF+&poly,8#4+4 %H0LP@ & ,8.2' C,-7,+;)- (,-)8. 8OC,+;)- % //Iilinear transformationalpha & ,cos,,omega!7omegaL (2 (cos,,omega!)omegaL (2 % //parameter 7alpha7

    //parameter 7k7 5 & ,cos,,omega! ) omegaL (2 (sin,,omega! ) omegaL (2 Ctan,omegaP(2 %

    N!? &),,+;2 ),,2CalphaC5(,57- C+ 7,,5)- (,57- %

    DEN & ,-),,2CalphaC5(,57- C+ 7,,,5)- (,57- C,+;2 %H 0 P@&horner,H0LP@#N!?(DEN % //.PF to IPF conversion using digitaltransformationdisp,H 0 P@#4Digital P@ ""$ @ilter H, & 4 %HJ &frmag,H 0 P@,2 #H 0 P@,3 # -2 % //frequenc6 responseJ & 8:Kpi( --:Kpi%a&gca, %a.thic5ness & -%

    plot,J(Kpi#HJ#4r4a.foregro nd & -%a.font0style & O%xgrid,-xtitle,4?agnit de $esponse of P@ @ilter c toff freq ency *8.2#8. /4#4Normali+edDigital @req ency)))F4#4?agnit de4 %

    esult

    38

  • 8/13/2019 DSP Laboratory Experiments

    39/53

    Program #' && Butter,ort8 BS

    //Caption:To 0esign a 0igital --% IutterDorth .PF Filter from Analog --%39

  • 8/13/2019 DSP Laboratory Experiments

    40/53

    //IutterDorth Filter and .PF to ISF using 0igital Transformationclear all%clc%close%omegaP & 8.2CKpi% //Filter cutoff frequenc6omegaL & ,-( CKpi% //.oDer Cutoff frequenc6 for ISFomega! & ,3( CKpi% //+pper Cutoff frequenc6 for ISF+&poly,8#4+4 %H0LP@ & ,8.2' C,-7,+;)- (,-)8. 8OC,+;)- //Iilinear transformationalpha & ,cos,,omega!7omegaL (2 (cos,,omega!)omegaL (2 % //parameter7alpha7 5 & tan,,omega! ) omegaL (2 Ctan,omegaP(2 % //parameter 7k7

    N!? &,,+;2 ),,2Calpha(,-75 C+ 7,,-)5 (,-75 % // umerator DEN & ,-),,2Calpha(,-75 C+ 7,,,-)5 (,-75 C,+;2 % //0enominator

    H 0 S@&horner,H0LP@#N!?(DEN % //.PF to ISF conversion using digitaltransformationHJ &frmag,H 0 S@,2 #H 0 S@,3 # -2 % //frequenc6 response for 1 pointsJ & 8:Kpi( --:Kpi%a&gca, %a.thic5ness & -%

    plot,J(Kpi#HJ#4r4a.foregro nd & -%a.font0style & O%xgrid,-xtitle,4?agnit de $esponse of S@ @ilter c toff freq *8.2#8. / 4#4Normali+ed Digital@req ency)))F4#4?agnit de4 %

    esult

    40

  • 8/13/2019 DSP Laboratory Experiments

    41/53

    ( ).0. Design of Digital && *8e0$s8e+ ilter

    41

  • 8/13/2019 DSP Laboratory Experiments

    42/53

    Aim: To design ilinear Transform method based Digital ""$ Pass @ilter.

    Program' && *8e0$s8e+ P

    //Program To 0esign the 0igital CheJ6shev --% Filter

    clear%clc%close%Jp & inp t,4Enter the Digital Pass and Edge @req ency4 %Js & inp t,4Enter the Digital Stop and Edge @req ency4 %T & inp t,4Sampling "nter=al4

    megaP & ,2(T Ctan,Jp(2megaS & ,2(T Ctan,Js(2

    Delta- & inp t,4Enter the Pass and $ipple4 %Delta2 & inp t,4Enter the Stop and $ipple4 %Delta & sqrt,,,-(Delta2 ;2 )-Epsilon & sqrt,,,-(Delta- ;2 )-

    N & ,acosh,Delta(Epsilon (,acosh, megaS( megaP N & ceil,N

    mega< & megaP(,,,,-(Delta- ;2 )- ;,-(,2CN*pols#gn/ & +pch-,N#Epsilon# megaP

    Hs & poly,gn#4s4#4coeff4 (real,poly,pols#4s4+ & poly,8#4+4 %H+ & horner,Hs#,,2(T C,,+)- (,+7-HJ &frmag,H+,2 #H+,3 # -2 % //Frequenc6 response for 1 pointsJ & 8:Kpi( --:Kpi%a&gca, %a.thic5ness & -%

    plot,J(Kpi#abs,HJ #4r4a.foregro nd & -%a.font0style & O%xgrid,-xtitle,4?agnit de $esponse of

  • 8/13/2019 DSP Laboratory Experiments

    43/53

    //Sampling -nterval 1 // T # // 1( // 8megaP # // 4(*)> // !psilon # // 4(; // #

    // 1( 4;> )< // # // ( // 8megaC # // 4(; 4"*>> // gn # // 4( < 5 4( "4 >1*i , 4( * > < , 4( "4 >1*i // 9s # // // 4( 1*s 5 s // //9$ # // // 4( 4; *1 , ;( >*1 *$ //,,B4( ?4( * > // ans # // 4(

  • 8/13/2019 DSP Laboratory Experiments

    44/53

    // 9$ # // // // 4(4 44 * // 9$ # // // 4(4 44< , 1(");

  • 8/13/2019 DSP Laboratory Experiments

    45/53

    Program' Decimation 0$ Pol$p8ase Decomposition

    //Caption:0ecimation J6 @ Filter .ength # "4

    //Cutoff Frequenc6 Ec # Hpi/ //Pass Jand !dge frequenc6 fp # 4( and a Stop Jand edge frequenc6 fs # 4("1 // Choose the numJer of cosine functions and create a dense grid // in &4@4( ' and &4("1@4( ' //magnitude for pass Jand # 1 K stop Jand # 4 2i(e3 &1 4' //Eeighting function #& 1'clear%clc%close%? & 38% //Filter .engthD & 2% //0ecimation Factor # Jc & Kpi(2% //Cutoff Frequenc6Jp & Jc(,2CKpi % //PassJand !dge Frequenc6Js & 8.3-% //StopJand !dge Frequenc6hn&eqfir,?#*8 Jp%Js . /#*- 8/#*2 -/ %disp,hn#4The LP@ @ilter >1

    //column < to 1) //4(4 1"

  • 8/13/2019 DSP Laboratory Experiments

    46/53

    //4()> );* 4()> );* 4(4>1 , 4(4")>>1 , 4(44)*;*1 ,4(44 < ")

    //column 1 //, 4(41

  • 8/13/2019 DSP Laboratory Experiments

    47/53

    Program' Scila0 program for Perio ogram 0ase Spectrum Estimation

    //Caption: Periodogram !stimate of Liven 0iscrete Sequence

    //x2n3 # 1@4@ @4@"@1@4@ N //using 0FT clear%clc%close%

    N &M% // " 5 4(1 1" 4"i // ( 5 i // , (;4;14*< 5 )(1 1" 4"i // "( , "(*;)0,1*i // , (;4;14*< , )(1 1" 4"i // ( , i // , 1( > " , 4(1 1" 4"i //

    // Peridogram of x2n3 is Pxx2k/ 3# //

    47

  • 8/13/2019 DSP Laboratory Experiments

    48/53

    // 14(1 // 4( 14; 1"* // 1(1 // "(4"> 1"* // 4(* // 4( 14;

  • 8/13/2019 DSP Laboratory Experiments

    49/53

    5rc8itecture of t8e Digital Signal Processor

    ne of the biggest bottlenec5s in exec ting DSP algorithms is transferringinformation to and from memory. This incl des data# s ch as samples from theinp t signal and the filter coefficients# as >ell as program instr ctions# the binarycodes that go into the program seq encer. @or example# s ppose >e need to

    49

  • 8/13/2019 DSP Laboratory Experiments

    50/53

    m ltiply t>o n mbers that reside some>here in memory. To do this# >e m st fetchthree binary =al es from memory# the n mbers to be m ltiplied# pl s the programinstr ction describing >hat to do.

    @ig re ,a sho>s ho> this seemingly simple tas5 is done in a traditionalmicroprocessor. This is often called a Qon Ne mann architect re# after the brilliantAmerican mathematician Rohn Qon Ne mann ,-O83)-O . Qon Ne mann g idedthe mathematics of many important disco=eries of the early t>entieth cent ry. Hismany achie=ements incl de: de=eloping the concept of a stored program comp ter#formali+ing the mathematics of q ant m mechanics# and >or5 on the atomic

    bomb.

    As sho>n in ,a # a Qon Ne mann architect re contains a single memory and asingle b s for transferring data into and o t of the central processing nit ,o n mbers req ires at least three cloc5 cycles# one to transfer eachof the three n mbers o=er the b s from the memory to the e ass me that it remains inthe hen =ery fast processing isreq ired# and >e are >illing to pay the price of increased complexity.

    This leads s to the Har=ard architect re# sho>n in ,b . This is named for the >or5done at Har=ard !ni=ersity in the -O'8s nder the leadership of Ho>ard Ai5en,-O88)-O 3 . As sho>n in this ill stration# Ai5en insisted on separate memories fordata and program instr ctions# >ith separate b ses for each. Since the b sesoperate independently# program instr ctions and data can be fetched at the sametime# impro=ing the speed o=er the single b s design. ?ost present day DSPs sethis d al b s architect re.

    @ig re ,c ill strates the next le=el of sophistication# the S per Har=ardArchitect re. This term >as coined by Analog De=ices to describe the internal

    operation of their ADSP)2-8 x and ne> ADSP)2--xx families of Digital SignalProcessors. These are called SHA$< DSPs# a contraction of the longer term#S per Har=ard A$ays# t>o areas are important eno gh to be incl ded in @ig. c: aninstr ction cache# and an "( controller.

    50

  • 8/13/2019 DSP Laboratory Experiments

    51/53

    @irst# let4s loo5 at ho> the instr ction cache impro=es the performance of theHar=ard architect re. A handicap of the basic Har=ard design is that the datamemory b s is b sier than the program memory b s. Jhen t>o n mbers arem ltiplied# t>o binary =al es ,the n mbers m st be passed o=er the data memory

    b s# >hile only one binary =al e ,the program instr ction is passed o=er the program memory b s. To impro=e pon this sit ation# >e start by relocating partof the 1data1 to program memory. @or instance# >e might place the filtercoefficients in program memory# >hile 5eeping the inp t signal in data memory.,This relocated data is called 1secondary data1 in the ill stration . At first glance#this doesn4t seem to help the sit ation% no> >e m st transfer one =al e o=er thedata memory b s ,the inp t signal sample # b t t>o =al es o=er the programmemory b s ,the program instr ction and the coefficient . "n fact# if >e >ereexec ting random instr ctions# this sit ation >o ld be no better at all.

    Ho>e=er# DSP algorithms generally spend most of their exec tion time in loops.This means that the same set of program instr ctions >ill contin ally pass from

    program memory to the ith the coefficientsthat m st also be fetched along this path. Ho>e=er# on additional exec tions of theloop# the program instr ctions can be p lled from the instr ction cache. Thismeans that all of the memory to

  • 8/13/2019 DSP Laboratory Experiments

    52/53

    52

  • 8/13/2019 DSP Laboratory Experiments

    53/53