Claude Debussy once responded to the question of how he composed by saying he starts by taking all pitches and then leaves out the ones he doesn't like. He foresaw the idea of filtering. In contrast to additive synthesis - which uses what might be considered the 'atom' of sound, the sine tone, as a starting point - subtractive synthesis begins with all sound and reduces it. It is actually possible to produce all sound. Causing a speaker membrane to vibrate completely chaotically and randomly will produce all audible frequencies simultaneously. The Pd object used to accomplish this is called "noise~":
Technically speaking, it would be more accurate if "noise~" were named "random~" instead, because it produces 44100 random numbers per second. These numbers occur in a range of -1 to 1, i.e., membrane positions.
Like light, noise that contains all audible frequencies is called "white noise". Normal white light contains all light frequencies while, say, red or blue light can be derived from it using filters.
Pd also has filters such as "lowpass", which allows only the low frequencies to pass through while suppressing the high frequencies. This is represented in the following diagram; the x-axis represents frequency and the y-axis amplitude:
There is also a "highpass" filter, which only allows high frequencies to pass through:
The Pd objects for these filters are called "hip~" and "lop~". Their argument or right input is the frequency from which the sound should be filtered.
As you can see in the preceding diagrams, the filters are not particularly 'steep'. However, you can intensify their effect by using several filters one after another (cascade):
The volume has to be readjusted for each filter, as they reduce the sound's intensity. (Though they sometimes strengthen other things.)
Another kind of filter is called a "band-pass". This allows only a small portion of sound surrounding a central frequency to pass through, like a 'band' of frequencies. As arguments/inlets it receives the central frequency and the width of the band, called "q".
Theoretically, if the band gets small enough, you should end up with just a single sine tone:
As you can easily hear, however, this is not the case. A certain noise element is always leftover with a band-pass filter.
Just as an example of how filters might be used, here is a random distribution of band-pass filters:
For transmitting telephone conversations, it was determined that frequencies from just 300 to 3000 Hz suffice for comprehending speech. You can simulate that:
Experiment with filtering the "glissando orchestra" (220.127.116.11.4).
The "noise~" object causes the speaker membrane to vibrate randomly. When you turn this sound on or off you don't hear a click; this is because noise is composed solely of clicks of varying intensity. Therefore, you don't need a "ramp" (cf. 18.104.22.168.2).
In addition to white noise, there is also "pink" noise. The human ear does not hear all frequency ranges at the same volume. It hears best around 2000 Hz, that's why white noise sounds somewhat high. We hear considerably worse in the low and high frequency ranges. If you want to create a noise that humans will perceive as an evenly distribution of all frequencies, you have to adapt it to the way we hear, i.e., the low frequencies have to be significantly louder than the middle frequencies. This distribution is called pink noise and can be generated in Pd using the "pink~" object:
When using a microphone, the signal will often exhibit a ground current. This is called "DC offset". The result is this waveform:
This offset amounts to an infinitely slow vibration with a frequency that approaches 0. Because it is so low, it can be filtered out with a high-pass filter that is set extremely low:
The 'inner life' of digital filters is complicated. One should, however, have some sort of an idea about how precisely they work: As described in 22.214.171.124.1, a sample rate of 44100 Hz is capable of representing a wave with a maximum of 22050 Hz. This wave would have only two points per period:
If you move this wave just one position, i.e., by one sample forwards or backwards, and then add it to the original wave, the result will be that the two waves cancel each other out completely. This shift can be accomplished (in Pd-extended) with "z~".
Digital filters employ this method of delaying a wave by one sample and then adding it to the original wave to effect cancellation. The "biquad~" object can be used to adjust this by hand. It executes the following differential equation: y(n) = ff1 * w(n) + ff2 * w(n - 1) + ff3 * w(n - 2) with w[n] = x[n] + fb1 * x[n - 1] + fb2 * x[n - 2].
'n' is the sample position and ff1, ff2, ff3, fb1, and fb2 are freely defined factors. In Pd, "biquad~" then requires five arguments for ff1, ff2, ff3, fb1, and fb2. The syntax is as follows: "biquad~" [fb1] [fb2] [ff1] [ff2] [ff3]. For the case of the wave of 22050 Hz discussed at the beginning of this section, you could also write "biquad~ 0 0 1 1 0". This suppresses high frequencies, especially waves with a frequency of 22050 Hz, which are completely cancelled out. Here is a low-pass filter using "biquad~":
You can use the biquad formula to create many other kinds of filters. For example, the arguments 1.41407 -0.9998 1 -1.41421 1 will make a "band-reject filter". This is the inverse of a band-pass filter; it rejects - i.e., blocks - a certain band of frequencies around a central frequency, in this case 5512.5 Hz. The explanation for this type of calculation would fill an entire book. In Pd-extended there are objects ("band-pass", "equalizer", "highpass", "highshelf", "hlshelf", "lowpass", "lowshelf", "notch") that carry out these calculations. The advantage of the biquad filter is that considerably steeper filter profiles are possible than with, say, "lop~", "hip~", or "bp~". The drawback is that it not only suppresses certain frequencies but also significantly intensifies others to the point of "explosion" (you can see in the formula, that the filter works recursively).
With biquad processing you can also see that filters employ phase shifts. That's why, e.g., a "bp~" object isn't simply the inversion of a band-reject filter: