DSP第一次实验.docx
- 文档编号:23749331
- 上传时间:2023-05-20
- 格式:DOCX
- 页数:19
- 大小:237.83KB
DSP第一次实验.docx
《DSP第一次实验.docx》由会员分享,可在线阅读,更多相关《DSP第一次实验.docx(19页珍藏版)》请在冰豆网上搜索。
DSP第一次实验
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.
%ProgramP1_1
%GenerationofaUnitSampleSequence
clf;
%Generateavectorfrom-10to20
n=-10:
20;
%Generatetheunitsamplesequence
u=[zeros(1,21)1zeros(1,9)];
%Plottheunitsamplesequence
stem(n,u);
xlabel('Timeindexn');ylabel('Amplitude');
title('UnitSampleSequence');
axis([-102001.2]);
Project1.2Exponentialsignals
AcopyofProgramsP1_2andP1_3aregivenbelow.
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-K
Q1.13Thedifferencebetweenthearithmeticoperators^and.^is-^一般表示数值的乘方,.^表示矩阵的乘方
Q1.14ThesequencegeneratedbyrunningProgramP1_3withtheparameterachangedto0.9andtheparameterKchangedto20isshownbelow:
Q1.15Thelengthofthissequenceis-36
ItiscontrolledbythefollowingMATLABcommandline:
n=0:
35;a=0.9;K=20;
x=K*a.^n;
stem(n,x);
Itcanbechangedtogeneratesequenceswithdifferentlengthsasfollows(giveanexamplecommandlineandthecorrespondinglength):
clf;
n=0:
60;a=0.9;K=20;
x=K*a.^n;
stem(n,x);
xlabel('Timeindexn');ylabel('Amplitude');
Project1.3Sinusoidalsequences,sinusodal序列
AcopyofProgramP1_4isgivenbelow.
%ProgramP1_4
%Generationofasinusoidalsequence
n=0:
40;
f=0.1;
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;
Answers:
Q1.17ThesinusoidalsequencegeneratedbyrunningProgramP1_4isdisplayedbelow.显示的图像:
Q1.18Thefrequencyofthissequenceis–0.1
ItiscontrolledbythefollowingMATLABcommandline:
arg=2*pi*f*n-phase;
Asequencewithnewfrequency__f___canbegeneratedbythefollowingcommandline:
f=0.1;
Theparametercontrollingthephaseofthissequenceis–相位参数:
phase
Theparametercontrollingtheamplitudeofthissequenceis–振幅参数是:
A
Theperiodofthissequenceis–周期是:
10
Q1.19Thelengthofthissequenceis–序列的长度是:
41
ItiscontrolledbythefollowingMATLABcommandline:
n=0:
40
Asequencewithnewlength__n___canbegeneratedbythefollowingcommandline:
n=0:
40
Q1.21Thepurposeofaxiscommandis–控制线形缩放比例和外观
Thepurposeofgridcommandis–产生网格
Q1.22ThemodifiedProgramP1_4togenerateasinusoidalsequenceoffrequency0.9isgivenbelowalongwiththesequencegeneratedbyrunningit.频率变为0.9后的信号图:
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.9后,但是图像却没有变化
Asinusoidalsequenceoffrequency1.1generatedbymodifyingProgramP1_4isshownbelow.
AcomparisonofthisnewsequencewiththeonegeneratedinQuestionQ1.17shows-频率改为1.1后,但是图像仍然没有变化
Q1.23Thesinusoidalsequenceoflength50,frequency0.08,amplitude2.5,andphaseshiftof90degreesgeneratedbymodifyingProgramP1_4isdisplayedbelow.
Theperiodofthissequenceis–12.5
Q1.24ByreplacingthestemcommandinProgramP1_4withtheplotcommand,theplotobtainedisasshownbelow:
用plot代替stem,运行程序得到:
ThedifferencebetweenthenewplotandtheonegeneratedinQuestionQ1.17is–命令中stem函数用于绘制火柴梗图;plot函数用于绘制线性二维图形
Q1.25ByreplacingthestemcommandinProgramP1_4withthestairscommandtheplotobtainedisasshownbelow:
用stairs代替stem
ThedifferencebetweenthenewplotandthosegeneratedinQuestionsQ1.17andQ1.24is–命令中stairs函数用于绘制阶梯状图;命令中stem函数用于绘制火柴梗图;plot函数用于绘制线性二维图形
Project1.4Randomsignals随机信号
Answers:
Q1.26TheMATLABprogramtogenerateanddisplayarandomsignaloflength100withelementsuniformlydistributedintheinterval[–2,2]isgivenbelowalongwiththeplotoftherandomsequencegeneratedbyrunningtheprogram:
%ProgramP1_4
%Generationofasinusoidalsequence
n=0:
99;
x=4*(rand(1,100)-0.5);
clf;%Clearoldgraph
stem(n,x);%Plotthegeneratedsequence
axis([099-22]);
grid;
title('SinusoidalSequence');
xlabel('Timeindexn');
ylabel('Amplitude');
axis;
Q1.27TheMATLABprogramtogenerateanddisplayaGaussianrandomsignaloflength75withelementsnormallydistributedwithzeromeanandavarianceof3isgivenbelowalongwiththeplotoftherandomsequencegeneratedbyrunningtheprogram:
%ProgramP1_4
%Generationofasinusoidalsequence
n=0:
74;
x=normrnd(0,3,1,75);
clf;%Clearoldgraph
plot(n,x);%Plotthegeneratedsequence
axis([074-44]);
grid;
title('SinusoidalSequence');
xlabel('Timeindexn');
ylabel('Amplitude');
axis;
Project1.5SignalSmoothing信号光滑
AcopyofProgramP1_5isgivenbelow.
%ProgramP1_5
%SignalSmoothingbyAveraging
clf;
R=51;
d=0.8*(rand(R,1)-0.5);%Generaterandomnoise
m=0:
R-1;
s=2*m.*(0.9.^m);%Generateuncorruptedsignal
x=s+d';%Generatenoisecorruptedsignal
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.31Thestatementx=s+dCAN/CANNOTbeusedtogeneratethenoisecorruptedsignalbecause-能产生被污染的信号吗?
若不能,为什么
答:
能
Q1.32Therelationsbetweenthesignalsx1,x2,andx3,andthesignalxare–X1,x2,x3是相邻的三个被污染的信号。
X是相邻的三个被污染的信号平均值
Q1.33Thepurposeofthelegendcommandis–标注图中的各条线
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- DSP 第一次 实验