Fatigue detection on the band.
A three lead EEG headband that tells when the wearer is getting tired. The client's detection algorithm existed as Python on a PC; we understood its signal processing and classifier and rebuilt both in C, so the FFT and the decision now run on the headband's own microcontroller.
- Sector
- Medtech
- Year
- 2020
- Our role
- Hardware, firmware and DSP
From a notebook to a microcontroller.
The client had a working fatigue model, but it was Python that needed a computer, floating point libraries and recordings sent off the head. A wearable has to decide on its own, in real time, on a small battery.
Porting it meant more than translating code. Every filter, window and feature had to give the same answer on a microcontroller with a fraction of the memory and processing, or the classifier would drift from what the client had validated.
Understand, port, verify.
- 01
Three lead headband
Dry forehead electrodes on a soft band, with a low noise analog front end and the electronics in a small pod at the back.
- 02
Understanding the algorithm
We worked through the client's Python line by line, the DSP chain from filtering and windowing to band power, and the classifier that turns those features into a fatigue score.
- 03
Python to C
We rewrote the chain in C for the MCU, with a fixed size FFT, memory planned up front and no dynamic allocation, so it runs within a fixed time per window.
- 04
Matching the reference
The same recordings ran through the Python and the C versions, and the band powers and fatigue scores were compared until they matched.
The decision, on the head.
The headband computes the FFT, band powers and fatigue score itself and only sends results, which keeps the radio quiet and the battery small. The client's algorithm now runs where it is needed, without a computer in the loop.