1
$\begingroup$

I understand that compression works by exploiting certain psycho-acoustical characteristics of our auditory perception, but I'm still confused. I mean ultimately, the waveform must be recorded regardless of what has been done to do it, and I was under the impression that all waveforms were born equal? Does removing a band of bits needed to store that information?

I'm confused?

$\endgroup$
  • $\begingroup$ you can compress it losslessly or lossily, which are fundamentally different. $\endgroup$ – endolith Apr 14 '14 at 20:16
2
$\begingroup$

there are at least two different meanings of "compressed audio", one is, as your title mentions, compression of data and the other is level compression. they're two totally different functions.

about compression of audio data, there are two general classes: lossless compression and lossy compression. in a crude sense of the word, signal quantization is a form of lossy compression, but i would not call word-width reduction the same topic as compression. so let's assume the audio data has already had its word-width (or "bit depth") reduced to its production length (say, 16 or 24 bits or whatever).

as the names might suggest, losslessly compressed audio data will have the audio data restored exactly when uncompressed. the original waveform will be restored. for lossy compression, when the audio is uncompressed the original waveform is not restored, but the expectation is that the audio will sound the same.

to do lossless compression of audio, there are two main steps, the first is what is commonly called "Differential Coding". "Delta Modulation" is the simplest example, but one can employ Linear Predictive Coding (LPC) to combine the past N samples in such a way as to predict the next incoming sample. if the prediction is good, the difference between the actual sample and the predicted sample will be small and that reduces the number of values to encode significantly. say, for 16-bit, instead of having 65536 values to encode, your difference signal might be not much bigger than 128 and you'll need only 8 bits to encode that difference.

what about the rare times you need more than 8 bits because the difference is greater than 128? this is where entropy coding or Huffman coding comes in. this is essentially what file compression programs like pkzip do. words that appear often are assigned fewer bits than words that appear rarely. this all comes out of Shannon's Information Theory.

that's, in a short form, what lossless compression is about. to learn what lossy compression is about, there is a whole additional science about perception of audio, what audio features can be heard and what are not heard. it's hard to explain, but there are ways of separating what can be heard from what cannot and for the separated data that is deemed not audible, no bits are allocated to it. it's a crude explanation.

$\endgroup$
2
$\begingroup$

Here is my non-technical 2 cents...

Usually when you are referring to compressing audio, you are referring to audio that humans tend to listen to, like voice or music. Voice and music are interesting and meaningful to humans because these signals have time correlations or redundancies that allow the human brain to track the signal and even predict where the signal is going. The simplest way to understand this is to consider a fully uncorrelated audio signal, white noise. White noise is not compressible in the strict sense because there is no way to predict from past samples of the signal what the next samples will be. White noise is not particularly interesting to listen to.

Going back to more interesting signals, if you analyze music and/or voice you will discover that such signals are composed of many segments that over a short term can be modeled as periodic signals. If you know how to model the source of the sounds, you can predict how to reproduce future signal from past values of the signal. This ability to predict is what allows compression to take place. If future signal samples can be predicted from past signal samples, the past signal samples include information that is not necessary to store information about the signal. A compression algorithm looks for ways to eliminate these information redundancies (or correlations) in the signal and store only non redundant information (clearly not in a format that can be understood by the human auditory system).

The other side of audio compression is audio reconstruction. Here you take the non-redundant stored information and use it to reconstruct an audio signal. Here a model of the audio source may be used as a tool in the reconstruction of the signal or more generally, the algorithm used to encode the signal without redundancy is reversed to insert the redundancy back into the signal. In the reconstruction of the audio signal, the reconstructed signal can leave out features that are not perceivable by the human auditory system. This is one area where psycho-acoustics can be considered. If features are known not to be unimportant for perception of the message, these features can be left out of the stored signal information. Psycho-acoustics can further reduce the size of the compressed signal representation, but is not necessary to achieve compression of the original signal. The only thing that is needed to compress any signal is time correlation.

One caveat here is that some audio signals include white noise as a component of the signal. White noise can't be compressed based on correlations, however this can be handled in a different way. One option is to include a code in the compressed signal that indicates where and how much noise exists as a component of the signal. Such codes are many times more efficient than storing the noise as time samples. When reconstructing the signal, the noise can be re-generated at the appropriate level and combined with the reconstructed signal. Some high compression voice coders use a technique like this for sounds such as 's' or 'sh'. The noise part of the signal can be added back in without difficulty because the human ear isn't capable of distinguishing phase information about white noise.

The topic that deals with this type of processing directly is information theory. You may like to read the following lightly technical treatment of the subject:

"Symbols Signals and Noise" By: J. R. Pierce

J.R. Pierce was a friend of Claude Shannon the so called father of information theory.

I believe this book is public domain and is now freely available as an ebook.

$\endgroup$
1
$\begingroup$

The waveform doesn't have to be preserved. All waveforms are not born equal in terms of being able to differentiate between them using just human ears and brains as the detection equipment. Sometimes, completely different looking waveforms will be heard as exactly the same sound. Only the characteristics of an audio waveform that a "typical" human might perceive is preserved in compressed audio. And often enough, these characteristics are simpler in terms of the bits required to describe them then the raw original waveform.

$\endgroup$
  • 1
    $\begingroup$ I'd like to add that the reason why some "waveforms" (you really use other domains usually) can be stored more efficiently is that the final stage of all the common psychoacoustic encoders is an entropy encoder. That stage assigns shorter bit patterns to more common symbols, hence reduces the total number of bits. $\endgroup$ – Jazzmaniac Apr 13 '14 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.