0
$\begingroup$

so I am fairly new to this SDR and dsp thing, I am working on a project that calculates the ppm and adjusts the offset, now I kinda got the idea of how to calculate the ppm after going through the rtl_test source code, but for that, I need the number of samples in a time frame( as in frequency offset, the sample rate changes a tad bit). Now I am not sure how to approach that, can someone guide me on that? I see there is some rtl_read_async function in c that probably has a parameter that is passed by reference and returns the number of samples received, but I am not sure how to use it as I can't seem to find any documentation.


$\endgroup$
4
  • $\begingroup$ what is "the ppm"? $\endgroup$ – Phil Frost - W8II Mar 22 at 22:24
  • $\begingroup$ and the sample rate is the number of samples per unit time, so why is "the number of samples in a time frame" different? If you want to know how many samples there are in 10 seconds, just multiply the sample rate, in samples per second, by 10, right? $\endgroup$ – Phil Frost - W8II Mar 22 at 22:25
  • $\begingroup$ So basically, when the oscillator of an sdr goes bonkers due to heat, your time*sample_rate does not give you exact number of samples, so, if you go through the source code of rtl_test, it calculates the real_rate of the sdr and calculates the ppm , the equation is ppm=1e6*(real_rate/sample_rate-1) $\endgroup$ – RasenRhino Mar 23 at 7:30
  • 1
    $\begingroup$ "ppm" is a unit, meaning "parts per million". Calculating "the ppm" is like calculating "the centimeters." What you're looking to do is probably "calibrate the sample rate" or "estimate the sample rate error". $\endgroup$ – Phil Frost - W8II Mar 23 at 13:32
2
$\begingroup$

The real number of samples from an RTL-SDR is not available via the USB interface. The RTL2832U chip samples at 28.8 Msps, but then mixes and downsamples the internal samples to lower rate IQ samples at from 240k to about 3 Msps, to allow transport over its slower USB 2.0 bus. The front-end R820T tuner can first downconvert VHF and UHF signal to a low HF IF frequency for sampling. Or HF under 14.4 MHz can be directly sampled by the RTL chip on some models of the device (V3, and clones). Undersampling is possible for higher HF.

Normally the PPM (parts per million frequency calibration offset) is determined by tuning the SDR to a commercial or standards transmitter at a known frequency (WWV, et.al.), or a GPS disciplined oscillator, and zero beating to measure any indicated offset from the known carrier frequency.

$\endgroup$
1
  • $\begingroup$ Yes, you are right , but if you look at rtl_test source code, u will see they calculate the ppm from the real_rate which is the number of samples that the SDR is actually sending after the oscillator goes bonkers. The formula is ppm=1e6(real_rate/(samplerate-1)) $\endgroup$ – RasenRhino Mar 23 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.