Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

pls i need a code that can be used to detect the peak of signal (peak detector)

Asked by bala sadiq on 19 Jun 2013
Latest activity Commented on by Chinnaiah Golla on 5 Nov 2014 at 22:56

pls i need a code that can be used to detect the peak of signal (peak detector)

0 Comments

bala sadiq

Products

No products are associated with this question.

4 Answers

Answer by Wayne King on 19 Jun 2013

Do you have the Signal Processing Toolbox, have you looked at findpeaks()?

0 Comments

Wayne King
Answer by bala sadiq on 19 Jun 2013

No, i have no signal processing toolbox. can you pls tell me how to access it. I am relatively new in the field.

1 Comment

Jan Simon on 19 Jun 2013

You'd have to buy this toolbox from MathWorks.

bala sadiq
Answer by Jan Simon on 19 Jun 2013

Did you search in the FileEchange already?

http://www.mathworks.com/matlabcentral/fileexchange/index?utf8=%E2%9C%93&term=find+peaks

You find a very large number of solutions for standard and non-standard problems there.

4 Comments

Jan Simon on 20 Jun 2013

If it works, accepting the answer would be a signal for others, that you do not need further suggestion.

bala sadiq on 20 Jun 2013

i used the following code to call a function that detect the peaks of a signal spectra generated. How do i display the values of these peaks. Pls i need your help.

figure % Plot peaks of the spectrum. [peaks, locs] = findpeaks (2*abs(OutputSignal(1:NFFT/2))) plot (2*abs(OutputSignal(1:NFFT/2))); hold on; plot (locs, peaks, 'r')

Chinnaiah Golla on 5 Nov 2014 at 22:56

In the above code you've used, 'locs' will contain the locations next to the detected peaks.

Have you observed it??

So, if you want to locate the peaks, try the below one...

stem(locs-1,peaks,'are'); % To display in a discrete manner

plot(locs-1,peaks,'are'); % To display in an analog manner

Jan Simon
Answer by Image Analyst on 20 Jun 2013

Here's one that doesn't need any toolbox. Go to the web site indicated:

%  Eli Billauer, 3.4.05 (Explicitly not copyrighted).
%  http://billauer.co.il/peakdet.html
%  This function is released to the public domain; Any use is allowed.

0 Comments

Image Analyst

Contact us