I am trying to compute the trigonometric fourier series coefficients of a periodic square wave time signal that has a value of 2 from time 0 to 3 and a value of -12 from time 3 to 6. It then repeats itself. I am trying to calculate in MATLAB the fourier series coefficients of this time signal and am having trouble on where to begin.
The equation is x(t) = a0 + sum(bk*cos(2*pi*f*k*t)+ck*sin(2*pi*f*k*t))
The sum is obviously from k=1 to k=infinity.
a0, bk, and ck are the coefficients I am trying to find. Thanks for the help.