Reduce "flicker" in spectrum analysis / spectrogram I'm performing a series of FFTs on windowed extracts of an input signal, to get a frequency spectrum over time.  This is for a visualisation - I'd like to keep the window small, so the visualisation is fast-moving and responsive.

I'm only interested in the amplitude.  Occasionally, two or more frequencies are close enough that the amplitude flickers wildly with the interference pattern between the two.

What ways are there to reduce this flickering, that will disturb my time-domain responsiveness less than increasing the window length?

(For reference, this is the visualisation - I'm not concerned with the "flashes" when something happens in the audio, but the juddering is not good.)
My suggestion is to low pass filter the FFT slices.

Suppose your current FFTs are:
$$
X(n,k) = {\tt FFT}\{x[n] \cdot w_n[n]\}
$$
where your signal is $x[n]$ and the window $w_n[n]$ enforces how much of the signal you want to include in the FFT at time $n$.

Then form:
$$
Y(n,k) = \alpha \cdot Y(n-1,k)  + (1-\alpha) \cdot X(n,k)
$$
where $\alpha$ is a fraction between 0 and 1 (probably around 0.7 to 0.99).

This will effectively apply a first order lowpass filter to your FFTs.



Another possibility:

$$
Y(n,k) = {\tt median}\{X(n,k)\}
$$

where the median is taken over the last $M$ values of $X(n,k)$ i.e. $\{ X(n,k), X(n-1,k), \ldots, X(N-M+1, k)\}$.