数字信号处理实验报告.docx

上传人:b****6 文档编号:12667346 上传时间:2023-06-07 格式:DOCX 页数:21 大小:659.80KB
下载 相关 举报
数字信号处理实验报告.docx_第1页
第1页 / 共21页
数字信号处理实验报告.docx_第2页
第2页 / 共21页
数字信号处理实验报告.docx_第3页
第3页 / 共21页
数字信号处理实验报告.docx_第4页
第4页 / 共21页
数字信号处理实验报告.docx_第5页
第5页 / 共21页
数字信号处理实验报告.docx_第6页
第6页 / 共21页
数字信号处理实验报告.docx_第7页
第7页 / 共21页
数字信号处理实验报告.docx_第8页
第8页 / 共21页
数字信号处理实验报告.docx_第9页
第9页 / 共21页
数字信号处理实验报告.docx_第10页
第10页 / 共21页
数字信号处理实验报告.docx_第11页
第11页 / 共21页
数字信号处理实验报告.docx_第12页
第12页 / 共21页
数字信号处理实验报告.docx_第13页
第13页 / 共21页
数字信号处理实验报告.docx_第14页
第14页 / 共21页
数字信号处理实验报告.docx_第15页
第15页 / 共21页
数字信号处理实验报告.docx_第16页
第16页 / 共21页
数字信号处理实验报告.docx_第17页
第17页 / 共21页
数字信号处理实验报告.docx_第18页
第18页 / 共21页
数字信号处理实验报告.docx_第19页
第19页 / 共21页
数字信号处理实验报告.docx_第20页
第20页 / 共21页
亲,该文档总共21页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

数字信号处理实验报告.docx

《数字信号处理实验报告.docx》由会员分享,可在线阅读,更多相关《数字信号处理实验报告.docx(21页珍藏版)》请在冰点文库上搜索。

数字信号处理实验报告.docx

数字信号处理实验报告

Name:

Section:

LaboratoryExercise2

DISCRETE-TIMESYSTEMS:

TIME-DOMAINREPRESENTATION

2.1SIMULATIONOFDISCRETE-TIMESYSTEMS

Project2.1TheMovingAverageSystem

AcopyofProgramP2_1isgivenbelow:

%ProgramP2_1

%SimulationofanM-pointMovingAverageFilter

%Generatetheinputsignal

n=0:

100;

s1=cos(2*pi*0.05*n);%Alow-frequencysinusoid

s2=cos(2*pi*0.47*n);%Ahighfrequencysinusoid

x=s1+s2;

%Implementationofthemovingaveragefilter

M=input('Desiredlengthofthefilter=');

num=ones(1,M);

y=filter(num,1,x)/M;

%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);

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

xlabel('Timeindexn');ylabel('Amplitude');

title('Signal#2');

subplot(2,2,3);

plot(n,x);

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

xlabel('Timeindexn');ylabel('Amplitude');

title('InputSignal');

subplot(2,2,4);

plot(n,y);

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

xlabel('Timeindexn');ylabel('Amplitude');

title('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

clf;

n=0:

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)

xlabel('Timeindexn');ylabel('Amplitude');

title('InputSignal')

subplot(2,1,2)

plot(n,y)

xlabel('Timeindexn');ylabel('Amplitude');

title('Outputsignal');

Answers:

Q2.5Thesinusoidalsignalswiththefollowingfrequenciesastheinputsignalswereusedtogeneratetheoutputsignals:

Theoutputsignalsgeneratedforeachoftheaboveinputsignalsaredisplayedbelow:

Theoutputsignalsdependonthefrequenciesoftheinputsignalaccordingtothefollowingrules:

Thisobservationcanbeexplainedmathematicallyasfollows:

Project2.3LinearandNonlinearSystems

AcopyofProgramP2_3isgivenbelow:

%ProgramP2_3

%Generatetheinputsequences

clf;

n=0:

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);

ylabel('Amplitude');

title('OutputDuetoWeightedInput:

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

subplot(3,1,2)

stem(n,yt);

ylabel('Amplitude');

title('WeightedOutput:

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

subplot(3,1,3)

stem(n,d);

xlabel('Timeindexn');ylabel('Amplitude');

title('DifferenceSignal');

Answers:

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

%Generatetheinputsequences

clf;

n=0:

40;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];

num=[2.24032.49082.2403];

den=[1-0.40.75];

ic=[00];%Setinitialconditions

%Computetheoutputy[n]

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

%Computetheoutputyd[n]

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

%Computethedifferenceoutputd[n]

d=y-yd(1+D:

41+D);

%Plottheoutputs

subplot(3,1,1)

stem(n,y);

ylabel('Amplitude');

title('Outputy[n]');grid;

subplot(3,1,2)

stem(n,yd(1:

41));

ylabel('Amplitude');

title(['OutputduetoDelayedInputx[n?

num2str(D),']']);grid;

subplot(3,1,3)

stem(n,d);

xlabel('Timeindexn');ylabel('Amplitude');

title('DifferenceSignal');grid;

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

clf;

N=40;

num=[2.24032.49082.2403];

den=[1-0.40.75];

y=impz(num,den,N);

%Plottheimpulseresponse

stem(y);

xlabel('Timeindexn');ylabel('Amplitude');

title('ImpulseResponse');grid;

Answers:

Q2.19Thefirst41samplesoftheimpulseresponseofthediscrete-timesystemofProject2.3generatedbyrunningProgramP2_5isgivenbelow:

Project2.6CascadeofLTISystems

AcopyofProgramP2_6isgivenbelow:

%ProgramP2_6

%CascadeRealization

clf;

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

n=0:

40;

%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);

stem(n,y);

ylabel('Amplitude');

title('Outputof4thorderRealization');grid;

subplot(3,1,2);

stem(n,y2)

ylabel('Amplitude');

title('OutputofCascadeRealization');grid;

subplot(3,1,3);

stem(n,d)

xlabel('Timeindexn');ylabel('Amplitude');

title('DifferenceSignal');grid;

Answers:

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

clf;

h=[321-210-403];%impulseresponse

x=[1-23-4321];%inputsequence

y=conv(h,x);

n=0:

14;

subplot(2,1,1);

stem(n,y);

xlabel('Timeindexn');ylabel('Amplitude');

title('OutputObtainedbyConvolution');grid;

x1=[xzeros(1,8)];

y1=filter(h,1,x1);

subplot(2,1,2);

stem(n,y1);

xlabel('Timeindexn');ylabel('Amplitude');

title('OutputGeneratedbyFiltering');grid;

Answers:

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

clf;

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

%Plottheimpulseresponse

n=0:

N;

stem(n,h)

xlabel('Timeindexn');ylabel('Amplitude');

%Printthevalueofabs(h(k))

disp('Value=');disp(abs(h(k)));

Answers:

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

Fromthisvalueand

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

当前位置:首页 > 法律文书 > 调解书

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2