# Estimating the spectral density

I'm interested in using the spectral density to determine the period of a time series $x_t$. According to Wikipedia, we can use the periodogram to estimate the spectral density. Going down the chain, Wikipedia says the periodogram is implemented using the FFT, but the details are not given. Is it literally the FFT on $x_t$?

Edit:

In R, there is a function spec.pgram that returns the raw periodogram. I tried to compare this to the FFT of the ACF, but I'm still not getting matching results (eventually I need to do this in Java, so I am trying to understand the implementation fully).

x = rep(c(5,1,5,10),4)
x.acf = acf(x)$acf[,,1] Mod(fft(x.acf))^2 [1] 0.3906250 0.4757183 0.9898323 15.5956432 2.5543312 0.3962321 [7] 0.2068152 0.2068152 0.3962321 2.5543312 15.5956432 0.9898323 [13] 0.4757183  vs x.pgram = spec.pgram(x, detrend=F) x.pgram$freq

[1] 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000

x.pgram\$spec

[1]  3.8819277  3.4948335  2.9155061 69.0892857  1.5487796  0.9694522  0.5823580
[8]  0.1607143