p501.m
来自「这是在AR模型的功率谱估计」· M 代码 · 共 36 行
M
36 行
%program p501
clf %clear the variable
N=1000;
n=0:N-1;
Fs=500;
t=n/Fs;
Lag=100;
x=sin(2*pi*20*t)+0.6*randn(1,length(t));
[c,lags]=xcorr(x,Lag,'unbiased');
subplot(221);
plot(t,x)
xlabel('t');
ylabel('x(t)')
title('orignal signal x');
grid;
subplot(222);
plot(lags/Fs,c);
xlabel('t');
ylabel('Rx(t)')
title('autocorrelation');
grid;
x1=randn(1,length(x));
[c,lags]=xcorr(x1,Lag,'unbiased');
subplot(223);
plot(t,x1)
xlabel('t');
ylabel('x1(t)')
title( 'White Noise');
grid;
subplot(224);
plot(lags/Fs,c);
xlabel('t');
ylabel('Rx1(t)')
title('autocorrelation');
grid;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?