Implement sawtooth waves.