实验一 连续信号的时域分析
一、实验目的
1、熟悉MATLAB 软件。
2、掌握常用连续信号与离散信号的MATLAB 表示方法。
二、实验设备
安装有matlab6.5 以上版本的PC 机一台。
三、实验原理
四、实验内容
1、用MATLAB表示连续信号: ,Acos(ω0 t +ϕ ),Asin(ω0 t +ϕ
)。
源程序:
clc
clear
close
syms t;
f1=6*exp(t);
f2=6*cos(3*t+6);
f3=6*sin(3*t+6);
subplot(2,2,1);
ezplot(f1,[-8,8]);
xlabel('t');
title('f(t)=6e^t');
grid on;
subplot(2,2,2);
ezplot(f2,[-8,8]);
xlabel('t');
title('f(t)=6*cos(3*t+6)');
grid on;
subplot(2,2,3)
ezplot(f3,[-8,8]);
xlabel('t');
title('f(t)=6*sin(3*t+6)');
grid on;
2.用MATLAB表示抽样信号(sinc(t))、矩形脉冲信号(rectpuls(t,
width))
及三角脉冲信号(tripuls(t, width, skew))。
源程序:
clc
clear
close
t=-6:0.01:6;
f1=sinc(t);
f2=rectpuls(t,2);
f3=4*tripuls(t,4,0);
subplot(2,2,1);
plot(t,f1);
xlabel('t');
title('f(t)=sinc(t)');
grid on;
subplot(2,2,2);
plot(t,f2);
xlabel('t');
axis([-6,6,-1,3]);
title('f(t)=rectpuls(t,2)');
grid on;
subplot(2,2,3);
plot(t,f3);
xlabel('t');
title('f(t)=tripuls(t,4,0)');
grid on;
3、编写如图3 的函数并用MATLAB 绘出满足下面要求的图形。
(1) f (−t); (2) f (t − 2); (3) f (1− 2t); (4) f (0.5t +1).
源程序:
clc
clear
close
t0=-1:0.02:14;
t1=-15:0.02:4;
t2=0:0.02:15;
t3=-7:0.02:2;
t4=-5:0.02:24;
f0=4*rectpuls(t0-6,12)+3*tripuls(t0-6,4,0);
f1=4*rectpuls(-t1-6,12)+3*tripuls(-t1-6,4,0);
f2=4*rectpuls(t2-8,12)+3*tripuls(t2-8,4,0);
f3=4*rectpuls(-2*t3-5,12)+3*tripuls(-2*t3-5,4,0);
f4=4*rectpuls(0.5*t4-5,12)+3*tripuls(0.5*t4-5,4,0);
subplot(3,2,1);
plot(t0,f0);
xlabel('t');
title('f(t)');
grid on;
subplot(3,2,2);
plot(t1,f1);
xlabel('t');
title('f(-t)');
grid on;
subplot(3,2,3);
plot(t2,f2);
xlabel('t');
title('f(t-2)');
grid on;
subplot(3,2,4);
plot(t3,f3);
xlabel('t');
title('f(1-2t)');
grid on;
subplot(3,2,5);
plot(t4,f4);
xlabel('t');
title('f(0.5*t+1)');
grid on;
实验总结:
实验二 连续时间系统的时域分析
一、实验目的
1、掌握卷积计算方法。
2、掌握函数lsim,impulse,step 的用法,lsim 为求取零状态响应,
impulse 为求取单位脉冲响应,step 为求取单位阶跃响应。
3、运用课堂上学到的理论知识,从RC、RL 一阶电路的响应中正确
区分零输入响应、零状态响应、自由响应与受迫响应。
二、实验设备
安装有matlab6.5 以上版本的PC 机一台。
三、实验原理
四、实验内容
1. 分别用函数lsim 和卷积积分两种方法求如图7 所示系统的零状态
响应。其中L=1,R=2,e(t) = ε(t),i(0− ) = 2。
源程序:
方法一:
clc
clear
close
t=0:0.01:10;
f=exp(-t);
a=[1 2];
b=[1];
y=lsim(b,a,f,t);
plot(t,y);
axis([0,10,-0.03,0.3]);
xlabel('Time(sec)');
ylabel('i(t)');
grid on;
方法二:
卷积法求零状态响应先求冲激响应为h= ε(t)
clc
clear
close
syms t x;
e=exp(-x);
h=exp(-2.*(t-x));
i=int(e.*h,x,0,t);
ezplot(i, [0 10]);
xlabel('time(sec)');
ylabel('i(t)');
title('f=exp(-t)*exp(-2t)');
grid on;
2. 求上述系统的冲激响应与阶跃响应。
一:冲激响应
源程序:
clc
clear
close
a=[1 2];
b=[0 1];
impulse(b,a,0:0.01:10);
plo