CalibrateSDR: Calibrating your SDR Frequency Offset with DAB+

Thanks to Andreas Hornig who has recently released a new program called "CalibrateSDR" (GitHub code) which is designed to accurately determine the frequency offset of an SDR via an IQ recording of a DAB+ station.

Cheaper RTL-SDR and SDRs use a low quality crystal oscillator which usually has a large offset from the ideal frequency. Furthermore, that frequency offset will change as the dongle warms up or as the ambient temperature changes. The end result is that any signals received will not be at the correct frequency, and they will drift as the temperature changes. Higher end SDRs and improved RTL-SDRs like our RTL-SDR Blog V3 use a temperature compensated oscillator (TCXO) which has a very small frequency offset and very little temperature drift.

CalibrateSDR can be used with almost any SDR to determine the frequency offset. Andreas notes that CalibrateSDR uses the synchronization channel symbols from DAB+ digital audio stations to determine the offset. His post contains a great explanation of how this works. If you don't have DAB+ in your area, an alternative is Kalibrate-RTL which uses GSM cellphone signals to calibrate.

His results were as expected, showing that the generic RTL-SDRs have large frequency offsets, and his RTL-SDR Blog V3 and LimeSDR have much better precision.

The null symbol (lower amplitude portion) and phase reference (Orange) in a DAB+ signal

13 comments

  1. Jarda

    Hi, how to run this on windows? How to compile to .exe? I want to test my nooelec nesdr smart. πŸ˜‰ Thanks. Or i can record dab signal.

    • Andreas Hornig

      Hi Jarda,

      you can use it with Python 3.7 on windows, compiling it is noot needed.
      I tried to compile it to an exe, because I wanted to test it with NUITKA, but that did not work yet. I will try to update that for you if you are interested.

      Thanks for testing it. πŸ™‚

      • Jarda

        I got this error.

        Traceback (most recent call last):
        File “cali.py”, line 3, in
        from tqdm import tqdm
        ModuleNotFoundError: No module named ‘tqdm’

        • Jarda

          or next error (i have installed python 3.8 into 3.7 folder).

          Traceback (most recent call last):
          File “cali.py”, line 5, in
          import calibratesdr as cali
          File “C:\Users\qquid\AppData\Local\Programs\Python\Python37\calibratesdr\__init__.py”, line 1, in
          from calibratesdr import utils, dabplus, dvbt, gsm
          File “C:\Users\qquid\AppData\Local\Programs\Python\Python37\calibratesdr\utils.py”, line 5, in
          from rtlsdr.helpers import limit_calls
          File “C:\Users\qquid\AppData\Local\Programs\Python\Python37\lib\site-packages\pyrtlsdr-0.2.92-py3.8.egg\rtlsdr\__init__.py”, line 56, in
          from .librtlsdr import librtlsdr
          File “C:\Users\qquid\AppData\Local\Programs\Python\Python37\lib\site-packages\pyrtlsdr-0.2.92-py3.8.egg\rtlsdr\librtlsdr.py”, line 50, in
          librtlsdr = load_librtlsdr()
          File “C:\Users\qquid\AppData\Local\Programs\Python\Python37\lib\site-packages\pyrtlsdr-0.2.92-py3.8.egg\rtlsdr\librtlsdr.py”, line 45, in load_librtlsdr
          raise ImportError(‘Error loading librtlsdr. Make sure librtlsdr ‘\
          ImportError: Error loading librtlsdr. Make sure librtlsdr (and all of its dependencies) are in your path

          • Jarda

            i reinstalled all completely, and install pytho 3.9 (newest version), your sdr calibrate, rtl sdr, and i ahh windows .dll files from sdrsharp (rtlsdr.dll and libusb1.0.dll) and your sdr calibrate start working.
            I record some examples from our local dab on 12C (czech republic national dab+) and every file show different results in ppm. Some files show none or 0,9… and some show more than 600 and i try dab dx from germany on 5C and 9A (best singlas) and got same as my local transmitter.

  2. willmore

    If you’re in the USA, you can use the network of weather radio stations which have stable center frequencies. They’re narror band FM modulated, so you can either wait for a quiet section of audio or just average over a period of time as the average offset has to be zero.

    • Andreas Hornig

      Hi Willmore,
      Unfortunately I am in Europe. Can you maybe record me such a weather signal and send/upload it to me? Then I will try to implement it to CalibrateSDR. πŸ™‚
      Baseband IQ please. πŸ™‚

      • willmore

        I believe you’re overthinking this. There is nothing special with the modulation of the weather stations. They are narrow band FM transmission with a computer automated voice repeating the weather forecast over and over. There is a network of them across the country using the following frequencies:
        162.400 MHz, 162.425 MHz, 162.450 MHz, 162.475 MHz, 162.500 MHz, 162.525MHz, and 162.550MHz

        I can record a baseband of one of them, but it won’t tell you anything more than I have here. If you need a tester, I’d be glad to try it out.

Leave a Reply to Anonymous Cancel reply

You may use the following HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.