# Fourier series representation

#### fdsa

Joined Aug 16, 2011
9
I would really appreciate if someone could verify my Fourier series representation of an odd square wave with period T and x(t) € [-1,1] (see image). #### WBahn

Joined Mar 31, 2012
26,398
What is ωo? I don't see any indication.

Have you tried setting up something like a spreadsheet to generate the first few terms and see if, when added together, they approach the x(t) that you are trying to find the series for?

Doing so is actually extremely fast and easy. You simply use one column per term, have the k parameter at the top and t in the left most column. In the second column you have a formula that simply sums up the cells to the right of it. I would recommend making T a cell that is referenced absolutely. You then just need to build the formula for the top left cell in the array (that starts to the right of the summing cell mentioned earlier) and copy it to all the other cells. Finally, you plot the time and the summing cell and see if it looks correct.

#### fdsa

Joined Aug 16, 2011
9
What is ωo? I don't see any indication.

Have you tried setting up something like a spreadsheet to generate the first few terms and see if, when added together, they approach the x(t) that you are trying to find the series for?

Doing so is actually extremely fast and easy. You simply use one column per term, have the k parameter at the top and t in the left most column. In the second column you have a formula that simply sums up the cells to the right of it. I would recommend making T a cell that is referenced absolutely. You then just need to build the formula for the top left cell in the array (that starts to the right of the summing cell mentioned earlier) and copy it to all the other cells. Finally, you plot the time and the summing cell and see if it looks correct.
Thanks for your reply, In this case T and $$\omega_0$$ are arbitrary. For the simulation I choose T = 1 and w = 2*pi/T;

The images below are the simulation result for 50 terms over an interval of time. One thing that troubles me is that this is when I changed the summation to only include odd number terms k = 1,3,5,7,.... Including even terms 2,4,6,... will screw up the approximation.

#### WBahn

Joined Mar 31, 2012
26,398
Thanks for your reply, In this case T and $$\omega_0$$ are arbitrary. For the simulation I choose T = 1 and w = 2*pi/T;

The images below are the simulation result for 50 terms over an interval of time. One thing that troubles me is that this is when I changed the summation to only include odd number terms k = 1,3,5,7,.... Including even terms 2,4,6,... will screw up the approximation.
How did you "include" the even terms in the summation? They are all zero. If you just used the same sum but included even values of k, then of course it would screw up the results because then you are including even terms that are not zero.