Fetal ECG extraction
A research implementation of Su and Wu's method for recovering the fetal ECG from a single electrode on the mother's abdomen.
- Odin
- Swift
- SwiftUI
- MATLAB
A research prototype. It is not a medical device and is not for clinical or diagnostic use.
The problem
An electrode on the mother’s abdomen picks up two hearts at once. Her heartbeat dominates the recording, and the fetal heartbeat is a smaller, faster rhythm underneath it, mixed with muscle noise and power-line hum. Many ways of separating the two need several electrodes. The method this project implements works from one.
The method
The project implements Li Su and Hau-Tieng Wu, Extract Fetal ECG from Single-Lead Abdominal ECG by De-Shape Short Time Fourier Transform and Nonlocal Median (Frontiers in Applied Mathematics and Statistics, 2017). In outline:
- Filter and normalize the recording.
- Track the mother’s heart rate over time as a ridge in the de-shape short-time Fourier transform, then locate each of her beats.
- Estimate each maternal beat’s shape as the median of its 40 most similar beats (the nonlocal median), and subtract it.
- Repeat on what remains to find the fetal heart rate and beats, then reconstruct the fetal ECG waveform the same way.
Every heart-rate estimate has to stay within a physiological range: 50–210 beats per minute for the mother and 90–270 for the fetus.
How it’s built
- Signal processing (Odin): filtering, the FFT and short-time Fourier transforms, ridge extraction, beat tracking, the nonlocal median, and the evaluation metrics.
- App (SwiftUI, for Mac and iPhone): imports recordings, runs the pipeline through a C interface to the Odin library, and plots the results.
- Reference (MATLAB): produces golden outputs that each Odin step is tested against.
Validation
Detected fetal beats are scored against the annotated beats in two public PhysioNet datasets: set A of the 2013 PhysioNet/Computing in Cardiology Challenge, and the Abdominal and Direct Fetal ECG Database. A detection counts if it falls within 50 ms of an annotated beat, and the scores are sensitivity, positive predictive value, and F1.
Status
Early and in progress. The work follows the pipeline one step at a time, and there are no results to report yet.