Sunday, October 4, 2009

Audio Formats Part 2:

I have given a lot of though to audio formats for my computer stored music. Although I just have an average audio system, I love music and my ITunes library has most of my CDs in it, about 25 days of music. But I worry that when I upgrade my audio system, I may reach a point where I will be bothered by audio file compression (see last blog post for a big discussion of audio formats etc.) Soooo I have reached a few conclusions and have a little bit of a rant.
First off, if I am going to archive a piece of music either from CD source or from ripping my Vinyl, it is going to be stored in the flac format which is a lossless format that allows tags. The big disadvantage of flac format is that, of course, I-Tunes won’t play it (grumble, grumble about the smarmy kid in the Apple PC commercials.) So that is just good for Archiving but since it allows tags you can at least have some information stored along with the music file.
For non archived music (ripped from CDs I own etc.) on my computer, I am going to use WMP with the mp3 format at a 256 Kbps variable rate. This does have some compression, but I think that for my ears and my stereo speakers it will be fine. I have adjusted my WMP (Windows Media Player) and my ITunes both to use mp3 as the default and set WMP to rip at 2565 kbps.
When I download files from the internet, (of course using only approved sites that respect copyrights, not free pirate sites) I am going to go to sites that either flac format downloads whenever I can find what I want on them
(for example: HDTracks: http://www.hdtracks.com/index.php
And Digital Global Marine Live: http://www.dgmlive.com/ )
For standard Pop music, Amazon offers downloads at 256 kbps mp3s and that will be fine for that kind of music. My experience suggests that the m4a downloaded from the ITunes store are about the same size as the 254 Kbps files I have created, so I think that they will certainly not be worse (not verified though).

Second, I am going to use ITunes as my main player. It is just too convenient. Besides the cover flow is awesome if you take the time to find every single last stinking album cover which is a LOT of work. If the music isn’t in ITunes you won’t get it easily. One reason for using WMP to rip music is that it seems to have better luck finding album art than ITunes does. And Amazon often has album art that neither program can find.

Finally, my rant. Besides the fact that I want to find all the music I want in highest resolution, I want complete tags and art for each piece of music. I want album art back and front, plus any inside art to be viewable. I want not just song titles but also composers and performers for each piece, and correct listing of original recording, release date, re-mastering date, and any info about tape provenance and engineering. I want song lyrics and I want liner notes. I WANT ALL THE INFO THAT WAS ON THE ORIGINAL RELEASE AT LEAST! People we have computers now we can do this.. Record companies; give us what we got when we bought the original back in 1972 or whatever! Why is no one buying CDs? Its because you don’t really get more value for the purchase compared to downloads. Give us all this info in a little file on each CD that installs on your computer when you play the CD. Make it one of those computer enhancements that some CDs have.

Whew ok I’m taking a chill pill and I’m going to listen to some nice Oregon to mellow out.

High Definition Digital Audio Files Part 1 - Background

I have been exploring higher definition audio file formats to store digital music with less compression. I want to be able to archive music I download or rip from my own CDs that is as close to the source as is possible. I know, mp3 (universal) or mwa (Windows Media Player) or m4p (ITunes) formats are the commonest formats for music files. But they all have compression, which means that there is loss of signal. Now that signal may be outside of the audio response of the player I use or the ears I have, but if I want to keep a copy that is as close to the original as possible, I want to have some kind of format that has all the original file information.

Background: When an audio stream is digitized, you essentially sample the sound pulse value with a very small time between samples. Then you can run the file of digits back through your computer or audio system to reproduce the music. The rate at which you collect those samples controls the highest frequencies that you have recorded. CDs have high frequency content to capture all of the sound in the original recording, and frankly you will not be able to heart most of that through your computer speakers. In addition, CD files take a lot of space. To store data, .wav format (wave files) is a binary format that essentially copies all the information off the CD at the original CD sample rated, and has no compression at all. And wav files are general purpose, any stream of binary data can be stored in a wav file, including a photo or even a volume of data. The difference is in the decoding software. A loss free format such as flac allows some compression to reduce size.

Compression is a way to make the files smaller. I am going to consider two levels of compression. One is to do things to store redundant material in an efficient way or to store enough information to predict values correctly in a more compact form. This is lossless compression, because when the file is uncompressed, the new copy is the same as the original. This is the type of compression used in the flac format. The second way is to store the music values with less precision and to remove both low amplitude and the highest frequency signal

Mp3, wma and I-Tunes formats all are compressed, resulting in lost information and smaller file size. Once compressed the information cannot be recovered. When you compress files with the mp3 format, the compression options are the sample rate and a smaller sampling frequency, the more compression and the more of the original is lost. In Windows Media Player, for example, the choices for sample rate are from 128 KPS to 320 Kbps (Kbps here stands for thousand bytes per second). How do you convert this to the sample rate to determine loss of high frequencies?

Math of compression: Consider that the normal range of human hearing is commonly quoted as 20 Hz to 20,000 Hz (1 Hz =1 cycle per second). To completely recover a signal of 20 KHz you would have to have a sampling rate of 40,000 samples per second. For a 16 bit word, stereo recording with response to 20 Khz, we will need a rate of: 40 Khz x 16 bits x 2 channels = 1280 kbps. So, for the example of Amazon downloads, with 256 KPS Variable rate (according to Amazon’s web site today, September 27, 2009), the compression averages 5:1 over the whole musical piece. The trick is that they are VARIABLE RATE, with better sampling in the more complex passages and longer in simpler parts. So this is why most people feel that the higher bit rates, though they are compressed some, are still “comparable” with the original CD especially heard through most computer speakers indeed most home or car audio systems and with most ears.

Tags: Tags are strings of information you can ad to a file to identify that can be read and used by the decoding software. For example, ITunes files usually have an Artist, a Title, and more. It can also incude such things as graphic images or digital rights management software (DRM) This means that somewhere in the file you would find the character string containing the title. The term “Tag” refers to both the character string itself and its name, which the decoding software must understand in order to display it properly. You either get this added to your file when you rip it, it comes with this when you download it, or you add it your self Obviously any there can be as much information as you want as long as you have software that can display it properly. And you would want to have agreed upon tag names so ITunes and Windows Media Player can both read the same tags, for example understand that “Artist” may not be the same as “Performing Artist” or “Artist Name,” which is the tag I use as the sort in my own ITunes to make sure that I get “Springsteen, Bruce” and “Bruce Springsteen and the E-Street Band” to end up next to each other when I view my album covers. The wav file cannot have tags but the flac lossless compression can have tags.