📄 ar1signv.m
字号:
function [g,a,c,g0,a0,c0]=ar1signv(x,sig)
% AR1SIGNV - AR(1) model estimation for noise component of data.
% Syntax: [g,a,c,g0,a0,c0]=ar1signv(x,sig);
% Naively estimates the parameters for a composite null-hypothesis
% of signal + AR(1) noise. The signal is subtracted from the data,
% and the AR(1) parameters are estimated from the residual.
%
% Input: x - the data vector.
% sig - the signal vector
%
% Output: g - estimate of the lag-one noise autocorrelation.
% a - estimate of the noise innovation variance.
% c - estimated lag-zero covariance of the noise.
% g0 - poor estimate of the lag-one noise autocorrelation.
% a0 - poor estimate of the noise innovation variance.
% c0 - poorly estimated lag-zero covariance of the noise.
%
% Written by Eric Breitenberger. Version 1/21/96
% Please send comments and suggestions to eric@gi.alaska.edu
%
x=x(:);
sig=sig(:);
N=length(x);
if length(sig)~=N, error('Data and signal must have same length.'), end
% Noise model:
n=x-sig;
% Lag zero and one covariance estimates:
c0=n'*n/N;
c1n=n(1:N-1)'*n(2:N)/(N-1);
c0x=x'*x/N;
c1x=x(1:N-1)'*x(2:N)/(N-1);
c0s=sig'*sig/N;
c1s=sig(1:N-1)'*sig(2:N)/(N-1);
% Really naive estimate based on noise variance:
g0=c1n/c0;
a0=sqrt((1-g0^2)*c0);
% A better method: Subtract model covar. from data covar.
c=c0x-c0s;
g=(c1x-c1s)/c;
a=sqrt((1-g^2)*c);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -