separate function for setting rate and oversampling