Audio: Analog vs Digital
- In maths, a variable is a characteristic or qualitie that can be counted or measured (for example voltage in volts, distance in meters, sound quality as muffled or warm, sound type as voice or guitar, etc).
- A Quantitative Variable is a type of variable that takes on numerical values representing measurable quantities. These values can be used to perform mathematical operations such as addition, subtraction, multiplication, and division.
- Quantitative variables can be classified into Continuous Variables and Discrete Variables.
- A discrete variable is a type of quantitative variable that can take on only specific, separate values with no intermediate values in between. For example: [1, 2, 3, 4, ...] or [10, 20, 30, 40, ...] or [0.5, 1.0, 1.5, 2.0, ...]
- A continuous variable is a type of quantitative variable that can take on any value within a given range or interval. For example: [1.3, 1.8, 2.5, 6.0, 7.8, 10.0, ...]
- The voltage is a quantitative continuos variable, as long as it can takes on any value within a given range.
- Audio signals can be produced and represented in a variety of ways. For example as air pressure variations.
- Audio in computer is represented as voltage variations.
- Depending on the hardware, the audio signal voltage values may be represented as a continuous variable or as a discrete variable.
- Since voice sounds, instruments sounds or many real world sounds are produced with air pressure variations, that audio signal needs to be converted into voltage variations. Note that the air pressure variations is a quantitative continuous variable.
- Microphone is usually the device that converts the air pressure variations into voltage variations. These voltage variations are also a quantitative continuous variable.
- That is called Analog Audio: audio signal that is represented with voltage variation as a continuos variable. So the audio signal can take on any voltage value between a given rage (the voltage range depends on the hardware and devices. For example 0v to 5V or 0V to 48V)
- On the other hand, computers work only with discrete voltage values. More specifically, computers only accept a range of two discrete values.
- The analog audio have to be converted into discrete values. This is done using some maths (sampling, quantification, encoding, etc).
- In a didactic and simplified way: a voltage threshold is established. If the analog signal voltage is below that threshold, then the audio signal voltage discrete value is 0. On the other way, if the analog signal voltage is above that threshold, then the audio signal voltage discrete value is 1. This process is called Discretization of a continuous variable. (For example: voltage below 3.5V is 0 and voltage equal or above 3.5V is 1).
- That is called Digital Audio: audio signal that is represented with voltage variations as a discrete variable. So the audio signal can take on only specific, separate values with no intermediate values in between. (For example 0 or 1).
- There is hardware specifically designed to perform the maths for continuous to discrete conversion. It is called Analog to Digital Converter (usually called ADC)