How do I "normalise" a power spectral density analysis?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I "normalise" a power spectral density analysis?

Tom C Cameron
Hi everyone

Can anyone tell me how I normalise a power spectral density (PSD) plot of a
periodical time-series. At present I get the graphical output of spectrum VS
frequency.

What I want to acheive is period VS spectrum? Are these the same things but the
x-axis scale needs transformed ?

Any help would be greatly appreciated

Tom
...........................................................................
Dr Tom C Cameron                        office: 0113 34 32837 (10.23 Miall)
Ecology & Evolution Res. Group.         lab: 0113 34 32884 (10.20 Miall)
School of Biological Sciences           Mobile: 07966160266
University of Leeds                     email: [hidden email]
Leeds LS2 9JT
LS2 9JT

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: How do I "normalise" a power spectral density analysis?

Spencer Graves
          Since I have not seen a reply to this post, I will offer a comment,
even though I have not used spectral analysis myself and therefore have
you intuition about it.  First, from the definitions I read in the
results from, e.g., RSiteSearch("time series power spectral density")
[e.g.,
http://finzi.psych.upenn.edu/R/library/GeneTS/html/periodogram.html] and
"spectral analysis" in Venables and Ripley (2002) Modern Applied
Statistics with S (Springer), I see no reason why you couldn't plot the
spectrum vs. the period rather than the frequency.  Someone else may
help us understand why it is usually plotted vs. the frequency;  I'd
guess that the standard plot looks more like the integrand in the
standard Fourier inversion formula, but I'm not sure.

          If you'd like more help from this listserve, you might briefly
describe the problem you are trying to solve, why you think spectral
analysis analysis should help, and include a toy example with some
self-contained R code to illustrate what you tried and what you don't
understand about it.  (And PLEASE do read the posting guide!
"www.R-project.org/posting-guide.html".  Nothing is certain but
following that posting guide will, I believe, tend to increase the speed
and utility of response.)

          hope this helps.
          spencer graves

Tom C Cameron wrote:

> Hi everyone
>
> Can anyone tell me how I normalise a power spectral density (PSD) plot of a
> periodical time-series. At present I get the graphical output of spectrum VS
> frequency.
>
> What I want to acheive is period VS spectrum? Are these the same things but the
> x-axis scale needs transformed ?
>
> Any help would be greatly appreciated
>
> Tom
> ...........................................................................
> Dr Tom C Cameron                        office: 0113 34 32837 (10.23 Miall)
> Ecology & Evolution Res. Group.         lab: 0113 34 32884 (10.20 Miall)
> School of Biological Sciences           Mobile: 07966160266
> University of Leeds                     email: [hidden email]
> Leeds LS2 9JT
> LS2 9JT
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: How do I "normalise" a power spectral density analysis?

Tom C Cameron
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, 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!

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).

Thankyou very much for replying and for the advice

Best wishes

Tom
...........................................................................
Dr Tom C Cameron                        office: 0113 34 32837 (10.23 Miall)
Ecology & Evolution Res. Group.         lab: 0113 34 32884 (10.20 Miall)
School of Biological Sciences           Mobile: 07966160266
University of Leeds                     email: [hidden email]
Leeds LS2 9JT
LS2 9JT

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: How do I "normalise" a power spectral density analysis?

Brian Ripley
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,                  [hidden email]
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html