欢迎来到天天文库
浏览记录
ID:28065116
大小:2.46 MB
页数:57页
时间:2018-12-08
《数字信号处理上机实验报告》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、数字信号处理上机实验报告2018年5月21日M2.21.题目ThesquarewaveandthesawtoothwavearetwoperiodicsequencesassketchedinfigureP2.4.Usingthefunctionstem.Theinputdataspecifiedbytheuserare:desiredlengthLofthesequenee,peakvalueA,andtheperiodN.Forthesquarewavesequeneeanadditionaluser-specifiedpar
2、ameteristhedutycycle,whichisthepercentoftheperiodforwhichthesignalispositive.Usingthisprogramgeneratethefirst100samplesofeachoftheabovesequenceswithasamplingrateof20kHz,apeakvalueof7,aperiodof13,andadutycycleof60%forthesquarewave・2.程序clc;closeall;f=20000;%采样频率L=100*(1
3、/f);%采样个数A=7;%最大值N=13;%周期t=0:1/20000:L-1/20000;%t=0:1:20;y1=(A*sawtooth(2*pi/N*f*t));m=(A-max(y1))/2;y2=m+y1;figure(1);subplot(2,1,1);stem(t,y2);y3=square(2*pi/13*20000*t,60);subplot(2,1,2)stem(t,y3);3.结果11-10.50-0.50.511.522.533.544.50.511.522.533.54.5x10"3M2.41.题目(a
4、)Writeamatlabprogramtogenerateasinusoidalsequeneex[n]=Acos(won+6)andplotthesequenceusingthestemfunction.TheinputdataspecifiedbytheuserarethedesiredlengthL,amplitudeA,theangularfrequencya)°,andthephase①where05、esshowninfigure2.15.(b)GeneratesinusoidalsequenceswiththeangularfrequenciesgiveninProblem2.22.Determinetheperiodofeachsequeneefromtheplotandverifytheresulttheoretically.1.程序clc;clearall;closeall;L=inputCDesiredlength=');A=inputfAmplitude=*);omega=input('Angularfrequen6、cy=f);phi=input(*Phase=*);%信号产生n二0:L-1;x=A*cos(omega*n+phi);stem(n,x);xlabel('n');ylabel('幅度');title(['omega_{o}=um2str(omega)]);2.结果(a)oj0=080H0-V-JIng416n£0H0・8ngnEonieo“37699£0H0・」4nEo"0.43982E%」b6sngO0U0.68=biobiooU1~~IrCocooc宀OGcOOrG0GQcCO-°oQ—oo-~-8C。o°o°-G7、0>jGrcOOo*G.oo「1i(Ocu.c-0oo」0ooCuO1£or~0c(/d1o■c亠~0C——QO°o-_—^-€)o°Ioc£O■oc11oIIoeM2・5EllllGenerateihesequencesofp「ob-em2・21(b)to2・2」(e)usingmai-ab・2・谕羽(b)nHCk959xusin(0.6*p*n+0.6*pirstem(n,x);xlabel('rf);ylabel('幅度);(c)n二0:99;x=2*cos(1.1*pi*n-0.5*pi)+2*sin(0.7*pi*n8、);stem(n,x);xlabel('rf);ylabel('幅度);(d)n二0:99;x=3*sin(1.3*pi*n-4*cos(0.3*pi*n+0.45*pi));stem(n,x);xlabel(h);ylabelC幅度);(e)n二
5、esshowninfigure2.15.(b)GeneratesinusoidalsequenceswiththeangularfrequenciesgiveninProblem2.22.Determinetheperiodofeachsequeneefromtheplotandverifytheresulttheoretically.1.程序clc;clearall;closeall;L=inputCDesiredlength=');A=inputfAmplitude=*);omega=input('Angularfrequen
6、cy=f);phi=input(*Phase=*);%信号产生n二0:L-1;x=A*cos(omega*n+phi);stem(n,x);xlabel('n');ylabel('幅度');title(['omega_{o}=um2str(omega)]);2.结果(a)oj0=080H0-V-JIng416n£0H0・8ngnEonieo“37699£0H0・」4nEo"0.43982E%」b6sngO0U0.68=biobiooU1~~IrCocooc宀OGcOOrG0GQcCO-°oQ—oo-~-8C。o°o°-G
7、0>jGrcOOo*G.oo「1i(Ocu.c-0oo」0ooCuO1£or~0c(/d1o■c亠~0C——QO°o-_—^-€)o°Ioc£O■oc11oIIoeM2・5EllllGenerateihesequencesofp「ob-em2・21(b)to2・2」(e)usingmai-ab・2・谕羽(b)nHCk959xusin(0.6*p*n+0.6*pirstem(n,x);xlabel('rf);ylabel('幅度);(c)n二0:99;x=2*cos(1.1*pi*n-0.5*pi)+2*sin(0.7*pi*n
8、);stem(n,x);xlabel('rf);ylabel('幅度);(d)n二0:99;x=3*sin(1.3*pi*n-4*cos(0.3*pi*n+0.45*pi));stem(n,x);xlabel(h);ylabelC幅度);(e)n二
此文档下载收益归作者所有