build_linux/src$ ./ofdm_get_test_bits - 10 | ./ofdm_mod - - | play -t raw -r 8000 -s -2 -
-2. Generate 10 seconds of test frame bits, modulate, demodulate, count errors:
+2. Generate 10 seconds of uncoded test frame bits, modulate, demodulate, count errors:
- build_linux/src$ ./ofdm_get_test_bits - 10 | ./ofdm_mod - - | ./ofdm_demod -t - /dev/null
+ build_linux/src$ ./ofdm_get_test_bits - 10 | ./ofdm_mod - - | ./ofdm_demod - /dev/null -t
(TODO write ofdm_demod_c.m)
Use Octave to look at plots of C modem operation:
octave:6> ofdm_ldpc_tx('ofdm_test.raw',4,60,3)
octave:7> ofdm_ldpc_rx('ofdm_test.raw',4)
- C demodulator/LDCP decoder:
+ C demodulator/LDPC decoder:
build_linux/src$ ./ofdm_demod ../../octave/ofdm_test.raw /dev/null -v -t --ldpc --interleave 4
Acceptance Tests
----------------
-The rate 1/2 LPDC code can correct up to about 10% raw BER, so a good
+The rate 1/2 LDPC code can correct up to about 10% raw BER, so a good
test is to run the modem at Eb/No operating points that produce just
less that BER=0.1
1
};
+static const int tx_uw[] = {1,0,0,1,0,1,0,0,1,0};
+
/* Functions */
/* Gray coded QPSK modulation function */
ofdm->foff_running = 0.0 + I*0.0;
/* sync state machine */
-
+
+ for(i=0; i<OFDM_NUWBITS; i++) {
+ ofdm->tx_uw[i] = tx_uw[i];
+ }
strcpy(ofdm->sync_state,"search");
strcpy(ofdm->last_sync_state,"search");
ofdm->uw_errors = 0;
we use a Unique Word to get a really solid indication of sync. */
ofdm->uw_errors = 0;
- int tx_uw[] = {1,0,0,1,0,1,0,0,1,0};
for (i=0; i<OFDM_NUWBITS; i++) {
- ofdm->uw_errors += tx_uw[i] ^ rx_uw[i];
+ ofdm->uw_errors += ofdm->tx_uw[i] ^ rx_uw[i];
}
/* during trial sync we don't tolerate errors so much, we look
if (argc < 3) {
fprintf(stderr, "\n");
- printf("usage: %s InputModemRawFile OutputFile [-o OctaveLogFile] [--llr] [-v VerboseLevel]\n", argv[0]);
+ printf("usage: %s InputModemRawFile OutputFile [-o OctaveLogFile] [--llr] [--ldpc] [--interleave depth] [-v]\n", argv[0]);
fprintf(stderr, "\n");
- fprintf(stderr, " Default output file format is one byte per bit hard decision\n");
- fprintf(stderr, " --llr LLR output, one double per bit, %d doubles/frame\n", CODED_BITSPERFRAME);
- fprintf(stderr, " -t Receive test frames and count errors\n");
- fprintf(stderr, " --ldpc Run (224,112) LDPC decoder. This forces 112, one char/bit output values\n"
- " per frame. In testframe mode (-t) raw and coded errors will be counted\n");
- fprintf(stderr, " -v Verbose info the stderr\n");
- fprintf(stderr, " -o Octave log file for testing\n");
+ fprintf(stderr, " Default output file format is one byte per bit hard decision\n");
+ fprintf(stderr, " --llr LLR output, one double per bit, %d doubles/frame\n", CODED_BITSPERFRAME);
+ fprintf(stderr, " -t Receive test frames and count errors\n");
+ fprintf(stderr, " --ldpc Run (224,112) LDPC decoder. This forces 112, one char/bit output values\n"
+ " per frame. In testframe mode (-t) raw and coded errors will be counted\n");
+ fprintf(stderr, " --interleave Interleaver for LDPC frames, e.g. 1,2,4,8,16, default is 1\n");
+ fprintf(stderr, " -v Verbose info the stderr\n");
+ fprintf(stderr, " -o Octave log file for testing\n");
fprintf(stderr, "\n");
exit(1);
}
\*---------------------------------------------------------------------------*/
-
/*
Copyright (C) 2018 David Rowe
/* modem sync state machine */
+ int tx_uw[OFDM_NUWBITS];
char sync_state[OFDM_STATE_STR];
char last_sync_state[OFDM_STATE_STR];
int uw_errors;
/* Generated by test_bits_ofdm_file() Octave function */
const int test_bits_ofdm[]={
+ 1,
0,
0,
+ 1,
0,
+ 1,
0,
0,
- 0,
- 0,
- 0,
- 0,
+ 1,
0,
0,
0,