Engineering MYOWAVE: Non-Invasive Uterine Biopotentials to Close the Endometriosis Diagnostic Gap
Our journey to winning the Departmental Best Design Project Prize: designing a 24-bit ADS1299 KiCad PCB for 50-microvolt uterine signals, building an Arduino Due synthetic uterus DAC, and migrating our 250 Hz DSP clinical portals from Streamlit to NiceGUI.
Ahmed Ahmed
MEng Molecular Bioengineering, Imperial College London
Why We Built MYOWAVE: A 7-to-9-Year Diagnostic Delay
When our Imperial College London design group first started researching endometriosis alongside the ENDO1000 clinical study framework, one statistic jumped off every clinical paper: it takes an average of 7 to 9 years from a patient's first symptom onset to receive a confirmed diagnosis.
The reason for that bottleneck is that non-invasive transvaginal ultrasound frequently misses superficial peritoneal endometriosis lesions, leaving invasive diagnostic laparoscopy under general anaesthesia as the clinical gold standard. However, a growing body of reproductive physiology literature has shown that endometriosis significantly alters uterine myometrial contractility: patients exhibit hyper-peristaltic, dysrhythmic uterine smooth-muscle contractions and elevated intrauterine basal pressure across the menstrual cycle.
Just as an ECG measures cardiac action potentials on the chest and an EMG measures skeletal muscle recruitment on a limb, Electrohysterography (EHG) records the slow myoelectrical action-potential bursts of the uterus non-invasively from surface Ag/AgCl electrodes placed over the lower abdomen.
Our project, MYOWAVE, set out to build a complete, wearable, non-invasive EHG acquisition and clinical longitudinal monitoring platform. I served as Project Manager and personally owned all of the electronic hardware design (KiCad ADS1299 PCB), embedded signal synthesis (Arduino Due DAC firmware), real-time 250 Hz digital signal processing (scipy.signal), and full-stack clinical and patient web applications (NiceGUI + Firebase), leading our team to win the Year 2 Molecular Bioengineering Prize for Best Design Group Project.
Designing Around a 50 Microvolt Signal Buried in 50 Hz Mains Noise
If you hook a standard 10-bit or 12-bit microcontroller ADC (analogRead() on an Arduino) up to a pair of abdominal skin electrodes through a basic op-amp, you will not see uterine contractions. You will see a giant power-line sine wave, a slow drifting DC offset from electrode-skin half-cell potential ( for Ag/AgCl), maternal ECG R-peaks bleeding down from the thorax, and respiration motion every four seconds.
Meanwhile, the actual uterine EHG signal sits way down at in amplitude and oscillates inside an ultra-low frequency window between and (with an underlying mechanical slow wave near ).
Choosing the Texas Instruments ADS1299-6PAGR Front-End
Instead of chaining discrete instrumentation amplifiers (such as an INA128 or AD620) into external active analog high-pass filters, where capacitor tolerance mismatches of even 1% degrade the Common-Mode Rejection Ratio (CMRR) at low frequencies, I designed our custom KiCad schematic (MYOWAVE.kicad_sch) around the Texas Instruments ADS1299-6PAGR:
- Simultaneous 24-Bit Delta-Sigma Resolution: Because a 24-bit converter partitions a input full-scale range (at internal programmable gain amplifier setting) into steps, the least significant bit (LSB) resolution is roughly . That allows the ADC to digitise both the massive DC electrode half-cell offset and the uterine burst simultaneously without saturating the front-end or needing bulky AC-coupling capacitors in the analog path!
- Active Bias / Driven-Right-Leg (DRL) Feedback Loop: By summing the common-mode voltage across the differential recording channels, inverting it through the
ADS1299internal bias amplifier, and driving it back into the patient reference electrode, we actively cancel capacitive mains pickup before it enters the PGA.
Solving the Bench-Testing Catch-22 with an Arduino Due 12-Bit DAC
Halfway through the hardware build, we faced a classic medical device testing Catch-22: you cannot bring an unverified prototype PCB into a clinical setting to record live uterine contractions, yet standard lab bench function generators only output simple or sine and square waves that look nothing like a non-stationary myometrial burst.
To test our hardware and software pipeline end-to-end on the bench, I programmed a dedicated Arduino Due (EHG_Generator.ino, streaming at and outputting real analog voltages via its true 12-bit hardware DAC0 pin) to act as a synthetic physiological uterus:
By modulating fast action-potential spikes ( and ) inside a slow Gaussian contraction envelope recurring at and deliberately injecting mains hum and white noise , we could feed a known physiological waveform through resistive voltage dividers directly into our electrode leads and verify our CMRR and filter recovery quantitatively (T3_CMRR.py).
The 250 Hz Python DSP Pipeline (dsp_math.py)
On the software side, I wrote a multi-threaded Python background acquisition service (background_service.py and dsp_math.py) that ingests incoming frames and runs them through a zero-phase scipy.signal processing chain:
- Zero-Phase 4th-Order Butterworth Bandpass (): Using forward-backward filtering (
scipy.signal.filtfilt) strips out both sub- electrode baseline drift and maternal cardiac/skeletal EMG artefacts without distorting burst arrival timing. - Welch Power Spectral Density & FWL/FWH Band Ratios: Using
scipy.signal.welch, the DSP engine partitions the spectral energy into the two canonical uterine diagnostic bands established in obstetrics and gynaecology literature:- Fast Wave Low (): Associated with local non-propagating basal uterine electrical activity.
- Fast Wave High (): Associated with coordinated, high-velocity action-potential propagation across gap junctions (connexin-43) during intense or dysmenorrhoeic contractions.
Building Two Distinct Interfaces: Why I Switched from Streamlit to NiceGUI
Initially, I prototyped our user interface in Streamlit. While Streamlit is great for single-page data science dashboards (like my Gene Expression Explorer app), we quickly hit its architectural ceiling when trying to run a continuous hardware background thread alongside two separate user roles (a patient logging symptoms on her phone and a clinician reviewing multi-channel spectral density on a desktop). In Streamlit, every UI interaction re-executes the entire Python script top-to-bottom.
To solve that cleanly, I migrated the entire full-stack application to NiceGUI (built on FastAPI, Vue, and Quasar) with a shared asynchronous background service (background_service.py), local SQLite storage, and dual Firebase Firestore cloud synchronisation:
- The Patient Companion Portal (
port 8082): Designed around our user-centric patient survey feedback to be calm and non-clinical. Rather than overwhelming participants with raw microvolt Fourier transforms, it provides an intuitive wearable connection indicator, gentle session progress tracking, and a longitudinal symptom diary (pain severity, menstrual cycle phase, and analgesia logs). - The Clinical Researcher Portal (
port 8081): Built for ENDO1000 investigators, rendering live multi-channel Plotly waveforms, RMS burst envelopes, Welch FWL/FWH power ratios, and downloadable session telemetry.
Limitations and Where Wearable EHG Research Goes Next
Winning the departmental Best Design Group Project Prize was a huge milestone, and reflecting on the engineering process also highlighted the hardest unsolved problems in wearable abdominal biopotentials:
- Separating Maternal Abdominal Skeletal EMG from Uterine Smooth Muscle: When a patient walks, laughs, or shifts posture, the rectus abdominis skeletal muscles fire. Even though skeletal EMG peaks primarily between , the low-frequency modulation envelope of a posture shift can leak into the EHG passband. Adding a board-mounted 3-axis MEMS accelerometer (IMU) (such as an
MPU6050orLIS3DH) and running an Adaptive LMS (Least Mean Squares) Noise Cancellation filter using the accelerometer channels as the motion reference would allow real-time ambulatory artefact subtraction. - Spatial Propagation Velocity via Laplacian Electrode Grids: A single bipolar channel tells you when a burst occurs and its frequency distribution, but in endometriosis, a critical diagnostic signature is the direction and propagation velocity of the contraction wave (e.g., retrograde fundus-to-cervix vs cervix-to-fundus peristalsis). Utilizing all 8 differential channels of our
ADS1299-6PAGRPCB across a high-density abdominal surface Laplacian grid would let us compute 2D spatial cross-correlation velocity vectors across the uterus.