Showing posts with label Compression. Show all posts
Showing posts with label Compression. Show all posts

Apr 29, 2008

Stacking and Multi-band compression

Stacking compression
You may have noticed when you were playing around with compression in the last setting that a little bit of compression sounds good, but too much starts to sound noticeable. Sometimes, however, you may need a little more than light compression. The problem is that if you use a heavier setting, the effect starts to become too noticeable. One way around this is to stack your compression effects.

It's a really simple concept; apply a light compression across your entire file, and then apply another light compression. Lightly compressing the material twice is a much subtler effect than heavily compressing once. In fact, this approach is very common in recording applications. Audio engineers lightly compress material that is being recorded, to provide a little control over levels. Then, after the material has been edited, they apply additional compression to give the program that extra bit of presence.

Another approach, used in multi-track recording situations, is to use different compression effects on different tracks, and then to have a limiter placed across the master mix, to make sure the final mix never goes into distortion.

Multi-band compression
All the compression we've been talking about up to this point has been compression that analyzes the entire frequency range when determining what has exceeded the threshold. There are specialized compressors that break the frequency range into a number of different bands and then compress them all individually. Radio stations use ridiculously expensive multi-band compressors and set them up to try to get a unique, signature sound. (All they're really doing is competing to see who sounds loudest.)

One area where multi-band compression can be incredibly useful is as a corrective measure, in particular to deal with microphone pops and sibilants problems. In the EQ section, we discussed how you could deal with pops and "ess" sounds by turning down certain frequencies at the instant the problem syllable appears. A multi-band compressor does this for you automatically.

Figure 1 shows Sony Sound Forge's multi-band compressor, using a preset called "Reduce plosives and sibilants." It's using two bands, both of which have very fast attack and release times, because we want the compressor to react immediately. Band #1 is set to low shelf mode, meaning it monitors all frequencies below the shelf frequency, which in this case is 600Hz. Band #2 is set to notch mode, with a moderate Q of one octave, centered on 5KHz. When I preview audio, I can see the second band being compressed when the narrator pronounces "ess" sounds. Because my narrator hasn't popped the mic, the top band doesn't do much of anything. If you have a guest who has a problem with sibilants, you can use the de-ess preset (yes, that's the technical term for this) to get rid of the problem. Fabulous.


Figure 1: Using Sony Sound Forge's multi-band compressor to fight pops and sibilants

Apr 27, 2008

Compression: A step-by-step example

Now that you know a little bit about how compression works, it's time to play around with it to see how it affects the sound of your podcast. For this example, we'll be using the compressor that comes with Audacity.

1. Open Audacity, and open your podcast file.

2. Select the entire file by pressing Ctrl-A (Opt-A on a Mac). Remember that Audacity doesn't expose the effects until you highlight a section of your audio.

3. Select Compressor from the Effect menu. This brings up the Dynamic Range Compressor window, as shown in Figure 1.


Figure 1: The Dynamic Range Compressor in Audacity


4. You can see in Figure 1 that the default settings for the Audacity Compressor is a 2:1 compression ratio, a -12dB threshold, and a .2 second attack time. (This plug-in doesn't have a release time setting.) In fact, this is a nice moderate setting that may work just fine for your content. However, you may want to experiment with the settings to see what changing the threshold, ratio, and attack times do to the sound of your file.

Audacity's Dynamic Range Compressor settings are adjustable in increments. For example, the ratios are variable in .5 increments (1.5:1, 2:1, 2.5:1, and so forth), and the attack times in tenths of seconds. Try changing the compression settings to a 4:1 ratio and a .1 second attack time. Preview the audio. Hear a difference?

In fact, 100 milliseconds is really too slow of an attack time. To hear why, try changing the threshold to something really low, say -30dB. Preview the audio. Hear that? The audio starts off loud, and 100 milliseconds later the compressor kicks in. The compression effect is audible, because the attack time is too slow. However, if you raise the threshold up to say -15dB, the effect may not be as audible. You should be able to find a threshold that works in conjunction with the sluggish attack time.

Apr 25, 2008

How compression works

How compression works
Most compressors offer the same basic controls, which allow you to set the following:

Threshold: Where the compression effect kicks in

Ratio: The amount of compression applied above the threshold

Attack and Release times: The length of time after the threshold is crossed that the effect is applied and removed

Figure 1 illustrates what different compression curves look like. Looking at the curve, you'll see that signal levels below the threshold are unaffected, and signal levels above the threshold are attenuated. The higher the compression ratio is, the more attenuation. When the compression ratio is high, it is known as limiting, because it more or less prevents the audio from exceeding the threshold.


Figure 1: Compression curves with different compression ratios


Setting a threshold
To illustrate how different threshold settings affect the output, let's assume that we're working with the audio file illustrated in Figure 2. We can see that this file has peaks as high as -2dB, but the bulk of the file is below the -10dB mark. If we want to compress this file lightly, we should set a threshold in the -6dB to -10dB range. Figure 3 illustrates compression applied to this file using two different thresholds, -6 and -20dB.


Figure 2: The audio file from Figure 7.5 after compression using a threshold of a) -6dB and b) -20dB



Figure 3: The audio files from Figure 2 after applying compensating gain


What is immediately apparent is that the file in Figure 2b has been compressed far more heavily than Figure 2a. We need to apply some gain to restore these files to their former levels. Figure 2b has far more headroom, so we can apply much more gain. After applying gain, we end up with the files illustrated in Figure 3.

These files are both much louder than the original, but if you look closely at the figure on the right, the entire file is loud. It doesn't have any dynamics left, because the dynamic range has been compressed. To be honest, this file might be a little too compressed. Files that have been over-compressed are fatiguing to listen to, because EVERY SINGLE SYLLABLE IS LOUD. Think of drive-time radio programs; they're highly compressed, because the DJs are going absolutely nuts in the studio. The idea is to compete with all the noise of traffic and to keep you awake on your drive to and from work. But this is not the type of programming you really want to listen to all day long (see the "Compression: How Much Is Enough?" sidebar).

If your original audio file is well recorded, you should have peaks in the -3dB to -6dB range. Choosing a threshold in the -6dB to -10dB range is a safe starting point. This way, you're only compressing the loudest sections of your file, leaving most of your file untouched. If you find yourself dropping your threshold much below that, you may consider revisiting your signal chain to figure out why your recording is so quiet in the first place.

Setting a ratio
The ratio setting determines how much compression is applied over the threshold. For example, a 2:1 compression ratio means that for every 2dB by which the incoming signal exceeds the threshold, only 1dB of gain is applied. Ratios up to around 4:1 are mild and can be used safely, provided you set a sensible threshold. Ratios in the 4:1 to 10:1 range are fairly heavy and should be used with caution. Any ratio over 10:1 falls into a special category known as limiting.

Limiting can be useful as a preventative measure, but it isn't appropriate as your main form of compression. For most applications, start off with a ratio of 4:1 and experiment with using slightly more or less until you achieve the effect you're after. In particular, voices are particularly compression tolerant, so if you don't have any music in your podcast, you may be able to use more compression (see the "Compression: Voice versus Music" sidebar).

Setting attack and release times

The attack and release times control how quickly the compression effect is applied to signals that exceed the threshold you set, and how quickly the signal level is returned to the original input. For most content, you want a quick attack time, so signals that exceed the threshold are immediately attenuated. For the release time, you want something a bit longer, so the sound doesn't abruptly get returned to the original level.

This is fairly self-evident from the attack and release controls. The scale on the attack control knob generally is in milliseconds, and the scale on the release knob is in seconds. Start with a quick attack, say 10-20 milliseconds, and a gradual release around 500 milliseconds. These settings should work for most podcasting content, but don't be afraid to play around with your compressor to see how these settings affect the compression.

Apr 22, 2008

Compression : Why use compression?

Compression
Compression is a form of dynamics processing, meaning that it deals with the overall levels in a file. Compression automatically turns down sections of your audio file, based on settings you specify. Think of it as an automatic volume control. In fact, you may have run into Automatic Gain Control (AGC) on a piece of hardware you own. Many portable tape recorders have an AGC circuit built in to the microphone. This is a fancy marketing term for a compressor. The AGC circuit ensures that all sounds are picked up and that sounds don't get so loud that they distort the microphone input.

Most compressors offer a number of controls that enable you to set where the compression effect kicks in and how drastic it is. But before we get into the details of how compression works, let's talk a little bit about why compression is useful.

Why use compression?
At its most basic, compression is useful as a safeguard against distortion. A compressor automatically adjusts the signal level when it exceeds a certain threshold, so that a guest who suddenly gets excited won't send your levels into the red. For this simple reason, compressors are very useful in live situations, when you may not be able to control situations as tightly as you'd like to.

Compression also is useful when working in lower fidelity environments, because it allows you to match the dynamic range of your production to the available dynamic range of the equipment on which it is played back. CD-quality audio has a very large dynamic range, and provided you're listening in a quiet environment, you can hear very quiet sounds as well as very loud sounds coming off a well-produced CD. This simply isn't the case for most podcasts.

First, most podcasts are played back on desktop systems, very often in slightly noisy environments. So if your podcast has very quiet sections, people will have a hard time listening, because they'll either have to turn the volume up temporarily or shush the people around them. And if you're encoding at a lower bit rate (96Kbps, 64Kbps, or even 32Kbps), the dynamic range simply isn't that great. The encoding software uses volume as a determinant of importance, so quieter sections won't sound as good as the louder sections.

If the quieter sections of your podcast are going to be difficult to hear, then you want to turn those sections up, right? Sure you do. You want the overall level of your file evened out, so you don't have large differences between the loud sections and the quiet sections. You want the dynamic range compressed. This is precisely what a compressor does.

Figure 1 illustrates the dynamic range and headroom of a file. We'd like to turn up the quiet sections of this file, but at a certain point, the louder sections will go into distortion. Using a compressor, we can turn the file up and ensure that the loud sections don't go into distortion, because the compressor turns those sections down automatically.


Figure 1: The dynamic range and headroom of an audio file


The final reason to use compression is because we're used to hearing compressed audio on all the traditional broadcast mediums. Radio and television use compression liberally. This is partially for the protective reasons discussed previously, but also because of a particular side effect of compression. Compression tends to make things sound fuller, because it brings up the bottom end of the audio signal. Between the protective qualities of compression and the added warmth, this combination is hard to beat.