基本信号在MATLAB中的表示和运算

一.实验目的
1.熟悉MATLAB软件的使用
2.用matlab表示表示常用信号和进行信号基本运算

二.实验内容

1.指数信号
A=1;a=-0.4;
t=0:0.01:10;
ft=Aexp(at)
plot(t,ft);
grid on;
在这里插入图片描述

2.正弦信号
A=1;w=2pi;phi=pi/6;
t=0:0.01:8;
ft=A
sin(w*t+phi);
plot(t,ft);
grid on;
在这里插入图片描述

3.抽样信号
t=-3pi:pi/100:3pi;
ft=sinc(t/pi);
plot(t,ft)
grid on
title(‘抽样信号’)
在这里插入图片描述

4.三角信号
t=-3:0.01:3;
ft=tripuls(t,4,0.5);
plot(t,ft);
grid on;
axis([-3,3,-0.5,1.5]);
在这里插入图片描述

5.虚指数信号
t=0:0.01:15;
w=pi/4;
X=exp(jwt);
Xr=real(X);
Xi=imag(X);
Xa=angle(X);
Xn=angle(X);
subplot(2,2,1)
plot(t,Xr)
axis([0,15,-(max(Xa)+0.5),max(Xa)+0.5]),
title(‘实部’)
在这里插入图片描述

6.复指数信号
t=0:0.01:3;
a=-1;b=10;
f=exp((a+j*b)*t);
subplot(2,2,1),
plot(t,real(f)),title(‘实部’)
subplot(2,2,3),
plot(t,imag(f)),title(‘虚部’)
subplot(2,2,2),
plot(t,abs(f)),title(‘模’)
subplot(2,2,4),
plot(t,angle(f)),title(‘相角’)
在这里插入图片描述

7.矩形脉冲信号
t=-2:0.01:2;
width=1;
ft=2*rectpuls(t,width);
plot(t,ft)
grid on;
在这里插入图片描述

8.单位阶跃信号
t=-1:0.01:5;
ft=(t>=0);
plot(t,ft);
grid on;
axis([-1,5,-0.5,1.5]);
在这里插入图片描述

9.正弦信号
syms t
y=sin(pi/4*t)
ezplot(y,[-16,16])

或者
f=sym(sin(pi/4*t))
ezplot(f,[-16,16])
在这里插入图片描述

10.单位阶跃信号
t=-1:0.01:3;
f=heaviside(t);
plot(t,f)
axis([-1,3,-0.2,1.2])

在这里插入图片描述

11.以f(t)三角信号为例,求f(2t).f(2-2t)

t=-3:0.001:3;
ft=tripuls(t,4,0.5);
subplot(3,1,1);
plot(t,ft)
grid on
title(‘f(t)’)
ft1=tripuls(2t,4,0.5);
subplot(3,1,2);
plot(t,ft1);
grid on;
title(‘f(2t)’)
ft2=tripuls(2-2
t,4,0.5);
subplot(3,1,3);
plot(t,ft2);
grid on;
title(‘f(2-2t’);
在这里插入图片描述

12.f1(t)=sinwt,f2(t)=sin8wt,w=2pi,求f1(t)+f2(t)和f1(t)f2(t)波形图
w=2pi;
t=0:0.01:3;
f1=sin(w
t);
f2=sin(8wt);
subplot(211)
plot(t,f1+1,’:’,t,f1-1,’:’,t,f1+f2)
grid on,title(‘f1(t)+f2(t)’)
subplot(212)
plot(t,f1,’:’,t,-f1,’:’,t,f1.*f2)
grid on,
title(‘f1(t)*f2(t)’)

在这里插入图片描述

13.求一阶导数 Y1=sin(ax2) , y2=xsinxlnx

syms a x y1 y2
y1=sin(ax^2)
y2=x
sin(x)*log(x);
dy1=diff(y1,‘x’)
dy2=diff(y2)
在这里插入图片描述

14.求积分
在这里插入图片描述
在这里插入图片描述

syms a x y3 y4
y3=x5-a*x2+sqrt(x)/2;
y4=(x*exp(x))/(1+x)^2;
iy3=int(y3,‘x’)
iy4=int(y4,0,1)

在这里插入图片描述

15.离散时间序列波形
k=-3:3;
f=[1,2,-1,3,2,4,-1];
stem(k,f,‘filled’);
axis([-4,4,-1.5,4.5])

在这里插入图片描述

  • 6
    点赞
  • 42
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wliiiams

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值