This past summer I worked in tandem with professor Joel Grodstein to design a new class at Tufts: Embedded Medical Devices. The main topics consist of programming in an embedded real time operating system (RTOS), and signal processing methods specifically for medical signals. A driving motivation of the course was to educate students on how an RTOS allows for reliable, precisely timed multi-tasking embedded devices. An RTOS provides the framework to schedule many tasks running at varying frequencies. This is helpful as many medical applications require lots of things to happen “concurrently” while typically only having a single core to work with.
Over the summer, utilizing FreeRTOS I designed a heartbeat monitor. I implemented several types of real time filters such as differentiators, integrators, signal peak detectors, cascading biquads for highpass, lowpass and bandpass filters, and decision tree algorithms to classify a QRS wave. Simultaneously a buzzer is triggered on the heartbeat and a display is periodically updated to display the measured heart rate in BPM.
In the course we used the many pitfalls I came up against in the summer project to create an RTOS “debug derby”, a style of lab where the students must debug a broken piece of code to better understand how RTOS’s work. We also teach basic real time signal processing, and PC based signal processing analysis. First we teach students how to design basic filters using python on their laptops so that they can play with different parameters and view the effects in the frequency domain in a nice GUI. After students have designed their filters, we teach them how to filter given real time constraints and explore the pitfalls that come outside the idealized world of python. We also teach more advanced signal processing ideas like wavelets which produce time localized frequency information, great for analyzing dynamic biological signals. Wavelets are one of my favorite signal processing topics and I was allowed to give a lecture on them!
You can find the course webpage here.
You can read more about the heartbeat detector designed using FREE RTOS and our signal processing labs here.
Here is a live demo of the heartbeat monitor correctly classifying my heartbeat. My heart rate is shown on the display of the device below (Green circuit board).

Here is an image of a scaleogram: a time, frequency, amplidude plot used to analyze dynamically changing signals. It’s the output of the continuous wavelet transform!
