LIBVMD: Python library for variational mode decomposition for both 1D and 2D
Project description
LIBVMD: Python library for variational mode decomposition for both 1D and 2D
This package's functions are translations of MATLAB source codes by Dragomiretskiy and Zosso (2013; 2015)
Related source codes and articles are as below
vmd: MATLAB code, Article
vmd2: MATLAB code, Article
Installation
pip install libvmd
or
git clone https://github.com/hyoddubi1/libvmd.git
python setup.py install
Example codes
1-dimensional VMD
from libvmd.vmd import vmd
from matplotlib import pyplot as plt
2-dimensional VMD
import numpy as np
from libvmd.vmd import vmd2
from matplotlib import pyplot as plt
xs = np.arange(0,200)
X,Y = np.meshgrid(xs,xs)
pi = np.pi
sa = np.sin((1/16 *pi *X + 1/16 * pi * Y ) * np.exp((-X)/200) )
sb = 0.5 * np.sin(1/8 * pi * X - 1/8 * pi * Y);
sc = X / 10 + 1
sc = sc * 0.1 +2
signal = sa+ sb + sc
fig, ax = plt.subplots(1,4,figsize=(15,6))
ax[3].imshow(signal)
ax[3].set_title("Ground truth")
ax[0].imshow(sa)
ax[1].imshow(sb)
ax[2].imshow(sc)
ax[0].set_title("signal 1")
ax[1].set_title("signal 2")
ax[2].set_title("signal 3")
alpha = 1000
tau = 0
K = 3
DC = True
init = 0
tol = 10**-7
N= 3000
mirror_extension = False
u, u_hat, omega = vmd2(signal, K, alpha, tau, DC, init, tol,mirror_extension = mirror_extension)
fig, ax = plt.subplots(2,4,figsize=(15,6))
ax[0,3].imshow(image1)
ax[0,3].set_title("Ground truth")
ax[0,0].imshow(sa)
ax[0,1].imshow(sb)
ax[0,2].imshow(sc)
ax[0,0].set_title("signal 1")
ax[0,1].set_title("signal 2")
ax[0,2].set_title("signal 3")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file libvmd-0.0.3.tar.gz.
File metadata
- Download URL: libvmd-0.0.3.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de26d22f4421ae43aba2e3ffa8e3c4aab8c459fb754cefa9463248817d7c26ee
|
|
| MD5 |
e1fae1f2c92585cb8d63a7111ab810bf
|
|
| BLAKE2b-256 |
a7fd4bc64167b230861d2b77617f74efc8427ee3bee8de85308df42deeaf7c36
|
File details
Details for the file libvmd-0.0.3-py3-none-any.whl.
File metadata
- Download URL: libvmd-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4135a76df76fea515cf450ac2d45451e1e22dc664e68f0b91cf9a4b45107330
|
|
| MD5 |
060d5219dfc7d96a6c76749e651ce069
|
|
| BLAKE2b-256 |
217e945244e047244b56b305a663620bf0891f92bca7f6e809353035dccdc174
|