After a few days of tweaking Codec2 guts, one question appeared. How much worse the LSP quantizer in ACELP (EN 300 395-2) is, as compared to that in Codec2? Both use the same excitation->filter model. The latter has excellent spectral distortion, much below of what could be called “transparent”. I remember comparing it back in 2022, but the results were never published.
Now, back to theory. As per Wai Chu “Speech Coding Algorithms”, the formant filter’s transparency criteria are as follows:
- average spectral distortion of less than 1 dB
- less than 2% outliers having a spectral distortion above 2 dB
- no outliers with spectral distortion larger than 4 dB
Spectral distortion is defined as a “distance metric” between frequency responses of two filters (we are using log magnitude spectra here):
(frequency responses) are based on discrete Fourier transforms of the measured and reference LPC filters. FFT bins are usually set to 256. Typically, at 8 kHz sample rate, and , giving 125..3,125 Hz range. Distortion outside this band is not considered perceptually critical.
Now back to Codec2 and ETSI ACELP. We are only going to focus on the 3,200 bps rate of the former (20 ms frames, 64 bits each). ACELP runs at around 4,567bps (30 ms frames, 137 bits each).
Codec2’s bit allocation for quantized LSPs is generous at 5 bits per LSP, yielding 50 bits total. ACELP isn’t as generous, spending only about half of that – 26 bits only.
Codec2 uses delta-encoded spectral frequencies in frequency domain – . ACELP utilizes split vector quantizer with LSPs in cosine domain – .
Let’s look at the spectral distortion of both codecs:

Now, the cumulative distribution (probability of SD below given threshold) for both:

Pretty much the same information, just from another angle. Both plots were generated using LibriSpeech English speech corpus.
Conclusion? Codec2 outperforms ACELP in terms of formant reconstruction but ACELP offers much, much more sophisticated excitation model. Excitation is Codec2’s biggest weakness. I really hope to be able to propose a better model in the coming months.






