MyNixOS website logo
Description

Variational Mode Decomposition.

'RcppArmadillo' implementation for the Matlab code of the 'Variational Mode Decomposition' and 'Two-Dimensional Variational Mode Decomposition'. For more information, see (i) 'Variational Mode Decomposition' by K. Dragomiretskiy and D. Zosso in IEEE Transactions on Signal Processing, vol. 62, no. 3, pp. 531-544, Feb.1, 2014, <doi:10.1109/TSP.2013.2288675>; (ii) 'Two-Dimensional Variational Mode Decomposition' by Dragomiretskiy, K., Zosso, D. (2015), In: Tai, XC., Bae, E., Chan, T.F., Lysaker, M. (eds) Energy Minimization Methods in Computer Vision and Pattern Recognition. EMMCVPR 2015. Lecture Notes in Computer Science, vol 8932. Springer, <doi:10.1007/978-3-319-14612-6_15>.

VMDecomp


The VMDecomp R package is the RcppArmadillo implementation of the "Variational Mode Decomposition" Matlab code in R. More details on the functionality of VMDecomp can be found in the package Documentation, Vignette and blog post.


Examples:


Variational Mode Decomposition (including residuals)



require(VMDecomp)
data(arrhythmia)

alpha = 2000       # moderate bandwidth constraint
tau = 0            # noise-tolerance (no strict fidelity enforcement)
K = 9              # 9 modes
DC = FALSE         # no DC part imposed
init = 1           # initialize omegas uniformly
tol = 1e-6

vec_arrhythmia = arrhythmia[['MLII']]

set.seed(1)
arr_vmd = vmd(data = vec_arrhythmia, 
              alpha = alpha,
              tau = tau, 
              K = K, 
              DC = DC,
              init = init, 
              tol = tol,
              verbose = TRUE)
              
imfs = data.table::data.table(arr_vmd$u)
colnames(imfs) = glue::glue("IMF_{1:ncol(imfs)}")
imfs$residual = rowSums(imfs) - vec_arrhythmia

round(imfs, digits = 5)

#           IMF_1    IMF_2    IMF_3   IMF_4   IMF_5    IMF_6    IMF_7    IMF_8    IMF_9 residual
#     1: -0.06947  0.07831  0.13355 0.14031 0.10371  0.05622 -0.00143 -0.09686 -0.00629 -0.01194
#     2: -0.06971  0.07765  0.13199 0.13698 0.09920  0.05226 -0.00062 -0.07683 -0.01055 -0.00963
#     3: -0.07016  0.07639  0.12896 0.13047 0.09046  0.04475  0.00097 -0.04075 -0.01487 -0.00377
#     4: -0.07068  0.07468  0.12466 0.12114 0.07810  0.03447  0.00329  0.00427 -0.01331  0.00662
#     5: -0.07108  0.07273  0.11937 0.10947 0.06297  0.02246  0.00622  0.04929 -0.00211  0.01932
#    ---                                                                                        
#  9996: -0.07001 -0.13154 -0.24738 0.18826 0.03381 -0.07354  0.00076  0.03773  0.01426  0.01234
#  9997: -0.06980 -0.13333 -0.25498 0.21256 0.03400 -0.11214  0.05833 -0.00481  0.01450  0.00432
#  9998: -0.06951 -0.13452 -0.26056 0.23154 0.03414 -0.14316  0.10925 -0.04580  0.00791 -0.00570
#  9999: -0.06934 -0.13534 -0.26432 0.24447 0.03413 -0.16496  0.14706 -0.07813 -0.00137 -0.00780
# 10000: -0.06932 -0.13581 -0.26626 0.25095 0.03402 -0.17629  0.16708 -0.09601 -0.00797  0.00040


Estimation of the K-modes Parameter (correlation threshold of 0.1 and a minimum K of 2)



require(VMDecomp)
data(arrhythmia)

default_vmd_params = list(alpha = 2000,
                          tau = 0,
                          DC = FALSE,
                          init = 1,
                          tol = 1e-6)

res_k = estimate_k_modes(signal_1d = arrhythmia[['MLII']],
                         cor_thresh = 0.1,
                         default_vmd_params = default_vmd_params,
                         min_K = 2,
                         seed = 1,
                         verbose = TRUE)
                         
# VMD based on a K of '2' will be computed ... 
# VMD based on a K of '3' will be computed ... 
# VMD based on a K of '4' will be computed ... 
# VMD based on a K of '5' will be computed ... 
# VMD based on a K of '6' will be computed ... 
# VMD based on a K of '7' will be computed ... 
# VMD based on a K of '8' will be computed ... 
# VMD based on a K of '9' will be computed ... 
# Optimal K parameter: '8'  Pre-specified correlation coefficient threshold: '0.1'
# Elapsed time: 0 hours and 1 minutes and 19 seconds.

res_k
# [1] 8


Installation:


To install the package from CRAN use,

install.packages("VMDecomp")


and to download the latest version of the package from Github,

remotes::install_github('mlampros/VMDecomp')


Docker Image


Docker images of the VMDecomp package are available to download from my dockerhub account. The images come with Rstudio and the R-development version (latest) installed. The whole process was tested on Ubuntu 18.04. To pull & run the image do the following,



docker pull mlampros/vmdecomp:rstudiodev

docker run -d --name rstudio_dev -e USER=rstudio -e PASSWORD=give_here_your_password --rm -p 8787:8787 mlampros/vmdecomp:rstudiodev


The user can also bind a home directory / folder to the image to use its files by specifying the -v command,



docker run -d --name rstudio_dev -e USER=rstudio -e PASSWORD=give_here_your_password --rm -p 8787:8787 -v /home/YOUR_DIR:/home/rstudio/YOUR_DIR mlampros/vmdecomp:rstudiodev



The USER defaults to rstudio but you have to give your PASSWORD of preference (see www.rocker-project.org for more information).


Open your web-browser and depending where the docker image was build / run give,


1st. Option on your personal computer,


http://0.0.0.0:8787 


2nd. Option on a cloud instance,


http://Public DNS:8787


to access the Rstudio console in order to give your username and password.


Similar Projects:

  • https://github.com/vrcarva/vmdpy (Variational Mode Decomposition in Python)
  • https://github.com/helske/Rlibeemd (ensemble empirical mode decomposition (EEMD) and its complete variant (CEEMDAN))

Citation:

If you use the VMDecomp R package in your paper or research please cite both VMDecomp and the original articles / softwarehttps://CRAN.R-project.org/package=VMDecomp:


@Manual{,
  title = {{VMDecomp}: Variational Mode Decomposition using R},
  author = {Lampros Mouselimis},
  year = {2022},
  note = {R package version 1.0.1},
  url = {https://CRAN.R-project.org/package=VMDecomp},
}

Metadata

Version

1.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows