Updated wavgen to use integer math to generate waveforms