Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDPC Integration Testing #1

Merged
merged 5 commits into from
Jun 29, 2020
Merged

LDPC Integration Testing #1

merged 5 commits into from
Jun 29, 2020

Conversation

darksidelemm
Copy link
Member

@darksidelemm darksidelemm commented Jun 28, 2020

This PR documents testing the integration of LDPC encoding/decoding into horus-lib, progressing the development of the new HorusBinary v2 16 and 32-byte modes.

Thanks to hexameron for soft-bit implementations of the de-interleave and de-scrambler, as are required by the LDPC demodulation chain.

Definitions:

  • Mode '0' = Legacy 22-byte mode
  • Mode '1' = 32-byte mode, using H_256_768_22 LDPC code.
  • Mode '2' = 16-byte mode, using H_128_384_23 LDPC code.

Current state of play:

  • Dummy frame generation added to horus_l2 for new modes.
    • Compile using: gcc horus_l2.c golay23.c H_128_384_23.c H_256_768_22.c mpdecode_core.c phi0.c -o horus_l2 -Wall -DGEN_TX_BITSTREAM -DSCRAMBLER -DINTERLEAVER
    • Generate bits using: ./horus_l2
  • Numerous horus_api changes for new 4-byte UW detection.

TODO:

  • Investigate UW threshold. This should be set so that all frames are detected at about 18% raw BER.
  • Move horus packet generation code into horus_gen_test_bits where it should have been in the first place.
  • Write FER test framework.

@darksidelemm
Copy link
Member Author

darksidelemm commented Jun 28, 2020

UW Threshold Tests

  • The LDPC code will ideally correct for 18% raw BER, so we want to be sure the UW detection is letting through all packets at this raw BER.
  • The cohpsk_ch channel sim from codec2 helps add noise to a channel for achieving a particular target BER.

The cohpsk_ch noise N0 value is a bit unintuitive to use, but the following command gives ~19% raw BER for 2FSK:

$ ./fsk_get_test_bits - 10000 | ./fsk_mod 2 48000 100 750 250 - - | ./cohpsk_ch - - -25 --Fs 48000 --ssbfilt 0 | ./fsk_demod 2 48000 100 - - | ./fsk_put_test_bits -t 0.4 -
...
[0183] BER 0.191, bits tested  18300, bit errors 3493

Enabling the mask estimator slightly improves matters:

$ ./fsk_get_test_bits - 10000 | ./fsk_mod 2 48000 100 750 250 - - | ./cohpsk_ch - - -25 --Fs 48000 --ssbfilt 0 | ./fsk_demod --mask 250 2 48000 100 - - | ./fsk_put_test_bits -t 0.4 -
[0176] BER 0.180, bits tested  17600, bit errors 3176

(Question: are the default frame sizes in get/put bits suitable for this?)

So, now let's see how many UWs are detected using the different modems. The default UW threshold is set to (uw_len - 2), which is 12.5% BER for the legacy mode (16-bit UW), but only 6.25% for the new modes.

$ ./horus_l2 1000 2 | ../build/src/fsk_mod 2 48000 100 750 250 - - | ../build/src/cohpsk_ch - - -25 --Fs 48000 --ssbfilt 0 | ../build/src/horus_demod -m 128bit --tonespacing=250 -v - - 2>&1 | grep uw_loc | wc -l
903

903 UWs detected out of 1000 sent, so probably not bad?
(The LDPC decoder only decodes 100 of the 1000 packets at this point, so something isn't quite right with that).

Decreasing the threshold further doesn't give any more detections, so we're probably set about right. Increasing the threshold to (uw_len-1) drops the number of detections to 579, so at least we know the threshold is doing something.

Result: UW threshold is probably OK? Maybe plot this out vs Eb/N0.

@darksidelemm darksidelemm merged commit f263b08 into master Jun 29, 2020
@darksidelemm darksidelemm deleted the ldpc_tests branch July 18, 2020 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants