The Fourier transform is linear, which means that if you sum two signals, then also their spectrum will be the sum.
$$ \mathscr{F} [x(t) + y(t)] = \mathscr{F}[x(t)] + \mathscr{F}[y(t)] $$
If you consider the power, you can have two cases:
The signals have different frequency
Then their power just sums up, because:
$$ P_{tot} = P_1 cos (\omega _1 t + \phi _1) + P_2 cos (\omega _2 t + \phi _2) $$
The signals have the same frequency
Then if they are in phase you have:
$$ P_{tot} = P_1 cos (\omega _0 t + \phi _0) + P_2 cos (\omega _0 t + \phi _0) =
(P_1 + P_2) \cdot cos(\omega _0 t + \phi_0) $$
If they're out of phase, the resulting power will be lower and precisely:
$$ P_{tot} = P_1 cos (\omega _0 t + \phi _1) + P_2 cos (\omega _0 t + \phi _2) $$
and setting arbitrarily \$\phi_1 = 0\$ we obtain:
$$ P_{tot} = P_1 cos (\omega _0 t) + P_2 cos (\omega _0 t + \Delta \phi) $$
which for \$\Delta \phi = \pi\$ gives the subtraction of the signals.
This is too long for a comment. I also needed the extra space. Feel free to comment anything.
The thing you are really asking is if the calculation is made with T/8 or T/4 or T/2. The thing is, the signal has a period of T/2, so that's the value you need to use. Now, we also need to take into account the time interval where the signal is 0. To do that, we need to define the signal properly.
The first thing you should do is to describe the signal, that is:
$$
f(t)=\left\{\begin{array}{ccc}\Biggl|A\sin\Bigl(2\pi\frac{4}{T}t\Bigr)\Biggr|&&t\in\biggl(0+k\frac{T}{2},\frac{T}{4}+k\frac{T}{2}\biggr),\,k\in\mathbf{Z}\\0&&t\in\biggl(\frac{T}{4}+k\frac{T}{2},\frac{T}{2}+k\frac{T}{2}\biggr),\,k\in\mathbf{Z}
\end{array}\right.$$
Note the sinusoid has amplitude A and period T/4, but the second semi-period is positive (so we use the absolute value).
The expression for f(t) is the same as:
$$
f(t)=\left\{\begin{array}{ccc}A\sin\Bigl(2\pi\frac{4}{T}t\Bigr)&&t\in\biggl(0+k\frac{T}{2},\frac{T}{8}+k\frac{T}{2}\biggr),\,k\in\mathbf{Z}\\-A\sin\Bigl(2\pi\frac{4}{T}t\Bigr)&&t\in\biggl(\frac{T}{8}+k\frac{T}{2},\frac{T}{4}+k\frac{T}{2}\biggr),\,k\in\mathbf{Z}\\0&&t\in\biggl(\frac{T}{4}+k\frac{T}{2},\frac{T}{2}+k\frac{T}{2}\biggr),\,k\in\mathbf{Z}
\end{array}\right.$$
Remember that
$$c_n=\frac{1}{P}\int_{t_0}^{P+t_0}f(t)e^{-2\pi j \frac{n}{P}t}\,dt$$
In our case, P is the period (P=T/2), j is the imaginary unit, and t_0 is the initial instant (say t_0=0). Then,
$$\begin{array}{rcl}
c_n=\frac{2}{T}\int_{0}^{\frac{T}{2}}f(t)e^{-2\pi j \frac{2n}{T}t}\,dt&=&I_1+I_2+I_3
\end{array}$$
where I'll only calculate I_1 to get the idea going:
$$\begin{array}{rcl}
I_1&=&\frac{2}{T}\int_0^{\frac{T}{8}}A\sin\Bigl(\frac{8\pi}{T}t\Bigr)e^{-2\pi j\frac{2n}{T}t}\,dt\\
&=&\frac{2A}{T}\int_0^{\frac{T}{8}}\frac{e^{j\frac{8\pi}{T}t}-e^{-j\frac{8\pi}{T}t}}{2j}\cdot e^{- j\frac{4\pi n}{T}t}\,dt\\
&=&\frac{A}{jT}\int_0^{\frac{T}{8}}e^{j\frac{8\pi}{T}t}e^{-j\frac{4\pi n}{T}t}\,dt-\frac{A}{2j}\int_0^{\frac{T}{8}}e^{-j\frac{8\pi}{T}t}e^{-j\frac{4\pi n}{T}t}\,dt\\
&=&\frac{A}{jT}\Biggl( \frac{T}{8\pi-4\pi n}e^{j2\pi\frac{2-n}{T}t}\Biggr|_{0}^{\frac{T}{8}}-\frac{T}{-8\pi-4\pi n}e^{-j2\pi\frac{2+n}{T}t}\Biggr|_{0}^{\frac{T}{8}}\Biggr)\\
&=&\frac{A}{jT}\Biggl( \frac{T}{8\pi-4\pi n}(e^{j2\pi\frac{2-n}{T}\frac{T}{8}}-1)+\frac{T}{8\pi+4\pi n}(e^{-j2\pi\frac{2+n}{T}\frac{T}{8}}-1)\Biggr)\\
&=&\frac{A}{j}\Biggl( \frac{1}{8\pi-4\pi n}(e^{j\pi\frac{2-n}{4}}-1)+\frac{1}{8\pi+4\pi n}(e^{-j\pi\frac{2+n}{4}}-1)\Biggr)\\
&&\\
I_2&=&\frac{2}{T}\int_{\frac{T}{8}}^{\frac{T}{4}}-A\sin\Bigl(\frac{8\pi}{T}t\Bigr)e^{-j\frac{4\pi n}{T}t}\,dt\\
&=&...\\
&&\\
I_3&=&\frac{2}{T}\int_{\frac{T}{4}}^{\frac{T}{2}}0e^{2\pi j\frac{2n}{T}t}\,dt\\
&=&0
\end{array}$$
I believe this is all you need to get your calculations correct now... Good luck!
Best Answer
Fourier series can only be used to represent repetitive signals. So if you want to use Fourier series to represent a "signal that should transmit bits", it will have to be a signal that transmits the same bits over and over.
They represent the relative magnitude of the in-phase and quadrature components of the harmonics in your signal.
Which doesn't really tell you anything new.
What you've really done by taking the Fourier series is found a new way to represent all the information in your signal. Mathematically, you've transformed it to a new basis set. This is useful because, for example, if you were to pass the signal through a filter with a known frequency response, it would be much easier to calculate the output by using the new frequency domain basis set, than directly using the time-domain representation.
Your 2nd, 3rd, and 4th equations are exactly how you calculate them.
Two key points. First, c is not a complex number, it is a real, as shown by the 4th equation.
Second, your first equation should be more like
\$g(t) = \dfrac{1}{2}c + \Sigma_{n=1}^{\infty}a_n{}\sin(2\pi{}nf_0t) + ...\$
Note the added n in the argument of the sine, as mentioned in the comments.
Also, notice I use f0 instead of just f. Here f0 is the frequency at which your signal repeats. That is, f0 is \$\dfrac{1}{NT_b}\$, where N is the number of bits in your repeating sequence, and Tb is the period of a single bit.