MIT-LCP / MIT-LCP/physionet

Bug in Cross-Sampen for Matlab

Open
#49 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
82
Forks
21
Avg merge
35m
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the Cross-Sampen function and read the sflag normalization block shown in the issue. Reproduce the two example plots, verify that both signals are centered and standardized, and consider the issue done when the corrected branch produces the expected normalized result.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.