User Tools

Site Tools


heartbeats

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
heartbeats [2010/05/28 23:43] – Updating to new version jochenheartbeats [2010/06/14 23:33] jochen
Line 8: Line 8:
 The [[xff]] IO reading class now supports reading the following formats: The [[xff]] IO reading class now supports reading the following formats:
   * ACQ (up until version <= 3.9.7)   * ACQ (up until version <= 3.9.7)
-  * TXT (use ''<nowiki>object = xff('*.ntt');</nowiki>'' to read!+  * TXT (use ''<nowiki>object = xff('*.ntt');</nowiki>'' to read!)
 and further formats might be added based on request and urgency. and further formats might be added based on request and urgency.
  
Line 102: Line 102:
 ==== Problems ==== ==== Problems ====
 Sometimes, the data is **very** noisy (like this): Sometimes, the data is **very** noisy (like this):
 +
 {{:heartbeats_cleanup_problem.png|Noisy ECG example}} {{:heartbeats_cleanup_problem.png|Noisy ECG example}}
  
Line 109: Line 110:
 Naturally, it is possible to script this function, save the pre-detected heartbeats (without manual interaction/plotting) and then, at a later time, revisit the inspection (for instance, if several subjects' datasets are to be examined, it usually is preferable to perform the extraction and detection of all datasets prior to engaging in the fine tuning). Naturally, it is possible to script this function, save the pre-detected heartbeats (without manual interaction/plotting) and then, at a later time, revisit the inspection (for instance, if several subjects' datasets are to be examined, it usually is preferable to perform the extraction and detection of all datasets prior to engaging in the fine tuning).
  
 +For instance, if the raw signal looks like this
 +
 +{{:heartbeats_crisp_example.png|crisp raw signal with very short spikes}}
 +
 +A two-pass detection scheme can be employed:
 +
 +<code matlab heartbeats_crisp_detection.m>% first, load the data
 +data = xff('*.ntt');
 +
 +% then z-transform the third column (in our case) and take the 4th power
 +pdata = ztrans(data.Data(:, 3)) .^ 4;
 +
 +% pre-detect beats
 +% since we used the 4th power, the skew detection threshold must be lowered
 +% and our signal has short spikes, so the detection length threshold also!
 +bp = heartbeats(pdata, struct( ...
 +    'skewdt',    0.05, ...
 +    'detlength', 0.01, ...
 +    'freq', 500));
 +
 +% then pass this along with the actual signal back in
 +[bp, bs, bf, bv, cp, wgd, wd] = heartbeats(data.Data(:, 3), struct( ...
 +    'bppre',   bp, ...
 +    'cleanup', true, ...
 +    'freq',    500, ...
 +    'plot',    true));</code>
heartbeats.txt · Last modified: 2010/06/29 17:17 by jochen