next up previous contents index
Next: Sinusoidal waveshaping: evenness and Up: Examples Previous: Waveshaping using Chebychev polynomials   Contents   Index

Waveshaping using an exponential function

We return now to the spectra computed on Page [*], corresponding to waveshaping functions of the form $f(x) = x^k$. We note with pleasure that not only are they all in phase (so that they can be superposed with easily predictable results) but also that the spectra spread out as $k$ increases. Also, in a series of the form,

\begin{displaymath}
f(x) = {f_0} + {f_1} x + {f_2} {x^2} + \cdots,
\end{displaymath}

a higher index of modulation will lend more relative weight to the higher power terms in the expansion; as we saw seen earlier, if the index of modulation is $a$, the various $x^k$ terms are multiplied by $f_0$, $af_1$, ${a^2}{f_2}$, and so on.

Now suppose we wish to arrange for different terms in the above expansion to dominate the result in a predictable way as a function of the index $a$. To choose the simplest possible example, suppose we wish $f_0$ to be the largest term for $0<a<1$, then for it to be overtaken by the more quickly growing $af_1$ term for $1<a<2$, which is then overtaken by the ${a^2}{f_2}$ term for $2<a<3$ and so on, so that each $n$th term takes over at index $n$. To make this happen we just require that

\begin{displaymath}
{f_1} = {f_0} , 2 {f_2} = {f_1}, 3 {f_3} = {f_2} , \ldots
\end{displaymath}

and so fixing $f_0$ at 1, we get ${f_1}=1$, ${f_2}=1/2$, ${f_3}=1/6$, and in general,

\begin{displaymath}
{f_k} = {1 \over {1 \cdot 2 \cdot 3 \cdot ... \cdot k}}
\end{displaymath}

These are just the coefficients of the power series for the function

\begin{displaymath}
f(x) = {e ^ x}
\end{displaymath}

where $e \approx 2.7$ is Euler's constant.

Before plugging in $e^x$ as a transfer function it's wise to plan how we will deal with signal amplitude, since $e^x$ grows quickly as a function of $x$. If we're going to plug in a sinusoid of amplitude $a$, the maximum output will be $e^a$, occuring whenever the phase is zero. A simple and natural choice is simply to divide by $e^a$ to reduce the peak to one, giving:

\begin{displaymath}
{{f(a \cos(\omega n))} \over {e^a}} = {e^{a (\cos(\omega n) - 1)}}
\end{displaymath}

This is realized in Example E06.exponential.pd. Resulting spectra for $a=$ 0, 4, and 16 are shown in Figure 5.13. As the waveshaping index rises, progressively less energy is present in the fundamental; the energy is increasingly spread over the partials.

Figure 5.13: Spectra of waveshaping output using an exponential transfer function. Indices of modulation of 0, 4, and 16 are shown; note the different vertical scales.
\begin{figure}\psfig{file=figs/fig05.13.ps}\end{figure}


next up previous contents index
Next: Sinusoidal waveshaping: evenness and Up: Examples Previous: Waveshaping using Chebychev polynomials   Contents   Index
Miller Puckette 2006-09-05