added MeasureWave algorithm by @mmaroti