Skip to main content

A python package for Empirical Mode Decomposition and related spectral analyses.

Please note that this project is in active development for the moment - the API may change relatively quickly between releases!

Installation

You can install the latest stable release from the PyPI repository

pip install emd

or clone and install the source code.

git clone https://gitlab.com/emd-dev/emd.git
cd emd
pip install .

Requirements are specified in requirements.txt. Main functionality only depends on numpy and scipy for computation and matplotlib for visualisation.

Quick Start

Full documentation can be found at https://emd.readthedocs.org and development/issue tracking at gitlab.com/emd-dev/emd

Import emd

import emd

Define a simulated waveform containing a non-linear wave at 5Hz and a sinusoid at 1Hz.

sample_rate = 1000
seconds = 10
num_samples = sample_rate*seconds

import numpy as np
time_vect = np.linspace(0, seconds, num_samples)

freq = 5
nonlinearity_deg = .25  # change extent of deformation from sinusoidal shape [-1 to 1]
nonlinearity_phi = -np.pi/4  # change left-right skew of deformation [-pi to pi]
x = emd.simulate.abreu2010(freq, nonlinearity_deg, nonlinearity_phi, sample_rate, seconds)
x += np.cos(2*np.pi*1*time_vect)

Estimate IMFs

imf = emd.sift.sift(x)

Compute instantaneous frequency, phase and amplitude using the Normalised Hilbert Transform Method.

IP, IF, IA = emd.spectra.frequency_transform(imf, sample_rate, 'hilbert')

Compute Hilbert-Huang spectrum

freq_range = (0, 10, 100)  # 0 to 10Hz in 100 steps
f, hht = emd.spectra.hilberthuang(IF, IA, freq_range, sum_time=False)
Make a summary plot

```python
import matplotlib.pyplot as plt
plt.figure(figsize=(16, 8))
plt.subplot(211, frameon=False)
plt.plot(time_vect, x, 'k')
plt.plot(time_vect, imf[:, 0]-4, 'r')
plt.plot(time_vect, imf[:, 1]-8, 'g')
plt.plot(time_vect, imf[:, 2]-12, 'b')
plt.xlim(time_vect[0], time_vect[-1])
plt.grid(True)
plt.subplot(212)
plt.pcolormesh(time_vect, f, hht, cmap='ocean_r')
plt.ylabel('Frequency (Hz)')
plt.xlabel('Time (secs)')
plt.grid(True)
plt.show()

Metadata

Release files for emd 0.5.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emd 0.5.5
File Size Uploaded
emd-0.5.5.tar.gz 78.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for emd 0.5.5
File Interpreter ABI Platform
emd-0.5.5-py3.7.egg Legacy Egg format - - Details
emd-0.5.5-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 315.5 kB

Release files / emd-0.5.5.tar.gz

Download URL emd-0.5.5.tar.gz
Size 78.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f44a1871c72a0599f6197fef08de61cf3742ce49d134e505852c1a6b24d13966
BLAKE2b-256 checksum
How to use checksums
b2929f720560313869aaa0ded09cf0785597ddeca58800bdb31ed718d4b676d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.26.0 setuptools/59.5.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release files / emd-0.5.5-py3.7.egg

Download URL emd-0.5.5-py3.7.egg
Size 153.5 kB
Tags Egg
SHA-256 checksum
How to use checksums
2ad69908f45f9833262211c0a529ce347a4de2b41aa1a8359ca588b58540a0bc
BLAKE2b-256 checksum
How to use checksums
a1ebcafa3eeedd48ba50db47e235c6381c333242c2db545c352e2b8fcf5855af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.26.0 setuptools/59.5.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release files / emd-0.5.5-py2.py3-none-any.whl

Download URL emd-0.5.5-py2.py3-none-any.whl
Size 83.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2f7ec91e51f5e6e40929e769c14a0a077095ad10d2f6d4f078b10c41388f626f
BLAKE2b-256 checksum
How to use checksums
aab5317804193b67ddb1e6bbb7b945c98ad8e63a4f6cfc40158659285f9ea03d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.26.0 setuptools/59.5.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release history Release notifications | RSS feed

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

3 release files

0.6.0

3 release files

This release

0.5.5 This release

3 release files

0.5.4

1 release file

0.5.3

3 release files

0.5.2

3 release files

0.5.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page