r - How to convert spectral density to amplitude -
i have standard periodogram produced spectrum function call in r "stats" package. produces spectral density on y axis. wish inspect amplitude of key frequency signals.
how convert spectral density amplitude? there periodgram plot/analysis in r produces frequency vs amplitude plot automatically? appreciate advice.
maybe use different terminology do. page says value returned spectrum function list first 2 elements are:
freq vector of frequencies @ spectral density estimated. (possibly approximate fourier frequencies.) units reciprocal of cycles per unit time (and not per observation spacing): see ‘details’ spec vector (for univariate series) or matrix (for multivariate series) of estimates of spectral density @ frequencies corresponding freq.
so $spec
element calling vector of "amplitudes"? (you haven't said "key frequency signals" picked fourth frequency example in ?spectrum
:
lh.spec <- spectrum(lh) lh.spec$freq[4] #1] 0.08333333 lh.spec$spec[4] #[1] 1.167519
Comments
Post a Comment