Learn R Programming

DecomposeR (version 1.0.6)

as.emd: Create / Check emd objects

Description

Allows to convert the result of a decomposition into a standard list. The warnings of the is.emd checking function allow to identify the problems.

Usage

as.emd(
  xy,
  dt,
  imf,
  residue = NULL,
  ini = NULL,
  mode = NULL,
  repl = 1,
  order = NA
)

is.emd(emd)

Value

a list made of $xy (original signal), $dt (depth/time), $m (a matrix of the decomposition), $repl (the replicate id of each point) and $mode (the mode id of each point).

Arguments

xy

a vector of length n for the original signal at each dt

dt

a vector of length n for the depth or time reference

imf

a data.frame or matrix of n rows of the IMFs

residue

a vector of length n for the residue of the decomposition

ini

an optional vector of length n of the eventual initial Intrinsic Mode Function xy would be a demodulation of, if it is a demodulation.

mode

the mode sequence index to give to each replicated IMFs

repl

the id of each replicates. The length of unique(repl) defines the amount of replicates.

order

the order of the imf, typically from higher frequency to lower frequency

emd

an emd object to check

Examples

Run this code
set.seed(42)

n <- 600
t <- seq_len(n)

p1 <- 30
p2 <- 240

s30  <- (1 + 0.6 * sin(t*2*pi/p2)) * sin(t*2*pi/p1)
s240 <- 2 * sin(t*2*pi/p2)
sn   <- rnorm(n, sd = 0.5)

xy <- s30 + s240 + sn

inter_dt <- round(runif(length(xy), min = 0.5, max = 1.5),1)

dt  <- cumsum(inter_dt)

dec <- as.emd(xy = xy, dt = dt, imf = matrix(c(sn, s30, s240), ncol = 3))

plot_emd(dec, pdf = FALSE)

is.emd(dec)

if (FALSE) {
dec$xy <- 1
is.emd(dec)}

Run the code above in your browser using DataLab