#This example uses the same data from the KZS example
# Define the time sequence
t <- seq(from = -round(400*pi), to = round(400*pi), by = .25)
# Positive t (includes time = 0)
tp <- seq(from = 0, to = round(400*pi), by = .25)
# Negative t
tn <- seq(from = -round(400*pi), to = -.25, by = .25)
# Positive side of signal
signalp <- 0.5*sin(sqrt((2*pi*abs(tp))/200))
# Negative side of signal
signaln <- 0.5*sin(-sqrt((2*pi*abs(tn))/200))
# Appending into one signal
signal <- append(signaln, signalp, after = length(tn))
# Randomly generate noise from the standard normal distribution
et <- rnorm(length(t), mean = 0, sd = 1)
# Add the noise to the signal
yt <- et + signal
# Data frame of (t,yt)
pts <- data.frame(cbind(t,yt))
argkzs(pts, 1)
Run the code above in your browser using DataLab