MATLAB Answers

finding the first, second and third maxima in the signal

6 views (last 30 days)
Ricky
Ricky on 29 May 2013
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 Comments
Ricky
Ricky on 29 May 2013
These are like echos of a signal and I want only the first signal and the next 3 echos of the signal.

Sign in to comment.

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 29 May 2013
I suggest that you do it manually using the function ginput
  2 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 29 May 2013
[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

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by