View source: R/gzc.algorithm.R
| gzc.algorithm | R Documentation |
Calculates instantaneous frequency of simplified IMF using the Generalised Zero-Crossing method from Huang et al., 2009.
gzc.algorithm(xy, dt)
xy |
a matrix of amplitude |
dt |
a vector of depth or time values |
the GZC method is precise to 1/4th of a period, so the results are provided between left and right points, i.e. either an extrema or a zero-crossing.
a list of $ldt (left position), $rdt (right position), $f (frequency) and $a (amplitude)
Huang, Norden E., Zhaohua Wu, Steven R. Long, Kenneth C. Arnold, Xianyao Chen, and Karin Blank. 2009. ‘On Instantaneous Frequency’. Advances in Adaptive Data Analysis 01 (02): 177–229. https://doi.org/10.1142/S1793536909000096.
xyi <- c(0.5,0,-0.5,0,0.5,0,-0.5,0,0.5,0,-0.5,0,0.5,0,-0.5,0,0.5,0,-0.5,0,
1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,-1)
dti <- 1:length(xyi)
d <- simp.emd(m = xyi, dt = dti)
xy <- d$xy
dt <- d$dt
res <- gzc.algorithm(xy, dt)
opar <- par('mfrow')
par(mfrow = c(2,1))
plot(dti, xyi, pch = 19, type = "o", ylab = "xy", xlab = "dt")
points(dt, xy, pch = 19, col = "green")
points(res$ldt, res$a, pch = 19, col = "red")
points(res$rdt, res$a, pch = 19, col = "red")
plot(dt, rep(max(res$f, na.rm = TRUE), length(dt)), type = "n",
ylab = "Frequency", xlab = "dt",
ylim = c(0, 2 * max(res$f, na.rm = TRUE)))
points(res$ldt, res$f, pch = 19)
points(res$rdt, res$f, pch = 19)
par(mfrow = opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.