# NOT RUN {
#### example : composite of two components having different frequencies
ndata <- 1000
tindex <- seq(0, 1, length=ndata)
comp1 <- cos(45*pi*tindex)
comp2 <- cos(6*pi*tindex)
f <- comp1 + comp2
op <- par(mfcol=c(3,1), mar=c(2,2,2,1))
plot(tindex, f, main="a signal", xlab="", ylab="", type='l')
abline(h=0, lty=3)
plot(tindex, comp1, main="high-frequency component", xlab="", ylab="", type='l')
abline(h=0, lty=3)
plot(tindex, comp2, main="low-frequency component", xlab="", ylab="", type='l')
abline(h=0, lty=3)
# }
# NOT RUN {
#### Multiscale Ensemble Patch Transform according to tau's
taus1 <- seq(20, 60, by=2)
outmulti <- meptransf(signal=f, taus=taus1, process=c("envelope", "average"),
pquantile=c(0, 1))
#### To continue, click the plot in case of "locator(1)".
par(mfrow=c(2,2), mar=c(2,2,2,1))
for (i in 1:length(taus1)) {
plot(f - outmulti$EpM[,i], type='l', main="", xlab="", ylab=""); abline(h=0, lty=3)
title(paste0("Remaining component for tau=", taus1[i]))
lines(comp1, col="red", lty=2, lwd=0.5)
plot(outmulti$EpM[,i], type="l", main=, xlab="", ylab=""); abline(h=0, lty=3)
title(paste0("Mean envelope of ensemble patch transform for tau=", taus1[i]))
lines(comp2, col="red", lty=2, lwd=0.5); locator(1)
}
# }
# NOT RUN {
par(op)
# }
Run the code above in your browser using DataLab