peaks detection in a smoothed processed signal

2 views (last 30 days)
i have a homework in biosignal procesing course which about processing ecg signal and count peaks
i applied some codes and i reach until the point shown in the photo
now i need a way to count these peaks without using the findpeak() function
i am really stuck at this point...
any help?

Accepted Answer

Image Analyst
Image Analyst on 4 Dec 2022
Try this (requires Image Processing Toolbox):
threshold = 2e-5; % for sqauring or 200 for "original signal".
mask = signal > threshold;
% Some peaks may have some "thickness" so find the centroid, or weighted centroid of the peak
props = regionprops(mask, signal, 'Centroid', 'WeightedCentroid', 'MaxIntensity');
indexesOfPeaks = vertcat(props.Centroid)
indexesOfWeightedPeaks = vertcat(props.WeightedCentroid)
% Get value of the very highest point in the thresholded signal.
peakValues = [props.MaxIntensity]
% Find indexes of where that highest peak occurs.
for k = 1 : numel(peakValues)
indexOfPeaks2(k) = find(signal == peakValues(k));
end
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

More Answers (0)

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!