数字信号处理大作业分析

数字信号处理大作业分析

ID:14630397

大小:928.50 KB

页数:20页

时间:2018-07-29

数字信号处理大作业分析_第1页
数字信号处理大作业分析_第2页
数字信号处理大作业分析_第3页
数字信号处理大作业分析_第4页
数字信号处理大作业分析_第5页
资源描述:

《数字信号处理大作业分析》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、数字信号处理大作业电子工程学院M2.2ThesquarewaveandthesawtoothwavearetwoperiodicsequenceassketchedinFigureP2.1.UsingthefunctionssawtoothandsquarewriteaMATLABprogramtogeneratetheabovetwosequencesandplotthemandtheperiodN.Forthesquarewavesequenceanadditionaluser-specifiedparame

2、teristhedutycycle,whileisthepercentoftheperiodforwhichthesignalispositive.Usingthisprogramgeneratethefirst100samplesofeachoftheabovesequenceswithasamplingrateof20khz,apeakvalueof7,aperiodof13andadutycycleof60%forthesquarewave.如下为matlab程序代码:%getuserinputsa=inp

3、ut('thepeakvalue=');l=input('lengthofsequence=');n=input('theperiodofsequence');ft=input('thedesiredsamplingfrequency=');dc=input('thesquarewavedutycycle=');%creatsingalst=1/ft;t=0:l-1;x=a*sawtooth(2*pi*t/n);y=a*square(2*pi*(t/n),dc);%poltsubplot(211)stem(t,x

4、)ylabel('Amplitude');xlabel(['Timein',num2str(t),'sec']);subplot(212)stem(t,y);ylabel('Amplitude');xlabel(['Timein',num2str(t),'sec']);在仿真之前,分析题目中所给出的数据,需要注意此时的周期为序列的个数13,而非时间周期13s,否则100个取样最终时间才花费0.05s,在图中就无法显示出来。同时占空比很明确的影响方波的取样正负所占比例,这也与占空比所本意相吻合。周期的多少也直接影响

5、一个周期内取样的个数。M2.4(a)WriteaMatlabprogramtogenerateasinusoidalsequencex[n]=Acos(ω0n+φ)andplotthesequenceusingthestemfunction.TheinputdataspecifiedbytheuserarethedesiredlengthL,amplitudeA,theangularfrequencyω0,andthephaseφwhere0<ω0<πand0≤φ≤2π.Usingtheprogramgenera

6、tethesinusoidalsequenceshowninfigure2.15.(b)Generatesinusoidalsequenceswiththeangularfrequenciesgiveninproblem2.2.Determinetheperiodofeachsequencefromtheplotandverifytheresulttheoretically.Answer:如下为matlab代码:>>L=input('Desiredlength=');A=input('Amplitude=');o

7、mega=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)]);%%example:Desiredlength=100Amplitude=1.5Angularfrequency=0.1*piPhase=0ω0=0.1πω0=0.14π由理论计算

8、可知其周期t=2pi/0.14pi=100/7,故时间周期T=100,由图中也可明显看出,其波形以100开始循坏,故其周期也为100,相符。.ω0=0.24π理论计算t=2pi/0.24pi=25/3,故其周期为25,由图中也可看出,其图像每25一循坏,周期为25,与理论也相符。w0=0.34pi理论计算t=2pi/0.34pi=100/17,故其周期为100,由图中,基

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。