\displaystyle E_k (t) = \frac{1}{T} \int_{-T/2}^{T/2}{[f(t) - S_k (t)]^2 \, dt}