数字信号处理实验一.docx
- 文档编号:11190625
- 上传时间:2023-05-29
- 格式:DOCX
- 页数:21
- 大小:209.01KB
数字信号处理实验一.docx
《数字信号处理实验一.docx》由会员分享,可在线阅读,更多相关《数字信号处理实验一.docx(21页珍藏版)》请在冰点文库上搜索。
数字信号处理实验一
姓名:
罗格学号:
2012302530084班级:
信安3班日期:
2014.3.15
实验1基本离散信号的MATLAB产生和图形显示
实验前言:
MATLAB是一套功能强大的工程计算及数据处理软件,在众多领域得到广泛应用。
它是一种面向对象的,交互式程序设计语言,其结构完整有优良的可移植性。
它在矩阵运算,数字信号处理方面有强大的功能。
另外,MATLAB提供了方便的绘图功能,便于用户直观地输出处理结果。
本课程实验要求学生运用MATLAB编程完成一些数字信号处理的基本功能,加深对教学内容的理解。
实验目的:
1.熟悉掌握MATLAB的基本操作
2.通过使用来熟悉常用离散信号;
实验内容:
1.1GENERATIONOFSEQUENCES
Project1.1Unitsampleandunitstepsequences
AcopyofProgramP1_1isgivenbelow.
%ProgramP1_1
%GenerationofaUnitSampleSequence
clf;
%Generateavectorfrom-10to20
n=-10:
20;
%Generatetheunitsamplesequence
u=[zeros(1,10)1zeros(1,20)];
%Plottheunitsamplesequence
stem(n,u);
xlabel('Timeindexn');ylabel('Amplitude');
title('UnitSampleSequence');
axis([-102001.2]);
Answers:
Q1.1Theunitsamplesequenceu[n]generatedbyrunningProgramP1_1isshownbelow:
Q1.2Thepurposeofclfcommandis–清除当前窗口图形
Thepurposeofaxiscommandis–设定坐标轴最大值最小值和
Thepurposeoftitlecommandis–命名图表名
Thepurposeofxlabelcommandis–命名X轴
Thepurposeofylabelcommandis–命名Y轴
Q1.3ThemodifiedProgramP1_1togenerateadelayedunitsamplesequenceud[n]withadelayof11samplesisgivenbelowalongwiththesequencegeneratedbyrunningthisprogram.
n=0: 30; u=[zeros(1,11)1zeros(1,19)]; stem(n,u); xlabel('Timeindexn');ylabel('Amplitude'); title('UnitSampleSequence'); axis([03001.2]); > < > Q1.4ThemodifiedProgramP1_1togenerateaunitstepsequences[n]isgivenbelowalongwiththesequencegeneratedbyrunningthisprogram. < %Programs_P1_1 %GenerationofaUnitStepSequenceclf; %Generateavectorfrom-10to20 n=-10: 20; %Generatetheunitsamplesequence s=[zeros(1,10)ones(1,21)]; %Plottheunitsamplesequence stem(n,s); xlabel('Timeindexn');ylabel('Amplitude'); title('UnitSampleSequence'); axis([-102001.2]);> < > Q1.5ThemodifiedProgramP1_1togenerateaunitstepsequencesd[n]withanadvanceof7samplesisgivenbelowalongwiththesequencegeneratedbyrunningthisprogram. < %Programs_P1_1 %GenerationofaUnitStepSequence clf; %Generateavectorfrom-10to20 n=-10: 20; %Generatetheunitsamplesequence s=[zeros(1,3)ones(1,28)]; %Plottheunitsamplesequence stem(n,s); xlabel('Timeindexn');ylabel('Amplitude'); title('UnitSampleSequence'); axis([-102001.2]);> < > Project1.2Exponentialsignals AcopyofProgramsP1_2andP1_3aregivenbelow. c=-(1/12)+(pi/6)*i; K=2; n=0: 40; x=K*exp(c*n); subplot(2,1,1); stem(n,real(x)); xlabel('Timeindexn');ylabel('Amplitude'); title('Realpart'); subplot(2,1,2); stem(n,imag(x)); xlabel('Timeindexn');ylabel('Amplitude'); title('Imaginarypart');> Answers: Q1.6Thecomplex-valuedexponentialsequencegeneratedbyrunningProgramP1_2isshownbelow: < > Q1.7Theparametercontrollingtherateofgrowthordecayofthissequenceis-C Theparametercontrollingtheamplitudeofthissequenceis-K Q1.8Theresultofchangingtheparametercto(1/12)+(pi/6)*iis-实部取反 Q1.9Thepurposeoftheoperatorrealis-合成实部 Thepurposeoftheoperatorimagis-合成虚部 Q1.10Thepurposeofthecommandsubplotis-创建坐标 Q1.11Thereal-valuedexponentialsequencegeneratedbyrunningProgramP1_3isshownbelow: < > Q1.12Theparametercontrollingtherateofgrowthordecayofthissequenceis-a Theparametercontrollingtheamplitudeofthissequenceis-n Q1.13Thedifferencebetweenthearithmeticoperators^and.^is-^用于矩阵.^用于数组 Q1.14ThesequencegeneratedbyrunningProgramP1_3withtheparameterachangedto0.9andtheparameterKchangedto20isshownbelow: < > Q1.15Thelengthofthissequenceis-36 ItiscontrolledbythefollowingMATLABcommandline: n=0: 35 Itcanbechangedtogeneratesequenceswithdifferentlengthsasfollows(giveanexamplecommandlineandthecorrespondinglength): n=0: : 2;length: 20 Q1.16Theenergiesofthereal-valuedexponentialsequencesx[n]generatedinQ1.11andQ1.14andcomputedusingthecommandsumare3.1851e+003,195.4943 Project1.3Sinusoidalsequences AcopyofProgramP1_4isgivenbelow. 40; f=0.1; phase=0; A=1.5; arg=2*pi*f*n-phase; x=A*cos(arg); clf; stem(n,x); axis([040-22]); grid; title('SinusoidalSequence'); xlabel('Timeindexn'); ylabel('Amplitude'); axis;> Answers: Q1.17ThesinusoidalsequencegeneratedbyrunningProgramP1_4isdisplayedbelow. < > Q1.18Thefrequencyofthissequenceis-f=0.1Hz ItiscontrolledbythefollowingMATLABcommandline: Asequencewithnewfrequencysuchas1000Hzcanbegeneratedbythefollowingcommandline: Theparametercontrollingthephaseofthissequenceis-phase Theparametercontrollingtheamplitudeofthissequenceis-A Theperiodofthissequenceis--10s Q1.19Thelengthofthissequenceis-序列的长度是: 41 ItiscontrolledbythefollowingMATLABcommandline: n=0: 40 Asequencewithnewlength__31___canbegeneratedbythefollowingcommandline: Q1.20Theaveragepowerofthegeneratedsinusoidalsequenceis- Q1.21Thepurposeofaxiscommandis-1.5000 Thepurposeofgridcommandis-控制坐标轴缩放比例 Q1.22ThemodifiedProgramP1_4togenerateasinusoidalsequenceoffrequency0.9isgivenbelowalongwiththesequencegeneratedbyrunningit. < %Generationofasinusoidalsequence n=0: 40; f=0.9; phase=0; A=1.5; arg=2*pi*f*n-phase; x=A*cos(arg); clf;%Clearoldgraph stem(n,x);%Plotthegeneratedsequence axis([040-22]); grid; title('SinusoidalSequence'); xlabel('Timeindexn'); ylabel('Amplitude'); axis; > < > AcomparisonofthisnewsequencewiththeonegeneratedinQuestionQ1.17shows-两幅图形相同(频率为0.1和频率为0.9的两个正弦序列的图形相同) Asinusoidalsequenceoffrequency1.1generatedbymodifyingProgramP1_4isshownbelow. < > AcomparisonofthisnewsequencewiththeonegeneratedinQuestionQ1.17shows– 波形相同 Q1.23Thesinusoidalsequenceoflength50,frequency0.08,amplitude2.5,andphaseshiftof90degreesgeneratedbymodifyingProgramP1_4isdisplayedbelow. < > Theperiodofthissequenceis–2π/ω=1/f=1/0.08=25/2周期为25/2所以在25以内有2个余弦波形 Q1.24ByreplacingthestemcommandinProgramP1_4withtheplotcommand,theplotobtainedisasshownbelow: < > ThedifferencebetweenthenewplotandtheonegeneratedinQuestionQ1.17is– 1.17中是离散的点,而PLOT命令将离散的点用平滑的曲线连接起来,使之成为连续的余弦信号。 Q1.25ByreplacingthestemcommandinProgramP1_4withthestairscommandtheplotobtainedisasshownbelow: < > ThedifferencebetweenthenewplotandthosegeneratedinQuestionsQ1.17andQ1.24is-Q1.17是离散的,Q1.24是连续的,此处是阶梯型波 1.2SIMPLEOPERATIONSONSEQUENCES Project1.5SignalSmoothing AcopyofProgramP1_5isgivenbelow. R=51; d=0.8*(rand(R,1)-0.5); m=0: R-1; s=2*m.*(0.9.^m); x=s+d'; subplot(2,1,1); plot(m,d','r-',m,s,'g--',m,x,'b-.'); xlabel('Timeindexn');ylabel('Amplitude'); legend('d[n]','s[n]','x[n]'); x1=[00x];x2=[0x0];x3=[x00]; y=(x1+x2+x3)/3; subplot(2,1,2); plot(m,y(2: R+1),'r-',m,s,'g--'); legend('y[n]','s[n]'); xlabel('Timeindexn');ylabel('Amplitude'); > Answers: Q1.29ThesignalsgeneratedbyrunningProgramP1_5aredisplayedbelow: < > Q1.30Theuncorruptedsignals[n]is-2*m.*(0.9.^m) Theadditivenoised[n]is-0.8*(rand(R,1)-0.5) Q1.31Thestatementx=s+dCAN/CANNOTbeusedtogeneratethenoisecorruptedsignalbecause–不可以,d是一个纵向矢量而S是一个横向矢量,必须把其中一个转换为另一个的形式才可以相加 Q1.32Therelationsbetweenthesignalsx1,x2,andx3,andthesignalxare–x1,x2,x3都是X的延伸,其中X1是x的延时信号,x2与x同步,x3超前于x。 Q1.33Thepurposeofthelegendcommandis-在当前的图形中添加图例,表明哪一种颜色的实线或虚线表示哪一种信号 Project1.6GenerationofComplexSignals AcopyofProgramP1_6isgivenbelow. < %ProgramP1_6 %Generationofamplitudemodulatedsequence clf; n=0: 100; m=0.4;fH=0.1;fL=0.01; xH=sin(2*pi*fH*n); xL=sin(2*pi*fL*n); y=(1+m*xL).*xH; stem(n,y);grid; xlabel('Timeindexn');ylabel('Amplitude'); > Answers: Q1.34Theamplitudemodulatedsignalsy[n]generatedbyrunningProgramP1_6forvariousvaluesofthefrequenciesofthecarriersignalxH[n]andthemodulatingsignalxL[n],andvariousvaluesofthemodulationindexmareshownbelow: < > Q1.35Thedifferencebetweenthearithmeticoperators*and.*is-*用于矩阵,.*用于数组 AcopyofProgramP1_7isgivenbelow. <%ProgramP1_7 %Generationofasweptfrequencysinusoidalsequence n=0: 100; a=pi/2/100; b=0; arg=a*n.*n+b*n; x=cos(arg); clf; stem(n,x); axis([0,100,-1.5,1.5]); title('Swept-FrequencySinusoidalSignal'); xlabel('Timeindexn'); ylabel('Amplitude'); grid;axis; > Answers: Q1.36Theswept-frequencysinusoidalsequencex[n]generatedbyrunningProgramP1_7isdisplayedbelow. < > Q1.37Theminimumandmaximumfrequenciesofthissignalare-0.25 Q1.38TheProgram1_7modifiedtogenerateasweptsinusoidalsignalwithaminimumfrequencyof0.1andamaximumfrequencyof0.3isgivenbelow: <%ProgramP1_7 %Generationofasweptfrequencysinusoidalsequence n=0: 100; a=pi/2/100; b=0; arg=a*n.*n+b*n; x=cos(arg); clf; stem(n,x); axis([0,100,-1.5,1.5]); title('Swept-FrequencySinusoidalSignal'); xlabel('Timeindexn'); ylabel('Amplitude'); grid;axis; > 1.3WORKSPACEINFORMATION Q1.39Theinformationdisplayedinthecommandwindowasaresultofthewhocommandis– Yourvariablesare: ARargdfLnums1udx2xL Kabfmphases2xx3y ManscfHnsux1xH Q1.40Theinform
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数字信号 处理 实验
![提示](https://static.bingdoc.com/images/bang_tan.gif)