add frequency argument to pulse and wave

This fixes #222.