# why does the additive synthesis method for a triangle wave require amplitude scaling by 8/pi^2?

I had to make a bunch of band limited digital triangle waves recently, so I went to (where else) wikipedia for the equations.

I noticed that there is a constant amplitude scalar of 8/pi^2 (~.8106). And indeed this does bring the amplitude range down to about +/-1. The wikipedia article (https://en.wikipedia.org/wiki/Triangle_wave#Harmonics) doesn't explain the theoretical reasoning for this but I would like to know why this is so.

• Look for the value of the sum $\sum_k (-1)^n \frac{1}{k^2}$. – Dilip Sarwate Jul 14 '20 at 2:43

Are you familiar with how to obtain the Fourier series of an arbitrary periodic function? Because if you are, I'm confused at your confusion.

This is simply the Fourier series expansion of the triangle wave with fundamental frequency $$f_0=1/T$$. This can be found by taking the inner product of the function with the basis functions. We note that the DC value (the time-average) is zero, and that the function is odd, so it has no cosine terms. So, let's attempt to expand it as the sum of sines or in other words as $$x(t) = \sum_{k=0}^{\infty} b_k \sin\left(\frac{2 \pi k t}{T}\right)$$ where $$x(t)$$ is the triangle wave defined on the interval $$-T/2$$ to $$T/2$$ as $$x(t) = \left\{\begin{array}{cc} \frac{4 t + 2 T}{T} & -\frac{T}{2} < t < -\frac{T}{4} \\ \frac{4 t}{T} & -\frac{T}{4} < t < \frac{T}{4} \\ \frac{4 t - 2 T}{T} & \frac{T}{4} < t < \frac{T}{2} & \end{array}\right.$$ and elsewhere by the fact that $$x(t) = x(t+T)$$.

To calculate our Fourier series coefficients, we must compute the integral $$b_k = \frac{2}{T} \int_{-\frac{T}{2}}^{\frac{T}{2}} x(t) \sin\left(\frac{2 \pi k t}{T}\right) dt.$$

Because the function we are integrating is a product of two odd functions, it is even, so we can reduce this to $$b_k = \frac{4}{T} \int_{0}^{\frac{T}{2}} x(t) \sin\left(\frac{2 \pi k t}{T}\right) dt.$$

We notice that $$x(t)$$ exhibits even symmetry about the point $$\frac{T}{4}$$ while even frequency sine waves of the form $$\sin(4\pi k t)$$ exhibit odd symmetry about the same point. This is quarter wave symmetry and tells us that the even harmonics will all be zero. So, we only need to solve this for odd values of $$k$$. To that end, we replace $$k$$ with $$2 k + 1$$.

We can once again exploit the even symmetry of the odd harmonics to further reduce the range of our integral to $$b_{2 k + 1} = \frac{8}{T} \int_{0}^{\frac{T}{4}} \frac{4 t}{T} \sin\left(\frac{2 \pi (2 k + 1) t}{T}\right) dt,$$ and, skipping the calculus (for brevity), we arrive at $$b_{2 k + 1} = \frac{8}{\pi^2 (2 k + 1)^2} \cos(\pi k).$$

This reduces to the formula given on Wikipedia. If you don't see it, let me know and I'll be explicit.

• Yes I am. This is not an answer to my question, though. Please post such comments as a comment. – dmedine Jul 14 '20 at 2:44
• I thought it was a comment. I apologize for the inconvenience. – hops Jul 14 '20 at 2:46
• Since, I made the error of "answering" instead of "commenting" I thought I'd have a stab at the answer. – hops Jul 14 '20 at 3:57
• @dmedine: If you understand what a Fourier series is and why it looks the way it does for a triangular wave, what's your question then? – Matt L. Jul 14 '20 at 7:09
• @mattl, your comment clearly violates the stackexchange code of conduct. Please review (meta.stackexchange.com/conduct) and please read carefully the section 'No subtle put-downs'. This comment is also in violation of the commenting privilege as it is a criticism that does not add anything constructive (meta.stackexchange.com/help/privileges/comment). I have flagged it. – dmedine Jul 15 '20 at 1:08