git-svn-id: http://moon:8086/svn/matlab/trunk@153 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
2021-03-22 20:28:22 +00:00
parent 1b5742e13e
commit b31f3e7435
140 changed files with 6054 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
% correl(x,y,N)
function rxy = corrph(x,y,S)
L = lge(x);
N = L-S;
if (N == 0)
error('N = 0 !');
end;
for s=0:S-1,
%rxy(s)=sum(x(S-s+1:L-s+1).*y(S:L))^2/(sum(x(S-s+1:L-s+1).^2)*sum(y(S:L).^2));
%rxy(s)=abs(sum(x(S-s+1:L-s+1).*y(S:L)))/(sum(abs(x(S-s+1:L-s+1).*y(S:L)))+0.0001);
rxy(s+1)=sum(x(1:L-S).*y(1+s:L-S+s))/(sum(abs(x(1:L-S).*y(1+s:L-S+s)))+0.001);
%rxy(s+1)=sum((x(1:L-S).^2).*(y(1+s:L-S+s).^2))/(sum(x(1:L-S).^2 + y(1+s:L-S+s).^2) +0.001);
end;