The function apllies the spectral decomposition to the time series according to the following expression
$$\left(\left(\sum\left(x*cos\left(w*t\right)\right)\right)^{2}+\left(\sum\left(x*cos\left(w*t\right)\right)\right)^{2}\right)/n$$
References
Box, G., Jenkins, G., Reinsel, G. (1994) Time Series Analysis : Forecasting and Control. 3rd edition, Prentice Hall, New Jersey.
Diggle, P. J. (1989) Time Series : A Biostatistical Introduction. Oxford University Press, Oxford.