I think you are seeing this because of the "granularity" of the generated wave. If you slowly modify the frequency from one value to another, the amplitude will pulse up and down.
If you change your sampling rate and your number of samples in waveform to 10k, the generated wave will be smoother, and this phenomenon goes away.
Hope this helps!
-Erik