Example: Real-Time ECG QRS Detection - style of coding real-time detector algorithms

1 visualización (últimos 30 días)
There is an example of real-time QRS detection algorithm:
ex_ecg_sigprocessing
I should say that in biomedical signal processing there are many similar real-time/streaming algorithms, that detect some time events and states, using complicated logic and signal transforms. And my question is about the style and best practice of coding such algorithms, based on this specific Simulink example.
Example structure:
The main algorithm blocks are some common DSP System Objects and a custom Function QRSDetection. QRSDetection is written as frame-based algorithm with sample-based sub-functions that use persistent variables to store its previous states.
On the other hand, System objects "use internal states to store that past behavior, which is used in the next computational step. As a result, System objects are optimized for iterative computations that process large streams of data in segments, such as video and audio processing systems."
Questions:
1) The first question is, why it was decided to use Matlab Function instead of System object in order to implement the algorithm? And how should it look like if written as a System object?
2) Also, in the algorithm there are many if-else construnctions. Can they be implemented using a Stateflow blocks? And how should it look like?

Respuestas (0)

Categorías

Más información sobre Applications en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by