Main Content

Heart Rate Monitor

The example model sldrtex_heartrate shows how to take heart rate mesurements using Simulink® Desktop Real-Time™ using a camera and the Video Input block. To measure heart rate, a person presses a thumb against the camera lens, optionally pointing a light source at the thumb to improve lighting conditions.

The camera measures luminance changes caused by blood inflow into the thumb. The signal from the camera is filtered to remove slow trends in luminance and high-frequency noise. Then, time intervals between successive peaks in luminance are computed. Average heart rate is computed based on these time intervals.

Note: To run this model, you must have a camera available in your computer. This model requires DSP System Toolbox™.

How to Run This Model in Connected IO Mode:

  1. To switch to Connected IO mode if needed, on the Desktop Real-Time tab, select Mode > Connected IO.

  2. To start the real-time execution, click Run in Real-Time.

How to Run This Model in Run in Kernel Mode:

  1. To switch to Run in Kernel mode if needed, on the Desktop Real-Time tab, select Mode > Run in Kernel.

  2. To start the real-time execution, click Run in Real-Time.

The model builds, connects to Run in Kernel mode, and starts.

Open the Model

open_system('sldrtex_heartrate');

Clean Up Model

clear
close all
bdclose all