This is a implementation of the MADH Indicator developed by John F. Ehlers.
The MAD indicator takes the difference of two simple moving averages. The length of the shorter moving average is determined by the desired smoothness of the indicator. The longer moving average is the length of the shorter plus the half period of the dominant cycle in the data.
MADH improves upon this by adding the hann windowing technique to help further smooth out the data.