The minimum-arclength EMD is built to deal with spikes in EMD. The core function is "MA_EMD.m" which applies minimum arclength criterion for the first IMF given the appointed spike positions (maxima and minima are separate input variables).
There are two examples. The first demonstrates the use of MA-EMD on real-life central body temperature (CBT). The other demonstrates the use of MAMA-EMD (masking aided MA-EMD) on a spike-contaminated duffing wave.

This script is written under Matlab R2016a and tested on R2017a.

Code writer: Hui-Wen Yang 2019 @GICE, NTU and LIBSA, NCU
Please cite:
Hui-Wen Yang ; Shyh-Kang Jeng ; Hsu-Wen V. Young ; Chen Lin ; Yung-Hung Wang ; 
Kun Hu ; Men-Tzung Lo. (2019). A Minimum Arclength Method for Removing Spikes 
in Empirical Mode Decomposition. IEEE Access PP(99):1-1 January 2019