876 lines
24 KiB
HTML
876 lines
24 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<!--Converted with LaTeX2HTML 2002-2-1 (1.71)
|
|
original version by: Nikos Drakos, CBLU, University of Leeds
|
|
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
|
|
* with significant contributions from:
|
|
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
|
|
<HTML>
|
|
<HEAD>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
<TITLE>Waveshaping</TITLE>
|
|
<META NAME="description" CONTENT="Waveshaping">
|
|
<META NAME="keywords" CONTENT="book">
|
|
<META NAME="resource-type" CONTENT="document">
|
|
<META NAME="distribution" CONTENT="global">
|
|
|
|
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
|
|
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
|
|
|
<LINK REL="STYLESHEET" HREF="book.css">
|
|
|
|
<LINK REL="next" HREF="node79.html">
|
|
<LINK REL="previous" HREF="node77.html">
|
|
<LINK REL="up" HREF="node75.html">
|
|
<LINK REL="next" HREF="node79.html">
|
|
</HEAD>
|
|
|
|
<BODY >
|
|
<!--Navigation Panel-->
|
|
<A ID="tex2html1711"
|
|
HREF="node79.html">
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
|
|
SRC="next.png"></A>
|
|
<A ID="tex2html1705"
|
|
HREF="node75.html">
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
|
|
SRC="up.png"></A>
|
|
<A ID="tex2html1699"
|
|
HREF="node77.html">
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
|
|
SRC="prev.png"></A>
|
|
<A ID="tex2html1707"
|
|
HREF="node4.html">
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
|
|
SRC="contents.png"></A>
|
|
<A ID="tex2html1709"
|
|
HREF="node201.html">
|
|
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
|
|
SRC="index.png"></A>
|
|
<BR>
|
|
<B> Next:</B> <A ID="tex2html1712"
|
|
HREF="node79.html">Frequency and phase modulation</A>
|
|
<B> Up:</B> <A ID="tex2html1706"
|
|
HREF="node75.html">Modulation</A>
|
|
<B> Previous:</B> <A ID="tex2html1700"
|
|
HREF="node77.html">Multiplying audio signals</A>
|
|
<B> <A ID="tex2html1708"
|
|
HREF="node4.html">Contents</A></B>
|
|
<B> <A ID="tex2html1710"
|
|
HREF="node201.html">Index</A></B>
|
|
<BR>
|
|
<BR>
|
|
<!--End of Navigation Panel-->
|
|
|
|
<H1><A ID="SECTION00930000000000000000"></A>
|
|
<A ID="sect5.waveshaping"></A>
|
|
<BR>
|
|
Waveshaping
|
|
</H1>
|
|
|
|
<P>
|
|
Another approach to modulating a signal, called
|
|
<A ID="5674"></A><I>waveshaping</I>,
|
|
is simply to pass it through a
|
|
suitably chosen nonlinear function. A block diagram for doing this is shown in Figure
|
|
<A HREF="#fig05.05">5.5</A>.
|
|
The function <IMG
|
|
WIDTH="25" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img14.png"
|
|
ALT="$f()$"> (called the
|
|
<A ID="5677"></A><I>transfer function</I>)
|
|
distorts the incoming waveform into a different shape. The new shape depends
|
|
on the shape of the incoming wave, on the transfer function, and
|
|
also--crucially--on
|
|
the amplitude of the incoming signal. Since the amplitude of the input
|
|
waveform affects the shape of the output waveform (and hence the timbre),
|
|
this gives us an easy way to make a continuously varying family of timbres,
|
|
simply by varying the input level of the transformation. For this reason,
|
|
it is customary to include a leading amplitude control as part of the waveshaping
|
|
operation, as shown in the block diagram.
|
|
|
|
<P>
|
|
|
|
<DIV ALIGN="CENTER"><A ID="fig05.05"></A><A ID="5681"></A>
|
|
<TABLE>
|
|
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 5.5:</STRONG>
|
|
Block diagram for waveshaping an input signal using a nonlinear
|
|
function <IMG
|
|
WIDTH="25" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img14.png"
|
|
ALT="$f()$">. An
|
|
amplitude adjustment step precedes the function lookup, to take advantage of
|
|
the different effect of the wavetable lookup at different amplitudes.</CAPTION>
|
|
<TR><TD><IMG
|
|
WIDTH="172" HEIGHT="226" BORDER="0"
|
|
SRC="img432.png"
|
|
ALT="\begin{figure}\psfig{file=figs/fig05.05.ps}\end{figure}"></TD></TR>
|
|
</TABLE>
|
|
</DIV>
|
|
|
|
<P>
|
|
The amplitude of the incoming waveform is called the waveshaping
|
|
<A ID="5684"></A><I>index</I>. In many situations a small index leads to relatively little
|
|
distortion (so that the output closely resembles the input) and a larger one
|
|
gives a more distorted, richer timbre.
|
|
|
|
<P>
|
|
Figure <A HREF="#fig05.06">5.6</A> shows a familiar example of waveshaping, in which
|
|
<IMG
|
|
WIDTH="25" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img14.png"
|
|
ALT="$f()$"> amounts to a
|
|
<A ID="5687"></A>
|
|
<I>clipping function</I>. This example shows clearly how the input
|
|
amplitude--the index--can
|
|
affect the output waveform. The clipping function passes its input
|
|
to the output unchanged as long as it stays in the interval between -0.3 and
|
|
+0.3. So when the input does not exceed 0.3 in
|
|
absolute value, the output is the same as the input. But when the input grows
|
|
past the limits, the output stays within; and as the amplitude of the
|
|
signal increases the effect of this clipping action is progressively more
|
|
severe. In the figure, the input is a decaying sinusoid. The output
|
|
evolves from a nearly square waveform at the beginning to a pure sinusoid
|
|
at the end. This effect will be well known to anyone who has played an
|
|
instrument through an overdriven amplifier. The louder the input, the
|
|
more distorted will be the output. For this reason, waveshaping is also sometimes
|
|
called
|
|
<A ID="5689"></A>
|
|
<I>distortion</I>.
|
|
|
|
<P>
|
|
|
|
<DIV ALIGN="CENTER"><A ID="fig05.06"></A><A ID="5693"></A>
|
|
<TABLE>
|
|
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 5.6:</STRONG>
|
|
Clipping as an example of waveshaping: (a) the input, a decaying
|
|
sinusoid; (b) the waveshaping function, which clips its input to
|
|
the interval between -0.3 and +0.3; (c) the result.</CAPTION>
|
|
<TR><TD><IMG
|
|
WIDTH="495" HEIGHT="367" BORDER="0"
|
|
SRC="img433.png"
|
|
ALT="\begin{figure}\psfig{file=figs/fig05.06.ps}\end{figure}"></TD></TR>
|
|
</TABLE>
|
|
</DIV>
|
|
|
|
<P>
|
|
Figure <A HREF="#fig05.07">5.7</A> shows a much simpler and easier to analyse situation,
|
|
in which the transfer function simply squares the input:
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(x) = {x^2}
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="66" HEIGHT="28" BORDER="0"
|
|
SRC="img434.png"
|
|
ALT="\begin{displaymath}
|
|
f(x) = {x^2}
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
For a sinusoidal input,
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
x[n] = a \cos(\omega n + \phi)
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="140" HEIGHT="28" BORDER="0"
|
|
SRC="img76.png"
|
|
ALT="\begin{displaymath}
|
|
x[n] = a \cos (\omega n + \phi )
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
we get
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(x[n]) = {{a^2} \over 2} \left ( 1 + \cos(2 \omega n + 2 \phi) \right )
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="229" HEIGHT="41" BORDER="0"
|
|
SRC="img435.png"
|
|
ALT="\begin{displaymath}
|
|
f(x[n]) = {{a^2} \over 2} \left ( 1 + \cos(2 \omega n + 2 \phi) \right )
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
If the amplitude <IMG
|
|
WIDTH="11" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img4.png"
|
|
ALT="$a$"> equals one, this just amounts to ring modulating the
|
|
sinusoid by a sinusoid of the same frequency, whose result we described in the
|
|
previous section: the output is a DC (zero-frequency) sinusoid plus a
|
|
sinusoid at
|
|
twice the original frequency. However, in this waveshaping example, unlike
|
|
ring modulation, the amplitude of the output grows as the square
|
|
of the input.
|
|
|
|
<P>
|
|
|
|
<DIV ALIGN="CENTER"><A ID="fig05.07"></A><A ID="5942"></A>
|
|
<TABLE>
|
|
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 5.7:</STRONG>
|
|
Waveshaping using a quadratic transfer function <IMG
|
|
WIDTH="71" HEIGHT="34" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img15.png"
|
|
ALT="$f(x) = {x^2}$">:
|
|
(a) the
|
|
input; (b) the transfer function; (c) the result, sounding at twice the
|
|
original frequency.</CAPTION>
|
|
<TR><TD><IMG
|
|
WIDTH="474" HEIGHT="368" BORDER="0"
|
|
SRC="img436.png"
|
|
ALT="\begin{figure}\psfig{file=figs/fig05.07.ps}\end{figure}"></TD></TR>
|
|
</TABLE>
|
|
</DIV>
|
|
|
|
<P>
|
|
Keeping the same transfer function, we now consider the effect of sending in a
|
|
combination of two sinusoids with amplitudes <IMG
|
|
WIDTH="11" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img4.png"
|
|
ALT="$a$"> and <IMG
|
|
WIDTH="10" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img21.png"
|
|
ALT="$b$">, and angular
|
|
frequencies <IMG
|
|
WIDTH="13" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img7.png"
|
|
ALT="$\alpha $"> and <IMG
|
|
WIDTH="13" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img8.png"
|
|
ALT="$\beta $">. For simplicity, we'll omit the initial phase
|
|
terms. We set:
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
x[n] = a \cos(\alpha n) + b \cos(\beta n)
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="193" HEIGHT="28" BORDER="0"
|
|
SRC="img437.png"
|
|
ALT="\begin{displaymath}
|
|
x[n] = a \cos(\alpha n) + b \cos(\beta n)
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
and plugging this into <IMG
|
|
WIDTH="25" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img14.png"
|
|
ALT="$f()$"> gives
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(x[n]) = {{a^2} \over 2} \left ( 1 + \cos(2 \alpha n) \right ) +
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="208" HEIGHT="41" BORDER="0"
|
|
SRC="img438.png"
|
|
ALT="\begin{displaymath}
|
|
f(x[n]) = {{a^2} \over 2} \left ( 1 + \cos(2 \alpha n) \right ) +
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
+ {{b^2} \over 2} \left ( 1 + \cos(2 \beta n) \right )
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="131" HEIGHT="41" BORDER="0"
|
|
SRC="img439.png"
|
|
ALT="\begin{displaymath}
|
|
+ {{b^2} \over 2} \left ( 1 + \cos(2 \beta n) \right )
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
+ a b \left [
|
|
\cos ( (\alpha + \beta) n ) + \cos ( (\alpha - \beta) n )
|
|
\right ]
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="247" HEIGHT="28" BORDER="0"
|
|
SRC="img440.png"
|
|
ALT="\begin{displaymath}
|
|
+ a b \left [
|
|
\cos ( (\alpha + \beta) n ) + \cos ( (\alpha - \beta) n )
|
|
\right ]
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
The first two terms are just what we would get by sending the two sinusoids
|
|
through separately. The third term is twice the product of the two input terms,
|
|
which comes from the middle, cross term in the expansion,
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(x+y) = {x^2} + 2 x y + {y^2}
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="174" HEIGHT="28" BORDER="0"
|
|
SRC="img441.png"
|
|
ALT="\begin{displaymath}
|
|
f(x+y) = {x^2} + 2 x y + {y^2}
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
This effect, called
|
|
<A ID="5708"></A><I>intermodulation</I>,
|
|
becomes more and more dominant as the number of terms in the input
|
|
increases; if there are <IMG
|
|
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img58.png"
|
|
ALT="$k$"> sinusoids in the input there are
|
|
only <IMG
|
|
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img58.png"
|
|
ALT="$k$"> "straight" terms in the product, but there are <IMG
|
|
WIDTH="75" HEIGHT="34" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img442.png"
|
|
ALT="$({k^2}-k)/2$">
|
|
intermodulation terms.
|
|
|
|
<P>
|
|
In contrast with ring modulation, which is a linear function of its input
|
|
signal, waveshaping is
|
|
nonlinear. While we were able to analyze linear processes by considering their
|
|
action separately on all the components of the input, in this nonlinear case we
|
|
also have to consider the interactions between components. The results are
|
|
far more complex--sometimes sonically much richer, but, on the other
|
|
hand, harder to understand or predict.
|
|
|
|
<P>
|
|
In general, we can show that a periodic input, no matter how complex, will
|
|
repeat at the same period after waveshaping: if the period is <IMG
|
|
WIDTH="12" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img135.png"
|
|
ALT="$\tau$"> so that
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
x[n+\tau] = x[n]
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="102" HEIGHT="28" BORDER="0"
|
|
SRC="img136.png"
|
|
ALT="\begin{displaymath}
|
|
x[n + \tau] = x[n]
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
and temporarily setting the index <IMG
|
|
WIDTH="41" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img18.png"
|
|
ALT="$a=1$">,
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(x[n+\tau]) = f(x[n])
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="146" HEIGHT="28" BORDER="0"
|
|
SRC="img443.png"
|
|
ALT="\begin{displaymath}
|
|
f(x[n+\tau]) = f(x[n])
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
(In some special cases the output can repeat at a submultiple of <IMG
|
|
WIDTH="12" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img135.png"
|
|
ALT="$\tau$">, so
|
|
that we get a harmonic of the input as a result; this happened for example
|
|
in Figure <A HREF="node77.html#fig05.04">5.4</A>.)
|
|
|
|
<P>
|
|
Combinations of periodic tones at consonant intervals can give rise to
|
|
distortion products at subharmonics. For instance, if two periodic signals <IMG
|
|
WIDTH="12" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img243.png"
|
|
ALT="$x$">
|
|
and <IMG
|
|
WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img106.png"
|
|
ALT="$y$"> are a musical fourth apart (periods in the ratio 4:3), then the sum of
|
|
the two repeats at the lower rate given by the common subharmonic. In
|
|
equations we would have:
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
x[t + \tau/3] = x[t]
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="111" HEIGHT="28" BORDER="0"
|
|
SRC="img444.png"
|
|
ALT="\begin{displaymath}
|
|
x[t + \tau/3] = x[t]
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
y[t + \tau/4] = y[t]
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="110" HEIGHT="28" BORDER="0"
|
|
SRC="img445.png"
|
|
ALT="\begin{displaymath}
|
|
y[t + \tau/4] = y[t]
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
which implies
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
x[t + \tau] + y[t+\tau] = x[t] + y[t]
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="207" HEIGHT="28" BORDER="0"
|
|
SRC="img446.png"
|
|
ALT="\begin{displaymath}
|
|
x[t + \tau] + y[t+\tau] = x[t] + y[t]
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
and so the distorted sum <IMG
|
|
WIDTH="62" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img447.png"
|
|
ALT="$f(x+y)$"> would repeat after a period of <IMG
|
|
WIDTH="12" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img135.png"
|
|
ALT="$\tau$">:
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(x+y)[n + \tau] = f(x+y)[n].
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="205" HEIGHT="28" BORDER="0"
|
|
SRC="img448.png"
|
|
ALT="\begin{displaymath}
|
|
f(x+y)[n + \tau] = f(x+y)[n].
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
This has been experienced by every electric guitarist who has set the amplifier
|
|
to "overdrive" and played the open B and high E strings together: the
|
|
distortion product sometimes sounds at the pitch of the low E string, two
|
|
octaves below the high one.
|
|
|
|
<P>
|
|
To get a somewhat more explicit analysis of the effect of waveshaping on
|
|
an incoming signal, it is sometimes useful to write the function <IMG
|
|
WIDTH="13" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img112.png"
|
|
ALT="$f$"> as
|
|
a finite or infinite
|
|
<A ID="5712"></A><I>power series</I>:
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(x) = {f_0} + {f_1}x + {f_2}{x^2} + {f_3}{x^3} + \cdots
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="247" HEIGHT="28" BORDER="0"
|
|
SRC="img449.png"
|
|
ALT="\begin{displaymath}
|
|
f(x) = {f_0} + {f_1}x + {f_2}{x^2} + {f_3}{x^3} + \cdots
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
If the input signal <IMG
|
|
WIDTH="31" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img80.png"
|
|
ALT="$x[n]$"> is a unit-amplitude sinusoid, <!-- MATH
|
|
$\cos(\omega n)$
|
|
-->
|
|
<IMG
|
|
WIDTH="57" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img450.png"
|
|
ALT="$\cos(\omega n)$">, we
|
|
can consider the action of the above terms separately:
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(a \cdot x[n]) = {f_0} + a {f_1}\cos(\omega n) + {a^2} {f_2} {\cos^2} (\omega n)
|
|
+ {a^3} {f_3} {\cos^3} (\omega n) + \cdots
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="461" HEIGHT="28" BORDER="0"
|
|
SRC="img451.png"
|
|
ALT="\begin{displaymath}
|
|
f(a \cdot x[n]) = {f_0} + a {f_1}\cos(\omega n) + {a^2} {f_...
|
|
...\cos^2} (\omega n)
|
|
+ {a^3} {f_3} {\cos^3} (\omega n) + \cdots
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
Since the terms of the series are successively multiplied by higher powers of
|
|
the index
|
|
<IMG
|
|
WIDTH="11" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img4.png"
|
|
ALT="$a$">, a lower value of <IMG
|
|
WIDTH="11" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img4.png"
|
|
ALT="$a$"> will emphasize the earlier terms more heavily, and
|
|
a higher value will emphasize the later ones.
|
|
|
|
<P>
|
|
The individual terms' spectra can be found by applying the cosine product
|
|
formula repeatedly:
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
1 = \cos (0)
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="69" HEIGHT="28" BORDER="0"
|
|
SRC="img452.png"
|
|
ALT="\begin{displaymath}
|
|
1 = \cos (0)
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
x[n] = \cos (\omega n)
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="100" HEIGHT="28" BORDER="0"
|
|
SRC="img453.png"
|
|
ALT="\begin{displaymath}
|
|
x[n] = \cos (\omega n)
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
{x^2}[n] = {1 \over 2} + {1 \over 2} \cos (2\omega n)
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="161" HEIGHT="38" BORDER="0"
|
|
SRC="img454.png"
|
|
ALT="\begin{displaymath}
|
|
{x^2}[n] = {1 \over 2} + {1 \over 2} \cos (2\omega n)
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
{x^3}[n] = {1 \over 4} \cos (-\omega n) + {2 \over 4} \cos (\omega n)
|
|
+ {1 \over 4} \cos (3 \omega n)
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="317" HEIGHT="38" BORDER="0"
|
|
SRC="img455.png"
|
|
ALT="\begin{displaymath}
|
|
{x^3}[n] = {1 \over 4} \cos (-\omega n) + {2 \over 4} \cos (\omega n)
|
|
+ {1 \over 4} \cos (3 \omega n)
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
{x^4}[n] = {1 \over 8} \cos (-2\omega n) + {3 \over 8} \cos (0)
|
|
+ {3 \over 8} \cos (2 \omega n) + {1 \over 8} \cos (4 \omega n)
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="409" HEIGHT="38" BORDER="0"
|
|
SRC="img456.png"
|
|
ALT="\begin{displaymath}
|
|
{x^4}[n] = {1 \over 8} \cos (-2\omega n) + {3 \over 8} \cos...
|
|
... {3 \over 8} \cos (2 \omega n) + {1 \over 8} \cos (4 \omega n)
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
{x^5}[n] = {1 \over 16} \cos (-3\omega n) + {4 \over 16} \cos (-\omega n)
|
|
+ {6 \over 16} \cos (\omega n) + {4 \over 16} \cos (3 \omega n)
|
|
+ {1 \over 16} \cos (5 \omega n)
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="553" HEIGHT="38" BORDER="0"
|
|
SRC="img457.png"
|
|
ALT="\begin{displaymath}
|
|
{x^5}[n] = {1 \over 16} \cos (-3\omega n) + {4 \over 16} \c...
|
|
... \over 16} \cos (3 \omega n)
|
|
+ {1 \over 16} \cos (5 \omega n)
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
and so on.
|
|
<A ID="eq-waveshaping"></A>The numerators of the fractions will be recognized as Pascal's triangle. The
|
|
<A ID="5747"></A>Central Limit Theorem
|
|
of probability implies that each <IMG
|
|
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img58.png"
|
|
ALT="$k$">th row can be
|
|
approximated by a Gaussian curve whose standard deviation (a measure of width)
|
|
is proportional to the square root of <IMG
|
|
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img58.png"
|
|
ALT="$k$">.
|
|
|
|
<P>
|
|
The negative-frequency terms (which have been shown separately here for clarity)
|
|
are to be combined with the positive ones; the spectral envelope is folded
|
|
into itself in the same way as in the ring modulation example of
|
|
Figure <A HREF="node77.html#fig05.04">5.4</A>.
|
|
|
|
<P>
|
|
As long as the coefficients <IMG
|
|
WIDTH="19" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img458.png"
|
|
ALT="$f_k$"> are all positive numbers or zero, then so
|
|
are all the amplitudes of the sinusoids in the expansions above. In this
|
|
case all the phases stay coherent as <IMG
|
|
WIDTH="11" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img4.png"
|
|
ALT="$a$"> varies and so we get a widening
|
|
of the spectrum (and possibly a drastically increasing amplitude) with
|
|
increasing values of <IMG
|
|
WIDTH="11" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
|
|
SRC="img4.png"
|
|
ALT="$a$">. On the other hand, if some of the <IMG
|
|
WIDTH="19" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img458.png"
|
|
ALT="$f_k$"> are
|
|
positive and others negative, the different expansions will interfere
|
|
destructively; this will give a more complicated-sounding spectral evolution.
|
|
|
|
<P>
|
|
Note also that the successive expansions all contain only even or only odd
|
|
partials. If the transfer function (in series form) happens to contain only
|
|
even powers:
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(x) = {f_0} + {f_2}{x^2} + {f_4}{x^4} + \cdots
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="204" HEIGHT="28" BORDER="0"
|
|
SRC="img459.png"
|
|
ALT="\begin{displaymath}
|
|
f(x) = {f_0} + {f_2}{x^2} + {f_4}{x^4} + \cdots
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
then the result, having only even partials, will sound an octave higher than
|
|
the incoming sinusoid. If only odd powers show up in the expansion of <IMG
|
|
WIDTH="34" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img460.png"
|
|
ALT="$f(x)$">,
|
|
then the output will contain only odd partials. Even if <IMG
|
|
WIDTH="13" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img112.png"
|
|
ALT="$f$"> can't be expressed
|
|
exactly as a power series (for example, the clipping function of Figure
|
|
<A HREF="node77.html#fig05.03">5.3</A>), it is still true that if <IMG
|
|
WIDTH="13" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img112.png"
|
|
ALT="$f$"> is an even function, i.e., if
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(-x) = f(x)
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="93" HEIGHT="28" BORDER="0"
|
|
SRC="img461.png"
|
|
ALT="\begin{displaymath}
|
|
f(-x) = f(x)
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
you will get only even harmonics and if <IMG
|
|
WIDTH="13" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
|
|
SRC="img112.png"
|
|
ALT="$f$"> is an odd function,
|
|
<BR><P></P>
|
|
<DIV ALIGN="CENTER">
|
|
<!-- MATH
|
|
\begin{displaymath}
|
|
f(-x) = -f(x)
|
|
\end{displaymath}
|
|
-->
|
|
|
|
<IMG
|
|
WIDTH="106" HEIGHT="28" BORDER="0"
|
|
SRC="img462.png"
|
|
ALT="\begin{displaymath}
|
|
f(-x) = -f(x)
|
|
\end{displaymath}">
|
|
</DIV>
|
|
<BR CLEAR="ALL">
|
|
<P></P>
|
|
you will get odd harmonics.
|
|
|
|
<P>
|
|
Many mathematical tricks have been proposed to use waveshaping to generate
|
|
specified spectra. It turns out that you can generate pure sinusoids
|
|
at any harmonic of the fundamental by using a Chebychev polynomial as
|
|
a transfer function [<A
|
|
HREF="node202.html#r-lebrun79">Leb79</A>] [<A
|
|
HREF="node202.html#r-dodge85">DJ85</A>], and from there you can go on to build
|
|
any desired static spectrum (Example E05.chebychev.pd
|
|
demonstrates this.) Generating <I>families</I> of spectra by
|
|
waveshaping a sinusoid of variable amplitude turns out to be trickier,
|
|
although several interesting special cases have been found, some of which
|
|
are developed in detail in Chapter <A HREF="node89.html#chapter-paf">6</A>.
|
|
|
|
<P>
|
|
<HR>
|
|
<!--Navigation Panel-->
|
|
<A ID="tex2html1711"
|
|
HREF="node79.html">
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
|
|
SRC="next.png"></A>
|
|
<A ID="tex2html1705"
|
|
HREF="node75.html">
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
|
|
SRC="up.png"></A>
|
|
<A ID="tex2html1699"
|
|
HREF="node77.html">
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
|
|
SRC="prev.png"></A>
|
|
<A ID="tex2html1707"
|
|
HREF="node4.html">
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
|
|
SRC="contents.png"></A>
|
|
<A ID="tex2html1709"
|
|
HREF="node201.html">
|
|
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
|
|
SRC="index.png"></A>
|
|
<BR>
|
|
<B> Next:</B> <A ID="tex2html1712"
|
|
HREF="node79.html">Frequency and phase modulation</A>
|
|
<B> Up:</B> <A ID="tex2html1706"
|
|
HREF="node75.html">Modulation</A>
|
|
<B> Previous:</B> <A ID="tex2html1700"
|
|
HREF="node77.html">Multiplying audio signals</A>
|
|
<B> <A ID="tex2html1708"
|
|
HREF="node4.html">Contents</A></B>
|
|
<B> <A ID="tex2html1710"
|
|
HREF="node201.html">Index</A></B>
|
|
<!--End of Navigation Panel-->
|
|
<ADDRESS>
|
|
Miller Puckette
|
|
2006-12-30
|
|
</ADDRESS>
|
|
</BODY>
|
|
</HTML>
|