Adjusted harmonic squarewave gain (HACK)