test0802gauss.m
来自「信号处理实例」· M 代码 · 共 31 行
M
31 行
%---------------------------------------------------------------------------------------
% test0803gauss.m, for example 08.03
% gauss signal and its spectrum
% 2006.12.15 LYB
%----------------------------------------------------------------------------------------
clear;
N=64;
alpha=0.05;
a=alpha/pi;a=sqrt(a);a=sqrt(a);
tmt0=((1:N)-N/2-1)';
y = exp(-tmt0.^2 * alpha/2);
y=y.*a;
subplot(221)
plot((-N/2:N/2-1),y);grid on;
axis([-30 30 0 0.5]);
xlabel(' Gauss signal x(t)');
figure(1);
subplot(222)
dsp=fftshift(abs(fft(y)).^2);
plot((-N/2:N/2-1)./N,dsp);grid on;
axis([-0.2 0.2 0 20]);
xlabel(' the Spectrum of x(t)');
%[t0,T]=loctime(y)
%[f0,B]=locfreq(y)
%T*B
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?