Detecting a local minima within a specific splice of data

2 views (last 30 days)
Abdul Rafay
Abdul Rafay on 5 Jul 2021
Answered: Peter O on 6 Jul 2021
Hi,
So i am trying to create a program for arrythmia detection from a given signal. For that I have to identify PQRST regions in the ECG as well after filtering. The program will be working as a state machine, identifying R peak, and then moving on to next state where it tries to identify Q minima peak. The condition for identifying Q is that it is behind R peak, such that it is a local minima within the 0.05 seconds of the R peak. That is what i am trying to identify. I am identifying R peaks using "findpeaks" function:
%R peaks
[Peaks Locations] = findpeaks(ECG1ds,'MinPeakDistance',45); %determining R peaks
Here ECG1ds is my ECG signal which has been filtered and all that. I get all the required R peaks
The x-axis is the time in seconds. Now I want the Q peak which is the local minima just behind this R peak within 0.05 seconds. How exactly should i go for that. I'd really appreciate any sort of suggestions, or help.
Thanks.

Answers (1)

Peter O
Peter O on 6 Jul 2021
I'm very unfamiliar with ECGs. Two ideas:
  1. Is the Q peak always the "lowest"? Flip/Invert the signal to search for the peak of Q. Minima-->Maxima. That might be fast and easy?
  2. Take a look at the islocalmin function: https://www.mathworks.com/help/matlab/ref/islocalmin.html. Since you know the timespan in which you want to look, segment the signal into vector chunks of (ix_pk-0.05):ix_pk for each peak and run the index for each function. Since you have ix_pk, you can map the reported local Q minimum location back into the full array.

Products

Community Treasure Hunt

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

Start Hunting!

Translated by