pyeemd Documentation Release Perttu Luukko

Similar documents
USING LINEAR PREDICTION TO MITIGATE END EFFECTS IN EMPIRICAL MODE DECOMPOSITION. Steven Sandoval, Matthew Bredin, and Phillip L.

Empirical Mode Decomposition Based Denoising by Customized Thresholding

Separation of Surface Roughness Profile from Raw Contour based on Empirical Mode Decomposition Shoubin LIU 1, a*, Hui ZHANG 2, b

Empirical Mode Decomposition Analysis using Rational Splines

An Improved Images Watermarking Scheme Using FABEMD Decomposition and DCT

FPGA Implementation of HHT for Feature Extraction of Signals

Adaptive Boundary Effect Processing For Empirical Mode Decomposition Using Template Matching

Equivalent Effect Function and Fast Intrinsic Mode Decomposition

Interpolation artifacts and bidimensional ensemble empirical mode decomposition

Cluster EMD and its Statistical Application

An Enhanced Video Stabilization Based On Emd Filtering And Spectral Analysis

A Scalable, Numerically Stable, High- Performance Tridiagonal Solver for GPUs. Li-Wen Chang, Wen-mei Hwu University of Illinois

Rolling element bearings fault diagnosis based on CEEMD and SVM

Fuzzy C-means with Bi-dimensional Empirical Mode Decomposition for Segmentation of Microarray Image

Audio Watermarking using Colour Image Based on EMD and DCT

A Modified Spline Interpolation Method for Function Reconstruction from Its Zero-Crossings

Ensemble Empirical Mode Decomposition Parameters Optimization for Spectral Distance Measurement in Hyperspectral Remote Sensing Data

Empirical Mode Decomposition: Improvement and Application

Perceptual audio coding schemes based on adaptive signal processing tools

Research Article Fast and Adaptive Bidimensional Empirical Mode Decomposition Using Order-Statistics Filter Based Envelope Estimation

Project Report. 1 Abstract. 2 Algorithms. 2.1 Gaussian elimination without partial pivoting. 2.2 Gaussian elimination with partial pivoting

RF Tutorial. Rhys Hawkins January This document gives a tutorial introduction to using the RF software.

dtcwt Documentation Release 0.3 Rich Wareham, Nick Kingsbury, Cian Shaffrey

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

PyEFD Documentation. Release 1.0. Henrik Blidh

BIDIMENSIONAL EMPIRICAL MODE DECOMPOSITION USING VARIOUS INTERPOLATION TECHNIQUES

Python Advance Course via Astronomy street. Sérgio Sousa (CAUP) ExoEarths Team (

PARALLELIZATION OF THE NELDER-MEAD SIMPLEX ALGORITHM

Audio Watermarking using Empirical Mode Decomposition

pyblock Documentation

prompt Documentation Release Stefan Fischer

TelFit Documentation. Release Kevin Gullikson

Fault Diagnosis of Wind Turbine Based on ELMD and FCM

python-samplerate Documentation

ARTIFICIAL INTELLIGENCE AND PYTHON

Key words: B- Spline filters, filter banks, sub band coding, Pre processing, Image Averaging IJSER

linkgrabber Documentation

Python Working with files. May 4, 2017

Audio encoding based on the empirical mode decomposition

WIME toolbox for Scilab

MPI Casestudy: Parallel Image Processing

LibrarY of Complex ICA Algorithms (LYCIA) Toolbox v1.2. Walk-through

CSC Advanced Scientific Computing, Fall Numpy

Multi-View Image Coding in 3-D Space Based on 3-D Reconstruction

Removal of ECG Baseline Wander using Savitzky-Golay Filter Based Method

Implicit Documentation

1 Strings (Review) CS151: Problem Solving and Programming

RESTORATION OF DEGRADED DOCUMENTS USING IMAGE BINARIZATION TECHNIQUE

Module 1 Lecture Notes 2. Optimization Problem and Model Formulation

Tutorial 2 PHY409 Anadi Canepa Office, TRIUMF MOB 92 B ( )

Interfacing With Other Programming Languages Using Cython

Introduction to Python Practical 1

Perceptual audio coding schemes based on adaptive signal processing tools

CSci 1113, Spring 2017 Lab Exercise 7 (Week 8): Strings

1 2 (3 + x 3) x 2 = 1 3 (3 + x 1 2x 3 ) 1. 3 ( 1 x 2) (3 + x(0) 3 ) = 1 2 (3 + 0) = 3. 2 (3 + x(0) 1 2x (0) ( ) = 1 ( 1 x(0) 2 ) = 1 3 ) = 1 3

Command Line and Python Introduction. Jennifer Helsby, Eric Potash Computation for Public Policy Lecture 2: January 7, 2016

CppSim and Ngspice Data Modules for Python

RTL Reference 1. JVM. 2. Lexical Conventions

Section 2.4 Library of Functions; Piecewise-Defined Functions

spnav Documentation Release 0.9 Stanley Seibert

VLC : Language Reference Manual

Deep Learning for Visual Computing Prof. Debdoot Sheet Department of Electrical Engineering Indian Institute of Technology, Kharagpur

3 An Introductory Demonstration Execute the following command to view a quick introduction to Matlab. >> intro (Use your mouse to position windows on

IJSRD - International Journal for Scientific Research & Development Vol. 5, Issue 05, 2017 ISSN (online):

pvextractor Documentation

NURBS-Python Documentation. Onur Rauf Bingol

Machine Learning Software ROOT/TMVA

IPCoreL. Phillip Duane Douglas, Jr. 11/3/2010

Part VI. Scientific Computing in Python. Alfredo Parra : Scripting with Python Compact Max-PlanckMarch 6-10,

windrose Documentation Lionel Roubeyrie & Sebastien Celles

The character of the instruction scheduling problem

Learning a collaborative multiscale dictionary based on robust empirical mode decomposition

imread Documentation Release 0.6 Luis Pedro Coelho

Xlearn Documentation. Release Argonne National Laboratory

Problem Based Learning 2018

CSci 1113 Lab Exercise 6 (Week 7): Arrays & Strings

Unit 6 - Software Design and Development LESSON 4 DATA TYPES

Archan. Release 2.0.1

Python Scripting for Computational Science

Part III Appendices 165

LECTURE 22. Numerical and Scientific Packages

Course May 18, Advanced Computational Physics. Course Hartmut Ruhl, LMU, Munich. People involved. SP in Python: 3 basic points

SUMMARY INTRODUCTION METHOD. Review of VMD theory

PADDLE Documentation. Release Curzio Basso

Yao WANG Ming J ZUO Yaguo LEI Xianfeng FAN. 1. Introduction

nptdms Documentation Release Adam Reeve

FONT CLASSIFICATION FOR KANNADA LANGUAGE

Flow Field Modulation. Bo Ren, Chen-Feng Li, Ming Lin, Theodore Kim, and Shi-Min Hu. Abstract

Graphical Analysis of Data using Microsoft Excel [2016 Version]

OVERVIEW DISPLAYING NUMBERS IN SCIENTIFIC NOTATION ENTERING NUMBERS IN SCIENTIFIC NOTATION

CSI33 Data Structures

CSci 1113, Fall 2015 Lab Exercise 7 (Week 8): Arrays! Strings! Recursion! Oh my!

Key Differences Between Python and Java

In some applications it may be important that the extrema of the interpolating function are within the extrema of the given data.

Function call overhead benchmarks with MATLAB, Octave, Python, Cython and C

Python Scripting for Computational Science

1 Introduction: Using a Python script to compile and plot data from Fortran modular program for Newton s method

Armide Documentation. Release Kyle Mayes

Tiberius Documentation

Using Excel for Graphical Analysis of Data

Transcription:

pyeemd Documentation Release 1.3.1 Perttu Luukko August 10, 2016

Contents 1 Contents: 3 1.1 Installing pyeemd............................................ 3 1.2 Tutorial.................................................. 3 1.3 API documentation............................................ 5 2 Indices and tables 9 Bibliography 11 Python Module Index 13 Python Module Index 15 i

ii

This is the documentation of pyeemd, which is a Python wrapper for libeemd, a C library for performing the ensemble empirical mode decomposition (EEMD), its complete variant (CEEMDAN) or the regular empirical mode decomposition (EMD). If you have any questions or problems with pyeemd, or you wish to propose enhancements, please check out the main page of libeemd. Also, if you want more detail on the inner workings of libeemd and/or wish to cite it in scientific work, please see the associated article published in Computational Statistics. Contents 1

2 Contents

CHAPTER 1 Contents: 1.1 Installing pyeemd The pyeemd module comes with a regular Python distutils installation script, so installing it should be quite straightforward. The only catch is that you need to first compile libeemd.so, since pyeemd is only a wrapper for that library. Please see the README file distributed with libeemd on more details on how to compile libeemd, but if you are unpatient and already have the necessary dependencies installed (GCC, GSL), you can just run make in the top-level directory of libeemd and you are done. To install pyeemd please run: python2 setup.py install In the top-level directory of pyeemd (the one with setup.py). If you want to specify an alternative installation prefix, you can do it as follows: python2 setup.py install --prefix=$home/usr 1.2 Tutorial After installing pyeemd as described in Installing pyeemd you are all set to using it with: import pyeemd The three main decomposition routines implemented in pyeemd EMD, EEMD and CEEMDAN are available as emd(), eemd() and ceemdan(), respectively. All these methods use similar conventions so interchanging one for another is easy. Input data to these routines can be any kind of Python sequence that numpy can convert to an 1D array of floating point values. The output data will be a 2D numpy array, where each row of the array represents a single intrinsic mode function (IMF). As an example, the examples subfolder of pyeemd contains a file ecg.csv, which contains ECG (electrocardiogram) data from the MIT-BIH Normal Sinus Rhythm Database. The data is in CSV (comma separated value) format, which can be read into Python in many ways, one of which is using numpy.loadtxt() using the appropriate delimiter: from numpy import loadtxt ecg = loadtxt("ecg.csv", delimiter=',') 3

Now we have the data in a numpy array ecg. matplotlib.pyplot. We can quickly plot what the data looks like using Fig. 1.1: Original ECG signal as plotted by matplotlib.pyplot. from matplotlib.pyplot import plot, show, title title("original signal") plot(ecg) show() The data stored in ecg can be decomposed with CEEMDAN using the routine ceemdan(). The only thing we need to decide is what to use as the stopping criterion for the sifting iterations. In this example we use a S-number of 4 and a maximum number of siftings of 50: from pyeemd import ceemdan imfs = ceemdan(ecg, S_number=4, num_siftings=50) Now the rows of the 2D array imfs are the IMFs the original signal decomposes to when applying CEEMDAN. We can plot these IMFs using matplotlib.pyplot as before, but pyeemd also comes with an utility function plot_imfs() for easily plotting the IMFs (using matplotlib.pyplot) in separate figures. from pyeemd.utils import plot_imfs plot_imfs(imfs, plot_splines=false) show() The plot_splines=false argument prevents the plotting of the envelope curves of the IMFs, which would otherwise be shown. This concludes our simple tutorial. For more in-depth information about the methods available in pyeemd please head to the API documentation. You can also look at example code at the examples subdirectory of pyeemd. 4 Chapter 1. Contents:

Fig. 1.2: IMF 7 extracted from ECG data with ceemdan() and plotted with plot_imfs(). How you choose to use or process the IMFs obtained by the decomposition routines is beyond the scope of this document and beyond the scope of pyeemd but you might be interested in the Hilbert transform routine offered by scipy.fftpack.hilbert(). 1.3 API documentation 1.3.1 Main decomposition routines pyeemd.eemd(inp, num_imfs=none, ensemble_size=250, noise_strength=0.2, S_number=None, num_siftings=none, rng_seed=0) Decompose input data array inp to Intrinsic Mode Functions (IMFs) with the Ensemble Empirical Mode Decomposition algorithm [R1]. The size of the ensemble and the relative magnitude of the added noise are given by parameters ensemble_size and noise_strength, respectively. The stopping criterion for the decomposition is given by either a S-number or an absolute number of siftings. In the case that both are positive numbers, the sifting ends when either of the conditions is fulfilled. By default, num_siftings=50 and S_number=4. If only S_number is set to a positive value, num_siftings defaults to 50. If only num_siftings is set to a positive value, S_number defaults to 0. Parameters inp : array_like, shape (N,) The input signal to decompose. Has to be a one-dimensional array-like object. num_imfs : int, optional Number of IMFs to extract. If set to None, a default value given by emd_num_imfs(n) is used. Note that the residual is also counted in this number, so num_imfs=1 will simply give you the input signal plus noise. 1.3. API documentation 5

See also: ensemble_size : int, optional Number of copies of the input signal to use as the ensemble. noise_strength : float, optional Standard deviation of the Gaussian random numbers used as additional noise. This value is relative to the standard deviation of the input signal. S_number : int, optional Use the S-number stopping criterion [R2] for the EMD procedure with the given values of S. That is, iterate until the number of extrema and zero crossings in the signal differ at most by one, and stay the same for S consecutive iterations. Typical values are in the range 3.. 8. If S_number is zero, this stopping criterion is ignored. num_siftings : int, optional Use a maximum number of siftings as a stopping criterion. If num_siftings is zero, this stopping criterion is ignored. rng_seed : int, optional A seed for the random number generator. A value of zero denotes an implementationdefined default value. Returns imfs : ndarray, shape (M, N) A MxN array with M = num_imfs. The rows of the array are the IMFs of the input signal, with the last row being the final residual. emd The regular Empirical Mode Decomposition routine. emd_num_imfs The number of IMFs returned for a given input length N unless a specific number is set by num_imfs. Notes At least one of S_number and num_siftings must be positive. If both are positive, the iteration stops when either of the criteria is fulfilled. References [R1], [R2] pyeemd.emd(inp, num_imfs=none, S_number=None, num_siftings=none) A convenience function for performing EMD (not EEMD). This simply calls function eemd() with ensemble_size=1 and noise_strength=0. pyeemd.ceemdan(inp, num_imfs=none, ensemble_size=250, noise_strength=0.2, S_number=None, num_siftings=none, rng_seed=0) Decompose input data array inp to Intrinsic Mode Functions (IMFs) with the Complete Ensemble Empirical Mode Decomposition with Adaptive Noise (CEEMDAN) algorithm [R3], a variant of EEMD. For description of the input parameters and output, please see documentation of eemd(). See also: eemd The regular Ensemble Empirical Mode Decomposition routine. 6 Chapter 1. Contents:

emd_num_imfs The number of IMFs returned for a given input length. References [R3] 1.3.2 Auxiliary routines pyeemd.emd_num_imfs(n) Return number of IMFs that will be extracted from input data of length N, including the final residual. pyeemd.emd_find_extrema(x) Find the local minima and maxima from input data x. This includes the artificial extrema added to the ends of the data as specified in the original EEMD article [R4]. Parameters x : array_like, shape (N,) The input data. Has to be a one-dimensional array_like object. Returns maxx : ndarray The x-coordinates of the local maxima. maxy : ndarray The y-coordinates of the local maxima. minx : ndarray The x-coordinates of the local minima. miny : ndarray The y-coordinates of the local minima. References [R4] pyeemd.emd_evaluate_spline(x, y) Evaluates a cubic spline with the given (x, y) points as knots. See also: Parameters x : array_like, shape (N,) The x coordinates of the knots. The array must be sorted, start from 0 and end at an integer. y : array_like, shape (N,) The y coordinates of the knots. Returns spline_y : ndarray The cubic spline curve defined by the knots and the not-a-knot end conditions, evaluated at integer points from 0 to max(x). emd_find_extrema A method of finding the extrema for spline fitting. 1.3. API documentation 7

Notes As you can see from the definition, this method is tuned to work only in the case needed by EMD. This method is made available mainly for visualization and unit testing purposes. Better general purpose spline methods exist already in scipy.interpolate. 1.3.3 Utility code: pyeemd.utils Some utility functions for visualizing IMFs produced by the (E)EMD methods. utils.plot_imfs(imfs, new_figs=true, plot_splines=true) Plot utility method for plotting IMFs and their envelope splines with pylab. Parameters imfs : ndarray The IMFs as returned by pyeemd.emd(), pyeemd.eemd(), or pyeemd.ceemdan(). new_figs : bool, optional Whether to plot the IMFs in separate figures. plot_splines : bool, optional Whether to plot the envelope spline curves as well. 8 Chapter 1. Contents:

CHAPTER 2 Indices and tables genindex modindex search 9

10 Chapter 2. Indices and tables

Bibliography [R1] Z. Wu and N. Huang, Ensemble Empirical Mode Decomposition: A Noise-Assisted Data Analysis Method, Advances in Adaptive Data Analysis, Vol. 1 (2009) 1 41 [R2] N. E. Huang, Z. Shen and S. R. Long, A new view of nonlinear water waves: The Hilbert spectrum, Annual Review of Fluid Mechanics, Vol. 31 (1999) 417 457 [R3] M. Torres et al, A Complete Ensemble Empirical Mode Decomposition with Adaptive Noise IEEE Int. Conf. on Acoust., Speech and Signal Proc. ICASSP-11, (2011) 4144 4147 [R4] Z. Wu and N. Huang, Ensemble Empirical Mode Decomposition: A Noise-Assisted Data Analysis Method, Advances in Adaptive Data Analysis, Vol. 1 (2009) 1 41 11

12 Bibliography

Python Module Index u utils, 8 13

14 Python Module Index

Python Module Index u utils, 8 15

16 Python Module Index

Index C ceemdan() (in module pyeemd), 6 E eemd() (in module pyeemd), 5 emd() (in module pyeemd), 6 emd_evaluate_spline() (in module pyeemd), 7 emd_find_extrema() (in module pyeemd), 7 emd_num_imfs() (in module pyeemd), 7 P plot_imfs() (in module utils), 8 U utils (module), 8 17