WIPIVERSE All articles

Sliding DFT

The sliding discrete Fourier transform (sliding DFT, or SDFT) is a recursive algorithm in digital signal processing for computing a sequence of discrete Fourier transforms (DFTs) on overlapping data windows, in which successive windows differ by a single sample. If a conventional DFT (or fast Fourier transform, FFT) computes a spectrum from scratch for each window, the sliding DFT instead updates the previous window's spectrum incrementally as each new sample enters and the oldest sample leaves the window. This yields a new spectral estimate for every input sample at substantially lower computation than repeatedly evaluating complete DFTs, particularly when only a subset of the DFT frequency bins is required.

Definition

Let the input sequence be xₙ, and let N be the window length. Write Xₖ(f) for the f-th DFT bin of the window ending at time index k, with frequency index f = 0, 1, …, N−1. Then

Xₖ₊₁(f) = e^{j2πf/N} · [ Xₖ(f) − xₖ + xₖ₊N ].

In words: the oldest sample in the window (xₖ) is subtracted, the newest sample (xₖ₊N) is added, and the result is multiplied by the bin-dependent complex exponential e^{j2πf/N} = e^{−j2π(−f)/N}. The recursion is derived by substituting a shifted index into the DFT definition; because e^{−j2πNf/N} = 1 for integer f, the boundary term simplifies and the update reduces to a constant number of operations. The recursion is exact: it produces the same values as a standard DFT of the current window, with no approximation or information loss, provided the algorithm has been properly initialized.

Implementation and computational cost

A single DFT bin of the sliding DFT can be implemented as a comb filter (which computes the difference xₖ₊N − xₖ, common to all bins) followed by a complex resonator with a pole on the unit circle. When several bins are needed, the same comb filter is shared, and a separate resonator is used for each bin. Each new input sample requires one complex multiplication and two real additions per bin (plus a common real-valued difference for real input).

Because the bins are updated independently, only the bins of interest need to be computed, and the transform length N need not be a power of two. For each new sample, updating all N bins costs on the order of N operations, which is generally far less than the cost of repeatedly recomputing an N-point DFT (order N²) or recomputing an FFT (order N log N) for every sample. This advantage decreases if a new spectrum is required only every M samples; in that case the relative cost depends on M, and the FFT may become competitive. The sliding DFT nevertheless retains a latency advantage, since each output bin can be produced with only a few operations once the incoming/outgoing sample difference has been formed. Initialization can be performed either by flushing the delay lines with N zeroes (after which outputs become valid) or by seeding the recursion with an FFT of the first N input samples.

Numerical stability

Because the recursion contains a feedback path with a pole located on the unit circle, finite-precision arithmetic (fixed-point or integer implementation) can cause rounding errors in the complex coefficient e^{j2πf/N} to accumulate. If the effective coefficient magnitude exceeds unity, the corresponding bin output can grow without bound. Known remedies include:

  • Truncating the largest component of an offending coefficient by one least-significant bit so that its magnitude is at most unity;
  • Applying a damping factor slightly less than one — a modification that stabilizes the recursion but introduces bias in the estimated magnitudes; and
  • The modulated sliding DFT (mSDFT), which moves the complex exponential out of the recursive feedback loop by modulation and mixing operations, providing accurate and guaranteed-stable behavior.

Windowing and variants

Applying a time-domain window (e.g., Hann, Blackman, Kaiser) directly within the sliding recursion is difficult because of its recursive structure. One practical approach is windowing in the frequency domain: a kernel derived from the desired time-domain window is applied to the SDFT output. For some common windows the resulting kernel is sparse, allowing the operation to be implemented as a short convolution across neighboring bins; for other windows the kernel can be approximated by discarding small coefficients while preserving the sample-by-sample recursion.

Related and generalized methods include:

  • Sliding-windowed infinite Fourier transform (SWIFT), which instead of a finite rectangular window uses an exponentially decaying (infinite impulse response) window, with a two-rate variant (αSWIFT) producing an effective window proportional to e^{−αx} − e^{−βx};
  • Hopping DFTs and related structures for hop sizes greater than one sample;
  • Two-dimensional sliding-window DFT algorithms, including tree-based approaches (arXiv:1707.08213, 2017) that avoid recomputing overlapping regions.

Relation to other algorithms

The sliding DFT's recursive, resonator-based structure is closely related to the Goertzel algorithm (1958), which computes individual DFT bins efficiently. The sliding DFT is reported to require fewer computations than the Goertzel algorithm for real-time, sample-by-sample spectral analysis. It is also related to general recursive and observer-based formulations of the DFT.

Applications

The sliding DFT is used where a frequency-domain value must be updated continuously at the input data rate, and where latency and computational cost are constrained. Reported application areas include radar and communication systems, medical imaging, touch-screen and capacitive sensing, real-time spectral analysis and instrumentation, and computer music/spectral music processing.

History and literature

Early recursive spectrum-updating techniques appear in the engineering literature of the 1980s (for example, T. Springer, EDN Magazine, 1988). The method became widely cited through E. Jacobsen and R. Lyons, "The Sliding DFT," IEEE Signal Processing Magazine, vol. 20, no. 2, pp. 74–80, 2003, followed by an update in 2004. Subsequent work addressed stability (K. Duda, IEEE Signal Processing Magazine, 2010), frequency-domain windowing (Z. Rafii, IEEE Signal Processing Magazine, 2018), the SWIFT variant (L. Grado, M. Johnson, and T. Netoff, IEEE Signal Processing Magazine, 2017), and comparative reviews of recursive SDFT structures (Digital Signal Processing, 2022).

See also

Discrete Fourier transform; Fast Fourier transform; Goertzel algorithm; Short-time Fourier transform; Digital filter.

Browse

More topics to explore

    Browse all articles