diff options
author | ashwinrcs | 2015-10-12 16:00:12 +0530 |
---|---|---|
committer | ashwinrcs | 2015-10-12 16:15:22 +0530 |
commit | 48ceccf211ee2706f09f54ce232e0c03f8087263 (patch) | |
tree | 40a240200e68be9d6f70d12628c405b98068a8cb /R/rbs1.R | |
parent | 69813446dfe77003c88773da6bc397a1658229e1 (diff) | |
download | SysID-R-code-48ceccf211ee2706f09f54ce232e0c03f8087263.tar.gz SysID-R-code-48ceccf211ee2706f09f54ce232e0c03f8087263.tar.bz2 SysID-R-code-48ceccf211ee2706f09f54ce232e0c03f8087263.zip |
Function idinput including rgs and rbs codes
Diffstat (limited to 'R/rbs1.R')
-rw-r--r-- | R/rbs1.R | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/R/rbs1.R b/R/rbs1.R new file mode 100644 index 0000000..033f6a3 --- /dev/null +++ b/R/rbs1.R @@ -0,0 +1,22 @@ +gen.rbs<-function(n,band,type){ + require(signal) + v<-rnorm(n) + for(i in 1:n){ + if (v[i]==0){ + + v[i]=rnorm(1) + } + } + a<-butter(8,band,type = type,plane = 'z') + v1=filter(a,v) + for(i in 1:n){ + + if(v1[i]>0){ + v1[i]=1 + } + if(v1[i]<0){ + v1[i]=-1 + } + } + return(v1) +}
\ No newline at end of file |