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

Answers (4)

Do you have the Signal Processing Toolbox, have you looked at findpeaks()?
No, i have no signal processing toolbox. can you pls tell me how to access it. I am relatively new in the field.
Did you search in the FileEchange already?
You find a very large number of solutions for standard and non-standard problems there.

4 Comments

thank you, i am grateful your advice have really work for me.
If it works, accepting the answer would be a signal for others, that you do not need further suggestion.
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')
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

Sign in to comment.

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.

Asked:

on 19 Jun 2013

Commented:

on 5 Nov 2014

Community Treasure Hunt

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

Start Hunting!