MP3 – the most popular digital audio format


Free Download Mp4Gain
picture

MP3 – the most popular digital audio format

Initial release 1986

MPEG-1 Audio Layer 3, better known as MP3, is a lossy compressed digital audio format developed by the Moving Picture Experts Group (MPEGH) to be part of version 1 (and later expanded to version 2) of the MPEG video. The standard mp3 is 144 kHz and a bitrate of 317 kbps for the quality / size ratio. Its name is the acronym for MPEG-1 Audio Layer 3 and the term should not be confused with that of MP3 player.

Mp3 – History

This format was mainly developed by Karlheinz Brandenburg, director of electronic media technologies at the Fraunhofer IIS Institute, part of the Fraunhofer-Gesellschaft – network of German research centers – which together with Thomson Multimedia controls the bulk of MP3-related patents. The first one was registered in 1986 and several more in 1991. But it was not until July 1995 when Brandenburg first used the .mp3 extension for the MP3-related files he kept on his computer. A year later, his institute paid 1.2 million euros for patents. Ten years later this amount has reached 26.1 million.

The MP3 format became the standard used for streaming audio and compression of high-quality audio (with loss in hi-fi equipment) thanks to the possibility of adjusting the quality of the compression, proportional to the size per second (bitrate), and therefore the final size of the file, which could occupy 12 and even 15 times less than the original uncompressed file.

It was the first audio compression format popularized thanks to the Internet, since it made possible the exchange of music files. The legal proceedings against companies like Napster and AudioGalaxy are the result of the ease with which this type of files are shared.

After the development of autonomous, portable or integrated players in music (stereo) channels, the MP3 format reaches beyond the world of computing.

At the beginning of 2002, other compressed audio formats such as Windows Media Audio and Ogg Vorbis began to be massively included in programs, operating systems and autonomous players, which made it foresee that MP3 would gradually fall into disuse, in favor of other formats, such as the mentioned ones, of much better quality. One of the factors that influences the decline of MP3 is that it has a patent. Technically, it does not mean that its quality is inferior or superior, but it prevents the community from continuing to improve it and can compel paying for the use of some codec, this is what happens with MP3 players. Even so, in late 2009, the mp3 format continues to be the most used and the most successful.

Mp3 player

Mp3 – Technical details

In this layer there are several differences with respect to the MPEG-1 and MPEG-2 standards, among which is the so-called hybrid filter bank that makes its design more complex. This improvement in frequency resolution worsens temporal resolution by introducing pre-echo problems that are predicted and corrected. Additionally, it enables audio quality at rates as low as 64 kbps.

Mp3 Filter bank

The filter bank used in this layer is the so-called hybrid multiphase / MDCT filter bank. It is responsible for mapping the time domain to the frequency domain for both the encoder and the decoder reconstruction filters. The bench output samples are quantized and provide variable frequency resolution, 6×32 or 18×32 subbands, adjusting much better to the critical bands of different frequencies. Using 18 points, the maximum number of frequency frequency components is: 32 x 18 = 576. Resulting in a frequency resolution of: 24000/576 = 41.67 Hz (if fs = 48 kHz.). If 6 frequency lines are used, the frequency resolution is lower, but the temporal resolution is higher, and it is applied in those areas where pre-echo effects are expected (abrupt transitions of silence at high energy levels).

The psychoacoustic model

Compression is based on the reduction of the irrelevant dynamic range, that is, on the inability of the auditory system to detect quantification errors under masking conditions. This standard divides the signal into frequency bands that approximate the critical bands, and then quantizes each subband based on the noise detection threshold within that band. The psychoacoustic model is a modification of the one used in Scheme II, and uses a method called polynomial prediction. It analyzes the audio signal and calculates the amount of noise that can be introduced as a function of frequency, that is, it calculates the “amount of masking” or masking threshold as a function of frequency.

The encoder uses this information to decide the best way to spend the available bits. This standard provides two psychoacoustic models of different complexity: model I is less complex than psychoacoustic model II and greatly simplifies calculations. Studies show that the distortion generated is imperceptible to the experienced ear in an optimal environment from 256 kbps and under normal conditions. For the inexperienced or common ear, with 128 kbps or up to 96 kbps it is enough to make you hear “well” (unless you have high quality audio equipment where the lack of bass is excessively noticeable and the sound stands out of “frying” in the treble). In people who listen to a lot of music or who have experience in the listening part, from 192 or 256 kbps it is enough to hear well. The music that circulates on the Internet, for the most part, is encoded between 128 and 192 kbps.

Coding and quantification

The solution proposed by this standard regarding the distribution of bits or noise is made in an iteration cycle that consists of an internal and an external cycle. Examines both the filter bank output samples and the signal-to-mask ratio (SMR) provided by the psychoacoustic model, and adjusts the bit or noise allocation, depending on the scheme used, to simultaneously satisfy the bit rate requirements and masking. These cycles consist of:

Internal cycle

The internal cycle performs non-uniform quantization according to the floating point system (each MDCT spectral value is raised to the 3/4 power). The cycle chooses a certain quantization interval and Huffman coding is applied to the quantized data in the next block. The cycle ends when the quantized values ​​that have been encoded with Huffman use less or equal number of bits than the maximum number of bits allowed. lokaS

External cycle

Now the external cycle is in charge of verifying if the scale factor for each subband has more distortion than allowed (noise in the encoded signal), comparing each band of the scale factor with the data previously calculated in the psychoacoustic analysis. The external cycle ends when one of the following conditions is met:

Neither scale factor band has much noise.
If the next iteration amplifies one of the bands more than is allowed.
All bands have been amplified at least once.
Bitstream packaging or formatter

This block takes the quantized samples from the filter bank, along with the bit / noise allocation data and stores the encoded audio and some additional data in the frames. Each frame contains information from 1152 audio samples and consists of a header, the audio data along with error checking by CRC and auxiliary data (the latter two optional). The header describes what layer, bit rate, and sample rate are being used for the encoded audio. Frames start with the same synchronization and differentiation header and their length may vary. In addition to dealing with this information, it also includes variable length Huffman encoding, an entropic encoding method that without loss of information eliminates redundancy. It acts at the end of compression to encode the information. Variable length methods are generally characterized by assigning short words to the most frequent events, leaving long words for the most infrequent.

Structure of an MP3 file

An Mp3 file is made up of different MP3 frames which in turn are made up of an Mp3 header and MP3 data. This data stream is called “elemental stream”. Each of the frames is independent, that is, a person can cut the frames of an MP3 file and then play them on any MP3 player on the market. The header consists of a sync word that is used to indicate the beginning of a valid frame. Following are a series of bits that indicate that the analyzed file is a Standard MPEG file and whether or not it uses layer 3.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Author: R. Arias

R. Arias is the author of this article and has extensive experience for more than 30 years as a recording engineer and audio specialist, as well as more than 20 years of experience creating algorithms related to audio and video. Linkedin