MATLAB实验报告
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
实验一 名称:连续时间信号分析
姓名:王嘉琦 学号:0636 班级:通信二班
一、实验目的
(一)掌握使用Matlab 表示连续时间信号
1、学会运用Matlab 表示常用连续时间信号的方法
2、观察并熟悉常用信号的波形和特性
(二)掌握使用Matlab 进行连续时间信号的相关运算
1、学会运用Matlab 进行连续时间信号的时移、反褶和尺度变换
2、学会运用Matlab 进行连续时间信号微分、积分运算
3、学会运用Matlab 进行连续时间信号相加、相乘运算
4、学会运用Matlab 进行连续时间信号卷积运算
二、实验条件
Matlab
三、实验内容
1、利用Matlab 命令画出下列连续信号的波形图。
(1))4/3t (2cos π+
代码:
k=2;w=3;phi=pi/4;
t=0:0.01:3;
ft=k*cos(w*t+phi);
plot(t,ft),grid on;
axis([0,3,-2.2,2.2])
title('余弦信号')
(2)
)t (u )e 2(t --
代码:
k=-1;a=-1;
t=0:0.01:3;
ft=2-k*exp(a*t);
plot(t,ft),grid on
axis([0,3,2,3])
title('指数信号')
(3))]2()(u )][t (cos 1[--+t u t π
代码:
k=1;w=pi;phi=0;
t=0:0.01:2;
ft=1+k*cos(w*t+phi);
plot(t,ft),grid on;
axis([0,3,0,2])
title('余弦信号')
2、利用Matlab 命令画出复信号)4/t (j 2e )
t (f π+=的实部、虚部、模和辐角。
代码:
t=0:0.01:10;
k=2;a=0;b=1;phi=pi/4;
ft=k*exp(a+i*(b*t+phi));
subplot(2,2,1);plot(t,real(ft));title('实部');axis([0,10,-2.2,2.2]);grid on;
subplot(2,2,2);plot(t,imag(ft));title('虚部');axis([0,10,-2.2,2.2]);grid on;
subplot(2,2,3);plot(t,abs(ft));title('模');axis([0,10,0,6]);grid on;
subplot(2,2,4);plot(t,angle(ft));title('相角');axis([0,10,-4,4]);grid on;
3、已知信号的波形(课本P13例题1-1),画出()()()()2
t
f
f
,
t
f,
t
,的波形图。
f
3
2-
3
-t
-
-
代码:
function f=funct1(t)
f=uCT(t+2)-uCT(t)+(-t+1).*(uCT(t)-uCT(t-1));
function f=uCT(t)
f=(t>=0)
t=-2:0.01:4;
ft1=funct1(t-2);
ft2=funct1(3*t);
ft3=funct1(-t);
ft4=funct1(-3*t-2);
subplot(2,2,1)
plot(t,ft1);grid on;
title('f(t-2)');
axis([-2,4,-0.5,2])
subplot(2,2,2)
plot(t,ft2);grid on;
title('f(3t)');
axis([-2,4,-0.5,2])
subplot(2,2,3)
plot(t,ft3);grid on;
title('f(-t)');
axis([-2,4,-0.5,2])
subplot(2,2,4)
plot(t,ft4);grid on;
title('f(-3t-2)');
axis([-2,4,-0.5,2])
4、使用微分命令求xsinxlnx y =关于变量x 的一阶导数;使用积分命令
计算不定积分 dx x ax x ⎰⎪⎪⎭
⎫ ⎝⎛+-225,定积分()dx x xe x ⎰+1021。
(1)
(2)
(3)
5、已知()()()t t f t t f Ω=Ω=8sin ,sin 21,使用命令画出两信号和及两信号乘积的波形图。其中,Hz f 12=Ω=
π
代码:
f=1;
t=0:0.01:3/f;
f1=sin(2*pi*f*t);
f2=sin(2*pi*8*f*t);
subplot(2,1,1)
plot(t,f1+1,':',t,f1-1,':',t,f1+f2) grid on,title('f1(t)+f2(t)') subplot(2,1,2)
plot(t,f1,':',t,-f1,':',t,f1.*f2) grid on,title('f1(t)*f2(t)')
6、用Matlab命令绘出下列信号的卷积积分())(2
1t
f
t
f*的时域波形图。代码:
function[f,t]=ctsconv(f1,f2,t1,t2,dt)
f=conv(f1,f2);
f=f*dt;
ts=min(t1)+min(t2);
te=max(t1)+max(t2);
t=ts:dt:te;
subplot(2,2,1)
plot(t1,f1);grid on;
axis([min(t1),max(t1),min(f1)-abs(min(f1)*0.2),max(f1)+abs(max(f1)*0.2)]) title('f1(t)');xlabel('t')
subplot(2,2,2)
plot(t2,f2);grid on;
axis([min(t2),max(t2),min(f2)-abs(min(f2)*0.2),max(f2)+abs(max(f2)*0.2)]) title('f2(t)');xlabel('t')
subplot(2,1,2)