How is analog audio converted to digital?


Free Download Mp4Gain
picture

How is analog audio converted to digital?

Analog-to-Digital

Sound is a complex analog signal. To analyze such signals a technique widely used in electronics is used. Using the Fourier transform, a complex signal is converted into a harmonic series, consisting of sinusoids with different frequencies and amplitudes. But in practice the signal we are dealing with is of course very different from the sinusoidal one.

Analog to Digital

Musicians call the first harmonic in this spectrum the fundamental tone, and harmonics with higher frequencies are called harmonics. The main tone determines the pitch and the harmonics give it a certain color, creating the timbre of a voice or musical instrument.

To study the spectra of audio signals, complex and expensive instruments are used – spectrum analyzers.

With the help of such devices, it can be established that some musical instruments, such as a violin, have a relatively uniform spectrum and some wind spectra with pronounced maxima and minima, called formants.

There are no terms that directly describe the coloration of the timbre of a human voice or musical instruments, so it is necessary to resort to various metaphors such as “deep timbre”, “hard timbre”, “metallic” sound or even “transistor”.

Digital information processing methods were attempted many times in connection with sound recording, but the first serious results were achieved in the early 1980s, coinciding with the rapid development of computers and the success of the microminiaturization of radio components. The use of digital sound processing techniques has opened up exciting new possibilities.

To process sound on a computer, it must first be converted to a digital, encoded format. An analog signal is encoded by devices called analog-to-digital converters (ADCs). The main method of encoding an analog signal is pulse code modulation, which consists of three operations: sampling, quantizing, and encoding.

We will not go into coding theory now, especially since it is quite complex and requires higher math skills. It is important for us to understand that the quality of the digitized sound and the resulting file size depend on the sample rate and bit depth.

The sample rate is the frequency at which the characteristics of an audio signal are measured. It follows from Kotelnikov’s sampling theorem that to obtain an undistorted digital signal, the sampling frequency must be at least twice the highest frequency of the encoded signal. Therefore, when encoding an audio signal, the sample rate must be at least 40 kHz. In digital communication systems, the sampling frequency is 32 kHz, in laser CD players and consumer digital tape recorders – 44.1 kHz. In digital studio equipment, the sample rate is even higher: 48 kHz.

The bit depth of the recorded sound is the number of memory bits that are allocated to record each value of the amplitude of the sound signal at the time of its measurement. Modern sound cards use 8 or 16 bits of memory per dimension, and higher quality 32-bit cards are available. The higher the bit depth, the higher the quality of the digitized sound.

As already mentioned, the size of an audio file depends on the sample rate and bit depth of the sound. So with a sample rate of 44 kHz and a sound depth of 16 bits, one minute of sound requires a file size of 5.3 MB and with a sample rate of 11 kHz and 8 bits, 660 Kb.

It is clear that such a waste of disk space turned out to be unacceptable, and special algorithms and formats were created for cheaper storage of audio files.

When comparing different compression formats, the parameter “sound quality at a certain bit rate” is often used.

Bit rate is a parameter that indicates how much disk space is used to store 1 second of music. For example, a bit rate of 128 Kbps means that a three-minute song will occupy about 2.8 MB.

In principle, all programs for encoding audio (also called encoders) use algorithms of two types: for lossless audio compression and for lossy compression.

Lossless compression algorithms, in fact, are well-known archivers for PC users, specially modified to work with an audio stream. When playing sound on the fly, the archive is decompressed from the archive.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Analog and digital sound sources

Analog and digital sound sources

analog and digital audio

Digital music comes from two main sources: analog and digital.

Analog and Digital

Analogous sources
An analog music source must use an analog-to-digital converter, such as a sound card, to convert the physical changes of the analog medium into a digital file that can be read by a computer. An analog medium is an object that stores music in itself through physical changes.

For example:

A cassette recorder changes the degree of magnetization of a cassette tape to record sound. Connecting a cassette deck to a recording device allows you to make a digital copy of an analog cassette.
The recorder cuts grooves in the vinyl record to create a physical representation of the sound. Ripping vinyl with a preamp and sound card allows you to make a digital copy of an analog record.
Analog recordings can be converted to digital music files in various formats, such as FLAC and MP3. Vinyl recordings can always be posted to the site, but posting tape recordings and other analog sources requires approval from the moderator.

Digital music sources
Music from digital sources is already encoded in a computer-compatible format, so no additional conversion is required. A digital medium is an object that stores music digitally (as a sequence of binary numbers).

For example:

CD
DVD
Super Audio CD (SACD)
Content from online stores (iTunes, Amazon, etc.)
Music from digital sources can be uploaded to RED after analyzing the spectrograms of the files to verify lossy transcoding.

Comparison of analog to digital music sources
Controversy still exists as to whether music sounds differently from analog and digital sources. Some people prefer the feel of vinyl and find that music on vinyl sounds “warmer” and “brighter.” On the other hand, some believe that digital sources provide true, pure and authentic sound. Both are represented in RED, so you can compare and make your own choice!

Analog and digital

First of all, a fundamental distinction is necessary: ​​what is meant by an analog signal and what is meant by a digital signal. Sampling is in fact an analog-to-digital conversion, and to understand how this is accomplished, it is necessary to understand what the subjects of this transformation are.

The classic definition of “analog” and “digital” is as follows.
The analog signal is one in which the variation is continuous in time.
The digital signal is one in which the variation in time occurs in a discrete way.
Pay attention to this definition because it expresses a very simple concept but at the same time misunderstood.

Let’s use some examples to get the concept down.
As a first example, let’s think of a watch with hands (suppose it is of the type in which the second hand moves continuously and not broken).

This clock not only marks the hours, minutes and seconds, but also any other type of fraction that we want to imagine: half seconds, tenths, hundredths, etc. As difficult as it is for the eye to distinguish the different moments, we know that the clock continuously passes through every instant of time that we can imagine.

Let’s think instead of a digital clock, those that indicate the time with numbers on a screen. This clock will mark the hours, minutes and seconds, activating the latter one by one; We do not see half seconds, tenths and so on: from 10:10:01 to 10:10:02 (for example) the clock will always read 10:10:01.

The watch with hands can be defined as an analog device, while the other watch, which provides only discrete, but not continuous measurements, is called digital.

A second example: let’s think about two different ways to monitor the level of a signal: the first, the classic needle VU-meter, typical of old mixers; the second, the column of bright LEDs, typical for example of equalizers.

The VU-meter, for reasons exactly analogous to those of the hand watch, is an analog device; The LED column, which only provides discrete data, is a digital device.

So what does it mean to sample a signal?

It means finding a discrete representation for something that originally has continuous variation.
The purpose is obvious: where, for example, to modify the analog recording of a voice, we must first convert the sound energy into electrical energy (through a microphone), then transform the electrical energy into the magnetic property of a tape ( through a tape recorder) and finally intervene with mechanical modifications to the tape itself (editing operations with manual cutting and pasting of the tape), with a digital recording, in which the electrical energy supplied by the microphone is converted directly In digital samples, that is, in discrete number data, it will be possible to modify the register through an electronic calculator capable of analyzing and modifying the data.

Sampling and time (frequency and Nyquist theorem)

The first practical problem that sampling is faced with is establishing how many times in a given period of time the signal must be measured for the sampling to be accurate, and the resulting digital signal can be converted back into an analog signal without losing or changing certain characteristics of the original signal.

Take as an example the classic elementary sinusoid, like the one in the figure.

Let’s say we have a device that takes, over a certain period of time, a certain number of samples of the signal: for example, 14 samples per period of the sinusoid.
We will obtain a series of samples like the one in the figure:

We see that the original sinusoid is still intuitive, so it is possible to reconstruct it and reverse the procedure.
But imagine halving the sample rate, that is, doubling the time between one measurement and another.
We will obtain a different series of samples, less dense than the previous one:

The sine wave can still be guessed, but it is clear that we have lost some of the original information.
Halving again, the situation becomes almost critical:

Here it is already very difficult to trace the original signal.
By reducing more by half, all traces of the sine wave are lost:

Therefore, we understood that there is a critical point, below which the sampling frequency cannot fall, under penalty of total loss of information.