next up previous contents index
Next: Predicting and controlling foldover Up: Fourier series of the Previous: Square and symmetric triangle   Contents   Index

General (non-symmetric) triangle wave

Figure 10.7: Non-symmetric triangle wave, with vertices at $(A, 1)$ and $(N-A, -1)$.
\begin{figure}\psfig{file=figs/fig10.07.ps}\end{figure}

A general, non-symmetric triangle wave appears in Figure 10.7. Here we have arranged the cycle so that, first, the DC component is zero (so that the two corners have equal and opposite heights), and second, so that the midpoint of the shorter segment goes through the point $(0,0)$.

The two line segments have slopes equal to $1/A$ and $-2/(N-2A)$, so the decomposition into component parabolic waves is given by:

\begin{displaymath}
x[n] = {{N^2} \over {AN - 2{A^2}}} (p[n+A] - p[n-A])
\end{displaymath}

(here we're using the periodicity of $p[n]$ to replace $p[n-(N-A)]$ by $p[n+A]$).)

The most general way of dealing with linear combinations of elementary (parabolic and/or sawtooth) waves is to go back to the Fourier components, as we did in finding the series for the elementary waves themselves. But in this particular case we can use a trigonometric identity to avoid the extra work of converting back and forth. Just plug in the trigonometric series:

\begin{displaymath}
x[n] = {{N^2} \over {2{\pi ^ 2} (AN - 2{A^2})}} \left [
{\cos ( \omega (n-A))} - {\cos ( \omega (n+A))}
\right .
\end{displaymath}


\begin{displaymath}
\left .
+ {{\cos ( 2 \omega (n-A)) - \cos ( 2 \omega (n+A))} \over 4}
+ \cdots
\right ]
\end{displaymath}

Now we use the identity,

\begin{displaymath}
\cos(a) - \cos(b) = 2 \sin({{b-a}\over 2}) \sin({{a+b}\over 2})
\end{displaymath}

so that, for example,

\begin{displaymath}
{\cos ( \omega (n-A))} - {\cos ( \omega (n+A))} =
2 \sin (2 \pi A / N) \sin ( \omega n)
\end{displaymath}

(Here again we used the definition of $\omega=2\pi/N$.) This is a simplification since the first sine term does not depend on $n$, and hence is just an amplitude term. Applying the identity to all the terms of the expansion for $x[n]$ gives:

\begin{displaymath}
x[n] = a[1] \sin(\omega n) + a[2] \sin(2 \omega n) + \cdots
\end{displaymath}

where the amplitudes of the components are given by:

\begin{displaymath}
a[k] = {1 \over {{\pi ^ 2} (A/N - 2{{(A/N)}^2})}}
{{\sin (2 \pi k A / N) } \over {k^2}}
\end{displaymath}

Notice that the result does not depend separately on the values of $A$ and $N$, but only on their ratio, $A/N$ (this is not surprising because the shape of the waveform depends on this ratio). If we look at small values of $k$:

\begin{displaymath}
k < {{1} \over {4 A/N}}
\end{displaymath}

the argument of the sine function is less than $\pi /2$ and using the approximation $\sin(\theta) \approx \theta$ we find that $a[k]$ drops off as $1/k$, just as the partials of a sawtooth wave. But for larger values of $k$ the sine term oscillates between 1 and -1, so that the amplitudes drop off irregularly as $1/{k^2}$.

Figure 10.8 shows the partial strengths with $A/N$ set to 0.03; here, our prediction is that the $1/k$ dependence should extend to $k \approx 1/(4\cdot 0.03) \approx 8.5$, in rough agreement with the figure.

Another way to see why the partials should behave as $1/k$ for low values of $k$ and $1/{k^2}$ thereafter, is to compare the period of a given partial with the length of the short segment, $2A$. For partials numbering less than $N/4A$, the period is at least twice the length of the short segment, and at that scale the waveform is nearly indistinguishable from a sawtooth wave. For partials numbering in excess of $N/2A$, the two corners of the triangle wave are at least one period apart, and at these higher frequencies the two corners (each with $1/{k^2}$ frequency dependence) are resolved from each other. In the figure, the notch at partial 17 occurs at the wavelength $N/2A \approx 1/17$, at which wavelength the two corners are one cycle apart; since the corners are opposite in sign they cancel each other.


next up previous contents index
Next: Predicting and controlling foldover Up: Fourier series of the Previous: Square and symmetric triangle   Contents   Index
Miller Puckette 2006-03-03