airspy / airspyone_host

AirSpy's usemode driver and associated tools
http://airspy.com
247 stars 88 forks source link

airspy_rx could use ppm correction option (fixed with new tool airspy_calibrate) #96

Closed zanco closed 8 months ago

zanco commented 8 months ago

Hi, I am running airspy_rx for satellite strf recordings. The airspy_mini is on location, wired to 1545 MHz bandpassfilter. It's observations are 3 kHz higher as the satellites center frequency. I can not run a calibrate tool cause I have no fixed / known signal source inside the bandpassfilter range.

In SDR software I can set + 2 ppm correction which makes the frequency match for my purpose.

However airspy_rx appears to have no option to add a ppm correction. Can this be added ? Thanks.

image

bvernoux commented 8 months ago

For that purpose I have just created a new tool airspy_calibrate to read & display calibration data or erase/write calibration data in ppb (see for example https://www.sitime.com/ppm-hz-calculator) See https://github.com/airspy/airspyone_host/commit/43570b63de90dacd2c5fc6500a538617fdb406ff

Specify either read or write option.
Usage:
        -r: Read and display calibration data.
        -w <calibration in ppb>: Erase and Write calibration in ppb.

I'm waiting for your feedback as I think it is the best solution instead of adding calibration in airspy_rx

zanco commented 8 months ago

Agreed it's a better solution :-) So, with the calculator, I find if 1544.500 shows as 1544.503 MHz, I am 3 kHz or 1.942 ppm off, which is nice shown as 1942 ppb too.

With -r it shows me ppb is set to -862 , so with that value it is 3 kHz off. Do I have to add this value to the calculated value, or do I just -w write the 1942 as new value ?

Do I have to re-pug the airspy after writing the new value ?

Thanks !

bvernoux commented 8 months ago

Agreed it's a better solution :-) So, with the calculator, I find if 1544.500 shows as 1544.503 MHz, I am 3 kHz or 1.942 ppm off, which is nice shown as 1942 ppb too.

With -r it shows me ppb is set to -862 , so with that value it is 3 kHz off. Do I have to add this value to the calculated value, or do I just -w write the 1942 as new value ?

Do I have to re-pug the airspy after writing the new value ?

Thanks !

For your example Actual Frequency 1544.500MHz vs Observed Frequency 1544.503 MHz (thanks to clarify Actual Frequency vs Observed Frequency) Algorithm is: ppb = (actual_freq_MHz - observed_freq_MHz) / actual_freq_MHz)*1e9

The airspy_calibrate tool will erase previous calibration and write the new one with your provided ppb value (+ or - accepted of course)

  1. To be sure of your new correction you shall first erase calibration using 0 ppb with airspy_calibrate -w 0
  2. PowerOff / PowerON AirSpy (as Calibration is read/applied during boot)
  3. Do the measurement with your tool and check the Frequency vs Frequency Expected like you have done then do again the computation (using https://www.sitime.com/ppm-hz-calculator ...) to find ppm & ppb (the important is to use ppb rounded to nearest)
  4. Apply the new ppb computed (example -1942) with airspy_calibrate -w -1942
  5. PowerOff / PowerON AirSpy (as Calibration is read/applied during boot)
  6. Check with your software all is fine now

I'm waiting for your feedback to confirm all is fine

zanco commented 8 months ago

Now running with -w 0 waiting for pass of SAR satellite. We will get there :-)

bvernoux commented 8 months ago

Now running with -w 0 waiting for pass of SAR satellite. We will get there :-)

If you really need something accurate to calibrate your AirSpy (or even to use the GPSDO on 10MHz External Reference Input on Airspy R2) I heavily recommend you to buy a GPSDO like https://www.leobodnar.com "Mini Precision GPS Reference Clock" which is quite cheap for excellent performances.

zanco commented 8 months ago

image

It's spot on now ! Thanks a lot :-)

bvernoux commented 8 months ago

Thanks for all so we can close that issue All details of arispy_calibrate have been added in wiki https://github.com/airspy/airspyone_host/wiki#airspy_calibrate