I am trying to calculate the coefficients for a trigonometric fourier series expansion of a square wave with a height of 1. It is centered at the origin, extending to pi on either side of it. It has a period of 10pi.

I have tried pulling the correct coefficients out for a couple hours now but my attempt to view my solution in a graphing calculator has been in vein and before I break something I decided to post in the forum.

My series expansion came out to:

f = 1/5 + sum{ (2/(n pi) * sin (n pi / 5) * cos(n/5 t)}

I approached this problem in the following manner.

Calculated by a0 term by calculating the average value of the function.

Calculated my an coefficients using an integral of 4/10pi * the integral from 0 to the period divided by 2, times cos(nwt).

Reasoned that my bn terms must be 0 since it is an even function.

The function in a graphing calculator does not resemble my signal at all.

I do not understand what I am doing wrong and if anyone could offer some pointers, I am self taught on the subject and would appreciate them very much.

Cheers