Real-Time ECG QRS Detection on ARM Cortex-M Processor

This example shows how to generate and run optimized code for real-time QRS detection of an electrocardiogram (ECG) signal on the ARM® Cortex®-M processor. It uses an ECG signal selector for choosing ECG signal sources with different mean heart rates in the Simulink® environment. The optimized code uses the CMSIS library for the discrete FIR blocks in the example.

Introduction

The electrocardiogram (ECG) is a recording of body surface potentials generated by the electrical activity of the heart. Clinicians can evaluate an individual's cardiac condition and overall health from the ECG recording and perform further diagnosis. Because of the physiological variability of the QRS complex and various types of noise present in the real ECG signal, it is challenging to accurately detect the QRS complex. The real-time QRS detection algorithm is described in the Real-Time ECG QRS Detection example of DSP System Toolbox.

The CMSIS library contains a set of optimized signal processing algorithms for ARM Cortex-M processors. This example shows how to optimize the generated code of a ECG QRS detection model with code replacement from the CMSIS library for ARM Cortex-M processors.

1. Create a PIL block for the ECGSignalProcessingSubsystem block by following Task 1 in example Code Verification and Validation with PIL and External Mode of Embedded Coder Support Package for STMicroelectronics Discovery Boards.

2. When the build finishes, examine the generated code of the PIL block by clicking on the ECGSignalProcessingSubsystem.c file. Notice the multiple function calls, arm_fir_f32, in the generated C code.

Task 4: Real-Time Processing with Processor-in-Loop Mode

2. On the model tool strip, click Run to start the simulation with PIL block. The PIL block runs on the STM32F4-Discovery board. All other parts of the model run on the host machine. The STM32F4-Discovery board communicates with the host via PIL block input and output.

2. Use the drop down menu of the ECG Signal Selector to switch among ECG signals with different mean heart rates.

3. To configure, build, and run the model in external mode, follow the steps in the Code Verification and Validation with PIL and External Mode example of Embedded Coder Support Package for STMicroelectronics Discovery Boards.

MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

This website uses cookies to improve your user experience, personalize content and ads, and analyze website traffic. By continuing to use this website, you consent to our use of cookies. Please see our Privacy Policy to learn more about cookies and how to change your settings.