What is the purpose of dividing a signal into subbands when compressing an audio file?

I must implement my own very simple MUSICAM algorithm (basic filtering + Huffman coding) to compress an audio file. But I'm having trouble understanding the interest of dividing a signal into 32 frequency bands before filtering the frequencies. I've read stuff about Nyquist rule but it's not clear for me since I don't have a huge background in signal processing.

Could anyone explain why not just filtering the raw data without dividing into subbands ?

Here is the main reference I use in understanding the concept of MUSICAM.

There are two types of compression algorithms loss-less (like Flac, Apple ALAC, etc.) which are algorithms similar to Huffman coding. If you apply those to raw audio wave files you get a reduction of maybe 75%-50%.

Anything more than that, you need a lossy codec like MP3, AAC, Musicam etc. These are perceptual coders, i.e they make use of detailed knowledge of the human auditory system. The main effect that is being exploited is called "masking". See for example https://en.wikipedia.org/wiki/Auditory_masking

Masking is the ability to hear (or not) one sound in the presence of another. The main idea of the perceptual coders is to eliminate the information that's not audible. To be more precise: the signal gets quantized with less bits in a way so that the quantization noise sits below the masking threshold. The masking threshold is highly dependent on frequency and the characteristics of the actual audio signal. So you need to compute this constantly similar to the way the human auditory system works, and that's basically in sub bands. Specifically in so called "critical bands". See https://en.wikipedia.org/wiki/Critical_band

More advanced codecs have a fairly detailed model of the human basilar membrane included that is basically the way how humans convert auditory information from the time to the frequency domain. See https://en.wikipedia.org/wiki/Basilar_membrane

100s of thousands if not millions of hours have been spent on developing these codecs. It requires massive amounts of psychoacoustics research and testing. I think you need to be realistic of what you can achieve in your own context and you perhaps looking into using an existing codec.

• Just of the mention: filter banks can be helpful for lossless compression as well, to decorrelate and help entropy coding Dec 31, 2016 at 18:23

We don't hear all frequencies equally well. Therefore, if we split the frequencies into subbands, we can give more bits to bands which we hear well, and less bits to bands we don't hear that well (which is determined by things like doing listening tests). Its usually easier easier to control the error of the compressed signal on a subband level than on the whole signal level.

This will typically give us less distortion for a given data rate than trying to encode all frequencies with equal number of bits.

An analogous experiment you can do is with (natural) images: Take the DFT or DCT of an image, and throw out the higher frequencies (i.e. high in the x,y directions). You still get a pretty decent approximation if you keep only a few low frequencies. So, instead of throwing them out, imagine you quantized them -- you'd want to give less bits to the higher frequencies than the lower frequencies, since you're not getting much perceptual gain by throwing lots of bits in the higher frequencies, but you are getting more in the lower frequencies. (This underlies JPEG; See something like Gonzalez and Woods' Digital Image Processing for details on how exactly JPEG works).

The Nyquist rule says that your sampling rate must be greater than twice the highest frequency in your signal to avoid aliasing.

(For the record, this is being written before reading the paper you linked, but hopefully this can provide some more insight into what compression is).

As far as compression goes, you can remove some of the very high frequency bands without affecting the overall quality of the signal too much. There is no single way to compress a signal, but splitting it up into many bands gives you the flexibility of choosing how much compression you want.

Do you want a small reduction in the amount of information? Then zero out a small number of the high frequency bands. Want to reduce the amount of information a lot? Zero out more frequency bands.

As a thought experiment, consider how much information can be contained in a signal whose information is only between 20 and 200 Hz. You may be able to make out a person's voice, but with the most of the frequency content removed, the signal contains less information than before. A voice signal containing frequencies between 20 and 200 Hz has less information than a voice signal containing frequencies between 20 Hz and 20 kHz, which means that the signal has been compressed.

When you filter a signal (with a standard low- or band-pass filter)), you indeed produce two "subbands": the one you keep, the one you leave out. The filtered signal might have less noise or unheard components. Its amplitude might be somehow a little smaller. But it keeps the same number of samples. So its is not really compressed in a bitrate sense.

Lossy compression is about saving as much bits as it can: either on amplitudes and on the number of samples. First, subband filtering (multiple filters in parallel) allows you to filter the data into say 32 bands, and each can be subsampled by 32, almost without loss of information. So you have split the signal into 32 simpler ones, at almost the same bitrate. Now you can reap the benefit: each simple subband signal is closer in shape to a sine, that is easy to predict. Moreover, in each subband, at each time, you are able to exploit fine auditory properties:

• a weak sound that closely follows a strong sound is not heard (you can save bits by not coding it),
• a weak frequency close to a strong frequency is not heard (you can save bits by not coding it),
• depending on the frequency range, your ear cannot distinguish easily between close frequencies, or amplitudes can vary by 15 % without getting noticed (and you can save bits in coding the amplitude less precisely).

All these tricks can be used because the signal is in time, and your subband filtering splits it into fine frequency bands (a time-frequency representation).

By contrast, with a single filter, you tend to treat all time instant equally, while it is beneficial to treat them different depending on the context (strong amplitude or frequency close-by).