added sample rate computation