set.seed(123)
n=128
types=c('box','rc','cr','sine')
shapes=matrix(NA,20,n)
for (i in 1:20){
shapes[i,]=cbfs(type=types[sample(1:4,1)])
}
whitenoise=ts2mat(rnorm(128*20),128)
# generate x which randomly combine the four types of events with each two of them
# seperated by noise
x=c(t(cbind(shapes,whitenoise)))
plot(x,ty='l')
w=128
# execute loops sequentially
tests=noiseTests(x,w,'white',parallel=FALSE)
# execute loops in parallel using doMC package (for non-Windows users)
# tests=noiseTests(x,w,'white',parallel=TRUE)Run the code above in your browser using DataLab