# How to detect impulse like peaks - Matlab

I have a signal which is a matched filter output.

whose values are given here:

Amplitude values

Input to this matched filter is radar return signals mixed with additive gaussian random noise.

Its impulse like peaks are at indices 2201,3005,4443,4444,6524(by manual inspection).

How can I detect these peaks programmatically. I have tried findpeaks function in matlab. Not got the result I wanted.

Can you help me out.

• 'findpeaks is working perfectly. Just remove the values of spectra below a given threshold - it's noise anyway. You can also specify a given minimum peak height. – jojek Aug 8 '14 at 14:09
• @jojek. How to select the threshold? – Vinod Aug 8 '14 at 16:09

Well I get your values in pastebin to test i get near results, take a look:

Original values from pastebin:

lessen you values from the mean and put zero all values lower than threshold * Standard deviation from your values.

What I did:

valuesfrompastebin( abs(valuesfrompastebin-mean(valuesfrompastebin)) < 4*std(valuesfrompastebin) ) = 0;


After it my plot was:

Now the locs from the findpeaks:

[pks, locs] = findpeaks(teste2)

2201
3005
4441
4443
6524

• How to calculate threshold? – Vinod Aug 8 '14 at 16:07

Try this:

1. Convert all values to dB (looks like you've already done this.)
2. Run the resulting data through a high pass filter with a cut off of 1/4 of your sampling rate.
3. Select a threshold (looks like 10dB would be good.) Anything above the threshold is peak.

You'll probably want to use a FIR filter for the highpass - the signal will be delayed depending on the length of your filter, but you can account for that easily since it will be an integer number of samples.

I've been thinking of making an acoustic echogram, and this is the method I thought up to get rid of clutter and show just the sharp reflections.

It appears that each peak stands out clearly (+15 dB or so) from it's neighbors, but certainly the peak at 6524 isn't that much higher than the noise near 2500. Have you tried findpeaks` on smaller intervals, say 250 points at a time?

Since your noise floor changes across the data, you can't just apply a simple threshold. Instead, have a sliding window that will calculate the average energy for a smaller subset (I like RMS) and compare the peak to that average. If you have a data point that is so many dB above your calculated noise level, you can mark that as a peak. You'll have to play around with that method to determine the correct threshold and window size for your data.

Slide three non-overlapping windows across the data: left, middle, and right. Apply the following tests:

1. Largest value in middle window is at the center of middle window
2. Largest value in middle window is > X dB larger than largest value in left window
3. Largest value in middle window is > X dB larger than largest value in right window

There can be a gap between the windows.

When all tests pass, mark the center value in the middle window as a peak.

John