Generic resampler