use sampling to make waveform faster and simpler