I am trying to apply a low pass Gaussian filter on a signal and find the exact location of maximum/minimum in the resulting smoothed signal. I have to do it for a few values of sigma (Gaussian bandwidth).

How is it possible to implement such Gaussian filtering and compensate phase shifts during filtering so that I can find the exact location of extrema as an index of signal location?


I have tried:

1) Convolution with a low pass Gaussian kernel (windowing) results in extension of resulting signal length which makes it impossible to find extremum as an index of original signal.

2) use of Fourier transform on signal and kernel and multiplication in Fourier domain makes the resulting signal in time domain circulary shifted.

  • $\begingroup$ are you doing it in real time? $\endgroup$ – Irreducible Mar 26 '19 at 7:24
  • 1
    $\begingroup$ One way to realize zero-phase digital filtering (offline) is to filter in both the forward and reverse direction $\endgroup$ – Irreducible Mar 26 '19 at 7:48
  • 4
    $\begingroup$ why does the length extension resulting from convolving with a Gaussian kernel make it impossible to find the extremum relative to the original index? you know the length of the Gaussian kernel. if it's symmetric, then the index of the extremum is offset by half of that length. $\endgroup$ – robert bristow-johnson Mar 26 '19 at 7:49
  • 3
    $\begingroup$ @Irreducible, since the Gaussian kernel is already symmetric. it's already linear phase. simply subtracting half of the length will return it to zero phase. filtfilt is not necessary for symmetric FIR filters. $\endgroup$ – robert bristow-johnson Mar 26 '19 at 7:51
  • 2
    $\begingroup$ @M.Jalali, As robert and irreducible said, if the kernel is symmetric then subtract half its length, if its not symmetric then run it both directions. $\endgroup$ – Digiproc Mar 26 '19 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.