资源描述:
《数字信号处理实验报告材料2》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实用Name:Section:LaboratoryExercise2DISCRETE-TIMESYSTEMS:TIME-DOMAINREPRESENTATION2.1SIMULATIONOFDISCRETE-TIMESYSTEMSProject2.1TheMovingAverageSystemAcopyofProgramP2_1isgivenbelow:%ProgramP2_1%SimulationofanM-pointMovingAverageFilter%Generatetheinputsignaln
2、=0:100;s1=cos(2*pi*0.05*n);%Alow-frequencysinusoids2=cos(2*pi*0.47*n);%Ahighfrequencysinusoidx=s1+s2;%ImplementationofthemovingaveragefilterM=input('Desiredlengthofthefilter=');num=ones(1,M);y=filter(num,1,x)/M;%Displaytheinputandoutputsignalsclf;subplot(
3、2,2,1);plot(n,s1);axis([0,100,-2,2]);xlabel('Timeindexn');ylabel('Amplitude');title('Signal#1');subplot(2,2,2);plot(n,s2);axis([0,100,-2,2]);xlabel('Timeindexn');ylabel('Amplitude');title('Signal#2');subplot(2,2,3);plot(n,x);axis([0,100,-2,2]);xlabel('Tim
4、eindexn');ylabel('Amplitude');文档实用title('InputSignal');subplot(2,2,4);plot(n,y);axis([0,100,-2,2]);xlabel('Timeindexn');ylabel('Amplitude');title('OutputSignal');axis;Answers:Q2.1TheoutputsequencegeneratedbyrunningtheaboveprogramforM=2withx[n]=s1[n]+s2[n]
5、astheinputisshownbelow.Thecomponentoftheinputx[n]suppressedbythediscrete-timesystemsimulatedbythisprogramis–s2文档实用Q2.2ProgramP2_1ismodifiedtosimulatetheLTIsystemy[n]=0.5(x[n]–x[n–1])andprocesstheinputx[n]=s1[n]+s2[n]resultingintheoutputsequenceshownbelow:
6、s3=cos(2*pi*0.05*(n-1));s4=cos(2*pi*0.47*(n-1));z=s3+s4;y=0.5*(x-z);TheeffectofchangingtheLTIsystemontheinputis-Project2.2(Optional)ASimpleNonlinearDiscrete-TimeSystemAcopyofProgramP2_2isgivenbelow:%ProgramP2_2%Generateasinusoidalinputsignalclf;n=0:200;x=
7、cos(2*pi*0.05*n);%Computetheoutputsignalx1=[x00];%x1[n]=x[n+1]文档实用x2=[0x0];%x2[n]=x[n]x3=[00x];%x3[n]=x[n-1]y=x2.*x2-x1.*x3;y=y(2:202);%Plottheinputandoutputsignalssubplot(2,1,1)plot(n,x)xlabel('Timeindexn');ylabel('Amplitude');title('InputSignal')subplot
8、(2,1,2)plot(n,y)xlabel('Timeindexn');ylabel('Amplitude');title('Outputsignal');Answers:Q2.5Thesinusoidalsignalswiththefollowingfrequenciesastheinputsignalswereusedtogeneratetheoutputsignals:Theoutputsignalsgenerated