# Spectral leakage **Spectral leakage** is the appearance of frequency content in a computed spectrum that was not present in the original signal, produced whenever a step in the analysis is not itself a [[Linear_time-invariant_system|linear time-invariant]] operation on that signal. A linear time-invariant operation can only reshape the magnitude and phase of frequencies already present in a signal; multiplying it by anything else — a finite observation window, or the train of impulses a digitizer effectively multiplies a continuous signal by when it samples — is not linear time-invariant, and both create frequencies that were not there before. [[Sampling_(signal_processing)|Sampling]] produces its own well-known form of leakage, aliasing; this article is about the more everyday case, windowing, where truncating a signal to a finite record smears a frequency that falls between two bins of a [[Discrete_Fourier_transform|discrete Fourier transform]] across many of them at once. The Goertzel algorithm sketch on this page approaches the same effect from a single bin. It computes one frequency component of a discrete Fourier transform with a small recursive filter rather than a full [[Fast_Fourier_transform|FFT]], and letting the reader detune the tone driving it away from the frequency it targets shows the bin's response falling off the same way a windowed spectrum's leakage skirt does: leakage is not something a bin-by-bin computation avoids, only something a full transform displays all at once. ## Spectral analysis Windowing is the most common source of spectral leakage and the one an analyst controls directly, by choosing how a finite record is shaped before it is transformed. [[Window_function|Window functions]] exist because every choice trades the narrowness of a rectangular window's main lobe for the lower side lobes of a tapered one, and that trade plays out differently depending on the kind of signal, the noise mixed in with it, and how the transform itself is built. ### Choice of window function #### Discrete-time signals For a signal already sampled at a rate fs and observed for N samples, the transform's bin spacing is fixed at Δf = fs/N regardless of which window is applied,[^tib129] and the window only changes how a frequency that falls between bins is distributed across them. At fs = 64 Hz over a one-second record, a 4 Hz tone falls exactly on a bin and reads as a single clean value, while a 4.5 Hz tone, sitting between two bins, spreads its energy across many of them under a rectangular window.[^tib143] Zero-padding the record before transforming narrows the spacing between the plotted points, but it adds no new information: it interpolates the same, already leaked spectrum more finely rather than resolving anything further.[^tib144] #### Noise bandwidth A window's main lobe does more than set how two tones are told apart; it also sets how much noise power a single bin collects, since a wider main lobe averages noise from a wider slice of the spectrum into every bin it reports. This equivalent noise bandwidth is one of the standard numbers used to compare windows, alongside the main-lobe width and highest side-lobe level tabulated in "Some window metrics" below, and it is the reason a window chosen to suppress leakage from a strong nearby tone also raises, as a side effect, the noise floor a weak signal must be seen above. A receiver or instrument that reports a noise level in a given bandwidth is, in effect, quoting a number that already has the window's equivalent noise bandwidth folded into it, which is why two spectrum analyzers can disagree slightly on a noise floor even when both are reading the same signal correctly. #### Processing gain and losses A window's average value sets its coherent gain: because a taper is smaller than 1 almost everywhere across the record, a windowed measurement's amplitude must be rescaled by the reciprocal of that average to read a tone's true level, a correction a rectangular window does not need. A separate loss, the scalloping or picket-fence loss, appears when a tone falls exactly between two bins rather than on one: even with no noise at all, the best any bin can report is reduced from the tone's true amplitude, and by how much depends only on the window's shape. For a rectangular window the worst case is close to 4 dB, a figure repeated often enough in spectral-analysis practice to be treated as a rule of thumb for how much margin a measurement needs when a tone is not guaranteed to land on a bin. ### Symmetry Most windows used for spectral analysis are symmetric about the center of the record, which keeps the window's own frequency response real-valued and centered on zero frequency. A one-sided or otherwise asymmetric window, by contrast, has a complex frequency response and adds a linear phase shift of its own on top of whatever it does to magnitude.[^tib97] Symmetry has a second, more practical meaning for a window generated to be exactly N samples long and fed to an N-point transform. #### DFT-symmetry A window that is symmetric in the ordinary sense, with its first and last samples equal, does not divide evenly into an N-point block for a discrete transform, because one edge sample is effectively shared with the period the transform assumes comes next. Windows built for this use are therefore usually generated as though they were one sample longer and then have that extra sample dropped, so the periodic extension the transform assumes stays consistent with the window's own symmetry instead of repeating a doubled edge sample. ### Convolution Multiplying a signal by a window in time is, in frequency, a [[Convolution|convolution]]: the signal's true spectrum is smeared by the window's own transform rather than left untouched. The same mechanism explains aliasing as another kind of leakage: sampling multiplies a continuous signal by a train of [[Dirac_delta_function|delta functions]] spaced at the sampling interval, and a product in time is a convolution in frequency there too, which is why sampling replicates a spectrum at every multiple of the sampling frequency instead of merely recording it unchanged. Windowing before transforming and sampling before recording are, in this sense, the same operation applied at two different stages of the same pipeline, and both leave their mark on the resulting [[Spectral_density|spectral density]] estimate. ## Some window metrics The trade a window makes can be reduced to a handful of numbers, several of them already implicit in the comparisons above. Highest side-lobe level states, in decibels below the main peak, how far down a strong tone's own interference falls before it could bury a weak one nearby; a rectangular window's response is a sinc function whose first side lobe sits close to its highest, worst-case level among windows in general use.[^tib96] Main-lobe width states how many bins wide the peak itself is; a Hann window's is about twice a rectangular window's, which is the price paid for its far lower side lobes.[^tib101w] | Window | Main-lobe width (× 1/T) | Highest side lobe | |---|---|---| | Rectangular | 1 | about −13 dB | | Hann | 2 | far lower, and falling with frequency | Equivalent noise bandwidth restates the same main-lobe width as an effective number of bins of noise power collected under a tone. Scalloping loss states the worst-case amplitude error for a tone that falls exactly between two bins, and worst-case processing loss combines scalloping loss with the coherent-gain correction into a single figure for how much signal-to-noise ratio a window can cost in the least favorable case. None of these numbers ranks the window shapes from best to worst; each states only where, on the same narrowness-versus-leakage curve, a given shape happens to sit, which is why the choice depends on whether the [[Dynamic_range|dynamic range]] between nearby tones or the sharpness of resolving them matters more in a given measurement. ## Microsims The Goertzel algorithm sketch on this page computes one bin of a discrete Fourier transform with a small recursive filter rather than a full [[Fast_Fourier_transform|FFT]], and its own diagnostics panel keeps a running comparison of the saving. The input-frequency and target-frequency sliders set the tone driving the resonator and the bin frequency it is tuned to; the block-length control sets N, the number of samples processed per detection, with a longer N narrowing the bin the same way a longer record narrows any DFT bin; a noise toggle adds interference; and a DTMF preset drives the resonator with a real touch-tone pair. The resonator's internal state rings up sample by sample when the input sits on the target frequency and stays small off it — the same leakage skirt a single windowed DFT bin has, seen from the side of one bin's own arithmetic rather than removed by it. *Try:* Detune the input-frequency slider away from the target a little at a time and watch the peak state fall along that skirt well before the two frequencies are a full bin apart, in the sketch's own readout of the resonating state. A three.js companion, a sibling build of [[Window_function|Window function]], renders how truncating a record smears a single tone across neighboring bins as the tone slides between bin centers. <!-- SIGSIM:BEGIN g35 — Signal Processing portal microsim (framework build, specs/sims/Spectral_leakage.json); do not hand-edit inside --> **Microsim — three.js (Wikitube framework), pending deploy:** *Spectral leakage: a tone that does not sit on a bin* will play here once `https://wikitube-3d-microsims.netlify.app/signal/Spectral_leakage.html` is live. <!-- pending: <div class="wt-sim" data-src="https://wikitube-3d-microsims.netlify.app/signal/Spectral_leakage.html" data-title="Spectral leakage"></div> --> *Built from `MICROSIM_GUIDE/specs/sims/Spectral_leakage.json`; part of the [[Signal_processing]] set ([[PORTAL_Signal_Processing]]).* <!-- SIGSIM:END --> ## Wikipedia : Wikitube **Strict pair:** [Wikipedia](https://en.wikipedia.org/wiki/Spectral_leakage) : [Wikitube](https://en.wikitube.io/wiki/Spectral_leakage) Skeleton mirrored at revision 1369587834. Prose, emphasis and the microsims are Wikitube's own. ## See also - [[Spectral_density]] - [[Discrete_Fourier_transform]] - [[Window_function]] - [[Aliasing]] - [[Fast_Fourier_transform]] - [[Short-time_Fourier_transform]] ## Notes The Goertzel algorithm sketch is ILLUSTRATIVE: its DTMF preset drives the resonator with an idealized two-tone signal rather than a captured telephone signal, and its noise toggle adds a fixed synthetic interference level rather than one measured from a real channel. ## Page citations Page numbers in the references below are the PDF page numbers of the open edition linked there, not the printed page numbers of the original work. ## References [^tib129]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering: Theory*. 2026, pp. 129–132 (PDF pages). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. [^tib143]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering: Theory*. 2026, pp. 143–144 (PDF pages). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. [^tib144]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering: Theory*. 2026, p. 144 (PDF page). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. [^tib97]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering: Theory*. 2026, p. 97 (PDF page). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. [^tib96]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering: Theory*. 2026, p. 96 (PDF page). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. [^tib101w]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering: Theory*. 2026, pp. 101–102 (PDF pages). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY. <!-- Hubs: Signal_processing. Portals: PORTAL_Signal_Processing. Signal Processing portal wave 1 · 2026-09-17 · drafted. -->