shiyubianhuan.m

来自「经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助」· M 代码 · 共 47 行

M
47
字号
%信号的平移、反褶和倒相运算  程序名:shiyubianhuan
%设f(t)=(t/4+1)[u(t+2)-u(t-2)]
%本程序分别画出f(t+5)、f(t-5)、f(-t)以及-f(t)的波形,同时还给出f(t)在时域中波形的压缩和扩展

%画f(t)=(t/4+1)[u(t+2)-u(t-2)]的波形
syms t;
f=sym('(t/4+1)*(u(t+2)-u(t-2))');
subplot(3,2,1);
ezplot(f,[-12,12]),grid on;


%画f(t)的左移波形
t0=input('请输入左移位移量t0=')
y1=subs(f,t,t+t0)
subplot(3,2,3)
ezplot(y1,[-12,12]),grid on
text(5,1.2,'信号左移')

%画f(t)的右移波形
t0=input('请输入右移位移量t0=')
y2=subs(f,t,t-t0);
subplot(3,2,5);
ezplot(y2,[-12,12]),grid on;
text(-5,1.2,'信号右移');


%画f(t)的反褶波形
y3=subs(f,t,-t);
subplot(3,2,2);
ezplot(y3,[-12,12]),grid on;
text(5,1.2,'信号反褶');

%画f(2t)的波形---波形压缩
a=input('请输入压缩系数a=');
y5=subs(f,t,a*t);
subplot(3,2,4);
ezplot(y5,[-12,12]),grid on;
text(5,1.2,'信号压缩')


%画f(0.5t)的波形---波形扩展
a=input('请输入扩展系数a=');
y6=subs(f,t,a*t);
subplot(3,2,6);
ezplot(y6,[-12,12]),grid on;
text(5,1.2,'信号扩展');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?