View source: R/empirical_mode_decomposition.R

Sig2IMF | R Documentation |

This function wraps the `emd`

function in the `EMD`

package.
`Sig2IMF`

is used in `EEMD`

and others.

```
Sig2IMF(sig, tt, spectral.method = "arctan", diff.lag = 1, stop.rule = "type5",
tol = 5, boundary = "wave", sm = "none", smlevels = c(1), spar = NULL,
max.sift = 200, max.imf = 100, interm = NULL)
```

`sig` |
a time series to be decomposed (vector) |

`tt` |
A vector of sample times for |

`spectral.method` |
defines how to calculate instantaneous frequency - whether to use the arctangent of the analytic signal with numeric differentiation (“arctan”)
or the result of the chain rule applied to the arctangent, then numerically differentiated ("chain"); see |

`diff.lag` |
specifies if you want to do naive differentiation ( |

`stop.rule` |
As quoted from the EMD package documentation: ”The stop rule of sifting. The type1 stop rule indicates that absolute values of envelope mean must be less than the user-specified tolerance level in the sense that the local average of upper and lower envelope is zero. The stopping rules type2, type3, type4 and type5 are the stopping rules given by equation (5.5) of Huang et al. (1998), equation (11a), equation (11b) and S stoppage of Huang and Wu (2008), respectively.” |

`tol` |
Determines what value is used to stop the sifting - this will depend on which stop rule you use. |

`boundary` |
how the beginning and end of the signal are handled |

`sm` |
Specifies how the signal envelope is constructed, see Kim et al, 2012. |

`smlevels` |
Specifies what level of the IMF is obtained by smoothing other than interpolation, see EMD package documentation |

`spar` |
User-defined smoothing parameter for spline, kernel, or local polynomial smoothing. |

`max.sift` |
How many sifts are allowed - if this value is exceeded the IMF is returned as-is. |

`max.imf` |
Maximum number of IMFs allowed. |

`interm` |
Specifies vector of periods to be excluded from IMFs to cope with mode mixing. |

This function configures and performs empirical mode decomposition using the `emd`

function in the `EMD`

package.

`emd.result` |
The intrinsic mode functions (IMFs), instantaneous frequencies, and instantaneous amplitudes of |

Kim, D., Kim, K. and Oh, H.-S. (2012) Extending the scope of empirical mode decomposition by smoothing.
*EURASIP Journal on Advances in Signal Processing*, **2012**, 168.

Huang, N. E., Shen, Z., Long, S. R., Wu, M. L. Shih, H. H.,
Zheng, Q., Yen, N. C., Tung, C. C. and Liu, H. H. (1998) The empirical
mode decomposition and Hilbert spectrum for nonlinear and
nonstationary time series analysis. *Proceedings of the Royal
Society London A*, **454**, 903–995.

Huang, N. E. and Wu Z. A. (2008) A review on Hilbert-Huang Transform: Method and its applications to geophysical studies.
*Reviews of Geophysics*, **46**, RG2006.

`EEMD`

, `PlotIMFs`

```
data(PortFosterEvent)
#Run EMD
emd.result=Sig2IMF(sig, tt)
#Display IMFs
time.span <- c(5, 10)
imf.list <- 1:3
original.signal <- TRUE
residue <- TRUE
PlotIMFs(emd.result, time.span, imf.list, original.signal, residue)
#Plot spectrogram
sdt <- tt[2] - tt[1]
dfreq <- 0.25
freq.span <- c(0, 25)
hgram <- HHRender(emd.result, sdt, dfreq, freq.span = freq.span, verbose = FALSE)
time.span <- c(4, 10)
freq.span <- c(0, 25)
amp.span <- c(0.000001, 0.00001)
HHGramImage(hgram, time.span = time.span,
freq.span = freq.span, amp.span = amp.span,
pretty = TRUE)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.