Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

c-Row

macrumors 65816
Original poster
Jan 10, 2006
1,193
1
Germany
Reading about compression rates and everything ususally won't replace some first-hand experience, so I ran a little test today. Might be interesting for those wondering (like I did). ;)

I encoded two versions of the same song (Trafik - Echoes), one in WAV and one in M4A lossless. Calling the first file ORIGINAL, I then converted the M4A file back to WAV and renamed it to REENCODED. In theory, if lossless would be really that, both files should be identical, right?

Next step, I started Cool Edit and loaded both files into a session, setting their starting point to the exact same position. Now here's the interesting part - I took one of the files and phase inverted it.

Usually, if you invert one file and play it back simultaneously with the original file, both signals will cancel out each other, leaving the listener with nothing but silence since one is the exact opposite of the other.

So I had the ORIGINAL and REENCODED (and now inverted) file in my session, moved the mouse over the PLAY button, clicked once, and...

... nothing. Pure silence. Not a single peak anywhere, just a perfectly flat line and absolutely no sound. Both files had perfectly cancelled out each other.

Which leads me to the conclusion that M4A is truly lossless as you can completely convert it back to its original WAV format without any loss. :cool:



[edit] If someone's interested, I could run this little test with some AAC encoded files as well, posting screenshots of what the mixed down tracks look like to visually compare compression quality.
 
Yes, lossless is lossless. ;)

Could you do the same thing with a 320AAC? I'd like to know what comes out of that.
 
I'd be interested also. If you don't mind and/or if it isn't too complicated, do the same song in 128, 256, and 320 AAC that you did in Lossless, and show all four results? That would be really interesting....
 
Took me some time (dinner got in my way ;) ) but here you go. Pictures show the visual difference between the original WAV and the compressed file - what you see is what you don't hear in your AAC/MP3. The sample is what gets lost during encoding. To not decrease their quality any further, I saved them as M4A files, or otherwise compression would water them down even more.

For some strange reason, the samples will be downloaded as .txt files - if someone knows how to fix that, please let me know.

I did the same song in 128, 256 and 320 kbit AAC and - to compare - a 128 kbit MP3 file. Interesting enough, there is far less difference between the 128 AAC and MP3 file than I thought (there still is some difference, though).

128 kbit MP3 (Sample)

128_MP3.jpg


There are some high peaks for sure, and the differences that are audible in the sample show just how much you are missing with a 128 kbit MP3 file. Next time, if somebody tells you there is no difference, point your finger at them and laugh hard. :D

128 kbit AAC (Sample)

128_AAC.jpg


Unsurprisingly, the AAC file doesn't "look" that much different from the MP3, but still, there are differences in the sound file. Keep in mind that the AAC file only takes up roughly half the size of the MP3 at the same bitrate, so if drive space isn't a problem, read on...

256 kbit AAC (Sample)

256_AAC.jpg


Roughly the same file size as the 128 kbit MP3, but much more information, or - as the picture shows - less losses due to better conversion. Especially the intro of the track is much more silent, meaning there is less difference compared to the original WAV. However, we are not done yet...

320 kbit AAC (Sample)

320_AAC.jpg


Now we are talking! Differences are even less, especially the vocals are much more silent and harder to make out than in the MP3 file for example. There is of course a difference between this and a proper lossless file - otherwise 320 AAC would be lossless already. ;) If you have listened to this last sample, just go back to the MP3 file and compare them again now.


Pictures and samples of the M4A file wouldn't show anything - as intended - so I left them out.


So while a 320 AAC file still isn't full quality, is as close as you can get. If you are running out of disk space rather fast, you should stick to 320 or at least 256 AAC files. If space isn't a problem, though, you might want to think about a M4A lossless library, especially if you want to burn them on CD-R again to listen to them on your car stereo (for example).


Test track Trafik - Echoes taken from the album Bullet, available at the iTMS as 128 kbit AAC file. ;)
 
Unsurprisingly, the AAC file doesn't "look" that much different from the MP3, but still, there are differences in the sound file. Keep in mind that the AAC file only takes up roughly half the size of the MP3 at the same bitrate, so if drive space isn't a problem, read on...

If it's the same bitrate, the file sizes will be the same.:rolleyes:
 
Oooh, exciting. Unfortunately, the images don't seem to load - either inline or by clicking on them. :( EDIT: NVM, you seem to have fixed this while i was in the bathroom! :eek: As for the song files coming up as text, it's because your webserver isn't configured to identify their MIME type correctly... it's a setting in Apache or whatever is used.
 
Thanks for running that test! It was interesting to see the differences between the encoded files. Regarding lossless, couldn't you also run an MD5 sum on the original WAV, encode the WAV to lossless, decode back to WAV (with MD5 sum) and compare the sums?

Looking at a flat line is pretty, though.
 
That's really cool. I would like to do this with a song I actually know :)

I'm redoing my library in ALAC, so every once and a while I look at my file sizes and say ":(", but this reminds me that it's worth it.
 
I'm sorry, so actually, I don't 100% understand what you've shown. You were talking about doing inverted overlays (so that you get, in essence, a difference curve). Is that in the pictures, and I'm missing it? I do see in places where the two versions are not identical.
 
You were talking about doing inverted overlays (so that you get, in essence, a difference curve).

You are correct in saying that it is a difference graph/wave. The graphs represent the result of subtracting the compressed MP3/AAC file from the original wav file.:)
 
You are correct in saying that it is a difference graph/wave. The graphs represent the result of subtracting the compressed MP3/AAC file from the original wav file.:)

Exactly. In a perfect world of lossless audio conversion, this graph would show nothing but a flat line. The higher the peaks, the larger the differences between the original WAV file and the encoded AAC/MP3 file.


mkrishnan said:
I do see in places where the two versions are not identical.

Oh, right... sorry for not mentioning, but those are the left and right stereo channel. ;) They don't have to be identical.
 
Regarding lossless, couldn't you also run an MD5 sum on the original WAV, encode the WAV to lossless, decode back to WAV (with MD5 sum) and compare the sums?

No problem - just how can I do an MD5 sum again? I know it's in the Terminal, but that's about it... :eek:
 
No problem - just how can I do an MD5 sum again? I know it's in the Terminal, but that's about it... :eek:

Download xACT from versiontracker. That's probably the easiest thing to do.

FWIW, I've done this with FLAC files, but never with SHN or Apple Lossless.
 
I can't believe that, nearly four years after its introduction (and well after its reverse-engineering by audio codec hackers), people still think that Apple Lossless is not, in fact, lossless. :rolleyes:
 
so in other words apple loseless is compressed file or lower in size but still contains the same frequencies as the wav uncompressed version???

and just to make sure did you rip the song from the original cd as wav?? or was is just some mp3 of it u had ???just wondering
 
so in other words apple loseless is compressed file or lower in size but still contains the same frequencies as the wav uncompressed version???

and just to make sure did you rip the song from the original cd as wav?? or was is just some mp3 of it u had ???just wondering

Yes, just like FLAC.

And it wouldn't really matter if the source file was a WAV or an MP3, for the purposes of this comparison. Any lossy re-encode will further degrade the sound. If you compared a FLAC (or Apple Lossless file) of an MP3 to the original MP3, it'd decode exactly the same—it's just that both would sound worse than the original CD. And an MP3 of an MP3 would sound even worse than the original MP3.
 
so in other words apple loseless is compressed file or lower in size but still contains the same frequencies as the wav uncompressed version???
Yes, sample for sample, it contains the exact same information as the original file. Really no different than ZIP and other generic data compression - just optimized for audio.

- Martin
 
okie dokie lol. alll i care about when im looking for sound quality is that i have the original cd from what ever studio or master house or cd dup facitly and ripped in wav format!!! cant gett better then that lol
 
ripped in wav format!!! cant gett better then that lol

Well you do get other benefits with apple lossless over and above wav such as the ability to add artwork to it while have the exact same audio quality so perhaps you can get better than that.
 
Well you do get other benefits with apple lossless over and above wav such as the ability to add artwork to it while have the exact same audio quality so perhaps you can get better than that.

ooo that sounds good. for using like itunes and stuff. the music im talking about that i usually i keep in wav format is soca reggea chuntey most of that isnt on itunes.
 
But you can also put album art on it manually. You don't have to rely on iTunes to do it automatically for you. If you have a picture of the art from online or scanning in the art from the CD you can add that to the file as well.
 
But you can also put album art on it manually. You don't have to rely on iTunes to do it automatically for you. If you have a picture of the art from online or scanning in the art from the CD you can add that to the file as well.

im to lazy to scan the cd coverss LOL i like cover flow its cool but just makes life more tough for me since i have thousands of albums that i would need to find album art for
 
Thanks OP

To the OP...

Thankyou so much for taking the time to do this...

I've been meaning to do this for ages!

Very interesting.

:)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.