How is music encoded?


Free Download Mp4Gain
picture

First of all, let’s understand why music should be compressed.

Uncompressed files like AIFF and WAV take up a lot of space. This causes that it is not comfortable to transfer them on phones or players, or even store them on the hard drive of our computer.

Lossy audio encoding

Even trying to send them online would be very difficult, due to their large size.
,
This has forced the creation of various formats of audio files that take up less space. Of course, the important thing is that they sound practically the same as the original, although they take up less space.

lossless lossy audio

This is where compression enters the picture.

On the one hand, ZIP or RAR compression is used, but it is not enough. So other techniques are used, namely:

– An uncompressed file contains a lot of information about sounds (even silence) that is inaudible to the human ear and that information is discarded. With that one, it is possible to save a lot of space, since there is little point in occupying space in storing information about sounds that our hatred cannot perceive.

-On the other hand, there is a perfectly known phenomenon regarding the human ear, which is based on the idea that if two sounds occur more or less simultaneously and these sounds occupy similar or close frequencies and one of them sounds louder, the ear You will NOT hear the less loud sound.

This is other information that can also be discarded, since it is generally not audible or the brain does not process it.

Once discarding both types of information, the file has been much less large and therefore does not occupy the same space.

Practically what remains is to apply some composition algorithm, something similar to ZIP. And then you will have a compressed file, for example the mp3.

This is called the lossy method.

There is another method, without loss, where it is only compressed with a method similar to ZIP, but without discarding information.

Is there really a difference between the two? Practically no. the human ear practically cannot distinguish between the two.

A file with loss, that has a good sample rate (minimum 44,100) and a good bit rate, it is almost impossible to distinguish it from the original and therefore, from the file without loss.

Many experiments have been done allowing people to listen to both types of files (those with loss and those without loss) and more than 90% have not been able to distinguish between them, as long as the one with loss has a good samplerate and a good bit rate.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Audio compression basics

Audio compression basics

Today we use music almost exclusively digitally. It has become quite normal for us too that we always carry our music collections, often many thousands of titles, with us. Stored on a chip somewhere in our smartphone or MP3 player. It is thanks to the so-called audio compression that this was possible in the first place.
initial situation

audio compression

Noises and tones, such as birdsong or the ringing of church bells, are analog events with an extremely wide spectrum. A good example of this is a bell. If it is struck, we think we only hear one note. In fact, its ringing consists of around 200 individual tones. These contain soft and strong tones, as well as frequencies that are outside our hearing range.

Audio Compressor

It is no different with music. However, the human ear can only perceive tones above a certain basic volume, so the thresholds for low, medium and high tones are very different. The ear is most sensitive in the tone range of human speech at around 3 kilohertz (kHz). The lower or higher tones have to be much louder for us to perceive them. The volume threshold, at which we begin to perceive sounds, is called the silent hearing threshold. A strong sound covers a lower one if its pitch is the same or similar.

For example, a 1 kHz high tone from an organ pipe can be heard clearly, while one or more soft tones that are close to each other in frequency are masked by higher ones. Although they are there, we still cannot perceive them. The secret that many hifi fans still trust the old record is that it stores all the tones and frequencies just as they are emitted by 1: 1 musical instruments. It also contains those tones that, strictly speaking, we cannot even perceive consciously. we still cannot perceive them.

The secret that many hifi fans still trust the old record is that it stores all the tones and frequencies just as they are emitted by 1: 1 musical instruments. It also contains those tones that, strictly speaking, we cannot even perceive consciously. we still cannot perceive them. The secret that many hifi fans still trust the old record is that it stores all the tones and frequencies just as they are emitted by 1: 1 musical instruments. It also contains those tones that, strictly speaking, we cannot even perceive consciously.

The essential

There are many standards for audio compression, such as MP3, AAC, or WMA. They are all based on the same fundamentals. The processes use the psychoacoustic effects of human auditory perception. All audio information that the human ear cannot perceive is filtered out of the data stream and therefore not saved. MP3 and Co make use of these human hearing effects by using mathematical analysis methods to determine and filter the imperceptible sound information.

An example: if you want to talk to a second person in a very noisy environment, they will hardly hear each other. In such cases, the energy level of the noise (or music at the disco, for example) is higher than that of your voices. This effect is also known as frequency masking. These masked tones are removed. In the same way, tones are filtered in the frequency range outside of our perception.
Another criterion is the so-called silent hearing threshold. All existing tones that are below it, here we talk about threshold masking, are also filtered through a compression process. Time masking is particularly exciting. With it, tones that are drowned out by other signals are also filtered. The timing of the tones is also taken into account. Our hearing is partially receptive to sounds and needs a short recovery phase before it can become receptive again.
This post masking takes about 200 milliseconds. There is also a pre-masking. It is caused by the fact that our brains take a little longer to process soft sounds than loud ones. The pre-masking time is approximately 20 milliseconds. Time masking alone ensures a relevant reduction in audio signals. True to the motto: everything nobody needs comes out. This reduces the music to a fraction of its original volume.

Audio compression, an explanation

Audio compression can be somewhat confusing at first due to the fact that the tools to implement it often have many elements that interact with each other and can be a headache.

Added to all this is the fact that audio / sound compression is often confused with compression in terms of digital formats (MP3 for example), which is a much more complex principle.

That is why we made this guide that aims to attack the most common doubts regarding compressors. The ones I had and the ones you probably have at the moment.

Let’s move on to the important:

What are compressors?

They are essentially an automatic volume or level control.

Let me explain: They are the equivalent of the fader of a console operated by a person in real time, that person has the function of lowering the fader when the volume of an element suddenly rises excessively. All this to control the dynamic range of said element and prevent it from going out of plane.

So what the compressor does in essence is reduce the level of a signal with parameters that are set by the user and that modify how it behaves.

How do they work?

Threshold and knee audio compression
An example of an acting audio compressor showing a 4: 1 reduction contrasting it with the signal without any reduction (1: 1)

Comparing signals, that is to say: a signal enters the compressor, for example the voice we were talking about before and we set a certain level (threshold or treshold) which, if exceeded, causes the compressor to act reducing the level of said voice at the output as if it were the fader on a console.

So the compressor is all the time comparing the input signal against this threshold and reducing the signal at the output if it passes it. On the other hand, the amount of reduction at the output is not always the same, but can be modified by the user with another parameter.

What are all those knobs?

Compressors have various user-modifiable parameters that appear in the form of knobs on both digital and hardware models. Let’s see what they are:

Threshold or Treshold: we tell the compressor that if the signal goes above a certain level, it reduces it in gain. The lower the amount of signal enters the compression and therefore there will be greater reduction in gain. A detail to keep in mind is that in digital models the threshold will appear as a negative number, in essence the more negative that number is, the lower the threshold and the more signal is compressed.
Compression ratio or Ratio: here we tell the compressor to reduce the signal that exceeds the threshold by a certain proportion established by us. For example, if our signal passes the threshold by 10 decibels and we want it to decrease by 5 decibels, we put a ratio of 2: 1 (it works as a division). At higher rates, there will be a greater reduction, but also the compression may start to be noticeable, which that we generally don’t want to happen. What is sought is that it be transparent so that the listener does not realize that the signal was manipulated.

Attack or Attack: it is the time in seconds (generally in the order of milli seconds) that the compressor takes from the moment the signal passes the threshold to the complete reduction in gain that we set with the compression ratio. Keep in mind that the compressor essentially acts immediately, but it is this time that determines how it interacts with the envelope of the signal to be compressed.

Release: is the time in milli seconds that the compressor takes to return to unity gain once the signal stops being above the set threshold. In the same way that with the attack the release can modify the envelope of the sound in question and therefore is very important in the operation of the compressor.

Knee: it is a parameter found in some compressors that modifies the way in which the compressor begins to act, the name is due to the fact that the curve that describes the way in which the compressor begins to act is similar to a knee (knee in English ).
So that we understand better when we talk about soft knee we are talking about that the compressor starts to act gradually before the set threshold and reaches its compression ratio established in this way. Instead, a hard knee compressor will only act when the signal goes beyond the established threshold and therefore more aggressively.

Make up gain or output gain: is the parameter that controls the compressor’s output gain, after having activated and reduced the signal by a number of decibels. What is sought in general is that what was reduced in level is re-gained and therefore make the parts that had less volume now approach those that were compressed.