Sine wave generator ripped from CAPS.