Main Content

实时检测心电图QRS手臂Cortex-A 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®-A processor. It uses an ECG signal selector to allow users to choose ECG signal sources with different mean heart rates in the SIMULINK® environment. The optimized code uses the NE10 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 theReal-Time ECG QRS Detectionexample of DSP System Toolbox.

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

Required MathWorks™ Products

DSP系统工具箱™

Simulink Coder™

Embedded Coder™

Embedded Coder Support Package for BeagleBone Black Hardware

DSP系统工具箱Support Package for ARM Cortex-A

Required Hardware

BeagleBone Black board

Task 1: Simulate

1.Open theexample model.

2.Change your current folder in MATLAB® to a writable folder.

3.On the model tool strip, clickRunto start the simulation.

4.Use theECG Signal Selectorto switch among ECG signals with different mean heart rates.

5.Click停止to end simulation.

Task 2: Configure model and Create a PIL block with Optimized Code on ARM Cortex-A Processor

1.Configure the model for ARM Cortex-A code replacement and PIL simulation by followingTask 2ofShort-Time Spectral Attenuation on ARM Cortex-A Processorexample.

2.Create a PIL block for theECGSignalProcessingSubsystemblock by followingTask 1in exampleCode Verification and Validation with PIL and External Modeof Embedded Coder Support Package for BeagleBone Black Hardware.

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

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

1.Replace theECGSignalProcessingSubsystemblock with the generated processor-in-loop (PIL) block.

2.On the model tool strip, clickRunto start the simulation with PIL block. The PIL block runs on the BeagleBone Black target. All other parts of the model run on the host machine. The BeagleBone Black target communicates with the host via PIL block input and output.

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

3.To configure, build, and run the model in external mode, follow the steps in theCode Verification and Validation with PIL and External Modeexample of Embedded Coder Support Package for BeagleBone Black Hardware.