peak width classification by width
1 回表示 (過去 30 日間)
古いコメントを表示
In this plot peak 2,4 have different widths than other peaks . is there is a way to find peaks widths and classify them according to that ?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162120/image.jpeg)
0 件のコメント
回答 (1 件)
Image Analyst
2017 年 3 月 25 日
You could use for loops to start at the peak and then start traveling the signal to the right and left until the peak starts to turn around (get smaller). For example, for peak (valley) 2:
% If the peak is at index 150
% Scan to the right.
for k = 151:length(signal)
if signal(k) < signal(k-1)
% Signal is starting to fall.
rightIndex = k-1;
break;
end
end
% Scan to the left.
for k = 149: -1 : 1
if signal(k) < signal(k+1)
% Signal is starting to fall.
leftIndex = k+1;
break;
end
end
peakWidth = rightIndex - leftIndex;
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!