高二下期信号与系统实验(MATLAB)
一、信号的时域分析及MATLAB实现
1.(1)f(t)=2sin(2t)/t,求f(-3t+5) syms t;
f=sym('2*sin(2*t)/t'); f1=subs(f,t,t+5); f2=subs(f1,t,3*t); f3=subs(f2,t,-t);
subplot(2,2,1);ezplot(f,[-8,8]);grid on; subplot(2,2,2);ezplot(f1,[-8,8]);grid on; subplot(2,2,3);ezplot(f2,[-8,8]);grid on; subplot(2,2,4);ezplot(f3,[-8,8]);grid on;
(2)f(k)=sin(100k),求f(k-10)
n=-pi:0.1:pi; x=sin(100*(n-10)); stem(n,x)
(3)f(k)=3ε(k),求f(-k-5)
clear,k0=-20;kf=10;ks=-4;
k2=k0:kf;x2=3*[ones(1,ks-k0),zeros(1,kf-ks+1)]; stem(k2,x2,'.');title('阶跃信号')
2.(1)f1(t)=e^(-5t),f2(t)=5sin(60*pi*t),求f1(t)+f2(t), f1(t) x f2(t)
t=0:0.03:1; f1=exp(-5*t); f2=5*sin(60*pi*t); f3=f1+f2; f4=f1.*f2;
subplot(2,2,1);plot(t,f1);title('f1(t)'); subplot(2,2,2);plot(t,f2);title('f2(t)'); subplot(2,2,3);plot(t,f3);title('f1+f2'); subplot(2,2,4);plot(t,f4);title('f1*f2');
(2) f1(k)=δ(k-5),f2(k)= ε(k-2),求f1(k)+f2(k), f1(k) x f2(k)
clear,k0=1;kf=10;ks=5;
k2=k0:kf;x1=[zeros(1,ks-k0),1,zeros(1,kf-ks)]; subplot(2,2,1),stem(k2,x1,'.');title('f1'); clear,k0=1;kf=10;ks=2;
k2=k0:kf;x2=[zeros(1,ks-k0),ones(1,kf-ks+1)]; subplot(2,2,2),stem(k2,x2,'.');title('f2'); x1=[0,0,0,0,1,0,0,0,0,0]; x2=[0,1,1,1,1,1,1,1,1,1]; k2=1:length(x1);
subplot(2,2,3);stem(k2,x1+x2);title('f1+f2'); subplot(2,2,4);stem(k2,x1.*x2);title('f1.*f2');
(3)f1=[2,5,-2,0,3,3,7,8];f2=[1,1,2,4,0,0,-2,-1];求f1+f2,f1xf2
f1=[2,5,-2,0,3,3,7,8]; f2=[1,1,2,4,0,0,-2,-1]; n=1:length(f2);
subplot(2,2,1);stem(n,f1);title('f1'); subplot(2,2,2);stem(n,f2);title('f2'); subplot(2,2,3);stem(n,f1+f2);title('f1+f2'); subplot(2,2,4);stem(n,f1.*f2);title('f1.*f2');