Classes and methods for the EMD algorithm