View Full Version : So just how lossless is Apple Lossless? (A short test)
c-Row
Jun 8, 2007, 12:24 PM
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.
Blue Velvet
Jun 8, 2007, 12:25 PM
Yes, lossless is lossless. ;)
Could you do the same thing with a 320AAC? I'd like to know what comes out of that.
mkrishnan
Jun 8, 2007, 12:37 PM
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....
c-Row
Jun 8, 2007, 03:21 PM
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 (http://www.klf.de/macrumors/128_MP3.m4a))
http://www.klf.de/macrumors/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 (http://www.klf.de/macrumors/128_AAC.m4a))
http://www.klf.de/macrumors/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 (http://www.klf.de/macrumors/256_AAC.m4a))
http://www.klf.de/macrumors/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 (http://www.klf.de/macrumors/320_AAC.m4a))
http://www.klf.de/macrumors/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. ;)
sycho
Jun 8, 2007, 03:27 PM
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:
c-Row
Jun 8, 2007, 03:37 PM
If it's the same bitrate, the file sizes will be the same.:rolleyes:
Whops... right. Now where did I put my mind again...? :o
mkrishnan
Jun 8, 2007, 04:34 PM
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! :o 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.
Mydriasis
Jun 9, 2007, 05:39 AM
Wow, thanks for that test. I thought it was really interesting. :D
bgalizio
Jun 10, 2007, 10:53 AM
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.
kalisphoenix
Jun 10, 2007, 11:04 AM
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.
mkrishnan
Jun 10, 2007, 11:24 AM
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.
sycho
Jun 11, 2007, 06:36 PM
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.:)
c-Row
Jun 12, 2007, 03:00 AM
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.
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.
c-Row
Jun 12, 2007, 03:04 AM
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... :o
bgalizio
Jun 12, 2007, 08:00 AM
No problem - just how can I do an MD5 sum again? I know it's in the Terminal, but that's about it... :o
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.
killmoms
Apr 3, 2008, 07:46 PM
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:
DJJONES
Apr 3, 2008, 07:51 PM
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
killmoms
Apr 3, 2008, 07:56 PM
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.
AviationFan
Apr 3, 2008, 08:02 PM
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
DJJONES
Apr 3, 2008, 08:19 PM
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
xUKHCx
Apr 3, 2008, 08:22 PM
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.
DJJONES
Apr 3, 2008, 08:41 PM
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.
yippy
Apr 3, 2008, 08:59 PM
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.
DJJONES
Apr 3, 2008, 09:21 PM
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
ausdave
Apr 3, 2008, 10:05 PM
To the OP...
Thankyou so much for taking the time to do this...
I've been meaning to do this for ages!
Very interesting.
:)
Luap
Apr 3, 2008, 10:58 PM
I thought this was a really stupid post at first. Of course its lossless! But then of course I read the rest of it, which turned out to be very informative and interesting..
Thanks for the info :)
Ptown Bopper
Apr 4, 2008, 01:33 AM
Thanks!! I'm currently 130 CD's into converting some 500 plus CD's to Apple Lossless for my music server. Nice to know I'm not completely wasting my time.
c-Row
Apr 4, 2008, 02:30 AM
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:
Sometimes people want to see it with their own eyes or hear it with their ears. ;)
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
I don't remember whether it was an already ripped WAV on my drive or a constant re-ripping from the original CD, but the source file was uncompressed for sure.
[edit] Still need to do the md5 comparison, although I guess the embedded tags might lead to different results...? Unless you'd burn the Lossless file to CDR and do a re-rip.
Slickgonzalez
Apr 1, 2009, 11:01 AM
This was truly eye-opening.
Within the past year I have switched to ripping everything in ALAC, but before that I was a V0 man.
Lossless is obviously the way to go. I always knew mp3's were lossy, but it's amazing when you actually HEAR what you're LOSING.
Anyone who cares about their music collection should use a lossless codec. And stop using the ITMS!
ChrisA
Apr 1, 2009, 12:57 PM
...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.
That is not true. That you see is literally the difference. Difference could be the result of something that is added or lost. Your test can't tell which it is.
The way MP3 encoding works is really not to "throw away" some data. What it does is "substitute" the actual data with a mathematical function that creates data like the audio data. What is recorded to the MP3 file are sets or parameters that are given to this function. So in effect ALL of the data are thrown away and new data takes its place.
What you have shown us is the difference between the output of a mathematical approximation and the true audio data. If you ask what data are "lost" in lossy compression, the answer is technically "all of it"
The function is designed to not reproduce data that the ear does not listen to. In music we pay a lot of attention to something the "attack" of a note but don't care as much about timbre. The idea of lossless is to "toss out" parts of the sound that will not be missed as much. The the size of difference does not tell you as much as we might think. That matters is what's in there.
Would be interesting to listen to it.
.JPG works the same way.
All that said. when I use my good headphones I can hear the difference from 320K mp3 and lossless in about 1% of the music I have. (not 1% of the songs, but 1% of the time) it was anoyying so I re-ripped everything to lossless. I have about 12,600 tracks in my iTunes library all but about 600 ripped from CD.
VirtualRain
Apr 2, 2009, 02:29 AM
Thanks for this!!!
What are the relative file sizes of all the formats compared?
ChrisA
Apr 2, 2009, 10:37 AM
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, "lossless" is as the name says. It is about the same as if you "zipped" the .wav file. Here is how it works (simplified)
WAV might have these numbers in it 12, 45, 46, 36 Then FLAC or Apple Lossless might have this 12, 33, 1, 10. The second string takes less space to write but can be used to reconstruct the first string. (2nd string is the difference between the values.) Thay use other more powerful tricks, but same idea
Yes, I have seen that. Someone re-encodes a downloaded MP3 to FLAC and thinks the sound is better.
Luap
Apr 2, 2009, 11:19 AM
Thanks for this!!!
What are the relative file sizes of all the formats compared?
This is an old(ish) thread which was brought back to life the other day. Anyway, relative file sizes are easy to determine yourself. Just rip the same track into a few different formats/bit rats to see the differences in file sizes.
But given that the thread is about lossless codecs, expect a roughly 50% reduction in file size from the original uncompressed audio file.
c-Row
Apr 3, 2009, 05:09 AM
The idea of lossless is to "toss out" parts of the sound that will not be missed as much.
I don't think so, since you can completely reconstruct the original file. "Toss out" might be a misleading term here.
.JPG works the same way.
I disagree, for the same reason as above. JPG is the equivalent to MP3 or AAC, since you can't get the original file back in its full complexity (saving to JPG at full quality might be an exception here, but I don't think so). If anything, it's PNG which would be to pictures what ALAC is to audio.
Teej guy
Apr 3, 2009, 10:58 AM
I don't think so, since you can completely reconstruct the original file. "Toss out" might be a misleading term here.
Absolutely. The I believe a more correct way of looking at it would be "substitute with a more efficient representation of the data."
"Toss out" is strictly lossy.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.