信号与系统 matlab答案
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
M2-3
(1) function yt=x(t)
yt=(t).*(t>=0&t<=2)+2*(t>=2&t<=3)-1*(t>=3&t<=5); (2)function yt=x (t)
yt=(t).*(t>=0&t<=2)+2*(t>=2&t<=3)-1*(t>=3&t<=5);
t=0:0.001:6;
subplot(3,1,1)
plot(t,x2_3(t))
title('x(t)')
axis([0,6,-2,3])
subplot(3,1,2)
plot(t,x2_3(0.5*t))
title('x(0.5t)')
axis([0,11,-2,3])
subplot(3,1,3)
plot(t,x2_3(2-0.5*t))
title('x(2-0.5t)')
axis([-6,5,-2,3])
图像为:
M2-5
(3) function y=un(k)
y=(k>=0)
untiled3.m
k=[-2:10]
xk=10*(0.5).^k.*un(k); stem(k,xk)
title('x[k]')
axis([-3,12,0,11])
M2-5
(6) k=[-10:10]
xk=5*(0.8).^k.*cos((0.9)*pi*k) stem(k,xk)
title('x[k]')
grid on
M2-7
A=1;
t=-5:0.001:5;
w0=6*pi;
xt=A*cos(w0*t);
plot(t,xt)
hold on
A=1;
k=-5:5;
w0=6*pi;
xk=A*cos(w0*0.1*k);
stem(k,xk)
axis([-5.5,5.5,-1.2,1.2])
title('x1=cos(6*pi*t)&x1[k]')
A=1;
t=-5:0.001:5;
w0=14*pi;
xt=A*cos(w0*t);
plot(t,xt)
hold on
A=1;
k=-5:5;
w0=14*pi;
xk=A*cos(w0*0.1*k);
stem(k,xk)
axis([-5.5,5.5,-1.2,1.2])
title('x2=cos(14*pi*t)&x2[k]')
A=1;
t=-5:0.1:5;
w0=26*pi;
xt=A*cos(w0*t);
plot(t,xt)
hold on
A=1;
k=-5:5;
w0=26*pi;
xk=A*cos(w0*0.1*k);
stem(k,xk)
axis([-5.5,5.5,-1.2,1.2])
title('x1=cos(26*pi*t)&x1[k]')
M2-9
(1)
k=-4:7;
xk=[-3,-2,3,1,-2,-3,-4,2,-1,4,1,-1];
stem(k,xk,'file')
(2) k=-12:21;
x=[-3,0,0,-2,0,0,3,0,0,1,0,0,-2,0,0,-3,0,0,-4,0,0,2,0,0,-1,0,0,4,0,0,1,0,0,-1]; subplot(2,1,1)
stem(k,x,'file')
title('3倍内插')
t=-1:2;
y=[-2,-2,2,1];
subplot(2,1,2)
stem(t,y,'file')
title('3倍抽取')
axis([-3,4,-4,4])
(3) k=-4:7;
x=[-3,-2,3,1,-2,-3,-4,2,-1,4,1,-1]; subplot(2,1,1)
stem(k+2,x,'file')
title('x[k+2]')
subplot(2,1,2)
stem(k-4,x,'file')
title('x[k-4]')
(4) k=-4:7;
x=[-3,-2,3,1,-2,-3,-4,2,-1,4,1,-1];
stem(-fliplr(k),fliplr(x),'file')
title('x[-k]')
M4-1
(1)对于周期矩形信号的傅里叶级数cn =-1/2j*sin(n/2*pi)*sinc(n/2) n=-15:15;
X=-j*1/2*sin(n/2*pi).*sinc(n/2);
subplot(2,1,1);
stem(n,abs(X),'file');
title('幅度谱')
xlabel('nw');
subplot(2,1,2);
stem(n,angle(X),'file'); title('相位谱')
(2)对于三角波信号的频谱是:Cn=-4
n2π2+
2
nπ
sin nπ
2
+
4
n2π2
cos nπ
2
n=-15:15;
X=sinc(n)-0.5*((sinc(n/2)).^2); subplot(2,1,1);
stem(n,abs(X),'file');
title('幅度谱')
xlabel('nw');
subplot(2,1,2);
stem(n,angle(X),'file');
title('相位谱')