Write resampler in utilities, will move it to sample soon.
Now sample resamples the data buffer if required.
Eliminated bugs in resample func in sampler.