physionet icon indicating copy to clipboard operation
physionet copied to clipboard

Bug in Cross-Sampen for Matlab

Open Bertruss opened this issue 7 years ago • 1 comments

The reference at the top of the function mentions that sflag enables standardizing of the two signals via the snippet below. But this code does nothing to normalize the two signals, and I believe it is the y=y/sx that is to blame. I would think it should be x=x/sx instead, unless I'm mistaken.

if sflag>0
   y=y-mean(y);
   sy=sqrt(mean(y.^2));   
   y=y/sy;
   x=x-mean(x);
   sx=sqrt(mean(x.^2));   
   y=y/sx;   
end

before the code, two example sets plot like this: unmodified

after the code: modified-wrong

with y=y/sx changed to x=x/sx: modified-right

This indicates to me that it is indeed an error.

Bertruss avatar Oct 05 '17 21:10 Bertruss

Should I have created this issue somewhere else?

Bertruss avatar Oct 24 '17 20:10 Bertruss