连续时间信号的基本运算

%连续时间信号的基本运算
%相加
clc;
clear;
t=-2:0.01:6;
u=(t>=0);
y=sin(pi*t);
ft=y+u;
plot(t,ft);
xlabel('时间(t)');
ylabel('幅值f(t)');
title('连续信号的相加');



%相乘
clc;
clear;
t=-2:0.01:6;
u=(t>=0);
y=sin(pi*t);
ft=y.*u;
plot(t,ft);
xlabel('时间(t)');
ylabel('幅值f(t)');
title('连续信号的相乘');



%移位
clc;
clear;
t=0:0.001:4;
y=sin(pi*(t));
y1=sin(pi*(t-0.5));
plot(t,y,'b',t,y1,'r');
xlabel('时间(t)');
ylabel('幅值f(t)');
title('连续信号的移位');



%翻转
clc;
clear;
t=-4:0.01:4;
u=(t>=0);
y=sin(pi*t);
ft=y.*u;
ft=fliplr(ft);
plot(t,ft);
xlabel('时间(t)');
ylabel('幅值f(t)');
title('连续信号的翻转');



%尺度变换
clc;
clear;
t=-4:0.001:4;
ft=tripuls(t,4,0.5);
subplot(3,1,1);
plot(t,ft);
grid on;
title('f(t)');
ft=tripuls(2*t,4,0.5);
subplot(3,1,2);
plot(t,ft);
grid on;
title('f(2t)');
ft=tripuls(0.5*t,4,0.5);
subplot(3,1,3);
plot(t,ft);
grid on;
title('f(0.5t)');

%倒相
clc;
clear;
t=-4:0.001:4;
ft=tripuls(t,4,0.5);
subplot(2,1,1);
plot(t,ft);
grid on;
title('f(t)');
ft=tripuls(t,4,0.5);
ft1=-ft;
subplot(2,1,2);
plot(t,ft1);
grid on;
title('-f(t)');

%微分
clc;
clear;
h=0.001;
t=-4:0.001:4;
ft=tripuls(t,4,0.5);
ft1=diff(ft)/h;%diff求差分
subplot(2,1,1);
plot(t,ft);
title('f(t)');
grid on;
subplot(2,1,2);
plot(t(1:length(t)-1),ft1);
title('df(t)/dt');
grid on;



clc;
clear;
t=-1:0.2:1;
syms t;%创建符号对象
ft=2*t*t;
ft1=int(ft);
subplot(2,1,1);
ezplot(ft);
grid on;
subplot(2,1,2);
ezplot(ft1);
grid on;




%练习
clc;
clear;
t=-10:0.01:10;
y1t=t;
y2t=(t>=0);
ft=y1t.*y2t;
plot(t,ft);
grid on;



clc;
clear;
k=-5:10;
f1k=[zeros(1,3),1,zeros(1,12)];
f2k=[zeros(1,10),1,zeros(1,5)];
fk=f1k-f2k;
stem(k,fk);


clc;
clear;
t=-1:0.01:1;
w=2*pi;
f1t=sin(w*t);
f2t=sin(8*w*t);
ft=f1t+f2t;
subplot(2,1,1);
plot(t,ft);
grid on;
ft=f1t.*f2t;
subplot(2,1,2);
plot(t,ft);
grid on;

在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值