Jump to content

MP3 vs. Ogg


franknputer

Recommended Posts

  • Members

Just saw this little blurb:

65% of all audio files by volume of traffic are still traded in the MP3 format, but a surprising 12.3% are in the open-source OGG file format (almost all of which are exclusively traded on the BitTorrent network, particularly in Asia).

 

http://blogs.zdnet.com/ITFacts/?p=8641

 

And I got to thinking about a test I recently read about in Mix: Take a mono WAV file, export it as MP3; then, convert it to WAV, invert it 180 degrees out of phase with the original & play them together.

 

A WAV 180 degrees out of phase with itself will cancel 100%. The test shows what is taken out by the MP3 compression process - what you hear on playback is the difference of the 2 files, or what is NOT cancelled in the original waveform by the inverted MP3.

 

I've been wanting to try this, so I did: I downloaded a WAV file of a sine wave sweep, -3 dB across the entire spectrum. I then ran the test, inverting it against itself (full cancellation) as well as against the highest bit rate (320) MP3 I could create using Audacity and the LAME encoder. (There was a LOT of information removed from the original file, I can tell you.)

 

Next, I tried the same using an Ogg Vorbis file, again at the highest quality available. Now this isn't exactly scientific - I don't know what bit rate it used, as Audacity sets it on a 1-10 scale. (I'll check the file sizes in a bit...) BUT - while there was viewable energy difference (the meters showed a low-level signal) it wasn't really audible.

 

I found that pretty amazing. :) Like I said, I'll have to check the file sizes - it could be that there was far less compression in the Ogg file. Still - the audible difference was huge.

 

EDIT: OK, I've come back to check the file sizes:

 

WAV: 948 k

MP3: 433 k

OGG: 97 k :eek:

 

Of course, the MP3 also has ID3 tag data in there somewhere - anyone know how much space that would take up? I didn't put anything in except Genre, which is selected from a drop list (no way to leave it blank).

 

Damned interesting, though.

Link to comment
Share on other sites

  • Members

I've always thought that Ogg sounds better than MP3. Evidence is nice, though.

 

Have you thought of trying 2 sines, 1 swept and 1 constant freq? This would point out how they handle intermod distortion.

 

I also wonder how Monkeys audio ( http://www.monkeysaudio.com/ )would fare against the other two. It is theoretically lossless, though, so I'd expect it to be at least better than the compressed ones.

Link to comment
Share on other sites

  • Members

Try a music file and recreate the test.

 

The codecs might not be as damaging to a single frequency (even swept) sound as they would to real music. I'm curious to see how the results differ.

Link to comment
Share on other sites

  • Members

The above points are good ones

 

given tha the compression might be "tuned", a larger test corpus is probably wise

 

I'd suggest at least

1) sines in octaves or decades

2) a PWM'd rectangular wave

3) a swept sine

4) white and pink noise

5) A dynamic range test sequence (maybe sine and noise with modulated dynamics)

6) music of a few varieties

 

just from the hip - it definitely isn't comprehensive and there may be some funcional duplication

Link to comment
Share on other sites

  • Members

OK - I found a problem with the initial check which explains the HUGE differences in noise, & probably file size too. Seems that the MP3 has a bit of "hash" in it, that offsets the beginning of the file - and thus, the cancellation is screwed up. This could be an artifact of the LAME encoder OR the act of importing it back into Audacity as a WAV - I don't have time now to test this.

 

Did it again - this time, using white noise peaking at -3 dB, and I manuallly aligned the MP3 to the inverted wave form at the sample level.

 

The WAV still shows full cancellation, of course.

 

The MP3 reads between about -17 to -21 dB on the meters, so average that at -19 dB.

 

The Ogg file averages at -31 (peaks running between -29 & -33). So, it still shows significantly less damage to the original audio than the MP3.

 

So - to sum it up:

 

File Sizes -

WAV: 862 kb

MP3: 395 kb

OGG: 312 kb

 

Residual energy after cancellation:

 

WAV: - inf (full cancellation)

MP3: - 19 dB

OGG: - 31 dB

 

Remember, this is what is REMOVED from the original file, so less is, in this case...more. :)

Link to comment
Share on other sites

  • Members

I'm not going to get super-deep on the subject - I do have other stuff to do. ;)

 

I'm pretty sure there are other factors that might account for some of the differences. Still, it is an interesting exercise, though - I suggest that some of you try it out too & post what you find.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...