Incorrect samplerate from RTL-SDR
steve at steve-m.de
Sun Jan 5 15:37:06 UTC 2014
On 05.01.2014 15:54, Joris van Rantwijk wrote:
> I noticed the following problem:
> When I configure a sample rate lower than 1 MS/s, I often get a very
> different sample rate then what I ask for. The library reports back the
> same sample rate that I asked (via rtlsdr_get_sample_rate), but the
> actual sample rate does not match at all.
Yes, this is a known hardware limitation.
> It is as if somebody is doing
> rsamp_ratio = (rsamp_ratio & 0x0fffffff) |
> ((rsamp_ratio & 0x08000000) << 1);
> after the configuration is sent out via USB but before it is applied by
> the RTL chip.
Good find, we could use this to calculate the real rate in those cases.
> I have a Terratec Cinergy Tstick RC rev3, USB ID 0ccd:00d3.
> The RTL-SDR library reports:
> Realtek, RTL2838UHIDIR, SN: 00000001
> Using device 0: Terratec Cinergy T Stick RC (Rev.3)
> Found Elonics E4000 tuner
> Does this ring any bells for people who understand the RTL chip?
> Is it caused by the difference between RTL2832 vs RTL2838?
There is no RTL2838 really, it's only used in the USB descriptor of OEM
dongles, don't ask my why... but if you open up your dongle, you'll
find an RTL2832U.
> I have seen other reports on the mailing list, saying that sample rates
> between 300 kS/s and 900 kS/s don't work. If this applies to all RTL
> devices, then maybe it should be documented and the library can return
> an error code for such sample rates. Otherwise people will keep walking
> into this trap.
We could return some sort of error in those cases, but such low rates
(< 1MS/s) aren't recommended in general. First of all, the
anti-aliasing filter we're using has a fixed bandwidth of 2 MHz, and
although the coefficients can be changed, I doubt you can get a nice
filter for lower bandwidths with such a low order. And then the ADCs
only have 8 bits resolution, so you want to improve that by decimating,
and also profit from decimation gain.
Even Realtek uses 2.048 MS/s for FM reception in their original Windows
More information about the osmocom-sdr