Spectral envelope (source code)

= Spectral envelope

A <spectral envelope> is a smooth description of the broad shape of a <frequency spectrum>, separating slowly varying magnitude structure from fine spectral peaks. It is an estimated representation, not a uniquely defined extra part of the <Fourier transform>. Smoothing scale, whether one smooths linear magnitude or log magnitude, and the estimation method all matter.<Spectral Audio Signal Processing by Julius O. Smith III>[Spectral Envelope Extraction, Cepstral Windowing and examples]{ref}

For a periodic <signal> passed through a <linear time-invariant system>, the harmonic line at $k f_0$ has amplitude proportional to $|X_kH(k f_0)|$. The excitation sets the line spacing $f_0$, while the filter's frequency response shapes their broad heights. Changing the fundamental <frequency> can therefore move the lines without moving the filter's resonant peaks. A spectral envelope aims to capture that broad shape; overly aggressive smoothing can erase meaningful resonances, while insufficient smoothing retains the individual harmonics.