From 6eedf002e8d399e4ac8c08037653f74a016fc7e4 Mon Sep 17 00:00:00 2001 From: Suraj Yerramilli Date: Wed, 3 Jun 2015 12:16:17 +0530 Subject: added code to compute the frf using WOSA --- R/nonparam.R | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'R/nonparam.R') diff --git a/R/nonparam.R b/R/nonparam.R index b3110ec..fcc1e20 100644 --- a/R/nonparam.R +++ b/R/nonparam.R @@ -91,7 +91,23 @@ step <- function(model){ #' spectral analysis #' spa <- function(data,WinSize=NULL){ + require(sapa) + temp <- cbind(data$y,data$u) + # Non-parametric Estimation of Spectral Densities - + # WOSA and Hanning window + + if(WinSize==NULL){ + M <- min(dim(temp,1),30) + } else{ + M <- WinSize + } + + gamma <- SDF(temp,method="wosa", + taper. = taper(type="hanning",n.sample=M)) + out <- list(response = gamma[,2]/gamma[,3]) + class(out) <- "spa" + return(out) } #' Estimate empirical transfer function -- cgit