Compression and compression methods of audio signals


Free Download Mp4Gain
picture

Compression and compression methods of audio signals (types, differences, use)

Audio Compression

Basics of the analog-to-digital conversion principle, sound conversion and compression method, existing sound storage formats. Programs to convert and process sound and audio files. Application of these programs in linguistic research.

Bit rate is the amount of information per unit of time. In general, the bit rate is the number of bits that we spend encoding a sound with a duration of 1 second.

Analog-to-digital converter (ADC): A device that converts an input analog signal into a binary code (digital signal). The reverse conversion is done using a DAC (digital-to-analog converter, DAC). Typically, an ADC is an electronic device that converts voltage into a binary digital code. However, some non-electronic devices with digital output must also be classified as ADCs, such as some types of angle-to-code converters. The simplest one-bit binary ADC is a comparator.

The circuit to convert an audio signal from analog to digital:

Sampling is the transformation of continuous images and sound into a set of discrete values ​​in the form of codes.

Quantization is the process of aligning a set of musical notes to a grid.

Compression (compression) of audio data is a process of lowering the bit rate by reducing the statistical and psychoacoustic redundancy of a digital audio signal.

The underlying idea behind all lossy audio compression techniques is to neglect the subtle details of the original sound that are beyond the reach of the human ear.

Codec (CoDec) is an abbreviation for compressor and decompressor. Basically, a codec is a collection of files, drivers, and libraries required to package a video or audio file into a compressed format and play the compressed file.

Formats:

AAC (Advanced Audio Coding) is an audio file format with less quality loss when encoding than MP3 of the same size. The format also allows you to compress without losing the quality of the source (ALAC AAC profile).

AAC (Advanced Audio Coding) was originally created as a successor to MP3 with improved encoding quality. The AAC format, officially known as ISO / IEC 13818-7, was released in 1997 as the new seventh part of the MPEG-2 family. There is also the AAC format known as MPEG-4

Apple AIFF: This file type is standard for Apple Macintosh systems and sound processing systems built on top of it. Apple AIFF stands for Audio Interchange File Format, an audio interchange file format, it is somewhat similar to WAV. Its peculiarity is that it allows you to place additional information along with the sound wave, in particular WaveTable samples (examples of the instrument sound together with synthesizer parameters), which improves the quality of the final result. Although today Apple computers are capable of playing files of almost any format, including MP3.

FLAC (Free Lossless Audio Codec) is a popular free codec for audio compression. Unlike lossy Ogg Vorbis, MP3 and AAC codecs, it does not remove any information from the audio stream and is suitable for both daily listening and archiving of audio collection. Today, the FLAC format is compatible with many audio applications.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Digital audio compression methods

Digital audio compression methods

audio compression

Lossless compression

AUDIO COMPRESSION

Generally speaking, the meaning of lossless compression is as follows: some pattern is found in the original data, and taking this pattern into account, a second stream is generated, uniquely describing the original. For example, to encode binary sequences in which there are many zeros and few ones, we can use the following replacement:

00> 0
01> 10
10> 110
11> 111

In this case, sixteen bits:
00 01 00 00 11 10 00 00

will be converted to thirteen bits:
0 10 0 0 111 110 0 0

If we write a compressed string without spaces, we can still add spaces in it, which means restoring the original sequence.

FLAC (Free Lossless Audio Codec)
Coding principle: the algorithm tries to describe the signal with this function so that the result obtained after subtracting it from the original (called difference, remainder, error) can be encoded with the minimum number of bits.

When the model is fitted, the algorithm subtracts the approximation from the original to obtain a residual signal (error), which is then losslessly encoded.

Lossy compression (MP3, AAC, WMA, OGG)
Using a lossy compression algorithm, the size of an MP3 file with an average bit rate of 128 kbps is approximately 1/11 of the original file of an Audio CD (uncompressed audio in CD-Audio format has a rate bit rate of 1411.2 kbps). MP3 files can be created at high or low bit rates, which affects the quality of the result.

The principle of compression is to reduce the precision of some parts of the sound flow, which is almost indistinguishable for most people. The audio signal is divided into segments of equal length, each of which, after processing, is packed into its own frame (frame). Spectral decomposition requires continuity of the input signal; therefore the table above and below are also used for calculations. The audio signal contains harmonics with a lower amplitude and harmonics that are close to the strongest; Such harmonics are cut off, as the average human ear will not always be able to determine the presence or absence of such harmonics. This characteristic of hearing is called the masking effect. It is also possible to replace two or more nearby peaks with an averaged one (which, as a rule, leads to sound distortion). The cutoff criterion is determined by the outflow requirement. Since the entire spectrum is relevant, the high-frequency harmonics are not cut off, but are only selectively removed to reduce information flow due to spectrum sparsity. After spectral removal, mathematical compression and frame packing methods are applied.

Masking effect
In certain cases, a sound can be hidden by another sound. For example, talking near the railroad tracks can be completely impossible if a train passes. This type of effect is called masking. A weak sound is said to be masked if it becomes indistinguishable in the presence of a louder sound.

Simultaneous masking
Any two sounds when heard simultaneously have an impact on the perception of the relative volume between them. A louder sound reduces the perception of a weaker one, until the disappearance of your hearing. The closer the frequency of the masked sound is to the frequency of the masker, the more it will be hidden. The masking effect is not the same when the masked sound is shifted down or up in frequency with respect to masking. Low-frequency sound masks high-frequency sound. However, it is important to note that high-frequency sounds cannot mask low-frequency sounds.

Time masking
This phenomenon is similar to frequency masking, but time masking occurs here. When the masking sound is stopped, the masking remains inaudible for some time. Under normal conditions, the temporary masking effect lasts significantly less. The masking time depends on the frequency and amplitude of the signal and can be up to 100 ms.
In the case where the masking tone appears at a time after masking, the effect is called post-masking. When the masking tone appears before the masking (this is also possible), the effect is called premasking.

Post-stimulus fatigue
Often after exposure to loud, high-intensity sounds, a person’s hearing sensitivity drops dramatically. Recovery to normal thresholds can take up to 16 hours. This process is called “temporary change in hearing sensitivity threshold” or “post-stimulus fatigue.”

What methods are used to effectively compress digital audio?

What methods are used to effectively compress digital audio?

Digital audio Compresssion

Currently, the most famous are Audio MPEG, PASC and ATRAC. All use the so-called “perception coding” (perceptual coding), in which information that is barely perceived by the ear is removed from the sound signal.

Audio compression

As a result, despite the change in the shape and spectrum of the signal, your hearing perception is practically unchanged and the compression ratio justifies a slight decrease in quality. Such encoding refers to lossy compression methods, when it is no longer possible to accurately restore the original waveform from the compressed signal.

Techniques to remove some of the information are based on a characteristic of human hearing, called masking: if there are pronounced peaks (dominant harmonics) in the sound spectrum, the weakest frequency components in the immediate vicinity of them are practically not perceived (masked) by ear. During encoding, the entire audio stream is divided into small frames, each of which is converted into a spectral representation and divided into several frequency bands. Within bands, masked sounds are detected and removed, after which each frame undergoes adaptive coding directly in spectral form. All these operations make it possible to significantly reduce (several times) the amount of data while maintaining the quality acceptable to most listeners.

Each of the described encoding methods is characterized by the bit rate at which the compressed information must enter the decoder when the audio signal is recovered. The decoder converts a series of compressed instantaneous signal spectra into a conventional digital waveform.

Audio MPEG is a group of audio compression techniques standardized by MPEG (Moving Pictures Experts Group). MPEG audio methods come in various types: MPEG-1, MPEG-2, etc .; currently the most common type is MPEG-1.

There are three layers of MPEG-1 audio to compress stereo signals:

1 – 1: 4 compression ratio with a data stream of 384 kbps;
2-1: 6..1: 8 at 256..192 kbps;
3 – 1: 10..1: 12 at 128..112 kbps.
The minimum data rate at each layer is defined as 32 kbps; the specified bit rates keep the signal quality close to that of a CD.

All three layers use a frame input spectral transform divided into 32 frequency bands. The most optimal level in terms of data volume and sound quality is recognized as level 3 with a bit rate of 128 kbps and a data density of approximately 1 Mb / min. When compressing at lower speeds, the forced limiting of the frequency band to 15-16 kHz begins, and phase distortions of the channels also appear (effect like a phaser or flanger).

MPEG audio is used in computer sound systems, CD-i / DVD, “audio” CD-ROM, digital radio / television, and other mass audio transmission systems.

PASC (Precision Adaptive Sub-Band Coding) is a special case of Audio MPEG-1 Layer 1 with a bit rate of 384 kbps (1: 4 compression). Used in the DCC system.

ATRAC (Adaptive TRansform Acoustic Coding) is based on a stereo audio format with 16-bit quantization and a sample rate of 44.1 kHz. When compressed, each frame is divided into 52 frequency bands, resulting in a transmission rate of 292 kbps (1: 5 compression). Used in MiniDisk system.

Digital audio compression methods

Digital audio compression methods

Audio Compression

Lossless compression

Audio Compression

Generally speaking, the meaning of lossless compression is as follows: some pattern is found in the original data, and taking this pattern into account, a second stream is generated, uniquely describing the original. For example, to encode binary sequences with many zeros and few ones, we can use the following replacement:

00> 0
01> 10
10> 110
11> 111

In this case, sixteen bits:

00 01 00 00 11 10 00 00

will be converted to thirteen bits:

0 10 0 0 111 110 0 0

If we write a compressed string without spaces, we can still add spaces in it, which means restoring the original sequence.

FLAC (Free Lossless Audio Codec – Free Lossless Audio Codec)
Coding principle: the algorithm tries to describe the signal with this function so that the result obtained after subtracting it from the original (called difference, remainder, error) can be encoded with the minimum of bits.

When the model is fitted, the algorithm subtracts the approximation from the original to obtain a residual signal (error), which is then losslessly encoded.

Lossy compression (MP3, AAC, WMA, OGG)
Using a lossy compression algorithm, the size of an MP3 file with an average bit rate of 128 kbps is approximately 1/11 of the original file of an Audio CD (uncompressed audio in CD-Audio format has a rate 1411.2 kbps bit rate). MP3 files can be created at high or low bit rates, which affects the quality of the result.

The principle of compression is to reduce the precision of some parts of the sound flow, which is almost indistinguishable for most people. The audio signal is divided into segments of equal length, each of which, after processing, is packed into its own frame (frame). Spectral decomposition requires continuity of the input signal; therefore, the previous and next tables are also used for calculations. The audio signal contains harmonics with a lower amplitude and harmonics that are close to the strongest; Such harmonics are cut off, as the average human ear will not always be able to determine the presence or absence of such harmonics. This characteristic of hearing is called the masking effect. It is also possible to replace two or more close peaks with an averaged one (which, as a rule, leads to sound distortion). The cutoff criterion is determined by the outflow requirement. Since the entire spectrum is relevant, the high frequency harmonics are not cut off, but are only selectively removed to reduce information flow due to rarefaction of the spectrum. After spectral removal, mathematical compression and frame packing methods are applied.

Masking effect
In certain cases, a sound can be hidden by another sound. For example, talking next to a train track can be completely impossible if a train passes. This type of effect is called masking. A weak sound is said to be masked if it becomes indistinguishable in the presence of a louder sound.

Simultaneous masking
Any two sounds, when heard simultaneously, have an impact on the perception of the relative volume between them. A louder sound reduces the perception of a weaker one, until the disappearance of your hearing. The closer the frequency of the masked sound is to the frequency of the masker, the more it will be hidden. The masking effect is not the same when the masked sound is shifted down or up in frequency relative to masking. Low-frequency sound masks high-frequency sound. However, it is important to note that high-frequency sounds cannot mask low-frequency sounds.

Time masking
This phenomenon is similar to frequency masking, but time masking occurs here. When the masking sound is stopped, the masking remains inaudible for some time. Under normal conditions, the effect of temporary masking lasts much less. The masking time depends on the frequency and amplitude of the signal and can be up to 100 ms.
In the case where the masking tone appears later than the masking, the effect is called post-masking. When the masking tone appears before the masking (this is also possible), the effect is called premasking.

Post-stimulus fatigue
Often, after exposure to loud, high-intensity sounds, a person’s hearing sensitivity drops dramatically. Recovery of normal thresholds can take up to 16 hours. This process is called “temporary change in hearing threshold.”

Digital audio compression

Digital audio compression

Digital Audio Compression

The concept of loudness is close and understandable not only for a musician, but also for people who are not associated with music. The relationship between the volume of the parts of a piece and the volume of the instruments that are playing simultaneously is called the dynamic range. One of the main tools producers and musicians use to influence dynamic range is the compressor.

Digital Audio Compression

Although the compressor works with a known phenomenon, loudness, in most cases its use occurs spontaneously, randomly, without understanding the essence of what is happening. You can know the general principle of the compressor and the purpose of each handle, but this does not eliminate the stupor at the first experience.

Why do you need a compressor?

The main purpose of the compressor is to automatically change the signal level. It works roughly the same as if you kept your hand constantly on the volume fader, turning it up and down. The difference is that a compressor can react very quickly to changes, much faster and more accurately than a human.

Up to this point, the word compressor meant a whole class of dynamic devices. Using the same basic principles as a conventional compressor, various instruments work for different purposes: limiters, expanders, gates, etc. They are united by working with the volume of individual sounds or the mix as a whole.

The classic compressor is controversial by its very name. Everyone knows that he makes the loudest sound. But the name comes from compress, which means “compression”, and if you ask any sound engineer what a compressor does, you’ll hear the answer: “squash the signal.” The compressor reduces the amplitude of the dynamic bursts, makes them quieter. So what is the main purpose of the compressor: to make it quieter or louder? The answer is both at the same time.

Let’s take an example of voice recording. Very often, in the process of singing, syllables or sounds of different volume are heard. If the singer does not control the dynamics of his performance very well, then such differences create problems for the sound engineer and negatively affect the final result of the work. Silent syllables disappear into the mix, text becomes difficult to distinguish, and if you adjust the volume for a quiet area, in other places the voice begins to “stand out.”

This is where the compressor comes in. It allows you to suppress strong bursts, equalize them with silent fragments. Now you can turn up the volume of the track without fear of some syllables sticking out. So the compressor makes the sound lower and higher at the same time. Three images show the stages of working with sound: a source with large peaks (a), a compressed signal (b) and an increase in the volume level of the entire file (c).

It is especially important to apply compression when recording in a digital environment, when we are forced to adhere to a maximum level of 0 dB, because exceeding this threshold leads to clips and distortion. When clips appear, we lower the preamp level, which means we lower the volume of not only bursts, but quiet areas as well, leading to signal degradation due to quantization and aliasing noise.

The compressor, positioned between the preamp and the digital recording system, operates only on the loudest bursts, reducing their volume and ensuring a smooth soundtrack. Thanks to this, we have the opportunity not to reduce the overall volume of the recorded signal and to maintain the sound quality.

Unfortunately, many modern musicians, without going into the technical characteristics of the compressor, use it everywhere, believing that with its help you can “stretch” any sound in the mix. Also, compressors are often included on the road in extreme conditions. They are only used by experienced sound engineers when there is a real need.

The compressor helps avoid recording problems. The most common causes of problems can be the following:

Non-professionalism of the interpreter (dynamic unevenness).
Mismatched path (bad, mismatched, or inadequate microphones, preamps).
Disadvantages of the digital environment (limited to 0 dB).
Uncomfortable conditions for the singer (small and stuffy room, poor monitoring).
Low qualification of a recording engineer.
If a performer has a voice and can sing into a microphone, and a recording engineer knows her job well and knows how to properly position microphones and set up equipment, a compressor may not be required at all. But this is the ideal situation.

Digital audio compression

Digital audio compression

Digital Audio Compression

Audio data compression is a real problem today. There are two reasons for the need to compress audio data: memory savings when storing audio information, low bandwidth of remote digital information transmission channels. Compression effectively solves the two problems above. Data compression is an algorithmic transformation of data performed to reduce its volume.

Data Compression

It is used for a more rational use of data storage and transmission devices. Compression is based on eliminating the redundancy contained in the original data. To guarantee the parameters necessary for the transmission of voice signals (music) over modern low-speed digital communication channels and to guarantee the specified noise immunity, it is necessary to use highly efficient data compression algorithms. The transmission channel is characterized by a concept such as the capacity of the channel: And the signal – by the volume (signal): …

Both of the above features include dynamic range D, channel width (signal spectrum), and transit time T. Digital audio compressors are used to reduce dynamic range. To improve spectral efficiency, digital filters are used to limit the spectrum of the encoder output signal (according to Nyquist criteria). Among other things, encoders based on the principles of elimination of redundancy (Huffman codes) are used to guarantee a certain information transmission speed. The essence of which is as follows: codes based on the principle of assigning more probable values ​​of the amplitudes of the codewords of shorter length than the improbable ones.

Let’s consider how the types of redundancy described above are eliminated.
Structure of a lossy audio compression encoder The original digital audio signal is divided into frequency subbands and time-segmented into a time-frequency segmentation block. The length of the encoded sample depends on the shape of the temporal function of the audio signal. In the absence of sharp peaks in amplitude, a long sample is used, which provides high-frequency resolution. In the case of abrupt changes in signal amplitude, the length of the encoded sample decreases dramatically, giving a higher time resolution. The decision to change the length of the coded sample is made by the psychoacoustic analysis unit, calculating the value of the psychoacoustic entropy of the signal.
After segmentation, the frequency subband signals are normalized, quantized, and encoded. In the most efficient compression algorithms, it is not the samples of the audio signal that are encoded, but the corresponding MDCT coefficients. (the differential between the coefficients is smaller) The accounting of the auditory perception patterns of a sound signal is carried out in the psychoacoustic analysis unit. Here, according to a special procedure, for each frequency sub-band, the maximum allowable level of quantization distortion (noise) is calculated, in which they are still masked by the useful signal of this sub-band.

The block of dynamic distribution of bits according to the requirements of the psychoacoustic model for each coding subband selects a minimum possible number of them, in which the level of distortions caused by quantization does not exceed the threshold of their audibility calculated by the model psychoacoustic.

This article will consider the functional diagrams of the audio data compression algorithms, based on µ-laws, A. The functional diagram of the compression algorithm based on the A-level compression law is shown in Fig.2. Figure 2. Functional diagram of the compression algorithm based on the A-level compression law A signal (discrete sine) is applied to the input of the compressor. After compression, the signal passes to the adder, where the noise is fed to the second input of the adder, thus simulating the additive noise of the transmission channel.

Then the noisy signal enters the input of the expander, at the output we get the reconstructed signal. The reconstructed and original signal is then fed to the adder, after which the power of the spectral noise is observed.

Simulation results (A = 87.6)
The following graphs are presented: 1-original signal, 2-signal passed through the compressor, 3-recovered signal, 4-noise power at the output of the noise generator, 5-noise power after the expander.

Audio. Digital and analog audio

Audio. Digital and analog audio

Digital Audio

Despite the fact that most of the external information we acquire with the help of sight, sound images are no less important to us and often even more. Try watching a movie with the sound turned off; in 2-3 minutes you will lose the thread of the plot and interest in what is happening, no matter how large the screen and the high quality image. Thus, a pianist played off-screen in silent movies. If you remove the picture and leave the sound, the movie can be “heard” like a fascinating radio show.

DIGITAL AUDIO

Hearing gives us information about what we do not see, since the visual perception sector is limited and the ear captures sounds from all directions, complementing visual images.

Hearing gives us information about what we do not see, since the sector of visual perception is limited and the ear captures the sounds that come from everywhere, complementing the visual images. At the same time, our hearing with great precision can locate an invisible sound source in direction, distance, speed of movement.

They learned to convert sound into electrical vibrations long before images. This was preceded by a mechanical recording of sound vibrations, whose history dates back to the 19th century.

Accelerated progress, including the ability to transmit sound at a distance, was made possible by electricity, with the advent of amplifying, acoustic, and electro-acoustic equipment and transducers – microphones, pickups, dynamic heads, and other emitters. Today, audio signals are transmitted not only over cables and over the air, but also over fiber optic communication lines, primarily in digital form.

The acoustic vibrations are converted into an electrical signal, usually by microphones. Any microphone contains a moving element, the vibrations of which generate a current or voltage in a certain way. The most common type of microphone is the dynamic, which is a reverse speaker. The vibrations of the air set in motion a membrane that is rigidly connected to a moving coil in a magnetic field. A condenser microphone, in fact, is a condenser, one of whose plates vibrates at the same time as the sound, and with it the capacitance between the plates changes. Ribbon microphones use the same principle, only one of the plates is freely suspended. Similar to a condenser electret microphone, whose plates, in the process of oscillation, generate by themselves an electric charge proportional to the amplitude of the oscillations. Many models of microphones have a built-in amplifier (the signal level directly from the acoustic-electric transducer is very low). Unlike a microphone, the pickup of an electric musical instrument registers vibrations not from the air, but from a solid body: a string or the soundboard of an instrument. The cartridge reads the record slot using a needle mechanically connected to moving coils in a magnetic field, or magnets if the coils are stationary. Or the vibrations of the needle are transmitted to the piezoelectric element which, under mechanical stress, generates an electrical charge. In magnetic recording, an audio signal is recorded on a magnetic tape and then read with a special head. Finally, optical recording was traditionally adopted in cinematography: an opaque soundtrack was applied from the edge of the film,

In synthesizers, sound is born directly in the form of electrical vibrations, there is no primary transformation of acoustic waves into an electrical signal.

Modern autumn sound sources are diverse and digital media are becoming more and more common: CDs, DVDs, although vinyl records are also preserved. We continue to listen to radio, both terrestrial and via cable (radio hotspots). Sound accompanies television shows and movies, not to mention a phenomenon as familiar as telephony. A computer receives an increasing share in the world of audio, allowing it to conveniently archive, combine and process sound programs in the form of files. In the digital age, digitized speech and music are transmitted through digital channels, including the Internet, without serious losses in transportation. This is provided by digital encoding and the loss is due solely to compression, which is used most often. However, in digital media, either it does not exist at all (CD, SACD), or lossless audio compression algorithms are used (DVD Audio, DVD Video). In other cases, the degree of compression is determined by the required level of soundtrack quality (MP3 files, digital telephony, digital television, some types of media).