The equivalent noise bandwidth of a window is the width of a
rectangle whose area contains the same total power as the window.
The height of the rectangle is the peak squared magnitude of the window's
Fourier transform.

Assuming a sampling interval of 1, the total energy for the
window, *w(n)*, can be expressed in the frequency
or time-domain as

$${\int}_{-1/2}^{1/2}|}W(f){|}^{2}df={\displaystyle \sum _{n}|}w(n){|}^{2$$

The peak magnitude of the window's spectrum occurs at *f*=0.
This is given by

$$|W(0){|}^{2}=|{\displaystyle \sum _{n}w}(n){|}^{2}$$

To find the width of the equivalent rectangular bandwidth, divide
the area by the height.

$$\frac{{\displaystyle {\int}_{-1/2}^{1/2}|}W(f){|}^{2}df}{|W(0){|}^{2}}=\frac{{\displaystyle \sum _{n}|}w(n){|}^{2}}{|{\displaystyle \sum _{n}w}(n){|}^{2}}$$

See Equivalent Rectangular Noise Bandwidth for an example that
plots the equivalent rectangular bandwidth over the magnitude spectrum
of a Von Hann window.