changed waveform resampling