# Help with Triangle Wave using complex exponential Fourier Series

1. Jun 3, 2014

### Milani

I'm participating in research this summer and it's has to do with the Fourier Series. My professor wanted to give me practice problems before I actually started on the research. He gave me a square wave and I solved that one without many problems, but this triangle wave is another story. I've been stuck on it for a day or two and wanted to see if I'm even on the right track because I'm very,very lost. Here is the problem: The triangle wave has a period of 4 and starts at (0,0) to (1,1). Then from (1,1) to (3,-1). And then (3,-1) to (4,0). I solved a0 and got 0. Solving for ak is where I'm having a problem. I tried to type the problem out on here but I couldn't get the code to work properly, so instead I took a picture.

My question is, did I solve the first one correctly? I didn't solve the (-t+2) or (t-4) integrals yet, just the very first one listed.

File size:
42.2 KB
Views:
436
File size:
32.3 KB
Views:
324
2. Jun 3, 2014

### jbunniii

[edited with a correction: the given function is odd, not even]

Here is a suggestion which will make the calculation much easier. Your triangle wave is an odd function: it satisfies $s(t) = -s(-t)$ for all $t$. Also, you can integrate over any period of the function, so instead of integrating from 0 to 4, you can integrate from -2 to 2, which will allow you to exploit the oddness of the function. The formula for $a_k$ simplifies as follows:
\begin{align} a_k &= \int_{-2}^{2}s(t)e^{-ik\omega t} dt \\ &= \int_{-2}^{2} s(t)(\cos(k\omega t) - i \sin(k \omega t)) dt \\ &= -i \int_{-2}^{2} s(t) \sin(k \omega t) dt \\ &= -2i \int_{0}^{2} s(t) \sin(k \omega t) dt \end{align}

Last edited: Jun 3, 2014
3. Jun 3, 2014

### Milani

jbunniii you said that it's an even function so is that why the isin(kwt) is no longer there when you simplied it?

4. Jun 3, 2014

### jbunniii

Yes, that's right. The cosine is an even function, and sine is an odd function. Also, an even function times an even function is even, an odd function times an odd function is even, and an even function times an odd function is odd.

Therefore if $s(t)$ is even, then $s(t)\cos(k\omega t)$ is even, and $s(t)\sin(k\omega t)$ is odd.

If $s(t)$ is odd, then $s(t)\cos(k\omega t)$ is odd, and $s(t)\sin(k\omega t)$ is even.

If you integrate an odd function over an interval of the form $[-x,x]$, the result is zero.

If you integrate an even function over an interval of the form $[-x,x]$, the result is two times the integral over $[0,x]$.

You should verify all of these facts if you're not sure - they follow directly from the definition of even and odd and basic calculus manipulations. They will frequently be useful when working with Fourier series.

Last edited: Jun 3, 2014
5. Jun 3, 2014

### jbunniii

Oh wait, I misinterpreted your function. If you plot it, you will see that it is actually an ODD function, not even. I'll edit my first post accordingly.

6. Jun 3, 2014

### jbunniii

OK, I fixed the first post. Sorry for the confusion.

7. Jun 6, 2014

### Milani

Thanks so much for the help jbunniii! :D
I eventually got it and showed it to my mentor today, he's now assigned me a new triangle wave to solve and plot in MATLAB.

8. Jun 6, 2014

Nice job!