If N is the length of the moving average, then an approximate cut-off frequency Fco (valid for N>=2) in normalized frequency F=f/fs is:
Fco=0.442947N2−1√
The inverse of this is
N=0.196202+F2co√Fco
This formula is asymptotically correct for large N, and has about 2% error for N=2, and less than 0.5% for N>=4.
P.S.: After two years, here finally what was the approach followed.
The result was based on approximating the MA amplitude spectrum around f=0 as a parabola (2nd order Series) according to
MA(Ω)=Sin(Ω∗N/2)Sin(Ω/2)
MA(Ω)≈1+(124−N224)Ω2
which can be made more exact near the zero crossing of MA(Ω)−2√2 by multiplying Ω by a coefficient
α=0.95264
obtaining
MA(Ω)≈1+0.907523(124−N224)Ω2
The solution of MA(Ω)−2√2=0 gives the results above, where 2πFco=Ωco.
All of the above relates to the -3dB cut off frequency, the subject of this post.
Sometimes though it is interesting to obtain an attenuation profile in stop-band which is comparable with that of a 1st order IIR Low Pass Filter (single pole LPF) with a given -3dB cut off frequency (such a LPF is also called leaky integrator, having a pole not exactly at DC but near to it).
In fact both the MA and the 1st order IIR LPF have -20dB/decade slope in the stop band (one needs a larger N than the one used in the figure, N=32, to see this), but whereas MA has spectral nulls at F=k/N and a 1/f evelope, the IIR filter only has a 1/f profile.
HIIR=1−Exp(−Ωco)1−Exp(−Ωco)∗Exp(jΩ)
If one wants to obtain an MA filter with similar noise filtering capabilities as this IIR filter, and matches the 3dB cut off frequencies to be the same, upon comparing the two spectra, he would realize that the stop band ripple of the MA filter ends up ~3dB below that of the IIR filter.
In order to get the same stop-band ripple (i.e. same noise power attenuation) as the IIR filter the formulas can be modified as follows:
Fco,IIR=0.32N2−1√
N=0.1024+F2co,IIR√Fco,IIR