GestureSynth.me

Music calculator

FFT Window Coherent Gain Calculator

Find the coherent amplitude gain of a sampled FFT window from its coefficients. Determine the correction for a bin-centered sinusoid and inspect cancellation.

fft window coherent gain calculator

FFT Window Coherent Gain Calculator guide

Windowing changes the amplitude returned by an FFT even for a tone that lies precisely on a bin. Paste the actual finite window coefficients used by the analyzer. This is especially helpful for short windows where periodic and symmetric definitions have different averages.

Play the instrument ↑
Default result
0.5 coherent gain

Calculation and units

For a complex sinusoid centered on the analyzed bin, each windowed contribution aligns after demodulation. The normalized amplitude is therefore multiplied by the sum of the coefficients divided by their count. Divide the coherent bin value by that signed mean to undo this part of the scaling.

Worked examples

Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.

Four-point periodic Hann

Window coefficients = 0 0.5 1 0.5.

0.5 coherent gain. 4 window samples · -6.0206 dB magnitude gain; divide the complex bin by 0.5 to compensate. For a bin-centered complex sinusoid.

These four coefficients sample one period without duplicating its endpoint. A bin-centered complex tone accumulates only half the rectangular-window amplitude.

Rectangular window

Window coefficients = 1 1 1 1.

1 coherent gain. 4 window samples · 0 dB magnitude gain; divide the complex bin by 1 to compensate. For a bin-centered complex sinusoid.

Every sample receives the same unit multiplier. The coherent amplitude survives unchanged and establishes a baseline for comparing other windows.

Symmetric Hann of five points

Window coefficients = 0 0.5 1 0.5 0.

0.4 coherent gain. 5 window samples · -7.9588 dB magnitude gain; divide the complex bin by 0.4 to compensate. For a bin-centered complex sinusoid.

Adding the second endpoint changes the mean even though the plotted shape looks similar. Short windows make the symmetric versus periodic distinction especially clear.

Already normalized coefficients

Window coefficients = 0 1 2 1.

1 coherent gain. 4 window samples · 0 dB magnitude gain; divide the complex bin by 1 to compensate. For a bin-centered complex sinusoid.

Doubling the periodic Hann coefficients restores unit average. Individual coefficients can exceed one even when the coherent response is normalized.

Alternating signs

Window coefficients = 1 -1 1 -1.

0 coherent gain. 4 window samples · zero coherent response; amplitude correction is undefined. For a bin-centered complex sinusoid.

Opposite weights cancel for the coherent component. Dividing a spectral bin by this zero average cannot recover its original amplitude.

Constant half weight

Window coefficients = 0.5 0.5 0.5 0.5.

0.5 coherent gain. 4 window samples · -6.0206 dB magnitude gain; divide the complex bin by 0.5 to compensate. For a bin-centered complex sinusoid.

The coherent gain matches the first Hann example, but the leakage pattern differs. An amplitude correction alone does not describe sidelobes or noise bandwidth.

Interpreting the result

Use a rectangular window first to check the transform normalization. Then replace only the coefficients and compare the measured bin amplitude with the predicted ratio. A real sinusoid, one-sided FFT and special DC or Nyquist bins may require additional scaling conventions.

To check an implementation, export a short copy of the coefficient array before FFT padding. Sum the values using their original signs and compare the average against this result. A disagreement often reveals an extra endpoint or an amplitude normalization already applied by the analysis library.

Measurement and model limits

Coherent gain is an amplitude correction for an aligned tone. It does not remove leakage or estimate the integrated power of white noise. A window with zero coefficient sum cancels the coherent component entirely and admits no finite inverse correction.

Answers before you play

Common questions

Should I use the periodic or symmetric version?

Use the exact sequence multiplied into your frame. Rebuilding a common named window with the wrong endpoint convention can alter the answer.

May window coefficients be negative?

Yes. Preserve their signs in the arithmetic average. Applying absolute values first would hide real cancellation.

What does the displayed decibel value mean?

It is twenty times the base-ten logarithm of the absolute coherent gain. The signed linear gain still determines complex-bin correction.

Does zero padding change the mean?

Zeros added after windowing to lengthen the FFT do not become part of the window. Enter only the coefficients applied to actual data samples.