Better sampling rate implementation. Still needs some scaling to make it
more usable.