Getting Physionet’s HRV tools (WFDB) running!

Our end goal is to do Heart Rate Variability analysis on the Beaglebone Black, but initially, just to understand how to run the toolkit, we are setting up everything on an Ubuntu laptop (with desktop and GUIs!)

Tutorial being followed: [ Physionet’s HRV howto ]

[ WFDB ]’s download was straightforward.

[ WAVE ] was slightly trickier. I wasn’t able to correctly update the sources.list file to include main universe (I think, because apt-get was complaining about duplicates) Things still worked out.

[ XView ] gave us some font problems, but using the flag -fn fixed worked.

To do our HRV analysis, here are the steps we followed:

  1. Sample ECG from AD8232 using an MSP432 (outputting both time of capture through millis(), and the actual analog value read)
  2. After conforming that the sample timings were consistent (3ms), generated a copy of the file with just the analog reads.
  3. Converted this text file to a Physionet compatible record:
    wrsamp -F 333.33 -G 1000 -i ecg_04_15_AM_3des_RibCollarAnkle_10min_2-3msSampling_fallingAsleep_headNods_ECG_only.txt -o ecg_04_15_AM 0
    I am not sure what exact gain value to use, but using 1000 allowed us to skip adjusting the thresholds on the the peak detection (next step)
  4. Used [ gqrs ] to get annotations for QRS complexes:
    gqrs -r ecg_04_15_AM -m 1
    m: sets the threshold
  5. The obtained peaks were viewed using rdann:
    rdann -a qrs -r ecg_04_15_AM
    (annotation type was set to qrs as gqrs outputs a .qrs file. This can be changed if another annotator was used. For example, -a wqrs can be used if a .wqrs file was generated from wqrs)
  6. wave was used to view the annotations too. There is some fonts issue with xview, and here’s physionet’s suggested workaround: use -fn fixed:
    (File>Annotator has to be specified to see the ‘N’s. View can be adjusted to change scales and add grids.)Everything except the first peak was correctly detected in this case.
  7. Getting the RR intervals:
    ann2rr -r ecg_04_15_AM -a qrs -w -i s -c >ecg_04_15_AM.rr1.txt
    -w: would specify that we are looking at ‘N’s
    -i s: would output times in seconds
    -c: would only exclude intervals that are not bounded on both sides (hopefully getting rid of the first problematic capture too)
  8. Next is to install [ plt ]. make install is not being able to find my X11 libraries…



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s