How to convert spectral density to amplitude

喜你入骨 提交于 2019-12-11 10:29:40

问题


I have standard periodogram produced from the spectrum function call in the R "stats" package. It produces a spectral density on the Y axis. I wish to actually inspect the amplitude of the key frequency signals.

How do i convert the spectral density to an amplitude? Is there a periodgram plot/analysis in R that produces a frequency vs amplitude plot automatically? Appreciate any advice.


回答1:


Maybe you use different terminology than I do. The help page says that value returned from the spectrum function is a list whose first two elements are:

freq    
vector of frequencies at which the spectral density is estimated. 
(Possibly approximate Fourier frequencies.) The units are the 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 the spectral density at frequencies corresponding to freq.

So is the $spec element what you are calling the vector of "amplitudes"? (You haven't said what the "key frequency signals" are so I just picked the fourth frequency from the example in ?spectrum:

 lh.spec <- spectrum(lh)

 lh.spec$freq[4]
#1] 0.08333333
  lh.spec$spec[4]
#[1] 1.167519


来源:https://stackoverflow.com/questions/18161789/how-to-convert-spectral-density-to-amplitude

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!