added resampling and some basic dsp (used in resample)