exp4.m.svn-base
来自「平稳信号的模拟与特征估计 随机信号课程实验」· SVN-BASE 代码 · 共 39 行
SVN-BASE
39 行
a1=0.1;
N1=500;
sigma1=1;
u1=randn(N1,1);
x(1)=sigma1*u1(1)/sqrt(1-a1^2);
for i=2:N1
x(i)=a1*x(i-1)+sigma1*u1(i);
end
figure;
subplot(1,2,1)
plot(x)
title('stochastic signal with less auto-correlation');
r1=xcorr(x)/15000;
f1=fft(r1);
fx=(0:length(f1)-1)*1000/length(f1);
subplot(1,2,2)
plot(fx,10*log10(abs(f1)));
title('power-spectrum');
a1=0.8;
N1=500;
sigma1=1;
u1=randn(N1,1);
x(1)=sigma1*u1(1)/sqrt(1-a1^2);
for i=2:N1
x(i)=a1*x(i-1)+sigma1*u1(i);
end
figure;
subplot(1,2,1)
plot(x)
title('stochastic signal with great auto-correlation');
r1=xcorr(x)/15000;
f1=fft(r1);
fx=(0:length(f1)-1)*1000/length(f1);
subplot(1,2,2)
plot(fx,10*log10(abs(f1)));
title('power-spectrum');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?