librtlsdr icon indicating copy to clipboard operation
librtlsdr copied to clipboard

R820t tuner fixes

Open mutability opened this issue 11 years ago • 6 comments

These changes improve the R820T tuner code to calculate the VCO/PLL parameters more precisely. The old code rounded the reference frequency to the nearest kHz and did some slightly dodgy hand-rolled long division.

These changes empirically reduce the tuning error from approx +/- 750Hz to approx +/- 200Hz. This is good enough to also fix some odd behaviour with applying frequency corrections, where for some PPM + frequency combinations, changing PPM by +/-1 would have no effect because the underlying tuner imprecision mapped both frequencies to the same PLL settings.

Tested on a generic RTL2832U with R820T tuner only.

mutability avatar Aug 23 '14 22:08 mutability

Before-and-after graphs for the changes.

This data was generated by a modified version of kalibrate which accepts a manual tuning offset. For a fixed GSM signal you would expect that tuning 1Hz higher would move the measured signal 1Hz lower; anything different is tuner error or oscillator drift. You can see a little oscillator drift in these graphs, but most of it is clearly tuner error.

20140824-tuning

20140824-tuning-error

mutability avatar Aug 23 '14 22:08 mutability

Hey I'm really intrigued by these changes, but like I commented on pull-request #7, it looks like this project doesn't use pull-requests for contributions :(.

RSully avatar Aug 24 '14 22:08 RSully

I already posted to the osmocom list about this - the pull request is just a useful place to collect the changes

mutability avatar Aug 24 '14 23:08 mutability

+1 looks useful

Romeo-Golf avatar Dec 29 '16 00:12 Romeo-Golf

@mutability Can you resend that to mailing list? That is important as hell!

ValZapod avatar Aug 17 '20 09:08 ValZapod

That ship sailed long ago; I have moved on to other projects. If you'd like to use this PR as a starting point for trying to get something merged upstream, that's fine.

mutability avatar Aug 18 '20 04:08 mutability