Scilab Function
Last update : 31/3/2006
CORRCROIS - Extension of the corr function
Calling Sequence
-
C = CORRCROIS(u,v,DecalNegMax,DecalPosMax)
Parameters
-
u
: First signal (Matrix [Nx1])
-
v
: Second signal (Matrix [Nx1])
-
DecalNegMax
: Maximal value of negative lag (u is shifted toward the future) between u and v. DecalNegMax is a positive integer !
-
DecalPosMax
: Maximal value of positive lag (u is shifted toward the past) between u and v. DecalPosMax is a positive integer !
-
C
: Result of the cross correlation analysis (Matrix [DecalNegMax+DecalPosMax x 2], first column = lag value, second column = coefficient of correlation)
Description
-
The function permit to locate the lag that optimises the cross correlation between two series.
This function is different from corr because it allows negative lags.
Examples
x=(0:0.1:10)';e=rand(size(x,1),1);
y1=sin(x)+e;
y2=sin(x+%pi/4)+e;
R=CORRCROIS(y1,y2,20,20);
subplot(2,1,1),plot2d([y1 y2])
subplot(2,1,2),plot2d(R(:,1),R(:,2))
See Also
corr
,
Authors
-
Julien Lerat
CEMAGREF Antony, HBAN Unit, julien.lerat@cemagref.fr