HAMNET-Access-Protocol / HNAP4PlutoSDR

Main transceiver application
GNU Lesser General Public License v3.0
29 stars 5 forks source link

Frequency offset estimation does not work when using different UL and DL bands #43

Closed lukasostendorf closed 4 years ago

lukasostendorf commented 4 years ago

Currently, the client estimates the frequency offset in the DL band. The offset estimation value is calculated in Hz and added to the DL carrier frequency in Hz. For the Uplink, the same offset value is added to the Uplink carrier frequency.

cfo_hz = The calculated carrier frequency offset in Hz by using received samples in the DL
// Correct UL and DL LO frequencies by the offset
DL_LO_corrected = DL_LO + cfo_hz
UL_LO_corrected = UL_LO + cfo_hz

This is only valid if the UL and DL carrier frequencies are similar. If the UL and DL are significantly different, e.g. 430 MHz and 1300 MHz, the offset for the 1300 MHz band is 1300/430 times the offset in the 430 MHz band. We have to consider this factor when correcting the UL frequency offset at the client side.

This has to be changed in the inital carrier sync function: https://github.com/HAMNET-Access-Protocol/HNAP4PlutoSDR/blob/8c70b6856facca2182fe565f00e3595148be66c4/src/runtime/client.c#L339

I have to check whether this affects other parts of the code.

DG9BFC commented 4 years ago

for sure you can not fix a too slow or too fast tcxo WITH AN OFFSET that has to be corrected WITH A FACTOR (why do we have "ppm" correction value in all sdr software and not an offset value?!?) for me solution is easy (i use a tuneable tcxo and can set frequency to be spot on) ... but for users with a fixed tcxo the soft has to calculate (and compensate) with a factor calculation and not with add or substract a fixed value in Hz means ... nominal qrg = real qrg x correction factor or xo correction (nominal 40 000 000 Hz) is real qrg divided by nominal qrg x 40 000 000 you see ... divide and multiply ... not adding or substracting (is xo correction used in the code?? if yes then user can tune away the fault with setting correct value in config text)