summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-02-23 00:54:05 +0530
committerSuraj Yerramilli2016-02-23 00:54:05 +0530
commit3727cfb5b3a3b0cdeb75f958d8bdd123ea9e8d12 (patch)
tree577014464f74879a922739ec264db678cd7c830c
parent51308947043af27965a369736bd65d673451a9b3 (diff)
downloadSysID-R-code-3727cfb5b3a3b0cdeb75f958d8bdd123ea9e8d12.tar.gz
SysID-R-code-3727cfb5b3a3b0cdeb75f958d8bdd123ea9e8d12.tar.bz2
SysID-R-code-3727cfb5b3a3b0cdeb75f958d8bdd123ea9e8d12.zip
fixing phase angles
-rw-r--r--R/idframe.R5
1 files changed, 4 insertions, 1 deletions
diff --git a/R/idframe.R b/R/idframe.R
index cd48958..e633177 100644
--- a/R/idframe.R
+++ b/R/idframe.R
@@ -162,8 +162,11 @@ plot.idfrd <- function(x,col="steelblue",lwd=1){
mag <- 20*log10(Mod(x$resp))
nout <- dim(mag)[1]; nin <- dim(mag)[2]
dim(mag) <- c(nin*nout,nfreq)
- phase <-180/pi*apply((Arg(x$resp)),3,signal::unwrap)
+ temp <- aperm(Arg(x$resp),c(3,2,1));dim(temp) <- c(nfreq,4)
+ l <- t(split(temp, rep(1:ncol(temp), each = nrow(temp))))
+ phase <- 180/pi*t(sapply(l,signal::unwrap))
+
g <- vector("list",nin*nout)
for(i in 1:length(g)){