[R] power in a specific frequency band
Giuseppe Pagnoni
gpagnon at emory.edu
Sat Oct 16 01:55:40 CEST 2004
Dear R users
I have a really simple question (hoping for a really simple answer :-):
Having estimated the spectral density of a time series "x" (heart rate
data) with:
x.pgram <- spectrum(x,method="pgram")
I would like to compute the power in a specific energy band.
Assuming that frequency(x)=4 (Hz), and that I am interested in the band
between f1 and f2, is the power in the band simply the following?
sum(x.pgram$spec[(x.pgram$freq > f1/frequency(x)) & (x.pgram$freq <=
f2/frequency(x))])
If it is so, are the returned units the same units as the original time
series, but squared (if x is bpm, then the power is in bpm^2)?
I own a copy of Venables and Ripley (MASS 2003), but I was not able to
extract this information from the time series chapter....
thanks for any help
(please cc to my e-mail, if possible)
giuseppe
Giuseppe Pagnoni
Dept. Psychiatry and Behavioral Sciences
Emory University
1639 Pierce Drive, Suite 4000
Atlanta, GA, 30322
tel: 404.712.8431
fax: 404.727.3233
More information about the R-help
mailing list