Wednesday, November 28, 2007

Sister Blog, Sonare Coeli

Hello everyone,
For everyone who came to this blog first, my primary blog is Sonare Coeli. There I discuss the nature of music and how it relates to our Lord and Savior. My primary goal there, and now here, is to find the best possible way to musically express praise to Our God. I hope you enjoy reading both of these blogs and gain something useful from them.

May God bless you and keep you!

Lossless Audio

I needed to find a solution for my mammoth library of .aiffs. I came upon, "lossless audio compression," and found my answer. Lossless audio compression works essentially like a .zip file. When a file is zipped, it is compressed, and when it is unzipped, it is uncompressed. No data is ever removed. I do not know how the actual processes work, but this is the general concept.

Lossless audio compression works in the same way. It will take a raw .wav file, and compress it to half its size WITHOUT removing any data at all. The files are still large, but much, much more manageable. In addition to that, you now have full CD quality sound files in their original, unaltered form. If one would like more proof, notice the difference between listening to a CD and listening to an .mp3. Simply sit and listen. You will be able to tell a larger difference than you would have thought possible.

I read about many different methods and file formats, including Monkey's Audio (.ape files) and Free Lossless Audio Codec (.flac files), but eventually ended up going with Apple Lossless Format. This is where true audiophiles will pick nits. However, all of these files are lossless, as they say, and will give you the same full quality. Here are the reasons I chose Apple Lossless:

- iTunes, Windows Media Player, Rhapsody (to the best of my knowledge), and Real Player (to the best of my knowledge), will not play .ape, .flac, or many other lossless formats.

- Apple Lossless can be played in iTunes on Windows and Mac.

- I wanted all of my music organized in once place, and on a Mac, iTunes is best for that.

So, then began the process of finding all of my CDs and ripping them into iTunes as Apple Lossless files. As I said before, a file that is compressed in an .mp3 like way cannot be converted upwards. You can make a .wav out of an .mp3, but it will only contain as much sound data as the .mp3, but expanded. So, one will end up with a lemon of a file; a .wav that is the same quality as an .mp3, but ten times as large (or more). The data that was selected for deletion is now gone and the data that was selected for editing is now irrevocably changed. One must re-rip the files from the original CD.

I've gone through about thirty CDs as of right now. It is actually a very easy process, and the result is wonderful, lush, full quality audio.

File Conversion Troubles

I recently switched to Mac, and unexpectedly, iTunes and Mac OS X abhored the .wma file format (made by Microsoft), which most of my sound files were ripped as. Take the last statement with a grain of salt, it is a harmless final jab while I switch to a new operating system. However, iTunes would not add my .wmas to the library, nor play them. There were alternatives, but they were inefficient, and for a reason. Apple does not want Windows files to play, and Windows does not want Apple files to play (until the recent years).

So, in my struggle to find a solution, I turned to conversion of my audio files. I downloaded an excellent program called Switch, which will convert between many popular music file formats, for Windows and Mac. I converted my entire collection to the .aac format, which I may speak on later. Basically, an .aac file is a better version of an .mp3. It was called the, "successor to the .mp3," by the creator of the .mp3 file format. All that you and I need to know is that is handles the psycho-acoustic processes better and more accurately, while giving the file a much reduced size. I set the encoding options at 256 kbps CBR, just so that there would be no chance of loss with my 192 kbps CBR encoded .wma files. After the conversion I tested the results. I had found a slightly tedious plugin for Quicktime which would play my .wmas on a Mac, but it did not support a playlist or library, and could only have one file open and ready to play at a time. I compared the .wma in Quicktime to the .aac equivalent of the same music file in iTunes. They were drastically different.

The .aac was, "crisper," but lacked the mid-range and low-range frequencies that the .wma was putting out. The type of crispness was not one that was desirable by my standards either. I need to hear my mid-range and low end, all music is lost without it (I'm a bassist ;) ). On a more serious note, the low end was in fact severely reduced. I cannot say for sure whether it was a difference in the two players, or the two files. Both players, as far as I could tell, were set to a flat EQ, so I am led to believe it was a difference in the actual files.

I then took a drastic route. I converted all of my .wmas to .aiffs. .aiff files are the same as .wavs, they are raw sound data, and include ALL things that were recorded. This ensured that there would be no loss in quality. However, the file format was huge in terms of file size. It was true overkill. While the format was that of a raw sound file, it can only take as much sound data as its given. Once a file is turned into an .mp3 .wma or .aac, the sound data that was removed is now gone forever from those files, and cannot be returned by upwards conversion. So, essentially I had a library full of . aiff files that sounded like 192 kbps .wma files. This would not do, considering the heavy demands on file storage. This led me to explore lossless audio.

The Nature of .mp3s and Why It Is Best to Avoid Them

The nature of MP3 compression is not a secret, but I'm sure many people do not know exactly how it works. It is quite amazing how a 50 MB raw .wav file can be compressed to a tenth of its size or less and still sound the same to most ears. Raw .wav data is essentially that, raw sound waves recorded into a digital device. The digital representations of their real-world counterparts are exact replicas (well, technically they aren't entirely exact, but the difference is actually indiscernible to the human ear). These files include ALL sounds recorded, even those which are hard or impossible for a human ear to hear.

To reduce the enormous file size of this raw sound data, and MP3 employs a science called psycho-acoustics (essentially how the mind interprets sound) to remove or change these frequencies which are hard to hear. Basically, an MP3 encoder will begin by removing sounds which the average human ear cannot hear by themselves; generally sounds above 20,000 Hz, and below 20 Hz if I am not mistaken. Next comes the true psycho-acoustic processes. The encoder will then remove sound data from the file based upon models that it is programed with. Scientists have studied how the mind interprets sound, and have programmed these encoders to edit sound data, based on what the human ear can hear well, or not so well.

I will not delve into the depths of these processes, as I do not know enough myself, but one example would be that of a loud sound playing above a quiet sound. If the loud sound is loud enough, then human mind is said to focus on only the louder sound, and assume that the quieter sound it still playing underneath, until the loud sound ceases upon which time the ear then hears the quiet sound alone. An MP3 encoder would, in this situation, remove the sound data for the quieter sound while the louder sound was playing. The ear is said to interpret the quieter sound as continuing underneath, even if the data is not there. I think a diagram would help this explanation.


While .wav (raw sound data) data could be represented like this:

Louder Sound data: -------- -------- -------
Quieter sound data: ====================================



The .mp3 (edited sound data) rendering of the exact same
section of data would look like this in comparison:

Louder Sound data: -------- -------- -------
Quieter sound data: ======= ======


In this example, the quieter sound wave is represented by the === line, and the louder sound wave is represented by the --- line. In the .wav file representation above, the quieter sound continues, even while the louder sound is being played, as it would be in real-life. The human ear can still hear the quieter sound, but its focus is on the louder sound while it is playing. The .mp3 file representation takes advantage of this psycho-acoustic property. It removes the data for the quieter sound while the louder sound is playing, and leaves it alone elsewhere. The human ear is essentially "tricked" into thinking that it still hears the quieter sound. This applies at a very complex level.

I assume the next question by a reader might be, "Why can I hear the second guitar in my .mp3 file? The first guitar is much, much louder." The answer is that the sound an instrument produces is comprised of many sound waves that all come together to form its unique sound. This example speaks of two separate, pure frequencies. So, yes, you can still hear the second guitar under the first, but, in both instruments, you are not hearing all of the frequencies that would be there, because they are absent entirely in the .mp3 file.

Now obviously real-world applications of .mp3 files are not as black and white as this example. Obviously they sound very good, so the creators of the file format certainly knew what they were doing. That being said, it is an unnerving fact for people like me that I am not hearing every single bit of an instrument's tone quality and timbre when I am listening to an .mp3. The fact is that the difference between an .mp3 and a .wav file is actually very audible.

My first experience with this was with a comparison of a 128 kbps CBR .mp3 with a 192 kbps CBR .mp3. I knew the difference between 64 kbps and 128 kbps, but I thought after that it was near impossible to tell two files apart. I was ripping one of my own CDs and decided it would be best to go for "overkill" on quality, so I chose the 192 kbps format. In comparison with a similar 128 kbps, I could discern an audible difference. I bet that you, the reader, can as well; that is not great feat of the ear. Listen to the cymbals especially. They will sound more crystalline in lower quality files, and more clear in higher quality files. I invite you to test this. Take one song from a CD, and rip it in both 128 kbps and 192 kbps formats. If you cannot quite tell the difference, then start by comparing a 64 kbps and a 128 kbps file of the same song. I could not hear the difference of the 128 to 192 at first either. Even less discernible, but still very apparent to alert ears is the difference between a 192 kbps .mp3 and a 256 kbps .mp3. I began to rip everything at anywhere from 192 kbps to 320 kbps (I thought 320 was equal to CD quality at that time), but most commonly in the 192 kbps CBR .wma file format.

Now, after several years, what I was doing hit me. While 192 kbps is very high quality, it is still missing some of the sound data that would make a recording sound as close to the real setting as possible. There is a very audible difference between a raw sound file and a compressed .mp3, even of a bit rate as high as 192. So, now comes my plug for lossless audio file formats.

Tuesday, November 27, 2007

A New Audiophile

Hello everyone,
I hope for this to be the technological, and perhaps less formal, side of Sonare Coeli. Recently I've become aware of some interesting properties of digital audio. In this blog I'll discuss the nature of MP3s, why they should be avoided, and what should be sought when dealing with digital audio files.

Before I end this first post, I believe the term, "Audiophile," needs some explanation. Literally, a "Lover of Sound," this term refers to a person who strives at all measures to achieve the best possible quality of sound in whatever situation they may be involved in. These are the people that constantly adjust their home theatre surround sound system to get things just how they want them, and also the people who listen to raw .wav or .aiff files on their computer, for fear of losing quality in sound. I would consider myself only a second class audiophile, or maybe even third. I own good speakers, but not ridiculously-expensive Bose- engineered-to-perfection sound-of-the-gods speakers that some true audiophiles own. Once again, I have good speakers that are of excellent quality (and excellent price), and I think they sound wonderful. Now, for the real nuts and bolts.