Expand description
Linear predictive coding (LPC).
LPC models a signal as the output of an all-pole filter driven by a white excitation: each
sample is predicted from the previous order samples, x̂[n] = -Σ_{k=1}^{p} a[k] x[n-k], and the
coefficients minimise the prediction error power. Writing A(z) = 1 + a[1] z^-1 + … + a[p] z^-p,
the analysis filter A(z) whitens the signal into the residual, and the synthesis filter
1 / A(z) rebuilds the signal from it. The all-pole spectrum σ² / |A(e^{jω})|² is a smooth
estimate of the signal’s spectral envelope, which is why LPC underlies speech coding.
The coefficients here come from the autocorrelation method: the autocorrelation sequence is computed (implicitly windowing the signal with zeros outside the record) and the resulting Toeplitz normal equations are solved with the Levinson-Durbin recursion, which also yields the reflection (PARCOR) coefficients. The autocorrelation method always gives a stable synthesis filter (all reflection coefficients have magnitude below one).
See the book entry Parametric spectra: linear prediction, Burg and MUSIC.
Structs§
- LpcResult
- The result of an LPC analysis.
Functions§
- autocorrelation
- Biased autocorrelation estimate
r[k] = Σ_n x[n] x[n+k]for lags0..=max_lag. - levinson_
durbin - Solves the Toeplitz normal equations for an autocorrelation sequence
r[0..=order]with the Levinson-Durbin recursion. - linear_
predictive_ coding - LPC analysis of
xby the autocorrelation method. - lpc_
residual - The prediction residual
e = A(z) x(the analysis filter), same length asx, assuming zero initial conditions. - lpc_
synthesize - Runs an excitation through the synthesis filter
1 / A(z), the inverse oflpc_residual. - lpc_
to_ reflection - Converts
A(z)coefficients to reflection coefficients (the step-down recursion). Fails if a stage has|k| >= 1(an unstable or degenerate filter). - reflection_
to_ lpc - Converts reflection coefficients to
A(z)coefficients (the step-up recursion).