1.Sa(t)函数的画法(代码与图如下):
t =-4*pi:0.01:4*pi; ft=sin(t)./t; plot(t,ft);
2.信号的平移,尺度变换,反褶等
t=-2:0.01:1;
y=1*(t>=(-2) & t<=(0))+(-1*t+1).*(t>(0) & t<=(1));
plot(t,y);
axis([-2 1 -1 2])
t1=t+2;
t2=t/3;
t3=-t;
t4=-(t+2)./3;
subplot(321),plot(t,y),axis([-2 1 -1 2]),xlabel('f(t)');
subplot(322),plot(t1,y),axis([0 3 -1 2]),xlabel('f(t-2)');
subplot(323),plot(t2,y),axis([-1 1 -1 2]),xlabel('f(3t)');
subplot(324),plot(t3,y),axis([-1 2 -1 2]),xlabel('f(-t)');
subplot(325),plot(t4,y),axis([-1 1 -1 2]),xlabel('f(-3t-2)');
3.信号运算之求导以及积分
syms x a;
A=diff(x*sin(x)*log(x),'x',1);
b=int(x.^5-a*x.^2+sqrt(x)./2,'x');
c=int(x*exp(x)./(1+x).^2,'x',0,1);
结果分别为:
A=sin(x) + log(x)*sin(x) + x*cos(x)*log(x)
b=x^(3/2)/3 - (a*x^3)/3 + x^6/6
c=exp(1)/2 - 1
4.信号的卷积之符号运算法:
syms tao;
t=sym('t','positive');
xt1=sym('heaviside(t)-heaviside(t-1)');
xt2=sym('heaviside(t)-heaviside(t-3)');
xt_tao=subs(xt1,t,tao)*subs(xt2,t,t-tao);
yt=int(xt_tao,tao,0,t);
yt=simplify(yt);
ezplot(yt,[0,2]);grid on;
注意:此处是门函数的卷积
5.信号卷积之数值求解法:
dt=0.01;
t=0:0.01:5;
n=length(t);
f1=( t>=0 )-( t>=2 );
f2=( t>=0 ) + ( t>=1 )-( t>=2 )-( t>=3 );
f=conv(f1,f2)*dt;
tt=(0:n-1)*dt;
subplot(221),plot(t,f1);
subplot(222),plot(t,f2);
subplot(223),plot(t,f);