Search for 2d pulse peaks in MATLAB

What is the best method for searching for pulsed peaks (delta dirac) in a 2d matrix.

In particular, I would like to find the harmonic frequencies of a given image, and therefore I need to find the impulse peaks in the absolute value of the DFT image.

I was thinking about using findpeaks, but there is no 2d version there. I also saw earlier posts looking for regular peaks using imdilate and / or imextendedmax, but they find all peaks in a 2d matrix, while I only care about pulsed peaks. I'm sure DSP people have a common recipe for this ...

Please, help,

thanks

+4
source share
3 answers

What you want to do is find high contrast peaks. Thus, you need a way to determine local maxima, as well as a way to measure the difference between the peak and surrounding values. The threshold value of this difference will determine the impulse peaks for you.

Assuming your input signal is called signal

 %# dilate to find, for every pixel, the maximum of its neighbors dilationMask = ones(3); dilationMask(5) = 0; dilSignal = imdilate(signal, dilationMask); %# find all peaks %# peaks = signal > dilSignal; %# find large peaks peaks by thresholding, ie you accept a peak only %# if it more than 'threshold' higher than its neighbors peaks = (signal - dilSignal) > threshold; 

peaks is a logical array with 1 where there is a good peak. You can use it to read peak heights from a signal using signal(peaks) and to find coordinates using find(peaks) .

+6
source

The findpeaks () algorithm is pretty trivial; if the element is larger than its neighbors, then this is the peak. Writing a two-dimensional version of this file should be fairly simple.

0
source

All Articles