Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R820t tuner fixes #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mutability
Copy link
Contributor

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.

…ion,

not at kHz resolution. Also replace the manual divison loop with a
simpler fixed-point calculation.
@mutability
Copy link
Contributor Author

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

@RSully
Copy link

RSully commented Aug 24, 2014

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 :(.

@mutability
Copy link
Contributor Author

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

@Romeo-Golf
Copy link

+1 looks useful

itdaniher added a commit to itdaniher/librtlsdr that referenced this pull request Jan 8, 2019
itdaniher added a commit to itdaniher/librtlsdr that referenced this pull request Jan 8, 2019
itdaniher added a commit to itdaniher/librtlsdr that referenced this pull request Jan 13, 2019
paulyc pushed a commit to paulyc/librtlsdr that referenced this pull request May 31, 2019
Bug Fix for some Broken MinGW PThreads sources
@mutability
Copy link
Contributor Author

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.

hayguen added a commit to librtlsdr/librtlsdr that referenced this pull request Sep 9, 2020
* see #91
* vcocmin/vcocmax: sets VCO current for R820T/2
* added tuner internal caching for VCO current,
 that register isn't written when unnecessary
* added vcoalgo option:
- vcoalgo=2 allows to select/use r82xx_set_pll() from
 https://github.com/rtlsdrblog/rtl-sdr.git
- vcoalgo=1 is previous algorithm, just with higher vco_max=3.9GHz
- vcoalgo=0 is previous algorithm - the default:
 kept this until steve-m#10
 is measured
* rtl_test: added options -f and -e to define where to start and end
 the tuner range test .. for quicker testing if the new options
 change/extend the tuner's frequency range

Signed-off-by: hayati ayguen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants