# How Audacity Noise Reduction Works

Peter 15Dec14: The new Noise Reduction effect is replacing Noise Removal in 2.1.0.

This page is for now and until 2.1.0 an orphan page in the Wiki linked to only from the Noise Reduction page in the Wiki. Once 2.1.0 is released this page can effectively replace How Noise Removal Works in the Wiki and that page will then only remain in the Legacy Wiki.

ToDo-1 This page needs some severe editing from someone who really understands how the effect works - all I have done so far is to copy the existing How Noise Removal Works Wiki page and make textual changes to replace "remove" with "reduce" throughout. So for all I know this could well be wildly inaccurate. We also have to as ourselves the question: "Do we really need this page, or do we (or should we) have sufficiently adequate documentation in the Manual - or on the Wiki page Noise Reduction?".

## About the Noise Reduction algorithm

Q: How do you actually reduce noise? What is the algorithm?

A: The noise reduction algorithm uses Fourier analysis : it finds the spectrum of pure tones that make up the background noise in the quiet sound segment that you selected - that's called the "frequency spectrum" of the sound. That forms a fingerprint of the static background noise in your sound file. When you reduce noise from the music as a whole, the algorithm finds the frequency spectrum of each short segment of sound in your music. Any pure tones that aren't sufficiently louder than the fingerprint (above the threshold to be preserved) are greatly reduced in volume. That way, (say) a guitar note or an overtone of the singer's voice are preserved, but hiss, hum, and other steady noises can be minimized. The general technique is called spectral noise gating .

The first pass of noise reduction is done over just noise. For each windowed sample of the sound, we take a Fast Fourier Transform (FFT) and then statistics are tabulated for each frequency band - specifically the maximum level achieved by at least <n> sampling windows in a row, for various values of <n>.

During the noise reduction phase, we start by setting a gain control for each frequency band such that if the sound has exceeded the previously-determined threshold, the gain is set to 0, otherwise the gain is set lower (e.g. -18 dB), to suppress the noise. Then frequency-smoothing is applied so that a single frequency is never suppressed or boosted in isolation, followed by time-smoothing so that the gain for each frequency band moves slowly. Lookahead is employed; this effect is not designed for real-time but if it were, there would be a significant delay. The gain controls are applied to the complex FFT of the signal, and then the inverse FFT is applied, followed by a Hanning window; the output signal is then pieced together using overlap/add of half the window size.

Q: How many frequency bands does the noise gate use?

A: In Audacity we use an FFT size of 2048, which results in 1024 frequency bands.

### Artifacts

Q: What causes the 'tinkling' artifacts, and what steps can and have been taken to elimibate them?

A: The tinkly artifacts happen when individual pure tones are near the threshold to be preserved -- they are small pieces of the background soundscape that survived the thresholding, perhaps because the background noise is slightly different from the fingerprint or because the main sound has overtones that are imperceptible but that boost them slightly over the threshold.

So while the Audacity noise gating algorithm could perhaps be improved, any Fourier-based noise reduction algorithm will have some artifacts like the "tinkle-bells". They are a symptom of the problem of discrimination - deciding whether a particular analog signal is above or below a decision threshold - that is central to the fields of digital data processing and information theory. In general the tinkle-bell artifacts are quieter than the original noise. The real question is whether they are more noticeable than the original noise. (For example, noise-gating the Beatles' Sun King track off the Abbey Road album is a bad idea, because the soft brushed cymbal sounds merge smoothly into the tape hiss on the original master recording, so tinkle bells and a related problem -- fluttering -- are prominent in noise-gated versions of that track.)

You can reduce the effect of tinkle bells by noise gating sounds that are well separated (either in volume or frequency spectrum) from the background noise, or by mixing a small amount of the original noisy track back into the noise gated sound. Then the muted background noise tends to mask the tinkle bells. That technique works well for (e.g.) noisy microcassette recordings, where the noise floor might only be 20 dB below the loudest sounds on the tape. You can get about 10dB of noise reduction that way, without excessive tinkly artifacts.