wfdb-python icon indicating copy to clipboard operation
wfdb-python copied to clipboard

qrs detector improvements

Open cx1111 opened this issue 6 years ago • 5 comments

This will be the single thread for discussing improvements for qrs detectors. I will probably only be working on the xqrs class in the near future.

Current thoughts:

  • The filter used to accentuate the qrs (we'll call this the moving wave integration filter) is currently an upright ricker with a fixed width: wavelet_filter = signal.ricker(self.qrs_width, 4). There are many things we could improve upon, such as:
    • Inverting it if we figure out the r wave is inverted
    • Designing a set of template beats for different ecg channels.

cx1111 avatar Jun 22 '18 19:06 cx1111

If you don't mind, i add several suggestions:

  1. XQRS works pretty well and has good specificity, PPV and FPR for MIT-BIH Arrhythmia Database, The QT Database and others. But sometimes for real signals there are errors for R-peak localization. This error equals +/- one sample around of peak sample.
  2. Adding some marks for erroneous/noisy beats (GQPOST functionality: changing N annotations into artifact ("|") annotations if they are likely to be erroneous)
  3. Adding R-peak voltages in returning value of xqrs_detect()
  4. Designing a set of template for different type of the beats. Like in CONSTRUE framework (Atrial fibrillation, Bigeminy, Trigeminy, Ventricular flutter/fibrillation, etc.). Link to framework below: [https://github.com/citiususc/construe]
  5. Adding ECGPUWAVE functionality (P,T wave peak/limit locator). I don't know if XQRS is able to do it

krivenkoz avatar Jun 23 '18 14:06 krivenkoz

One possible solution is to call the raw C function through Cython. I used this approach in some of our project

peiyaoli avatar Nov 21 '18 00:11 peiyaoli

A bit off-topic but, is there any publication that describes the xqrs algorithm?

artur-deluca avatar Feb 09 '21 18:02 artur-deluca

Hey @artur-deluca

You can find a review of some algorithms from this link:

https://physionet.org/content/challenge-2014/1.0.0/

And more technical detail here:

http://ecg.mit.edu/george/publications/qrs-cinc-2003.pdf

However, checking out the source code documentation from these three links will also help:

https://github.com/MIT-LCP/wfdb-python/blob/733f3e4e14a644cf1e1b39a2ca86bcc4f0271f7a/wfdb/processing/qrs.py#L13-L67 https://wfdb.readthedocs.io/en/latest/processing.html https://www.physionet.org/physiotools/wag/gqrs-1.htm https://www.physionet.org/physiotools/wag/wqrs-1.htm

Hope this helps!

Lucas-Mc avatar Feb 09 '21 18:02 Lucas-Mc

Thanks @Lucas-Mc!

artur-deluca avatar Feb 09 '21 18:02 artur-deluca