Add baud rate error notes

master
Mark Jessop 2025-06-22 18:45:24 +09:30
rodzic d993f60981
commit 6671bd1505
2 zmienionych plików z 89 dodań i 2 usunięć

Wyświetl plik

@ -89,3 +89,84 @@ Currently there are demod chain tests for:
* `wenet_rs232_demod` - Wenet 'traditional' (v1?), 115177 baud, RS232 framing, with complex u8 samples going into fsk_demod
* `wenet_rs232_demod_c16` - Same as above, but feeding complex signed-16-bit samoples into fsk_demod (should give the same results).
## Baud Rate Error
If we compile the `tsrc` [resampling utility](https://github.com/projecthorus/radiosonde_auto_rx/blob/master/utils/tsrc.c) from radiosonde_auto_rx and place that in the working directory, we can also investigate how baud rate error effects the modem. We emulate baud rate error by resampling the test samples before feeding them into the demodulator. The --resample argument to test_demod.py allows this.
The short version of the results below is that at 0.3% baud rate error, the demodulator is barely affected. At 0.4 to 0.5% we start to see some significant degradation in performance. At 0.6% error the demodulator falls over completely.
Some detailed results below:
0.3% baud rate error (resampling 1.003)
```
wenet_sample_fs921416_float_05.0dB.bin, 0, 11.616
wenet_sample_fs921416_float_05.5dB.bin, 0, 11.082
wenet_sample_fs921416_float_06.0dB.bin, 0, 10.958
wenet_sample_fs921416_float_06.5dB.bin, 0, 11.502
wenet_sample_fs921416_float_07.0dB.bin, 0, 11.689
wenet_sample_fs921416_float_07.5dB.bin, 512, 10.945
wenet_sample_fs921416_float_08.0dB.bin, 44288, 12.450
wenet_sample_fs921416_float_08.5dB.bin, 319744, 10.885
wenet_sample_fs921416_float_09.0dB.bin, 498176, 12.270
wenet_sample_fs921416_float_09.5dB.bin, 517888, 11.823
wenet_sample_fs921416_float_10.0dB.bin, 524800, 11.473
wenet_sample_fs921416_float_10.5dB.bin, 527872, 12.089
wenet_sample_fs921416_float_11.0dB.bin, 527616, 10.763
wenet_sample_fs921416_float_11.5dB.bin, 529408, 10.672
wenet_sample_fs921416_float_12.0dB.bin, 528640, 10.982
wenet_sample_fs921416_float_12.5dB.bin, 529920, 10.786
wenet_sample_fs921416_float_13.0dB.bin, 530432, 11.128
wenet_sample_fs921416_float_13.5dB.bin, 530432, 11.618
wenet_sample_fs921416_float_14.0dB.bin, 530688, 13.131
wenet_sample_fs921416_float_14.5dB.bin, 530176, 11.227
```
0.4% baud rate error (resampling 1.004)
```
wenet_sample_fs921416_float_05.0dB.bin, 0, 14.871
wenet_sample_fs921416_float_05.5dB.bin, 0, 12.558
wenet_sample_fs921416_float_06.0dB.bin, 0, 11.828
wenet_sample_fs921416_float_06.5dB.bin, 0, 11.590
wenet_sample_fs921416_float_07.0dB.bin, 0, 11.789
wenet_sample_fs921416_float_07.5dB.bin, 768, 39.762
wenet_sample_fs921416_float_08.0dB.bin, 33024, 11.199
wenet_sample_fs921416_float_08.5dB.bin, 233472, 11.640
wenet_sample_fs921416_float_09.0dB.bin, 383744, 11.952
wenet_sample_fs921416_float_09.5dB.bin, 423424, 11.615
wenet_sample_fs921416_float_10.0dB.bin, 443392, 13.541
wenet_sample_fs921416_float_10.5dB.bin, 464640, 11.773
wenet_sample_fs921416_float_11.0dB.bin, 473600, 14.853
wenet_sample_fs921416_float_11.5dB.bin, 489728, 12.342
wenet_sample_fs921416_float_12.0dB.bin, 492800, 11.302
wenet_sample_fs921416_float_12.5dB.bin, 509184, 14.049
wenet_sample_fs921416_float_13.0dB.bin, 514816, 10.986
wenet_sample_fs921416_float_13.5dB.bin, 516864, 11.716
wenet_sample_fs921416_float_14.0dB.bin, 521216, 11.401
wenet_sample_fs921416_float_14.5dB.bin, 526592, 11.116
```
0.5% baud rate error (resampling 1.005)
```
wenet_sample_fs921416_float_05.0dB.bin, 0, 11.811
wenet_sample_fs921416_float_05.5dB.bin, 0, 12.631
wenet_sample_fs921416_float_06.0dB.bin, 0, 19.314
wenet_sample_fs921416_float_06.5dB.bin, 0, 23.884
wenet_sample_fs921416_float_07.0dB.bin, 0, 17.919
wenet_sample_fs921416_float_07.5dB.bin, 256, 24.970
wenet_sample_fs921416_float_08.0dB.bin, 5120, 13.781
wenet_sample_fs921416_float_08.5dB.bin, 41472, 12.175
wenet_sample_fs921416_float_09.0dB.bin, 70400, 23.371
wenet_sample_fs921416_float_09.5dB.bin, 93952, 14.122
wenet_sample_fs921416_float_10.0dB.bin, 105728, 12.069
wenet_sample_fs921416_float_10.5dB.bin, 116992, 18.710
wenet_sample_fs921416_float_11.0dB.bin, 141056, 13.651
wenet_sample_fs921416_float_11.5dB.bin, 143616, 20.215
wenet_sample_fs921416_float_12.0dB.bin, 169216, 13.285
wenet_sample_fs921416_float_12.5dB.bin, 178944, 13.912
wenet_sample_fs921416_float_13.0dB.bin, 198656, 15.465
wenet_sample_fs921416_float_13.5dB.bin, 219392, 14.138
wenet_sample_fs921416_float_14.0dB.bin, 228864, 22.024
wenet_sample_fs921416_float_14.5dB.bin, 255744, 18.072
```

Wyświetl plik

@ -37,7 +37,7 @@ processing_type = {
},
}
def run_analysis(mode, file_mask=None, shift=0.0, verbose=False, log_output = None, dry_run = False, quick=False, show=False):
def run_analysis(mode, file_mask=None, shift=0.0, resample=1.0, verbose=False, log_output = None, dry_run = False, quick=False, show=False):
_mode = processing_type[mode]
@ -64,6 +64,8 @@ def run_analysis(mode, file_mask=None, shift=0.0, verbose=False, log_output = No
# Calculate the frequency offset to apply, if defined.
_shiftcmd = "| csdr shift_addition_cc %.5f 2>/dev/null" % (shift/96000.0)
_resamplecmd = f"| csdr convert_f_s16 | ./tsrc - - {resample:.5f} -c | csdr convert_s16_f "
if log_output is not None:
_log = open(log_output,'w')
@ -77,6 +79,9 @@ def run_analysis(mode, file_mask=None, shift=0.0, verbose=False, log_output = No
if shift != 0.0:
_cmd += _shiftcmd
if resample != 1.0:
_cmd += _resamplecmd
# Add on the rest of the demodulation and decoding commands.
_cmd += _mode['demod'] + _mode['decode']
@ -126,6 +131,7 @@ if __name__ == "__main__":
parser.add_argument("-v", "--verbose", action='store_true', default=False, help="Show additional debug info.")
parser.add_argument("-d", "--dry-run", action='store_true', default=False, help="Show additional debug info.")
parser.add_argument("--shift", type=float, default=0.0, help="Shift the signal-under test by x Hz. Default is 0.")
parser.add_argument("--resample", type=float, default=1.0, help="Resample. Default is 1 (no resampling).")
parser.add_argument("--batch", action='store_true', default=False, help="Run all tests, write results to results directory.")
parser.add_argument("--quick", action='store_true', default=False, help="Only process the last sample file in the list (usually the strongest). Useful for checking the demodulators are still working.")
parser.add_argument("--show", action='store_true', default=False, help="Show the first few lines of output, instead of running the post-processing step.")
@ -145,4 +151,4 @@ if __name__ == "__main__":
_log_name = "./results/" + _mode + ".txt"
run_analysis(_mode, file_mask=None, shift=args.shift, verbose=args.verbose, log_output=_log_name, dry_run=args.dry_run, quick=args.quick, show=args.show)
else:
run_analysis(args.mode, args.files, shift=args.shift, verbose=args.verbose, dry_run=args.dry_run, quick=args.quick, show=args.show)
run_analysis(args.mode, args.files, shift=args.shift, resample=args.resample, verbose=args.verbose, dry_run=args.dry_run, quick=args.quick, show=args.show)