Skip to main content

Empirical Mode Decomposition

Project description

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!


You can install the latest stable release from the PyPI repository

pip install emd

or clone and install the source code.

git clone
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 and development/issue tracking at

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.utils.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_stats( imf, sample_rate, 'nht' )

Compute Hilbert-Huang spectrum

freq_edges,freq_bins = emd.spectra.define_hist_bins(0,10,100)
hht = emd.spectra.hilberthuang( IF, IA, freq_edges )

Make a summary plot

import matplotlib.pyplot as plt
plt.figure( figsize=(16,8) )
plt.xlim(time_vect[0], time_vect[-1])
plt.pcolormesh( time_vect, freq_bins, hht, cmap='ocean_r' )
plt.ylabel('Frequency (Hz)')
plt.xlabel('Time (secs)')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emd-0.3.1.tar.gz (31.2 kB view hashes)

Uploaded Source

Built Distribution

emd-0.3.1-py2.py3-none-any.whl (45.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page