next up previous contents index
Next: Waveshaping using an exponential Up: Examples Previous: Waveshaping and difference tones   Contents   Index


Waveshaping using Chebychev polynomials

Patch E05.chebychev.pd(Figure 5.12) demonstrates how you can use waveshaping to generate pure harmonics. We'll limit ourselves to a specific example here; for more details see [Leb79]. In this example we would like to generate the pure fifth harmonic,

Figure 5.12: Using Chebychev polynomials as waveshaping transfer functions.
\begin{figure}\psfig{file=figs/fig05.12.ps}\end{figure}

\begin{displaymath}
\cos(5 \omega n)
\end{displaymath}

by waveshaping a sinusoid

\begin{displaymath}
x[n] = \cos (\omega n)
\end{displaymath}

We just need to find a suitable transfer function $f(x)$. Our technique is to use the formula for the waveshaping function $f(x) = x^5$ (page [*]), which gives first, third and fifth harmonics:

\begin{displaymath}
16 {x^5} = \cos (5 \omega n) + 5 \cos(3 \omega n) + 10 \cos(\omega n)
\end{displaymath}

Next we add a suitable multiple of $x^3$ to cancel the third harmonic:

\begin{displaymath}
16 {x^5} - 20 {x^3} = \cos (5 \omega n) - 5 \cos(\omega n)
\end{displaymath}

and then a multiple of $x$ to cancel the first harmonic:

\begin{displaymath}
16 {x^5} - 20 {x^3} + 5 x = \cos (5 \omega n)
\end{displaymath}

So for our waveshaping function we choose

\begin{displaymath}
f(x) = 16 {x^5} - 20 {x^3} + 5 x
\end{displaymath}

This procedure allows us to isolate any desired harmonic; the resulting functions $f$ are known as Chebychev polynomials.

To incorporate this in a waveshaping instrument, we simply build a patch that works as in Figure 5.5, computing the expression

\begin{displaymath}
x[n] = f( a[n] \cos(\omega n))
\end{displaymath}

where $a[n]$ is a suitable index which may vary as a function of the sample number $n$. When $a$ happens to be one in value, out comes the pure fifth harmonic. Other values of $a$ give varying spectra which, in general, have first and third harmonics as well as the fifth.

By suitably combining Chebychev polynomials we can fix any desired superposition of components in the output waveform (again, as long as the waveshaping index is one). But the real promise of waveshaping--that by simply changing the index we can manufacture spectra that evolve in a variety of interesting ways--is not addressed, at least directly, in the Chebychev picture.


next up previous contents index
Next: Waveshaping using an exponential Up: Examples Previous: Waveshaping and difference tones   Contents   Index
Miller Puckette 2005-02-21