You are on page 1of 2

Digital Signal Processing

Lab H4

11.1.EchoGeneration 11.1.1.ProgramEcho.c: #include"stdio.h" #definebufferlength3000 #defineamplitude5; shortinput; intoutput; intbuffer[bufferlength]; shorti=0; interruptvoidc_int11() { input=input_sample(); output=input+0.1*amplitude*buffer[i]; buffer[i]=input; output_sample(output); i++; if(i>=bufferlength) i=0; } voidmain(void) { comm_intr(); printf("TheEchoGeneration"); while(1) { } } 12.1.2.Howitworks: This experiment demonstrate you the power of DSP. The basic purpose of this program is to introducethesoundprocessingtechniques.Thesoulofthewholeprogramisintheexpression givenbelow: Outputt=input+0.1*amplitude*buffer[i]; buffer[i]=input; Toexplaintheseexpressionpleaseanalyzethefollowingblockdiagram.Believeme,thisisthe bestwaytounderstand.Ihavealsovisualizeditwiththehelpofthefollowingblockdiagram:

-Sir Syed University of Engineering & Technology-

Digital Signal Processing

Lab H4

The above figure is the block diagram of the Echo. In the above program, the delay factor is calculated as: Delay = 3000x125usec
Delay=375msec Here,125usecisthesamplingtimeoftheADCand3000isthebufferlengthofthearray,which isusedasadelaymultiplyingfactor.Youcanseetheeffectbychangingthevalueofthe bufferlengthwhichis3000inaboveprogram.Youcanalsochangethevalueofthe amplitudewhichis5intheprogram. Torunthisprogramcorrectlyyoumustincludethefollowingfiles: 1.C6xdsk.cmd 2.C6xdsk.h 3.C6xinterrupts.h 4.C6xdskinit.h 5.C6xdskinit.c 6.Vectors_11.asm 7.Echo.c 8.Rts6701.lib

-Sir Syed University of Engineering & Technology-

You might also like