[wplug] MP3 or OGG-Vorbis recovery tool?

Bill Moran wmoran at potentialtech.com
Mon Oct 27 14:26:22 EST 2003


Benjamin Slavin wrote:
> I certainly understand (rather, assumed) that if I simply use lame (et
> al) to encode that there would be quality loss, however my thought was
> as follows:
> 
> Semi-accurate analogy follows:
> 1) I create a formatted word processing document
>      [original]
>      [comparable to the WAV representation]
> 2) I save it as a plain text document
>      [minimal 'readable' form]
>      [akin to a WAV with the portions of the waveform missing]
> 3) then ZIP it
>      [compressed minimal form]
>      [similar to Ogg or MP3 encoding]
> 4) UNZIP it
>      [document identical to #2]
>      [Ogg/MP3 converted to waveform]
> 
> Steps 3 and 4 can be performed as many times as one wants.
> 
> I understand that one might say "but ZIP is lossless", and I understand
> that. However, MP3 and Ogg Vorbis represent waveforms. I'd imagine that
> there should be some mathematical way to go from MP3->WAV->MP3 without a
> quality loss, but I don't have a firm grasp on how the codecs actually
> work internally. I say this only because the quality of the WAV
> should(?) be identical to that of the MP3, and I was under the
> impression that a CD is just a representation of the waveform, so a CD
> burned from MP3s converted to WAV files should have a quality equal to
> that of the MP3.

Not really.  .wav files are made by sampling the waveform at fixed
intervals (44khz, right?), whereas mp3s use more complex mathematics
to store the data.  I don't have a great understanding of how the mp3
math works, but I've been lead to believe that it's similar in concept
to how jpeg files store images.  If that is correct, here is what your
circumstance is:

You start with a .wav (whether it's straigh from a CD, or in a .wav file,
it's in the same format) and you convert it to mp3 by changing the data
format and discarding some details that you'd never hear anyway, this
results in excellent compression.  Now you convert the mp3 back to .wav
format.  The .wav is exactly the same waveform representation as the
mp3, but is not the same as the original .wav.

At this point, logic would seem to tell you that if you saved the second
.wav as an mp3, but set the quality to maximum, you would get an exact
duplicate with the same compression ratio ... however, in the case of
jpeg files, this is not the case.  If you follow the same process (going
from bmp to jpg and back) you get an image of equal quality, but much
poorer compression.  If you compress the image any further, you will
lose _some_ quality.

Don't ask me why this is.  It seems to go against all the mathematics I
understand, but I would assume the case is similar with mp3s, since they
are basically jpegs for sound.

I think what happens is this:  In the case of an mp3, the compressed
waveform itself is not the only data stored, also stored is information
about what was done to make the waveform compress so well (which
information was discarded) but the .wav is not able to store that second
bit of information, so it's lost when you repeat the process.

-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com




More information about the wplug mailing list