|
fingersoup
|
 |
« on: April 27, 2005, 09:14:12 PM » |
|
Ever wonder what all those numbers mean when you are downloading samples? Want to know how to get the BEST possible sound when recording your samples? Do you want to know how to make your mastered files smaller, or optimize the file for CD? This article attempts to tell you what all the numbers mean so that you can make your recording sound better.
Digital Vs. Analog
Everyone knows sound travels in Waves, right? Everyone also knows that computers work off ones and zeroes. The tricky bit to figure out, is "How do you turn Waves into ones and zeroes?"
Of course, your first answer might be "My sound card figures that out... I don't need to worry about it." And you couldn't be further from the truth. There are fundamental things going on there that will let you IMPROVE your sound recordings.
Raw Waveforms
Sample Size (The Original Bitrate)
Your sound card has circuits that can sense the amplitude and phase of a sound at any given point. It converts it to a number. This number is called a sample (Hence the term Sampling). If you load your sound into an editor such as Audacity, and zoom in really close (until you can see little nodes/dots) each node is a sample. Sample size affects how detailed and accurate your recorded sound is.
This number is measured in bits. Now, using basic binary math, we can tell that an 8 bit sample has 256 different possible values for phase and amplitude. a 16 bit sample has 65536 different values. a 24 bit sample (for those of you with expensive sound cards) has 16777216 values available, to measure amplitude and phase. What does this mean? The more bits, the higher the dynamic range. You can fit more subtlety into your sound. You can have higher highs, and lower lows.
Sample Rate
Now one sample isn't going to give you very much... You need to have a bunch of them. I mean, a LOT. This is your Sampling rate. The speed at which your sound card records samples, at regular intervals. When your sound is played back using an identical rate, it SHOULD sound the same as when you recorded it. Provided you're taking enough samples that is....
Samples need to be recorded very fast. So fast, that we refer to this rate in Hz, and kHz. Whereas the samples themselves are the "Up and down", or a point on the Y-axis of a graph, your samples are placed sequentially (one after another) on the X-axis, from left to right. X is time, Y is amplitude, and your sample rate is the speed at which time passes. the bigger number of your sample rate, the faster the samples are played back, resulting in a higher pitch, and more waveform accuracy.
Channels
Up until now, we've dealt with a single waveform. One channel. However, once we go stereo, we've added another channel to the mix. Double the amount of work the sound card needs to do. Want to export your track, and encode it in 5.1 surround? That's 6 channels (3 front, 2 rear and subwoofer). That's 6 independent audio streams. What does this do? it increases file size to 6 times the size of a single channel. You need to decide, Do you want to do this?
Every raw digital waveform has these 3 Properties. Phone networks use a standard of an 8000hz sample rate, 8 bits per sample, and one channel. Compact discs are 44100hz, 16 bit stereo.
Now if I'm going for quality, why wouldn't I sample everything at 96000hz at 24 bit Stereo? Answer: Nyquist's theorem. Basically, it states, that if you sample at Double the rate of your highest audio frequency, If you output through a lowpass filter you get a PERFECT reproduction. Thus, in Tracking, most samples don't need to be any bigger. 44100hz is good enough for most purposes. Sometimes, it's even way too much, especially if it's a simple sine wave...
There is another audio problem that trackers encounter - Mixing. If my software uses a 16-bit mixer at 44100hz, on several samples that stretch that limit, then I may introduce mixing errors when the final output is played. Solution? Most Audio software have mixers that mix to 32 bits of accuracy, which reduce the effect of mixing errors. The mix is then interpolated back to 16 bit, digitally, thereby minimizing errors.
Fun Math Fact:
Uncompressed audio File size in bytes= File header info + ( (# of samples * sample size * channels) / 8 )
Compressed files
Many times it is necessary to distribute your song in a compressed format. What does this do to the sound? Are you losing something? Lets explore...
The New Bitrate
We live in a digital world, with a digital network and ISP Regulated speeds/bandwidth limits. There is a new definition for bitrate, and it doesn't refer to sample rate. It refers to how big a chunk of data it takes to send 1 second of audio. This is what most people call bitrate these days. You've all seen it... In Winamp, or Windows Media Player, you see a number that looks like 128kbps, or 192kbps. This is Kilobits per second. 1 kilobit=1000 bits, or 125 bytes.
Uncompressed Files
This is what you want if you are editing your files, or are mastering them. Gargantuan in size, these files will play back with minimal processor power. These are WAV, RAW, AU, and AIFF files. They're what we've been talking about. so far.
Lossless Compression
Such a thing does exist. Many people compare this to a playable ZIP file. Basically, whatever you get when you play back, will be identical to what you recorded. It takes time to uncompress the file - either in chunks for streaming, or all at once, but the end result is the same audio. This is a great format for audiophiles who wish to get the full dynamic range. Formats are FLAC, and Monkey's Audio. These files typically compress an audio file from half to 1/3 it's original size. It's great if you want to distribute stuff with full fidelity, with medium bandwidth costs.
Lossy Compression
A CD can hold 700MB of raw music. 1/3 of 700MB is 233.3 MB. That's a lot, if you're distributing over the net. You're going to have to lose something in your mix, but maybe that's not such a bad thing, compared to the massive bandwidth costs of your webspace provider, right?
Enter the world of MP3, OGG, WMA, and AAC. Each with it's own unique algorythms. Each one of these formats tries to figure out what's in the mix that people can't hear. Some create Pseudo-center channels, and only keep the centre channel and "Differences" in the left and right channels. Some have variable bitrates, and rely on Nyquist's theorem for groups of samples to be played back at a decent quality. Regardless, sound elements are lost. Depending on the codec, and bitrates, you may be losing more than others. A 128kbps OGG file may very well sound better than a 128kbps MP3. Or not. It's a tradeoff. Kind of like how 90% of the stuff that goes over FM Radio has Analog compression applied to fit in the bandwidth... Depending on how aggressively it's applied, it may sound almost perfect, or it may sound tinny, electronic and distorted.
It's My advice to distribute in MP3 or OGG. MP3 is a proprietary standard that'll be hard to get away from - sure it's outdated, but everyone still uses it. Likewise, OGG is relatively new, full featured and open-source. Nobody can take away the rights to use OGG for free. However, less audio programs use it right now, so MP3 might be more suitable for a mainstream audience. WMA and AAC are proprietary formats for Windows and Apple respectively. These are comparable to OGG in many respects, but also have DRM capabilities, which some say, is bad. At least with MP3 it will never prevent you from playing your music. OGG is for dreamers, foward thinkers, and Open-source fanatics. I happen to be all 3, so that's what I use.
When compressing using a lossy format, finding the bitrate/filesize/quality barrier is a subjective choice. I personally won't download or listen to an MP3 unless it's 128kbps or more. However, I will listen to an OGG at a lower bitrate, because OGG is designed for better sound at lower rates. Always test-listen to your encoded tracks. If you notice MP3 treble anomalies (listen to cymbals, hats, etc for a metalic digital hiss) that are typical with the format, it's time to increase your bitrate. If you've reached the limit of your compression codec, then try switching codecs... Sometimes OGG does sound worse than MP3 (although not often).
Hopefully you now have the fundamental theory to sample your own sounds and master your tracks.
|