MATLAB使用手记(三):高斯脉冲及其高阶导
高斯脉冲
单周期高斯脉冲公式一般如下:
\[g(t)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{t^2}{2\sigma^2}}
\]
matlab代码
sigma = 1;
N=100;
x=linspace(-4,4,N);
syms t;
gp(t) = 1/(sqrt(2*pi)*sigma)*exp(-power(t,2)/(2*power(sigma,2))); %高斯脉冲
subplot(1,5,1);
plot(x,gp(x));
title('高斯脉冲') ;
grid on;
subplot(1,5,2);
y=diff(gp,t,1); %高斯脉冲一阶导
plot(x,y(x));
title('1 order');
grid on;
subplot(1,5,3);
y=diff(gp,t,2); %高斯脉冲二阶导
plot(x,y(x));
title('2 order');
grid on;
subplot(1,5,4);
y=diff(gp,t,3); %高斯脉冲三阶导
plot(x,y(x));
title('3 order');
grid on;
subplot(1,5,5);
y=diff(gp,t,4); %%高斯脉冲四阶导
plot(x,y(x));
title('4 order');
grid on;