spec.pgram(x, spans=1, taper=0.1, pad=0, detrend=T, demean=F, plot=F)
The spectrum is estimated by taking the discrete Fourier transform of the (detrended then tapered then padded) data. The squared modulus of this transform is then smoothed by a sequence of running averages. See Bloomfield (1976) for a discussion of the methods.
The chapter "Analyzing Time Series" of the S-PLUS Guide to Statistical and Mathematical Analysis.
p <- spec.pgram(log(lynx), pad=1) # Compute and plot Raw Periodogram. p2 <- spec.pgram(log(lynx), pad=1, spans=c(9,7), plot=F) spec.plot(p2,add=T) # Superimpose a Smooth Periodogram.