数字信号处理实验报告材料2Word文档格式.docx

上传人:b****5 文档编号:21472857 上传时间:2023-01-30 格式:DOCX 页数:20 大小:659.89KB
下载 相关 举报
数字信号处理实验报告材料2Word文档格式.docx_第1页
第1页 / 共20页
数字信号处理实验报告材料2Word文档格式.docx_第2页
第2页 / 共20页
数字信号处理实验报告材料2Word文档格式.docx_第3页
第3页 / 共20页
数字信号处理实验报告材料2Word文档格式.docx_第4页
第4页 / 共20页
数字信号处理实验报告材料2Word文档格式.docx_第5页
第5页 / 共20页
点击查看更多>>
下载资源
资源描述

数字信号处理实验报告材料2Word文档格式.docx

《数字信号处理实验报告材料2Word文档格式.docx》由会员分享,可在线阅读,更多相关《数字信号处理实验报告材料2Word文档格式.docx(20页珍藏版)》请在冰豆网上搜索。

数字信号处理实验报告材料2Word文档格式.docx

%Displaytheinputandoutputsignals

clf;

subplot(2,2,1);

plot(n,s1);

axis([0,100,-2,2]);

xlabel('

Timeindexn'

ylabel('

Amplitude'

title('

Signal#1'

subplot(2,2,2);

plot(n,s2);

Signal#2'

subplot(2,2,3);

plot(n,x);

InputSignal'

subplot(2,2,4);

plot(n,y);

OutputSignal'

axis;

Answers:

Q2.1TheoutputsequencegeneratedbyrunningtheaboveprogramforM=2withx[n]=s1[n]+s2[n]astheinputisshownbelow.

Thecomponentoftheinputx[n]suppressedbythediscrete-timesystemsimulatedbythisprogramis–s2

Q2.2ProgramP2_1ismodifiedtosimulatetheLTIsystemy[n]=0.5(x[n]–x[n–1])andprocesstheinputx[n]=s1[n]+s2[n]resultingintheoutputsequenceshownbelow:

s3=cos(2*pi*0.05*(n-1));

s4=cos(2*pi*0.47*(n-1));

z=s3+s4;

y=0.5*(x-z);

TheeffectofchangingtheLTIsystemontheinputis-

Project2.2(Optional)ASimpleNonlinearDiscrete-TimeSystem

AcopyofProgramP2_2isgivenbelow:

%ProgramP2_2

%Generateasinusoidalinputsignal

200;

x=cos(2*pi*0.05*n);

%Computetheoutputsignal

x1=[x00];

%x1[n]=x[n+1]

x2=[0x0];

%x2[n]=x[n]

x3=[00x];

%x3[n]=x[n-1]

y=x2.*x2-x1.*x3;

y=y(2:

202);

%Plottheinputandoutputsignals

subplot(2,1,1)

plot(n,x)

ylabel('

subplot(2,1,2)

plot(n,y)

Outputsignal'

Q2.5Thesinusoidalsignalswiththefollowingfrequenciesastheinputsignalswereusedtogeneratetheoutputsignals:

Theoutputsignalsgeneratedforeachoftheaboveinputsignalsaredisplayedbelow:

Theoutputsignalsdependonthefrequenciesoftheinputsignalaccordingtothefollowingrules:

Thisobservationcanbeexplainedmathematicallyasfollows:

Project2.3LinearandNonlinearSystems

AcopyofProgramP2_3isgivenbelow:

%ProgramP2_3

%Generatetheinputsequences

40;

a=2;

b=-3;

x1=cos(2*pi*0.1*n);

x2=cos(2*pi*0.4*n);

x=a*x1+b*x2;

num=[2.24032.49082.2403];

den=[1-0.40.75];

ic=[00];

%Setzeroinitialconditions

y1=filter(num,den,x1,ic);

%Computetheoutputy1[n]

y2=filter(num,den,x2,ic);

%Computetheoutputy2[n]

y=filter(num,den,x,ic);

%Computetheoutputy[n]

yt=a*y1+b*y2;

d=y-yt;

%Computethedifferenceoutputd[n]

%Plottheoutputsandthedifferencesignal

subplot(3,1,1)

stem(n,y);

OutputDuetoWeightedInput:

a\cdotx_{1}[n]+b\cdotx_{2}[n]'

subplot(3,1,2)

stem(n,yt);

WeightedOutput:

a\cdoty_{1}[n]+b\cdoty_{2}[n]'

subplot(3,1,3)

stem(n,d);

DifferenceSignal'

Q2.7Theoutputsy[n],obtainedwithweightedinput,andyt[n],obtainedbycombiningthetwooutputsy1[n]andy2[n]withthesameweights,areshownbelowalongwiththedifferencebetweenthetwosignals:

Thetwosequencesare–same;

wecanregard10(-15)as0

Thesystemis–alinersystem

 

Q2.9Program2_3wasrunwiththefollowingnon-zeroinitialconditions-ic=[22];

Theplotsgeneratedareshownbelow-

Basedontheseplotswecanconcludethatthesystemwithnonzeroinitialconditionsis–assameasthezeroinitialconditionwiththetimegone

Project2.4Time-invariantandTime-varyingSystems

AcopyofProgramP2_4isgivenbelow:

%ProgramP2_4

D=10;

a=3.0;

b=-2;

x=a*cos(2*pi*0.1*n)+b*cos(2*pi*0.4*n);

xd=[zeros(1,D)x];

%Setinitialconditions

%Computetheoutputy[n]

%Computetheoutputyd[n]

yd=filter(num,den,xd,ic);

%Computethedifferenceoutputd[n]

d=y-yd(1+D:

41+D);

%Plottheoutputs

Outputy[n]'

grid;

stem(n,yd(1:

41));

title(['

OutputduetoDelayedInputx[n?

num2str(D),'

]'

]);

Answers:

Q2.12Theoutputsequencesy[n]andyd[n-10]generatedbyrunningProgramP2_4areshownbelow-

Thesetwosequencesarerelatedasfollows–same,theoutputdon’tchangewiththetime

Thesystemis-Timeinvariantsystem

Q2.15Theoutputsequencesy[n]andyd[n-10]generatedbyrunningProgramP2_4fornon-zeroinitialconditionsareshownbelow-ic=[52];

Thesetwosequencesarerelatedasfollows–justasthesequencesabove

Thesystemis–notrelatedtotheinitialconditions

2.2LINEARTIME-INVARIANTDISCRETE-TIMESYSTEMS

Project2.5ComputationofImpulseResponsesofLTISystems

AcopyofProgramP2_5isshownbelow:

%ProgramP2_5

%Computetheimpulseresponsey

N=40;

y=impz(num,den,N);

%Plottheimpulseresponse

stem(y);

ImpulseResponse'

Q2.19Thefirst41samplesoftheimpulseresponseofthediscrete-timesystemofProject2.3generatedbyrunningProgramP2_5isgivenbelow:

Project2.6CascadeofLTISystems

AcopyofProgramP2_6isgivenbelow:

%ProgramP2_6

%CascadeRealization

x=[1zeros(1,40)];

%Generatetheinput

%Coefficientsof4thordersystem

den=[11.62.281.3250.68];

num=[0.06-0.190.27-0.260.12];

%Computetheoutputof4thordersystem

y=filter(num,den,x);

%Coefficientsofthetwo2ndordersystems

num1=[0.3-0.20.4];

den1=[10.90.8];

num2=[0.2-0.50.3];

den2=[10.70.85];

%Outputy1[n]ofthefirststageinthecascade

y1=filter(num1,den1,x);

%Outputy2[n]ofthesecondstageinthecascade

y2=filter(num2,den2,y1);

%Differencebetweeny[n]andy2[n]

d=y-y2;

%Plotoutputanddifferencesignals

subplot(3,1,1);

Outputof4thorderRealization'

subplot(3,1,2);

stem(n,y2)

OutputofCascadeRealization'

subplot(3,1,3);

stem(n,d)

Q2.23Theoutputsequencesy[n],y2[n],andthedifferencesignald[n]generatedbyrunningProgramP2_6areindicatedbelow:

Therelationbetweeny[n]andy2[n]is–y[n]istheConvolutionofy2[n]andy1[n]

The4thordersystemcandothesamejobasthecascadesystem

Q2.24ThesequencesgeneratedbyrunningProgramP2_6withtheinputchangedtoasinusoidalsequenceareasfollows:

x=sin(2*pi*0.05*n);

Therelationbetweeny[n]andy2[n]inthiscaseis–sameastherelationabove

Project2.7Convolution

AcopyofProgramP2_7isreproducedbelow:

%ProgramP2_7

h=[321-210-403];

%impulseresponse

x=[1-23-4321];

%inputsequence

y=conv(h,x);

14;

subplot(2,1,1);

OutputObtainedbyConvolution'

x1=[xzeros(1,8)];

y1=filter(h,1,x1);

subplot(2,1,2);

stem(n,y1);

OutputGeneratedbyFiltering'

Q2.28Thesequencesy[n]andy1[n]generatedbyrunningProgramP2_7areshownbelow:

Thedifferencebetweeny[n]andy1[n]is-same

Thereasonforusingx1[n]astheinput,obtainedbyzero-paddingx[n],forgeneratingy1[n]is–thelengthofxis7,butthelengthoftheConvolutionis14,andn=14,weneedthelengthoffiltertobe14

Project2.8StabilityofLTISystems

AcopyofProgramP2_8isgivenbelow:

%ProgramP2_8

%Stabilitytestbasedonthesumoftheabsolute

%valuesoftheimpulseresponsesamples

num=[1-0.8];

den=[11.50.9];

N=200;

h=impz(num,den,N+1);

parsum=0;

fork=1:

N+1;

parsum=parsum+abs(h(k));

ifabs(h(k))<

10^(-6),break,end

end

N;

stem(n,h)

%Printthevalueofabs(h(k))

disp('

Value='

disp(abs(h(k)));

Q2.32Thediscrete-timesystemofProgramP2_8is-

[h,t]=impz(hd)computestheinstantaneousimpulseresponseofthediscrete-timefilterhdchoosingthenumberofsamplesforyou,andreturnstheresponseincolumnvectorhandavectoroftimesorsampleintervalsintwhere(t=[012...]'

).impzreturnsamatrixhifhdisavector.Eachcolumnofthematrixcorrespondstoonefilterinthevector.Whenhdisavectorofdiscrete-timefilters,impzreturnsthematrixh.Eachcolumnofhcorrespondstoonefilterinthevectorhd.

impz(hd)usesFVTooltoplottheimpulseresponseofthediscrete-timefilterhd.Ifhdisavectoroffilters,impzplotstheresponseandforeachfilterinthevector.

TheimpulseresponsegeneratedbyrunningProgramP2_8isshownbelow:

Thevalueof|h(K)|hereis-1.6761e-005

Fromthisvalue

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1