필터 지우기
필터 지우기

for finding peak. i tried findpeaks(). but its not working

조회 수: 6 (최근 30일)
Archana R
Archana R 2014년 8월 6일
댓글: Image Analyst 2014년 8월 6일
for the given
waveform
  댓글 수: 2
Adam
Adam 2014년 8월 6일
You need to give more information really. In what way does it not work? Assuming the waveform you show there is in discrete form in an array I would think findpeaks should work ok.
I sometimes find myself wanting to write my own peak-finding algorithm after trying findpeaks, but that usually comes from me identifying something specific about its output that I don't like and can't seem to paramaterise well enough to give what I want. For a general case it should be fine though.
Image Analyst
Image Analyst 2014년 8월 6일
So now you have two threads on the same question. Why did you want that? What was wrong with your original discussion you had started in http://www.mathworks.com/matlabcentral/answers/146486-hi-i-have-a-signal-i-want-to-calculate-peak-and-area-of-the-signal

댓글을 달려면 로그인하십시오.

답변 (2개)

Nir Rattner
Nir Rattner 2014년 8월 6일
편집: Nir Rattner 2014년 8월 6일
Assuming that the image provided is the input format for the signal, you can use the “find” function with a threshold to get all of the black pixels which represent the signal. You may need to use the “smooth” function to get remove some of the unwanted blurriness and noise from the signal. At that point you can simply use the “findpeaks” function with the “y” data:
I = imread('PPG.jpg');
% Threshold to pull signal pixels
[y, x] = find(I(:, :, 1) < 150);
% Smooth to remove image artifacts
ySmooth = size(I, 1) - smooth(x, y, 0.02);
plot(x, ySmooth, 'r');
hold on;
axis equal;
% Find peaks of Y Data
[peaks, locations] = findpeaks(ySmooth);
plot(x(locations), ySmooth(locations), 'o');

Chad Greene
Chad Greene 2014년 8월 6일

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by