Tech Notes: Digital Music Theory 101

Analog vs Digital

The world is analog. Everything we see and hear is analog energy, which simply put, is energy that flows continuously in a fluid motion. Our senses (eyes and ears) are designed to interpret analog signals. The modern computer processes information in a digital form. Digital is simply a fluid wave that is dissected into time samples so that each discrete sample can be quantified, processed, stored, or transmitted as individual pieces of information (bytes). Signals can be converted to digital with an analog to digital converter (ADC) or converted back to analog with a digital to analog converter (DAC). The number of times a wave is dissected is called the bit rate. The higher the bit rate the more accurate the reproduced signal and the larger the file size. Streaming audio sites can stream at different bit rates ranging from 32k to 256k bits per second which will also have a large impact on sound quality. Digital signals can be shaped (changes in amplification, equalization, or frequency) by a Digital Signal Processor (DSP). In most computers the DAC and DSP are performed by the sound card. Since raw audio can be present at the Universal Serial Port (USB), you can connect an external DAC/DSP of higher grade to your computer using that port.

Digital sine wave

Acoustic energy vs electrical energy

Sound waves are pressure waves that flow through air molecules similar to surface ripples in a pond. Waves move outward from a source (at the speed of sound). If there are a higher number of waves (the waves are closer together) an observer will detect a higher frequency of waves per time interval, which produces a higher pitch acoustically. If the wave pressure is higher the sound will appear louder. Sound is created when any vibrating molecules reaches your ears causing your inner ear hair follicles to vibrate, which causes chemical neurotransmitters to flow to the brain creating a sensation we call sound. [Actually the wave is first amplified by the ear drum which causes your three middle ear bones (ossicles) to vibrate, which in turn causes the liquid in the inner ear to vibrate, which in turn causes those inner ear hairs to vibrate- I did not want to get technical- oh crap!]. A transducer is any device that changes one type of energy into another, such as acoustical sound into electrical energy (ex. microphone, magnetic cartridge). A speaker is a transducer that changes electrical energy back to acoustic energy. Electrical energy can flow through wires or can be transmitted over space as electro-magnetic energy.
Wave form
Wave form

Audio Files

The digital representation of raw sound in electrical form is a Pulse Code Modulated signal (PCM). Modulation is the technique that changes signals from one format to another. Files can be stored or transmitted in PCM. PCM files are very large making storage and transmissions costly & difficult. A music Compact Disc (CD) can hold 80 minutes of music and takes 700 Million Bytes of data (700MB). Uncompressed PCM formats include CDDA & WAV files. Digital music is stored in files that can also be compressed. You can compress files with a lossless format (ex. FLAC, ALAC, APE) or compress a file with a lossy format (ex. MP3 AAC). Files must be restored to a PCM format to be played. Lossy formats compress to a much higher extent, although you lose information and therefore sound quality. The process to compress or decompress a file is called an audio CODEC (Code-Decode). CODECs can use hardware & software for the process implementation. Converting from one digital file format to another is called transcoding.

Optical media

CD's, DVD's & Blu-Ray discs are optical media discs that stores digital files. All three disc types can store audio, video, or data type files. Because of their capacity, CD's are ideal for audio albums, DVD's for video movies, and Blu-Ray for HD movies.

CD's can be formatted into three general types:
1) Audio CD: Holds uncompressed audio (PCM/ Red Book)
2) MP3 Disc: A special format specifically for compressed MP3 audio files.

3) Data Disc: Holds all types of data including audio, video, or text data.

Data discs are designed for computers whereas audio CD's and MP3 CD's are made for audio players. Any compressed audio other then MP3 files must be stored on a data disc. An MP3 disc can hold about eight hours of music versus 80 minutes of PCM audio on the same CD-r disc. Remember though that MP3 is a lossy format so the sound quality is degraded. There are also other lossy formatted type files with better quality than MP3's including AAC (MP4) files. A benefit of MP3 over other compressed formats is they are universally accepted and have their own disc format.

Solid State

The use of optical media is waning with solid state technologies becoming increasingly popular. Solid state refers to memory devices without moving parts which are usually contained on semi-conductor chips, also called RAM (Random Access Memory). Solid state memory inside computers are integrated with the micro-processor to process the application machine code. Storage (vs. memory) refers to data stored on magnetic disks (hard drives) which must be transferred to memory for processing. Portable solid state memory devices are called Flash memory and are contained within many portable devices or as USB devices called thumb drives. Solid state memory density is increasing exponentially each year, and is much faster than optical or magnetic disc storage. Most application software, music, and movies can be easily downloaded from the web to your computer storage.
The biggest advantage to purchased audio CD’s is that the music is PCM encoded which makes the music much superior to the common compressed download versions (MP3, AAC) that are widely available. In addition, Optical disc storage is useful if you would like a permanent copy of your data as a back-up to your stored data. Many people opt for the easy and flexible download method and forgo the quality of a music CD. Of course audio from a music CD can be easily converted to any format type (compressed or non-compressed).

Bits & Bytes

From a physical layer standpoint computer signaling can maintain only two different states to represent data. An on or off condition which is measured by a voltage change. Each on or off state is a “Bit” of data (which is a compression of “Binary Digit”). Programming and machine code requires 8 bits of data, which is called a Byte. A byte could represent a multitude of meanings to the computer, from data content, memory addressing, routing information, configuration data, or any other numerous computer instructions.

Number systems: Binary, Decimal, Hexadecimal

We are so familiar with our Base 10 decimal system that most people could not imagine how a different system might look or work. The decimal system works by having 10 symbols (0-9) and when more than 9 items needs to be represented, we move to the next position to the left, which is weighted by 10. So a "1" digit in the second position equals 10, a "5" in the second position equals 50. Having 10 fingers was probably the logic with a base 10 system when it was devised.

The digital computer only has two states so inherently uses the binary system. Binary only requires two digits (0 & 1) and an increase in the position increases the value by 2. The binary number “10” = 2 because the second position equals 2. You cannot tell the difference between the binary “10” (which represents the decimal 2) or the decimal 10 unless it is stated or understood. One Byte “11111111” can represent up to 256 values in binary.

Number systems can have any Base unit, meaning the numerical position can change to any value. The number system used by computer programmers and computer scientists is base 16 and is called Hexadecimal (Hex for short). Unfortunately, Hex would require 16 symbols since you need 16 unique symbols before you start the second position. HEX developers needed symbols to reflect the values over the number 9 (10 - 15), since the second position is weighted to 16. Where can we find an additional 6 symbols to add to the HEX symbol inventory? Well the easy way was to use the first six letters of the alphabet which are well known to everyone.
[PS: Our numeral symbols are sometimes known as Arabic numerals, although they were invented by the Indians decades or centuries earlier].

Decimal Notation

lets calculate the number 3452
the forth position = 1000 so (3 x 1000 = 3000)
the third position = 100 so (4 x 100 = 400)
the second position = 10 so (5 x 10 = 50)
the first position has equal weight so (2 x 1 = 2)
We add 3000 + 400 + 50 + 2 and we get 3452 (I know, that where we started)
This example illustrates the logic we use without necessarily thinking about it. so on to HEX.

Hex Notation

Lets calculate the number 39AF
the forth position = 4,096 so (4,096 x 3 = 12,288)
The third position = 256 so (256 x 9 = 2,304)
the second position = 16 so (16 x 10 = 160)
remember A=10
the first position has equal weight = (1 x 15 = 15)
remember F=15
We add 12,288 + 2,304 + 160 + 15 and we get in decimal form 14,767. It still means 39AF in Hex but converted to decimal is 14,767. OK

Advantages of HEX: Hex can represent larger numbers with a smaller amount of symbols, but the main reason we use HEX in the computer world is because of the byte system. Two HEX digits represents one byte which works perfectly for programmers. Hex represents binary easily which is the way digital machines communicate internally and with each other over networks.

Units of measure
Binary Decimal chart
JRD 8/2011
Stacks Image 10
Back to Tech Notes