Waveshaping is a popular synthesis-and-transformation technique that turns simple sounds into complex sounds. You can take a pure tone, like a sine wave, and transform it into a harmonically rich sound by changing its shape. A guitar fuzz box is an example of a waveshaper. The unamplified electric guitar sound is fairly close to a sine wave. But the fuzz box amplifies it and gives it sharp corners. We have seen in earlier chapters that a signal with sharp corners has lots of high harmonics. Sounds that have passed through a waveshaper generally have a lot more energy in their higher-frequency harmonics, which gives them a "richer" sound.
Simple Waveshaping Formulae
A waveshaper can be described as a function that takes the original signal x as input and produces a new output signal y. This function is called the transfer function.
y = f(x)
This is simple, right? In fact, its much simpler than any other function weve seen so far. Thats because waveshaping, in its most general form, is just any old function. But theres a lot more to it than that. In order to change the shape of the function (and not just make it bigger or smaller), the function must be nonlinear, which means it has exponents greater than 1, or transcendental (like sines, cosines, exponentials, logarithms, etc.). You can use almost any function you want as a waveshaper. But the most useful ones output zero when the input is zero (thats because you usually dont want any output when there is no input).
0 = f(0)
Lets look at a very simple waveshaping function:
y = f(x) = x * x * x = x3
What would it look like to pass a simple sine wave that varied from -1.0 to 1.0 through this waveshaper? If our input x is sin(wt), then:
y = x3 = sin3(wt)
If we plot both functions (sin(x) and the output signal), we can see that the original input signal is very round, but the output signal has a narrower peak. This will give the output a richer sound.
Figure 4.15 Waveshaping by x3.
This example gives some idea of the power of this technique. A simple function (sine wave) gets immediately transformed, using simple math and even simpler computation, into something new.
One problem with the y = x3 waveshaper is that for x-values outside the range –1.0 to +1.0, y can get very large. Because computer music systems (especially sound cards) generally only output sounds between –1.0 and +1.0, it is handy to have a waveshaper that takes any input signal and outputs a signal in the range –1.0 to +1.0. Consider this function:
y = x / (1 + |x|)
When x is zero, y is zero. Plug in a few numbers for x, like 0.5, 7.0, 1,000.0, –7.0, and see what you get. As x gets larger (approaches positive infinity), y approaches +1.0 but never reaches it. As x approaches negative infinity, y approaches –1.0 but never reaches it. This kind of curve is sometimes called soft clipping because it does not have any hard edges. It can give a nice "tubelike" distortion sound to a guitar. So this function has some nice properties, but unfortunately it requires a divide, which takes a lot more CPU power than a multiply. On older or smaller computers, this can eat up a lot of CPU time (though its not much of a problem nowadays).
Here is another function that is a little easier to calculate. It is designed for input signals between –1.0 and +1.0.
y = 1.5x - 0.5x3
Distortion synthesis is a group of sound synthesis techniques which modify existing sounds to produce more complex sounds (or timbres), usually by using non-linearcircuits or mathematics.
While some synthesis methods achieve sonic complexity by using many oscillators, distortion methods create a frequency spectrum which has many more components than oscillators.
Some distortion techniques are: FM synthesis, waveshaping synthesis, and discrete summation formulas.
Frequency modulation synthesis distorts the carrier frequency of an oscillator by modulating it with another signal. The distortion can be controlled by means of a modulation index.
The method known as phase distortion synthesis is similar to FM.
Waveshaping synthesis changes an original waveform by responding to its amplitude in a non-linear fashion. It can generate a bandwidth-limited spectrum, and can be continuously controlled with an index.
The clipping caused by overdriving an audio amplifier is a simple example of this method, changing a sine wave into a square-like wave. (Note that direct digital implementations suffer from aliasing of the clipped signal's infinite number of harmonics, however.)
Discrete summation formulas
DSF synthesis refers to algorithmic synthesis methods which use mathematical formulas to sum, or add together, many numbers to achieve a desired wave shape. This powerful method allows, for example,synthesizing a 3-formant voice in a manner similar to FM voice synthesis. DSF allows the synthesis of harmonic and inharmonic, band-limited or unlimited spectra, and can be controlled by an index. As Roads points out, by reducing digital synthesis of complex spectra to a few parameters, DSF can be much more economical.
Jean-Claude Risset was one notable pioneer in the adoption of distortion methods.
- ^Nb. Some authors refer to these techniques as 'modulation synthesis'; e.g. Chapter 6 of Roads, Curtis (1996). The computer music tutorial. MIT Press.
- ^Dodge 1997, pp.115-138
- ^Roads, Curtis (June 1979). "A Tutorial on Non-Linear Distortion or Waveshaping Synthesis". Computer Music Journal. MIT Press. 3 (2): 29–34. JSTOR 3680281.
- ^Dodge 1997, pp.139-157
- ^Dodge 1997, pp.158-168
- ^J. Chowning (1973). "The Synthesis of Complex Audio Spectra by Means of Frequency Modulation". Journal of the Audio Engineering Society. 21 (7).
- ^Arfib, D. 1979. "Digital synthesis of complex spectra by means of multiplication of non-linear distorted sine waves." Journal of the Audio Engineering Society 27: 10.
- ^Marc Le Brun. "Digital Waveshaping Synthesis" in Journal of the Audio Engineering Society, 27(4), 1979, p250-266.
- ^Moorer, J. A. (November 1976). "The Synthesis of Complex Audio Spectra by Means of Discrete Summation Formulae". Journal of the Audio Engineering Society, 27(4), pp.717-727.
- ^T Stilson; J Smith (1996). "Alias-free digital synthesis of classic analog waveforms". Proc. Int. Comp. Music Conf. (ICMC’96 Hong Kong): 332–335. CiteSeerX 10.1.1.60.4437.
- ^C. Roads 1996, p.260-61.
- Dodge, Charles; Thomas A. Jerse (1997). "5. Synthesis Using Distortion Techniques". Computer Music. New York: Schirmer Books. pp. 115–168. ISBN 0-02-864682-7.
- Chowning, John; Bristow, David (1986). FM Theory & Applications - By Musicians For Musicians. Tokyo: Yamaha. ISBN 4-636-17482-8.