x <- c(rep(0,1000),rep(0.5,1000),rep(0,1000))
set.seed(1)
v <- x + rnorm(n = 3000, sd = 1.0) # normally-distributed random variates
z <- kza(v,100,3)
z <- z[[1]]
# determine adaptive filter
d <- rep(0,3000)
f <- kzf(v,100,d)
f <- f[[4]]
# plot of sample variance
s <- kzsv(z,100,f)
plot(s[[1]],type="l")
Run the code above in your browser using DataLab