v1.0, AC sinewave algorithm