# NOT RUN {
library(grid) # To use the gpar function
set.seed(42)
n <- 600
t <- seq_len(n)
p1 <- 30
p2 <- 240
xy <- (1 + 0.6 * sin(t*2*pi/p2)) * sin(t*2*pi/p1) + 2 * sin(t*2*pi/p2) +
rnorm(n, sd = 0.5)
inter_dt <- round(runif(length(xy), min = 0.5, max = 1.5),1)
dt <- cumsum(inter_dt)
dec <- extricate(xy, dt, nimf = 7, repl = 10, comb = 10, factor_noise = 10,
speak = TRUE)
# }
# NOT RUN {
plot_emd(dec, dir = tempdir())
# }
# NOT RUN {
integrity(xy, dec)
parsimony(dec)
ht <- inst.pulse(dec, plot = FALSE)
plot_hex(x = 1/ht$f, y = ht$a, bins = 100, ybnds = c(0,2),
log = "x", trans = log10, inv = function(x) 10^x,
main = "Spectral Population", xlab = "Period", ylab = "Amplitude")
plot_hex(x = 1/ht$f, y = ht$a, bins = 100, ybnds = c(0,2),
log = "x", trans = log10, inv = function(x) 10^x,
main = "Spectral Population", xlab = "Period", ylab = "Amplitude",
id = ht$mode, select = c(4,6,7),
l = list(x = c(30, 30, 240, 240), y = unit(c(0,1,0,1), "npc"),
id = c(1,1,2,2), gp = gpar(col = c("red", "blue"), lwd = 2)),
g = list(x = c(18, 50, 50, 18, 18, 50, 50, 18),
y = c(0, 0, 1.9, 1.9, 2.05, 2.05, 1.95, 1.95),
id = c(1,1,1,1,2,2,2,2),
gp = gpar(col = c("red", NA), fill = c(NA, "white"), lwd = 2)),
t = list(label = "Mode 4", x = 30, y = 2, gp = gpar(col = "red")))
# }
Run the code above in your browser using DataLab