peaks detection in a smoothed processed signal
조회 수: 3 (최근 30일)
이전 댓글 표시
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?

댓글 수: 0
채택된 답변
Image Analyst
2022년 12월 4일
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:
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!