So just how lossless is Apple Lossless? (A short test)

Discussion in 'Digital Audio' started by c-Row, Jun 8, 2007.

  1. c-Row macrumors 65816

    c-Row

    Joined:
    Jan 10, 2006
    Location:
    Germany
    #1
    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.
     
  2. Blue Velvet Moderator emeritus

    Joined:
    Jul 4, 2004
    #2
    Yes, lossless is lossless. ;)

    Could you do the same thing with a 320AAC? I'd like to know what comes out of that.
     
  3. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #3
    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....
     
  4. c-Row thread starter macrumors 65816

    c-Row

    Joined:
    Jan 10, 2006
    Location:
    Germany
    #4
    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)

    [​IMG]

    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)

    [​IMG]

    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)

    [​IMG]

    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)

    [​IMG]

    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. ;)
     
  5. sycho macrumors 6502a

    sycho

    Joined:
    Oct 7, 2006
    #5
    If it's the same bitrate, the file sizes will be the same.:rolleyes:
     
  6. c-Row thread starter macrumors 65816

    c-Row

    Joined:
    Jan 10, 2006
    Location:
    Germany
    #6
    Whops... right. Now where did I put my mind again...? :eek:
     
  7. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #7
    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.
     
  8. Mydriasis macrumors 6502

    Mydriasis

    Joined:
    Mar 17, 2005
    #8
    Wow, thanks for that test. I thought it was really interesting. :D
     
  9. bgalizio macrumors member

    Joined:
    Apr 28, 2006
    #9
    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.
     
  10. kalisphoenix macrumors 65816

    kalisphoenix

    Joined:
    Jul 26, 2005
    #10
    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.
     
  11. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #11
    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.
     
  12. sycho macrumors 6502a

    sycho

    Joined:
    Oct 7, 2006
    #12
    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.:)
     
  13. c-Row thread starter macrumors 65816

    c-Row

    Joined:
    Jan 10, 2006
    Location:
    Germany
    #13
    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.


    Oh, right... sorry for not mentioning, but those are the left and right stereo channel. ;) They don't have to be identical.
     
  14. c-Row thread starter macrumors 65816

    c-Row

    Joined:
    Jan 10, 2006
    Location:
    Germany
    #14
    No problem - just how can I do an MD5 sum again? I know it's in the Terminal, but that's about it... :eek:
     
  15. bgalizio macrumors member

    Joined:
    Apr 28, 2006
    #15
    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.
     
  16. killmoms macrumors 68040

    killmoms

    Joined:
    Jun 23, 2003
    Location:
    Washington, DC
    #16
    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:
     
  17. DJJONES macrumors 6502

    Joined:
    Mar 9, 2008
    Location:
    Newengland usa!
    #17
    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
     
  18. killmoms macrumors 68040

    killmoms

    Joined:
    Jun 23, 2003
    Location:
    Washington, DC
    #18
    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.
     
  19. AviationFan macrumors 6502a

    AviationFan

    Joined:
    Jan 12, 2006
    Location:
    Cedar Rapids, IA
    #19
    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
     
  20. DJJONES macrumors 6502

    Joined:
    Mar 9, 2008
    Location:
    Newengland usa!
    #20
    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
     
  21. xUKHCx Administrator emeritus

    xUKHCx

    Joined:
    Jan 15, 2006
    Location:
    The Kop
    #21
    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.
     
  22. DJJONES macrumors 6502

    Joined:
    Mar 9, 2008
    Location:
    Newengland usa!
    #22
    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.
     
  23. yippy macrumors 68020

    yippy

    Joined:
    Mar 14, 2004
    Location:
    Chicago, IL
    #23
    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.
     
  24. DJJONES macrumors 6502

    Joined:
    Mar 9, 2008
    Location:
    Newengland usa!
    #24
    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
     
  25. ausdave macrumors member

    ausdave

    Joined:
    Aug 28, 2007
    #25
    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.

    :)
     

Share This Page