[Vorbis] oggenc adds severe distortion

Paul Martin pm at nowster.org.uk
Thu Aug 28 05:23:57 PDT 2008


On Wed, Aug 13, 2008 at 03:10:45PM -0400, xiphmont at xiph.org wrote:
> On Wed, Aug 13, 2008 at 1:18 PM, Ti Kan <ti at amb.org> wrote:
> > I routinesly rips my CDs to WAV and then convert to ogg vorbis format
> > for use in my car and portable player.  I don't usually notice anything
> > amiss, but on the last track of Mike Oldfield's "Music of the Spheres"
> > album ("Musica Universalis", at the very end crescendo), the converted
> > .ogg file exhibits terrible distortion (sounds like digital clipping).
> > This does not occur with MP3 or WMA formats.  I used a quality factor of 4.
> >
> > Does oggenc raise the amplitude (to cause digital clippiing)?  Any
> > idea why this happens?
> 
> No, but it does lose precision.  What is happening is not that Vorbis
> is amplifying, it's that the other encoders are attenuating when near
> clipping.  Vorbis does not do this; it is capable of representing and
> outputiing digital signals of > +0dB, and most players just clip it.

It can also be that the original CD's waveform is exceptionally "hot" and is
close to clipping (or has been mastered with soft clipping), and Vorbis is
trying to represent the frequencies present in the waveform in such a way
that on reconstruction they do go into clipping due to ringing.

You can't express a square wave accurately using a limited number of sine
waves. You will get some ringing at the rising and falling edges. If the
waveform was close to clipping anyway, the reconstructed waveform will go
into clipping due to the overshoot caused by the ringing.

Depending on how the player handles the reconstruction (ie. when it converts
from Vorbis's floating point representation to integers between -32768 and
32767) you may get the clipping happening before the player has made any
volume adjustment. If the player also does dithering, that may misbehave as
the signal approaches clipping.

MP3 can suffer from this, too, depending on the player.

-- 
Paul Martin <pm at nowster.org.uk>


More information about the Vorbis mailing list