How Effects Work

This page, for developers, describes how effects in Audacity work.

Oh, we also describe how generators work too.

Described on a Page of their Own

 * Noise Removal - The effect creates a custom filter, based on the spectrum of the noise. The wiki page explains more detail and why there can be a 'tinkly-bells' artifact.


 * Chirp and Tone - The generator modifies a sine wave. The wiki page describes why things are a bit more complex with generating a square wave, and how very long chirps and tones are generated.


 * Truncate Silence - The effect has first to detect silence, not as obvious a thing as it sounds at first. For our purposes silence is not necessarily a flat-line.  We may have low energy low frequency sounds - including as a special case DC bias.  Having detected it, removing it is not as obvious as you might think.  Doing it wrong can lead to clicks.


 * Change Tempo - This effect changes the speed of audio without changing the pitch. It uses the SoundTouch library.  It removes cycles of audio, using a best match (autocorrelation) to decide how much to slide the audio.

Amplify
Amplify is just multiplication of each sample by a constant. The most interesting code in the effect is for the UI, where the UI computes the maximum amplification that can be applied without clipping. Rather than examine every single sample to do this, it re-uses the code used for fast drawing of waveforms which keeps a cache of the minimum and maximum values of audio over a particular range. ''Umm... I'm not sure if this is true, but it is what it should do, isn't it?''

Repeat
An interesting wrinkle here is that the effect re-uses the same blockfiles multiple times.