Automatic sampling rate selection