杭电信号与系统实验

  • 格式:doc
  • 大小:42.50 KB
  • 文档页数:6

1
第十一章:
1.
clear all;
close all;
t=-10:0.01:10;
ft=exp(abs(-0.4*t));
plot(t,ft)
2
clear all;
close all;
h=0.001
t=-3:h:3;

%ft的函数表达式%
ft=0.5*exp(-2*t).*stepfun(t,0);
%ft1的函数表达式%
ft1=0.5*exp(-2*(t-1)).*stepfun(t-1,0);
%ft的导数表达式%
y1=diff(ft)*1/h;
%产生ft的波形%
subplot(3,1,1)
plot(t,ft);

title('f(t)波形');

%产生ft1的波形%
subplot(3,1,2)
plot(t,ft1);

title('f(t-1)的波形');

%产生ft的微分波形%
subplot(3,1,3)
plot(t(1:length(t)-1),y1);

title('f(t)的微分波形');

第十二章:
1). clear all;
close all;
2

syms t f;
f=fourier(cos(2*t).*sin(3*t));
ezplot(f);

2). clear all;
close all;
r=0.02;
t=-5:r:5;
N=200;
w=2*pi;
k=-N:N;
w=k*w/N;
f1=sinc(t/pi);
F=r*f1*exp(-j*t'*w);
F1=abs(F);
P1=angle(F);
subplot(3,1,1);
plot(t,f1);
grid on;
xlabel('t');
ylabel('f(t)');
title('f(t)');
subplot(3,1,2)
plot(w,F1);
xlabel('w');
grid on;
ylabel('F(jw)');
subplot(3,1,3);
plot(w,P1*180/pi);
grid;
xlabel('w');
ylabel('相位(度)');

3). clear all;
close all;
syms t w;
ifourier((((sin(w/4))/(w/4))^2),t);ans

4).
clear all;
close all;
r=0.02;
t=-5:r:5;
3

N=200;
w=2*pi;
k=-N:N;
w=k*w/N;
f1=sin(2*pi*3*t+eps)./(pi*3*t+eps);
F=r*f1*exp(-j*t'*w);
F1=abs(F);
P1=angle(F);
subplot(3,1,1);
plot(t,f1);
grid on;
xlabel('t');
ylabel('f(t)');
title('f(t)');
subplot(3,1,2)
plot(w,F1);
xlabel('w');
grid on;
ylabel('F(jw)');
subplot(3,1,3);
plot(w,P1*180/pi);
grid;
xlabel('w');
ylabel('相位(度)');

clear all;
close all;
r=0.02;
t=-5:r:5;
N=200;
w=2*pi;
k=-N:N;
w=k*w/N;
f1=sin(2*pi*(t-2)+eps)./(pi*(t-2)+eps);
F=r*f1*exp(-j*t'*w);
F1=abs(F);
P1=angle(F);
subplot(3,1,1);
plot(t,f1);
grid on;
xlabel('t');
ylabel('f(t)');
title('f(t)');
4

subplot(3,1,2)
plot(w,F1);
xlabel('w');
grid on;
ylabel('F(jw)');
subplot(3,1,3);
plot(w,P1*180/pi);
grid;
xlabel('w');
ylabel('相位(度)');

clear all;
close all;
r=0.02;
t=-5:r:5;
N=200;
w=2*pi;
k=-N:N;
w=k*w/N;
f1=sin(2*pi*(t/3)+eps)./(pi*(t/3)+eps);
F=r*f1*exp(-j*t'*w);
F1=abs(F);
P1=angle(F);

subplot(3,1,1);
plot(t,f1);
grid on;
xlabel('t');
ylabel('f(t)');
title('f(t)');

subplot(3,1,2)
plot(w,F1);
xlabel('w');
grid on;
ylabel('F(jw)');

subplot(3,1,3);
plot(w,P1*180/pi);
grid;
xlabel('w');
5

ylabel('相位(度)');
第十三章
syms s real;
a=[0,1,8,16];
b=[1,0,2,1];
sn=[s^3,s^2,s,1];
A=a*sn';
B=b*sn';
H=B/A;
e=sym('(1-t)*(Heaviside(t)-Heaviside(t-2))-(Heaviside(t-2)-Heaviside(t-3))');
E=laplace(e);
Vos=H.*E;
Vo=ilaplace(Vos);
Vo=vpa(Vo,4);
ezplot(Vo,[0,10])
axis([0,10,-8,1])
第十四章
clear all;
close all;
for k=1:20;
f1(k)=2^k*k;
f2(k)=(-1)^k-(-2)^k;
end
y=conv(f1,f2);
y0=0;
yf=[y0 y(1:19)];
ny=1:20;
figure(1);
stem(ny-1,yf);
grid on;
xlabel('ny');
ylabel('yf');
title('离散系统的零状态响应');

y0=1;
y(1)=2;
y(2)=-6;
for k=3:20;
y(k)=2^(k-1)*(k-1)-3*y(k-1)-2*y(k-2);
end
yy=[y0 y(1:19)];
k=1:20;
figure(2);
6

stem(k-1,yy);
grid on;
xlabel('k');
ylabel('y(k)');
title('系统全响应');

k=1:20;
figure(3);
stem(k-1,yy-yf);
grid on;
xlabel('k');
ylabel('y(k)');
title('零输入响应');