vmd: Create VMD Object

Description Usage Arguments Author(s) References Examples

View source: R/R6Vmd.R

Description

Create instance of R6Vmd, which is an R6 implementation, ported from the original 2013 Matlab code developed by Dragomiretskiy & Zosso.

Usage

1
2
3
vmd(signal, alpha = getOption("vmd.alpha"), tau = getOption("vmd.tau"),
  K = getOption("vmd.K"), DC = getOption("vmd.DC"),
  init = getOption("vmd.init"), tol = getOption("vmd.tol"), ...)

Arguments

signal

the time domain signal (1D) to be decomposed

alpha

the balancing parameter of the data-fidelity constraint

tau

time-step of the dual ascent (pick 0 for noise-slack)

K

the number of modes to be recovered

DC

true if the first mode is put and kept at DC (0-freq)

init

0 = all omegas start at 0, 1 = all omegas start uniformly distributed or 2 = all omegas initialized randomly

tol

tolerance of convergence criterion, typically around 1e-6

...

any other arguments to be passed to the R6 initializer

Author(s)

Nicholas Hamilton, UNSW Sydney

References

Variational Mode Decomposition, Dragomiretskiy & Zorro, 2013, http://dx.doi.org/10.1109/TSP.2013.2288675

Original Matlab Source: https://goo.gl/fJH1d5.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
x = seq(-2*pi,2*pi,length.out=1000)
signal = cos(x)
v = vmd(signal,DC=FALSE,tol=1e-3)
v$getResult()
plot(v)

nv   = 1000
fs   = 1/nv
t    = (1:nv)/nv
freq = 2*pi*(1 - 0.5 - 1/nv)/fs
f_1 = 2;
f_2 = 24;
f_3 = 288;
f_4 = 12;
v_1 = (cos(2*pi*f_1*t));
v_2 = 1/4*(cos(2*pi*f_2*t));
v_3 = 1/16*(cos(2*pi*f_3*t));
v_4 = 1/8*(cos(2*pi*f_4*t));
signal = v_1 + v_2 + v_3 + v_4 + 0.5*runif(nv,min=-0.5,max=0.5);
v = vmd(signal,alpha=2000,tau=0,DC=FALSE,init=0,tol=1e-3,K=3,orderModes=TRUE)

#List of Results
l = v$getResult()
names(l)

#To Data Frame
df = as.data.frame(v)
head(df)

#Plot Results
plot(v)
plot(v,facet='bymode',scales='free')
plot(v,facet='byclass',scales='free')

#Input Spectrum
v$plot.input.spectrum()

#Spectral Decomposition
v$plot.spectral.decomposition()

vmd documentation built on May 1, 2019, 9:13 p.m.