diff options
Diffstat (limited to 'R/nonparam.R')
-rw-r--r-- | R/nonparam.R | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/R/nonparam.R b/R/nonparam.R index 7df30d9..4d8496a 100644 --- a/R/nonparam.R +++ b/R/nonparam.R @@ -175,9 +175,11 @@ spa <- function(data,npad=255){ # Non-parametric Estimation of Spectral Densities - # WOSA and Hanning window - gamma <- SDF(temp,method="wosa",sampling.interval = data$Ts,npad=npad) - freq <- seq(from=1,to=ceiling(npad/2),by=1)/ceiling(npad/2)*pi/data$Ts - out <- idfrd(response = gamma[,2]/gamma[,3],freq=freq,Ts= data$Ts) + gamma <- SDF(temp,method="wosa",sampling.interval = deltat(data), + npad=npad) + freq <- attributes(gamma)$frequency*2*pi + out <- idfrd(response = Conj(gamma[,2])/Mod(gamma[,3]),freq=freq, + Ts= deltat(data)) return(out) } |