欢迎来到天天文库
浏览记录
ID:38522087
大小:1.09 MB
页数:18页
时间:2019-06-14
《数字信号处理(DSP)实验报告》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、数字信号处理(DSP)实验报告学院电子科学与工程学院姓名学号指导教师2016年6月2日实验一M2.1WriteaMATLABprogramtothegeneratetheconjugate-symmetricandconjugate-antisymmetricpartsofafinitelengthcomplexsequence.UsingthisprogramverifytheresultsofExample2.8.Code:x=[01+4j-2+3j4-2j-5-6j-2j3];cs=0.5*(x+conj(fliplr(x)));ca=0.5*(x-conj
2、(fliplr(x)));M2.2(a)UsingProgram2-2,generatethesequencesshowninFigures2.23and2.24.(b)Generateandplotthecomplexexponentialsequence-2.7e(-0.4+jπ6)nfor0≤n≤82usingProgram2-2.Code:%Program2_2%Generationofcomplexexponentialsequence%a=input('Typeinrealexponent=');b=input('Typeinimaginaryexpo
3、nent=');c=a+b*i;K=input('Typeinthegainconstant=');N=input('Typeinlengthofsequence=');n=1:N;x=K*exp(c*n);%Generatethesequencestem(n,real(x));%Plottherealpartxlabel('Timeindexn');ylabel('Amplitude');title('Realpart');disp('PRESSRETURNforimaginarypart');pausestem(n,imag(x));%Plottheimagi
4、narypartxlabel('Timeindexn');ylabel('Amplitude');title('Imaginarypart');Figure2.23Figure2.24Figure2.2bM2.4(a)WriteaMATLABprogramtogenerateasinusoidalsequencex[n]=Asin(w0n+f),andplotthesequenceusingthestemfunction.TheinputdataspecifiedbytheuserthedesiredlengthL,amplitudeA,theangularfre
5、quencyw0,andthephasefwhere06、');A=input('Amplitude=');omega=input('Angularfrequency=');phi=input('Phase=');n=0:L-1;x=A*cos(omega*n+phi);stem(n,x);xlabel('TimeIndex');ylabel('Amplitude');title(['omega_{o}=',num2str(omega/pi),'pi']);Figure2.22M2.6WriteaMATLABprogramtoplotacontinuous-timesinusoidalsignalanditssamp7、ledversion,andverifyFigure2.28.Youneedtotheholdfunctiontokeepbothplots.Code:t=0:0.001:1;fo=input('FrequencyofsinusoidinHz=');FT=input('SamplingfrequencyinHz=');g1=cos(2*pi*fo*t);plot(t,g1,':');xlabel('time');ylabel('Amplitude');holdn=0:1:FT;gs=cos(2*pi*fo*n/FT);plot(n/FT,gs,'o');holdo8、ffM3.
6、');A=input('Amplitude=');omega=input('Angularfrequency=');phi=input('Phase=');n=0:L-1;x=A*cos(omega*n+phi);stem(n,x);xlabel('TimeIndex');ylabel('Amplitude');title(['omega_{o}=',num2str(omega/pi),'pi']);Figure2.22M2.6WriteaMATLABprogramtoplotacontinuous-timesinusoidalsignalanditssamp
7、ledversion,andverifyFigure2.28.Youneedtotheholdfunctiontokeepbothplots.Code:t=0:0.001:1;fo=input('FrequencyofsinusoidinHz=');FT=input('SamplingfrequencyinHz=');g1=cos(2*pi*fo*t);plot(t,g1,':');xlabel('time');ylabel('Amplitude');holdn=0:1:FT;gs=cos(2*pi*fo*n/FT);plot(n/FT,gs,'o');holdo
8、ffM3.
此文档下载收益归作者所有