[R] How do I "normalise" a power spectral density analysis?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Jan 31 11:18:43 CET 2006
What's wrong with
z <- spec.pgram(ldeaths, plot = FALSE)
plot(1/z$freq, z$spec, log="y", xlab="period", ylab="power")
On Tue, 31 Jan 2006, Tom C Cameron wrote:
> Hi Spencer, yes thanks it does help. In short I have resolved the issue.
> In length, not directly, as I have not found a way to ask R to actually
> plot frequency vs. period directly,
That's the 1/x function, so I am sure you can manage that. I presume you
want power vs period?
> I have scoured the R help pages and Venebles &
> Ripley but the call to R "spectrum()" or "periodogram()" generates error
> messages if I try to enhance or change the plot!
There is no periodogram() function in R.
> I did find that you can install the library packages "growth" and "rmutil" and
> then use the function "pergram" that gives you the output of the PSD in a
> matrix which I have then transformed to give me the period (1/frequency).
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help