Tom C Cameron
2006-Jan-27 14:53 UTC
[R] How do I "normalise" a power spectral density analysis?
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: t.c.cameron at leeds.ac.uk Leeds LS2 9JT LS2 9JT
Spencer Graves
2006-Jan-31 01:45 UTC
[R] How do I "normalise" a power spectral density analysis?
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: t.c.cameron at leeds.ac.uk > Leeds LS2 9JT > LS2 9JT > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Tom C Cameron
2006-Jan-31 09:19 UTC
[R] How do I "normalise" a power spectral density analysis?
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: t.c.cameron at leeds.ac.uk Leeds LS2 9JT LS2 9JT