# Difference between Gaussian and moving average filters for peak detection and doppler shift detection?

Consider having a signal in the time domain, and you want to smooth the signal. Moving average and Gaussian filters that are used. How do you choose which is used for what?

What are the conditions under which Gaussian is better and conditions under which moving average is better?

What I am trying to do with this signal is, peak detection initially, then apply small windows on every part and figure out the frequency changes (Doppler shifts) for every part to figure out the direction of motion from the frequency change. I want to smoothen out the signal in time-domain without loss of information in the frequency domain. I thought for the part of figuring out the Doppler shifts, using STFT would be a good idea.If reference could be given to some paper, that would also be really helpful.

• Such a discussion of "under which conditions which type of filter is better" would be too long. Instead you just try the two filters and tell us which one produces the better output for your application. – Fat32 Sep 29 '16 at 13:02
• Happy new years, and a reminder of this question and its answers requiring some action – Laurent Duval Dec 31 '16 at 16:15
• Can you give more specifics on how you got the signal to add to "This is a signal I obtained from a mobile device, for a rotatory hand swipe motion". I am curious what frequency content you expect and the characteristics of the Doppler. With that I may be able to offer more suggestions. – Dan Boschen Mar 7 '17 at 2:46
• I made a rotating hand device that is controlled by a motor. I made an android app to collect any audio signals that it receives and also send a 20 Khz signal. This image you see above is that of the received signal from the rotating device in the android app. – Dinesh Sep 5 '17 at 9:58

A centered moving average filter is a finite impulse response (FIR) filter that affects the same weight to all the samples in the window. If you only care about time domain properties, and do not care about its relatively poor performance in the spectral domain, for a signal $s$ that is quite stationary across the window, you can use it. It has extremely fast running implementation, and can be used easily for very short signals. In the spectral domain, suppose that you have the same signal amplitude at three frequencies $f_1 < f_2 <f_3$: $|S(f_1)| = |S(f_2)|=|S(f_3)|$. The amplitude spectrum of this filter is nondecreasing in general. So you you may end up with a filtered signal $s'$ for which $|S'(f_2)| = 0 < |S'(f_1)| < |S'(f_3)|$. In other words, the frequency behavior is not completely natural.