finding the first, second and third maxima in the signal

조회 수: 2 (최근 30일)
Ricky
Ricky 2013년 5월 29일
Can someone please help me with the code for finding the signal peaks in the below figure .
I hae tried using for loops, and also MATLAB function findpeaks() . I am new to MATLAB and I am not sure if I am doing this correctly. Please help me.
  댓글 수: 5
Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 29일
And how can we do it by code? You should explain why some peaks are ignored, If there is no explanation it's impossible to do it by program.
Ricky
Ricky 2013년 5월 29일
These are like echos of a signal and I want only the first signal and the next 3 echos of the signal.

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

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 29일
I suggest that you do it manually using the function ginput
  댓글 수: 2
Ricky
Ricky 2013년 5월 29일
Hello Azzi, I do not want to do this manually. Somehow I need to write a code which says that if my peak value is greater than previous 3 values and next 3 values it is a good Data point. Also as soon as i get 4 values in this variable I should stop the execution.
Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 29일
[peaks,index]=findpeaks(y)
for k=1:numel(peaks)
ii=index(k);
jj=0;
if abs(y(ii)/y(ii-1))>=3 & abs(y(ii)/y(ii+1))>=3
jj=jj+1
real_peak(jj)=peaks(k)
index_peak(jj)=ii
end
end

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

카테고리

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