top of page

Naive Compression

Now that we have an intuition of what compression is and what the various input settings do for the effect it's time to jump in and process some audio!  First though lets go over a litte bit of the background of this project as well as a preview of what you will see moving forward.

Our Project

The goal of Audio Processing: Exploring Dynamic Range Compression is to facillitate understanding of core compression concepts for audio beginners while simultaneously offering those interested an opportunity to understand the engineering behind digital compressor design.

 

Our project will implement a six compression algorithms and highlight characteristic differences between them for those interested in the technical background, and simply provide our favorite compressor to those who want the fast track.  It is our hope that by doing this we will be able to 'demystify' compression for beginning digital audio students and allow deeper understanding of tradeoffs between different compressors and different compression settings for more advanced readers.  With this goal in mind, we have elected to keep our input signal library small in order to keep the focus on the compression characteristics and to keep our output data easy to digest.

 

We have selected three different audio signals for input.  The signals were chosen with the intention of creating a representative group of sounds you would typically find in recorded music.

  • A male vocal sample

  • An strummed acoustic guitar

  • A drum kit

 

Audio was recorded at University of Michigan in the Duderstadt Recording Studio by Avery Bruni.  All files were recorded with at 44.1k with 16 bit depth and are stored as .wav files.

Algorithm and Plots

Now lets do some processing!

 

Our naive compression algorithm is intended to be an 'honest try' approach - simply reduce the volume of any sample above a preselected threshold by a fixed amount.  Attack and release time are often difficult to understand and select correctly, so this approach simply puts into action what every beginner wishes they could do - remove attack and release all together.  Compression is applied immediately to all samples above the threshold and is not applied at all below the threshold.

 

Our sample signal (in this case the male vocal clip)  is plotted both before and after compression in the time domain in Figure 1, where the red line shown represents our threshold.  By noting the maximum amplitude on each plot (approx. 0.4V for uncompressed and 0.25V for compressed) it is clear the signals volume is being reduced when it exceeds the threshold, and thus we have achieved simple compression.  Figure 2 shows the same two signals plotted in the frequency domain as well as a plot of the difference between the two signals, illustrating the effect of the compressor.

All plots were generated using built-in MATLAB plotting tools.

 

While our naive compressor does accomplish its given task, it is significantly distorted and completely unusable in any real context.  The distortion is a side effect of removing the attack and release from the processing chain.  Without those parameters, the compressor immediately switches from no compression, to full compression, and back again any time even the smallest peak crosses the threshold.  These discontinuities in the output signal gain cause the distorition.

Male Vocal - Sample Audio
00:00 / 00:00
Drum Kit - Sample Audio
00:00 / 00:00
Acoustic Guitar - Sample Audio
00:00 / 00:00

Figure 1: Male vocal signal compressed and uncompressed in time domain

Figure 1: Male vocal signal compressed and uncompressed in time domain

Acoustic Guitar - Sample Audio
00:00 / 00:00
Naive Comp. Guitar - Sample Audio
00:00 / 00:00
bottom of page