Audio encoding and processing


Free Download Mp4Gain
picture

Audio encoding and processing

Encoding

Sound information.

ENCODING

Sound is a wave that travels through air, water, or other medium with a continuously changing intensity and frequency.

A person perceives sound waves (air vibrations) with the help of hearing in the form of sound of different volume and pitch. The higher the intensity of the sound wave, the louder the sound, the higher the frequency of the wave, the higher the pitch of the sound

The human ear perceives sound at a frequency of 20 vibrations per second (low sound) to 20,000 vibrations per second (high sound).

A person can perceive sound in a wide range of intensities, in which the maximum intensity is 10 14 times greater than the minimum (one hundred thousand billion times). A special unit “decibel” (dbl) is used to measure the volume of sound (Table 5.1). Decreasing or increasing the volume of the sound by 10 dB corresponds to a decrease or increase in the intensity of the sound by 10 times.

Table 5.1. Sound volume
Sonar Volume in decibels
Lower limit of human ear sensitivity 0
Whisper of Leaves 10
Conversation 60
Horn 90
Jet engine 120
Pain threshold 140
Sound time sampling. For a computer to process sound, a continuous audio signal must be converted to a discrete digital form using time sampling. A continuous sound wave is divided into separate small time sections, for each section a certain value of sound intensity is set.

Therefore, the continuous dependence of the loudness of the sound at time A (t) is replaced by a discrete sequence of loudness levels.

Sampling frequency.

A microphone connected to the sound card is used to record analog sound and convert it to digital format. The quality of the digital sound obtained depends on the number of measurements of the sound volume level per unit time, that is, the sampling frequency. The more measurements that are made in 1 second (the higher the sampling frequency), the more accurately the “ladder” of the digital audio signal repeats the curve of the dialogue signal.

The audio sample rate is the number of measurements of the volume of a sound in one second.

The audio sample rate can range from 8000 to 48000 sound volume measurements per second.

Audio encoding depth. Each “step” is assigned a specific value for the volume level of the sound. Loudness levels of sound can be viewed as a set of possible states N, for which a certain amount of information is needed to encode, which is called audio encoding depth.

Audio encoding depth is the amount of information required to encode the discrete volume levels of digital audio.

If the known encoding depth, the number of digital audio volume levels can be calculated using the formula N = 2 I. Let the sound encoding depth be 16 bit, then the number of sound volume levels is:

N = 2 I = 2 16 = 65 536.

During the encoding process, each sound volume level is assigned its own 16-bit binary code, the smallest sound level will correspond to the code 0000000000000000 and the highest, 1111111111111111.

The quality of digitized sound. The higher the sound sampling frequency and depth, the better the digitized sound will sound. The lowest quality of digitized sound, corresponding to the quality of telephone communication, is obtained at a sampling rate of 8000 times per second, a sampling rate of 8 bits, and by recording an audio track (“mono” mode). The highest quality digitized audio, corresponding to the quality of an audio CD, is achieved with a sampling rate of 48,000 times per second, a sampling rate of 16 bits, and the recording of two audio tracks (“stereo” mode ).

It should be remembered that the higher the quality of the digital sound, the greater the volume of information in the audio file. It is possible to estimate the information volume of a digital stereo sound file with a duration of 1 second with an average sound quality (16 bits, 24,000 measurements per second). To do this, the encoding depth must be multiplied by the number of measurements in 1 second and multiplied by 2 (stereo sound):

16 bits × 24,000 × 2 = 768,000 bits = 96,000 bytes = 93.75 KB.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Audio Coding: Secrets Revealed – Part 2

Audio Coding: Secrets Revealed – Part 2

AUDIO ENCODING

Audio settings for video capture and transmission.

AUDIO ENCODING

Sampling frequency (kHz, kHz)
Sample rate (or sample rate): the frequency with which the signal is digitized, stored, processed, or converted from analog to digital. Time sampling means that the signal is represented by several of its samples (samples) taken at regular intervals.

Measured in hertz (Hz, Hz) or kilohertz (kHz, kHz,) 1 kHz equals 1000 Hz. For example, 44,100 samples per second can be labeled 44,100 Hz or 44.1 kHz. The selected sample rate will determine the maximum playback frequency and, as follows from Kotelnikov’s theorem, to fully restore the original signal, the sample rate must be twice the highest frequency in the signal spectrum.

As you know, the human ear is capable of picking up frequencies between 20 Hz and 20 kHz. Given these parameters and the values ​​shown in the table below, you can understand why 44.1 kHz was chosen as the sampling frequency for CD and is still considered a very good frequency for recording.

There are several reasons for choosing a higher sample rate, although it may seem like a waste of time and effort to reproduce sound outside the range of the human ear. At the same time, 44.1 – 48 kHz will suffice for the average listener for a high-quality solution to most problems.

Bit depth
Along with the sample rate, there is the bit depth or depth of sound. Bit depth is the number of bits of digital information to encode each sample. Simply put, the bit depth determines the “accuracy” of the input signal measurement. The larger the digit capacity, the smaller the error for each individual conversion from the magnitude of an electrical signal to a number and vice versa. With the smallest possible bit depth, there are only two options for measuring sound accuracy: 0 for full silence and 1 for full sound. If the bit width is 8 (16), then by measuring the input signal, 2 8 = 256 (2 16 = 65,536) different values ​​can be obtained.

Bit depth is fixed in the PCM codec, but for codecs that assume compression (eg MP3 and AAC), this parameter is calculated during encoding and may vary from sample to sample.

Bitrate
Bit rate is an indicator of the amount of information that one second of sound encodes. The higher it is, the less distortion and the closer the encoded composition is to the original. For linear PCM, the bit rate is very easy to calculate.

bitrate = sample rate × bit depth × channels

For systems such as the Epiphan Pearl Mini that encode 16-bit (16-bit) linear PCM, this calculation can be used to determine how much additional bandwidth the PCM audio might require. For example, for stereo (two channels), the signal is digitized at 44.1 kHz at 16 bits and the bit rate is calculated as follows:

44.1 kHz × 16 bit × 2 = 1411.2 kbps

Meanwhile, audio compression algorithms like AAC and MP3 have fewer bits to transmit the signal (that’s their purpose), so they use low bit rates. Typically, the values ​​are in the range of 96 kbps to 320 kbps. For these codecs, the higher the bit rate you choose, the more audio bits you get per sample and the better the sound quality.

Sample rate, bit depth and bit rates in real life.
Audio CDs, one of the most popular early inventions for the general public for storing digital audio, used 44.1 kHz (20 Hz – 20 kHz, human ear range) and 16 bits. These values ​​were chosen to be able to save as much audio as possible to disk with good sound quality.

When video was added to audio and DVD and then Blu-ray discs came along, a new standard was created. DVD and Blu-Ray recordings typically use 48 kHz (stereo) or 96 kHz (5.1 surround) linear PCM format and 24-bit depth. These settings have been chosen as ideal for keeping the audio in sync with the video while obtaining the best possible quality using additional available disk space.

Our recommendations
CDs, DVDs, and Blu-Ray discs all have one goal: to provide the consumer with a high-quality playback engine. The goal of all developments was to provide high-quality audio and video without worrying about file size (if only it could fit on disk). Such quality could be provided by linear PCM.

By contrast, mobile media and streaming media have a completely different goal: to use the lowest bit rate possible, while still being sufficient to maintain acceptable quality for the listener.

Audio encoding: secrets revealed

Audio encoding: secrets revealed

audio encoding

Audio settings for video capture and transmission.

AUDIO ENCODING

As people directly related to the AV sphere, we constantly talk about audio coding and audio codecs, but what is it? An audio codec is essentially a device or algorithm that can encode and decode a digital audio signal.

In practice, the audio waves that travel through the air are continuous analog signals. The signals are converted to digital form by a device called an analog-to-digital converter (ADC), and the reverse converter is called a digital-to-analog converter (DAC). The codec lies between these two functions and it is he who allows you to adjust some important parameters for the successful capture, recording and transmission of an audio signal: the codec algorithm, the sampling frequency, the bit width and the speed of the audio signal. data.

The three most popular audio codecs are Pulse-Code Modulation (PCM), MP3, and Advanced Audio Coding (AAC). The choice of codec determines the compression rate and the recording quality. PCM is a codec used by computers, CDs, digital phones, and sometimes SACD. The PCM signal source is sampled at regular intervals, and each sample is the digital amplitude of the analog signal. PCM is the simplest option for digitizing an analog signal.

With the correct parameters, this digitized signal can be completely converted back to analog without any loss. But this codec, which provides an almost complete identity with the original audio, is unfortunately not very cheap, which results in very large file sizes, and such files are not suitable for streaming. We recommend using PCM to record digital images for your sources or when doing audio post-processing.

Fortunately, we always have the option of choosing a different codec that can compress digital data (rather than PCM) based on some helpful observations on the behavior of sound waves. But in this case, you have to make a compromise: all alternative algorithms are associated with “losses”, since it is impossible to completely restore the original signal, but nevertheless the result is still so good that most users will not be able to to catch the difference.

MP3 is an audio encoding format that uses a digital data compression algorithm that allows you to save the audio signal in smaller files. The MP3 codec is the most used by users to record and store music files. We recommend using MP3 to stream audio content as it requires less network bandwidth.

AAC is a newer audio encoding algorithm that is the successor to MP3. AAC has become the standard for the MPEG-2 and MPEG-4 formats. In fact, this is also a digital data compression codec, but with less quality loss than MP3 when encoded with the same bit rate. We recommend using this codec for online streaming.

Digital audio encoding

Digital audio encoding

Digital audio encoding

PC-based audio coding is based on the process of converting air vibrations into electrical current fluctuations and the subsequent sampling of an analog electrical signal.

DIGITAL AUDIO ENCODING

The encoding and reproduction of audio information is carried out using special programs. The quality of reproduction of the encoded sound depends on the sampling frequency and its resolution (sound encoding depth – the number of levels).

Digital audio is an analog audio signal represented by discrete numerical values ​​of its amplitude.

Sound digitization is a technology with a divided time step and subsequent recording of the values ​​obtained in numerical form. Another name for digitizing audio is analog to digital audio conversion, which includes the following operations:

Bandwidth limiting is done by using a low pass filter to suppress spectral components that are more than half the sample rate.

Time sampling, that is, replacing a continuous analog signal with a sequence of its values ​​at discrete moments of time: samples.

Level quantization is the replacement of the signal’s reference value with the closest value of a set of fixed values: quantization levels.

Encoding or digitization, as a result of which the value of each quantized sample is represented as a number corresponding to the ordinal number of the quantization level.

This is done as follows: a continuous analog signal is “cut” into sections with a sample rate, a discrete digital signal is obtained, which goes through the quantization process with a certain bit depth, and is then encoded, that is, it is replaced by a sequence of code symbols. To record sound in a 20-20,000 Hz frequency band, a sampling frequency of 44.1 and higher is required (today there are ADCs and DACs with a sampling frequency of 192 and even 384 kHz). To obtain a high-quality recording, 16-bit is sufficient, however, to expand the dynamic range and improve the quality of the sound recording, 24 (less often 32) bits are used.

Sound coding methods (of course an electrical signal coming from a microphone) are based on the fact that, theoretically, any complex sound can be decomposed into a sequence of simpler harmonic signals of different frequencies, each of which it is a sinusoid, called the spectrum of the original signal. The task of encoding sound, like any other analog signal, is to represent it in the form of another analog or digital signal, which is more convenient for its transmission or storage in each specific case. Real sound sources have a limited spectrum width, therefore, for encoding, transformation methods are used that transform the original signal into one, the spectrum of which is more suitable for transmission on the selected channel. Representing an analog signal as another analog signal is commonly referred to as modulation and digitally as encoding. This division is very arbitrary. An analog signal can be represented as a harmonic signal (that is, a sinusoid), the parameters of which change depending on the value of the original signal. In the event that the amplitude of the sinusoid changes with a change in the original signal, it is amplitude modulation (AM). If, depending on the value of the original signal, the frequency or phase of the sinusoid changes, we are dealing with frequency modulation (FM) or phase modulation (PM). Amplitude and frequency modulation, for example, is widely used to transmit sound by radio. These types of modulation, of course, are not the decomposition of the original signal into harmonics. The development of digital technology and the use of computer processing and information storage has led to the widespread use of pulse encoding or modulation methods. Such types of modulation are, for example, pulse code modulation, in which the value of the original signal at regular intervals is represented in code form. The vast majority of “computer sound” is precisely the recording of the binary code of the received signal in short equal time intervals, determined by the sampling frequency. For storage and transmission through communication channels, this signal is usually compressed (reducing the volume by discarding unnecessary or insignificant information). In addition to pulse code modulation, other types of digital modulation (pulse width, pulse frequency, etc.) are also used to encode sound.