Assume you want to estimate the amplitude of a known frequency sinusoid in additive Gaussian (white or pink) noise. Also assume mainlobe width/sidelobe decay doesn't matter. Windows should be compared such that the time latency of the resulting amplitude estimate is equal. (I believe for all symmetric windows of a given period, their time latency will be equivalent -- specifically, equal to half of their period.) What is the optimal window in this case?

It seems this problem would simply reduce to what window has the smallest magnitude integral in the frequency domain (affects amount of noise smeared around) relative to its peak magnitude in the frequency domain (what will be used to estimate amplitude). However, given the presumably random phases of each noise frequency component, I am not sure it is as simple as just considering the magnitude of the window's fourier transform because there may be some 'destructive interference' among noise components of different phase.

The main two contenders I am aware of are: the rectangular window, which is said to have the minimum equivalent bandwidth noise for any window of its length (source); and the Gaussian window, which is said to minimize the 'time-frequency bandwidth product' (source). However, time-bandwidth product refers to the 'frequency duration' (sidelobe behavior) of a signal, which was stated to not matter in this case, so I don't think that optimality is useful here.

Therefore, I believe the goal would be to minimize the equivalent noise bandwidth of the window. If that is the case, how would one prove that the rectangular window does minimize ENBW, and that there is not some other obscure window in the function space that does 'better'? Here is an illustration of the 'optimality' in the ENBW-sense of the rectangular window (source):

enter image description here

Additionally, here are the corresponding time/frequency plots of rectangular and Gaussian windows, making it appear that the Gaussian window is much more spread out in frequency than the rectangular function and therefore does not have as high of a 'peak relative to frequency domain integral'. (Compare +/-5Hz, maybe +/-2.5Hz if window lengthened for Gaussian vs +/-1Hz for rectangular of same time duration.) (source_rect, source_Gauss):

enter image description here

enter image description here

Edit: I want to mention the possibility of a non-symmetric window function, since the goal is to optimize the amplitude estimate relative to a fixed measurement latency. My intuition is that it may be possible to use a 'ramp' window to more heavily weight the most recent samples, and allow the overall window size to be greater.

For instance, consider the following window of length $T$ with integral 1:

$$w(t) = \left \{\begin{array}{ll} \frac{2t}{T^2} & t\in (0,T] \\ 0 & t\not\in (0,T]\\ \end{array} \right.$$

E.g., for $T = 2$: enter image description here

If we define the window latency as a linear weighting based on their time offset relative to the last sample taken, then for a window of length $T$:

$$weight_T(t) \triangleq T-t$$

As we would expect, a rectangular window $\frac{1}{T}rect\frac{t}{T}$ with integral 1 has latency:

$$\int_{0}^{T} \frac{1}{T}\cdot weight_T(t) dt = \frac{T}{2}$$

In the case of the ramp window, the latency is:

$$\int_{0}^{T} \frac{2t}{T^2}\cdot weight_T(t) dt = \frac{T}{3}$$

This implies that the ramp window can be 50% longer than the rectangular window and still have the same time latency.

Using the approach given in the answer below, which requires that the sum of the (discrete time) window coefficients = 1, we could for instance compare the total signal variance between a rectangular window of length 10 and a ramp window of length 15. Each rect window coefficient would = $\frac{1}{10}$, such that the total variance (assuming unit variance AWGN) would be:

$$\sigma^2_{rect} = (10)(\frac{1}{10})^2 = .1$$

The ramp window would have coefficients:

$$a_{ramp} = \{1,2,...,15\}\cdot (\frac{1}{120})$$

You can verify that the sum of these coefficients = 1. This would result in variance:

$$\sigma^2_{ramp} = \{1^2 + 2^2 + ... + 15^2\}\cdot (\frac{1}{120})^2 \approx .08611 $$

Therefore, it would seem that the ramp window would perform better than a rect window in AWGN for a given amplitude measurement latency. The only practical caveat would be that the ramp window may suffer from larger discontinuities (i.e. if first sample does not have similar value to last sample).

Here's a comparison of the magnitude response for a ramp window of length 1.5 vs a rect window of length 1, and their difference:

enter image description here enter image description here enter image description here

It does seem that the rect window has a generally smaller magnitude response than the ramp function. However, maybe the complex components of the ramp Fourier transform result in destructive interference among the noise components?

  • 2
    $\begingroup$ I assume your noise is AWGN? You should specify that as it will have a significant impact on what the optimum solution for amplitude estimation will be. The rectangular window does indeed have the minimum EQNBW. See fred harris classic paper: utdallas.edu/~cpb021000/EE%204361/Great%20DSP%20Papers/… $\endgroup$ Apr 11, 2017 at 3:24
  • $\begingroup$ @DanBoschen Yes, I just edited to specify additive Gaussian noise, but would prefer not to restrict it to white noise unless necessary. Thanks for the link, I'll look it over $\endgroup$
    – abc
    Apr 11, 2017 at 3:28
  • 2
    $\begingroup$ One reason to easily (I think) see why you need to specify the noise is consider using a rectangular window, which has significant "vulnerability" to other frequencies given the high sidelobe levels; so if the "noise" was a tone at one of the peak sidelobes, it would significantly effect your estimate of amplitude more so than other window choices. You may think of other noise distributions that match your application, but you just need to specify them. (Also noticed you said additive Gaussian, but for same reasons you probably should say Additive White Gaussian, or specify the filter profile $\endgroup$ Apr 11, 2017 at 3:42
  • 2
    $\begingroup$ If you know the frequency then a windowing technique may not be the best approach - you might be able to use that apriori knowledge in an alternative measure. Using the spectral leakage amplitudes from adjacent FFT bins you can interpolate a more accurate amplitude estimate. There were recent posts on comp.dsp group about this. One of their members also has a report comparing various techniques. The result will depend on the SNR. $\endgroup$
    – David
    Apr 13, 2017 at 12:28
  • 1
    $\begingroup$ An alternative to the Gaussian window is the "approximate confined Gaussian window", which is a very good approximation of the en.wikipedia.org/wiki/Window_function#Confined_Gaussian_window , which is supposed to give the smallest possible RMS frequency width. $\endgroup$ Apr 18, 2017 at 5:43

1 Answer 1


Consider a window just three samples long, $[a, b, c]$. To enforce symmetry, we rewrite the window as $[a, b, a]$. As an estimate $A(\omega)$ of the amplitude of angular frequency $\omega$, we'd calculate:

$$A(\omega) = \left|\sum_{i=0}^2 e^{-i k\omega}[a, b, a]x[k]\right| = \Big|ax[0] + e^{-i\omega}bx[1] + e^{-i2\omega}ax[2]\Big|$$

I'm using zero-based indexing here. When noise is not present, the above will only work perfectly if $a+b+a = 1$, so we can rewrite the window as $[a, 1-2a, a]$. For simplicity, let's estimate the amplitude of frequency $\omega = 0$ by:

$$A(0) = \left|\sum_{i=0}^2 [a, 1-2a, a]x[k]\right| = \Big|ax[0] + (1-2a)x[1] + ax[2]\Big|$$

If $x[k]$ have additive white noise with zero mean and a variance of $1$ (I mean that the noise comes from such a distribution), then the windowed samples have errors with variances $[a^2, (1-2a)^2, a^2]$. Because the noise is white, the distributions of the errors are independent and their sum will have variance that is the sum of their variances, $a^2+(1-2a)^2+a^2$. Plotting that:

Plot of the variance of error
Figure 1. Variance $a^2+(1-2a)^2+a^2$ of the error as function of the window parameter $a.$

The potentially complex number $ax[0] + (1-2a)x[1] + ax[2]$ describes both phase and amplitude, the latter of which is extracted by taking the absolute value. The error due to noise in that number is zero-mean, so we may wish to minimize the variance of that error. The minimum variance $1/3$ is at $a = 1/3$, which means that the optimal window is $[1/3, 1/3, 1/3]$. That is not a proof but a pretty good indication that the rectangular window minimizes the error in phase and amplitude estimation in presence of additive zero-mean white noise.

Had we not imposed symmetry, the window would be $[a, 1-a-c, c],$ and the variance of the error to minimize would be $a^2 + (1 - a - c)^2 + c^2.$ Requiring the partial derivatives with respect to each of $a$ and $c$ to equal zero would give the same optimal window as before:

$$\cases{4a + 2c - 2 = 0\\ 2a + 4c - 2 = 0}\\ \begin{align} &\Rightarrow a = \frac{1}{3},\quad c = \frac{1}{3}\\ &\Rightarrow 1-a-c = \frac{1}{3}\end{align}$$

  • 2
    $\begingroup$ Nice Olli! To generalize, if I understand correctly: Given the coefficients of the window as $[a_1,a_2, ..., a_N]$ you want to minimize $\sum_ia_i^2$ under the constraint $\sum_ia_i=1$. Using Lagrange multipliers, you can prove that $a_i=1/N$ is the optimal solution, i.e. a rectangular window. $\endgroup$ Apr 18, 2017 at 8:17
  • $\begingroup$ Thanks for the answer Olli, and @MaximilianMatthé for the generalization. This is a good way to think about it. However, if you removed the constraint of symmetry, do you think there could be a better window? (see my edit) $\endgroup$
    – abc
    Apr 18, 2017 at 19:29
  • $\begingroup$ It seems no, see edit to answer. $\endgroup$ Apr 18, 2017 at 20:11
  • $\begingroup$ @OlliNiemitalo To be more specific, I meant that if you removed symmetry, the window could be longer (i.e. more samples) without increasing the time lag. Therefore, there may be for example 4 coefficients of a non-symmetric window vs 3 coefficients of a symmetric window. $\endgroup$
    – abc
    Apr 19, 2017 at 3:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.