Open dragonyzl opened 8 years ago
Any news on this?
I'm seeing similar results (one channel has positive error, another has negative), not sure what to make of it:
kalibrate-hackrf $ src/kal -s EGSM -g 40 -a 1 -l 62 -g 40 -D -v
kal: Scanning for E-GSM-900 base stations.
E-GSM-900:
chan: 22 (939.4MHz + 39.506kHz) power: 479901.14
chan: 23 (939.6MHz + 38.991kHz) power: 552242.73
chan: 124 (959.8MHz - 17.619kHz) power: 462343.58
chan: 975 (925.2MHz - 12.470kHz) power: 456618.47
chan: 978 (925.8MHz + 6.348kHz) power: 253424.74
chan: 993 (928.8MHz + 32.406kHz) power: 788348.75
chan: 995 (929.2MHz - 17.658kHz) power: 853285.56
kalibrate-hackrf $ src/kal -c 995
kal: Calculating clock frequency offset.
Using E-GSM-900 channel 995 (929.2MHz)
average [min, max] (range, stddev)
- 17.188kHz [-17642, -16452] (1190, 414.669037)
overruns: 0
not found: 145
average absolute error: 18.498 ppm
kalibrate-hackrf $ src/kal -c 995
kal: Calculating clock frequency offset.
Using E-GSM-900 channel 995 (929.2MHz)
average [min, max] (range, stddev)
- 17.197kHz [-17650, -16460] (1190, 437.720978)
overruns: 0
not found: 353
average absolute error: 18.507 ppm
kalibrate-hackrf $ src/kal -c 993
kal: Calculating clock frequency offset.
Using E-GSM-900 channel 993 (928.8MHz)
average [min, max] (range, stddev)
+ 32.646kHz [32334, 33467] (1133, 359.282837)
overruns: 0
not found: 157
average absolute error: -35.148 ppm
This is with a HackRF One with firmware 2014.08.1 (stock firmware from the factory, old, will update). Any chance this could be related to https://github.com/scateu/kalibrate-hackrf/issues/2?
Same with firmware 2015.07.2 https://github.com/scateu/kalibrate-hackrf/issues/2#issuecomment-224487715 - but to answer the original question, -33 ppm for one channel and +38 ppm for another doesn't make sense, something's wrong. According to the documentation, "GSM base stations are required to be accurate to within 0.05ppm"
The "not found" count is also suspect, though mine is much higher than @dragonyzl's. For comparison the original documentation shows:
jl@thinkfoo:~/src/kal-v0.4.1$ src/kal -c 145
kal: Calculating clock frequency offset.
Using GSM-850 channel 145 (872.6MHz)
average [min, max] (range, stddev)
- 1Hz [-8, 7] (14, 3.948722)
overruns: 0
not found: 0
+1, I have the same problem.
the same for me, using a rad1o hardware
What I've found using kalibrate-rtl on RTL-SDR sticks that have fairly wide PPM errors is that once the device is warmed up and at a steady temperature, kalibrate can be used to get fine grained PPM error estimation, but you've got to narrow the range of the error first!
If the error is too large, kalibrate guesses the channel number incorrectly, which means it will give the wrong PPM correction.
When trying to determine the PPM error for a new device (non-TCXO) what I usually do is:
Note: I'd guess the device kalibrate was originally written for used oscillator parts that had relatively small PPM errors compared to RTL-SDR or HackRF. I've seen it mentioned by Dominic Spill that the HackRF parts should be a tolerance of around 20 PPM. I'm not sure if that applies to all batches or versions of boards that are HackRF compatible. I see a +23 PPM error on my HackRF. I've seem 70+ on cheap RTL sticks.
I suppose it is possible that there is more information that could be pulled out of a GSM/LTE signal to know the absolute frequency. I'm guessing the correct information that is pulled out of the GSM signal currently is relative to the channel number which is why it can guess the wrong channel.
I'm having the exact same issue of ppm values that seems really out of specs, and widely changing from channel to channel (fw 2018.01.01)
Same observations here, even with TCXO installed. Is there any update on this issue?
I get the same behavior, variations between -35 and +38 Khz:
$ kal -s EGSM -l 40 -g 40
kal: Scanning for E-GSM-900 base stations.
E-GSM-900:
chan: 103 (955.6MHz + 38.232kHz) power: 3171605.17
chan: 104 (955.8MHz + 9.988kHz) power: 2877563.87
chan: 105 (956.0MHz - 15.838kHz) power: 3252816.50
chan: 106 (956.2MHz - 35.671kHz) power: 2097305.42
chan: 117 (958.4MHz + 37.869kHz) power: 3392056.30
chan: 118 (958.6MHz + 26.028kHz) power: 3075027.04
chan: 119 (958.8MHz + 8.156kHz) power: 3345089.27
chan: 120 (959.0MHz - 11.466kHz) power: 3525672.75
chan: 121 (959.2MHz - 34.499kHz) power: 3461628.61
chan: 975 (925.2MHz - 34.221kHz) power: 2161879.70
chan: 990 (928.2MHz - 34.328kHz) power: 3110094.20
chan: 1002 (930.6MHz + 2.362kHz) power: 5228492.68
I found the solution. Current code contains a bug since 2014. Sample rate of SDR is set to 8MHz but all other code is expecting that sample rate is 1MHz: https://github.com/scateu/kalibrate-hackrf/blob/5d907327a490cc6b8ede7862d73c5e7394a5a253/src/usrp_source.cc#L235 https://github.com/scateu/kalibrate-hackrf/blob/5d907327a490cc6b8ede7862d73c5e7394a5a253/src/kal.cc#L117 Right sample rate for SDR is 1MHz. I made my own variant of this utility with this bug fixed, it will be good if someone can test it: https://github.com/iliasam/kalibrate-hackrf
@iliasam Thank you for the solution! And sorry for my lazy maintenance.
However I remember HackRF won't support sample rate lower than 8 MHz. Even if HackRF doesn't complain, some RF behavior may still be not right. In the datasheet of some chip in HackRF (don't remember which) you'll find the lowest sample rate support is 8 MHz.
Sometime you'll be lucky just because that batch of chip has manufacture margin that supports 1 Msps.
Another point is, back in 2013, I found this issue when transmitting a WBFM GNUradio graph to test TX performance of a batch of HackRF we homebrewed. Maybe low sample rate issue won't affect RX performance. So if works well in your case, please let me know, and I'll be honored to merge your patch.
Hope this helps.
Cheerio,
@scateu You are right, that HackRF designers do not recommend to work below 8 MHz: https://hackrf.readthedocs.io/en/latest/sampling_rate.html But as I understand, original kalibrate utility was not designed for such high sample rate.
I tried to use "true" 8 MHz sample rate, but get "local overrun" error. After that I increased
"local overrun" error disappear after that, but signals are still not detected in this case. Maybe some other values in the code must be changed to support bigger sample rate. That is why I keep 1MHz sample rate, as it was in your commit e4014ec90f06b6057887e3e0a3abdcf6c14a342d
just esc :)
Dear Scateu: The result of kal for my hackrf like this:
I am confused about the result. -33.570 ppm and 38.369 ppm? For my dvb-t dongle, the result of kal-sdr is about -36 ppm for all channels.
Can you give some hints about it. Thank you!