Skip to content

Commit 05d3423

Browse files
committed
freedv 2020B MPP ctest, and 2020B memory leak ctests
1 parent fdc09de commit 05d3423

File tree

4 files changed

+45
-10
lines changed

4 files changed

+45
-10
lines changed

CMakeLists.txt

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,14 @@ if(LPCNET)
786786
./ch - - --No -24 --mpp --fading_dir ../unittest |
787787
./freedv_rx 2020A - /dev/null --testframes"
788788
)
789+
790+
add_test(NAME test_freedv_api_2020B_mpp
791+
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
792+
dd bs=32000 count=60 if=/dev/zero |
793+
./freedv_tx 2020B - - --testframes --clip 1 |
794+
./ch - - --No -25 --mpp --fading_dir ../unittest |
795+
./freedv_rx 2020B - /dev/null --testframes"
796+
)
789797
endif()
790798

791799
add_test(NAME test_freedv_api_2400A
@@ -967,16 +975,33 @@ if (NOT APPLE)
967975
if(LPCNET)
968976
add_test(NAME test_memory_leak_FreeDV_2020_tx
969977
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
970-
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./freedv_tx 2020 ../../wav/wia_16kHz.wav /dev/null"
978+
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \
979+
./freedv_tx 2020 ../../wav/wia_16kHz.wav /dev/null"
971980
)
972981
set_tests_properties(test_memory_leak_FreeDV_2020_tx PROPERTIES PASS_REGULAR_EXPRESSION "ERROR SUMMARY: 0 errors")
973982

974983
add_test(NAME test_memory_leak_FreeDV_2020_rx
975984
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
976985
./freedv_tx 2020 ../../wav/wia_16kHz.wav t.raw; \
977-
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./freedv_rx 2020 t.raw /dev/null"
986+
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \
987+
./freedv_rx 2020 t.raw /dev/null"
978988
)
979989
set_tests_properties(test_memory_leak_FreeDV_2020_rx PROPERTIES PASS_REGULAR_EXPRESSION "ERROR SUMMARY: 0 errors")
990+
991+
add_test(NAME test_memory_leak_FreeDV_2020B_tx
992+
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
993+
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \
994+
./freedv_tx 2020B ../../wav/wia_16kHz.wav /dev/null"
995+
)
996+
set_tests_properties(test_memory_leak_FreeDV_2020B_tx PROPERTIES PASS_REGULAR_EXPRESSION "ERROR SUMMARY: 0 errors")
997+
998+
add_test(NAME test_memory_leak_FreeDV_2020B_rx
999+
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
1000+
./freedv_tx 2020B ../../wav/wia_16kHz.wav t.raw; \
1001+
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \
1002+
./freedv_rx 2020B t.raw /dev/null"
1003+
)
1004+
set_tests_properties(test_memory_leak_FreeDV_2020B_rx PROPERTIES PASS_REGULAR_EXPRESSION "ERROR SUMMARY: 0 errors")
9801005
endif(LPCNET)
9811006
endif(NOT APPLE)
9821007

README_freedv.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ These are designed for use with a HF SSB radio.
5454

5555
| Mode | Date | Codec | Modem | RF BW | Raw bits/s | FEC | Text bits/s | SNR min | Multipath |
5656
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
57-
| 1600 | 2012 | Codec2 1300 | 14 DQPSK + 1 DBPSK pilot carrier | 1125 | 1600 | Golay (23,12) | 25 | 4 | poor |
58-
| 700C | 2017 | Codec2 700C | 14 carrier coherent QPSK + diversity | 1500 | 1400 | - | - | 2 | good |
59-
| 700D | 2018 | Codec2 700C | 17 carrier coherent OFDM/QPSK | 1000 | 1900 | LDPC (224,112) | 25 | -2 | fair |
60-
| 700E | 2020 | Codec2 700C | 21 carrier coherent OFDM/QPSK | 1500 | 3000 | LDPC (112,56) | 25 | 1 | good |
61-
| 2020 | 2019 | LPCNet 1733 | 31 carrier coherent OFDM/QPSK | 1600 | 3000 | LDPC (504,396) | 22.2 | 2 | poor |
57+
| 1600 | 2012 | Codec2 1300 | 14 DQPSK + 1 DBPSK pilot carrier | 1125 | 1600 | Golay (23,12) | 25 | 4 | poor |
58+
| 700C | 2017 | Codec2 700C | 14 carrier coherent QPSK + diversity | 1500 | 1400 | - | - | 2 | good |
59+
| 700D | 2018 | Codec2 700C | 17 carrier coherent OFDM/QPSK | 1000 | 1900 | LDPC (224,112) | 25 | -2 | fair |
60+
| 700E | 2020 | Codec2 700C | 21 carrier coherent OFDM/QPSK | 1500 | 3000 | LDPC (112,56) | 25 | 1 | good |
61+
| 2020 | 2019 | LPCNet 1733 | 31 carrier coherent OFDM/QPSK | 1600 | 3000 | LDPC (504,396) | 22.2 | 2 | poor |
62+
| 2020A | 2022 | LPCNet 1733 | 31 carrier coherent OFDM/QPSK | 1600 | 3000 | LDPC (504,396) unequal | 22.2 | 2 | fair |
63+
| 2020B | 2022 | LPCNet 1733 | 29 carrier coherent OFDM/QPSK | 2100 | 4100 | LDPC (112,56) unequal | 22.2 | 3 | good |
6264

6365
Notes:
6466

@@ -86,6 +88,8 @@ Notes:
8688

8789
1. FEC was added fairly recently to FreeDV modes. The voice codecs we use work OK at bit error rates of a few %, and packet error rates of 10%. Raw bit error rates on multipath channels often exceed 10%. For reasonable latency (say 40ms) we need small codewords. Thus to be useful we require a FEC code that works at over 10% raw BER, has 1% output (coded) bit error rate, and a codeword of around 100 bits. Digital voice has unusual requirements, most FEC codes are designed for data which is intolerant of any bit errors, and few operate over 10% raw BER. Powerful FEC codes have long block lengths (1000's of bits) which leads to long latency. However LDPC codes come close, and can also "clean up" other channel errors caused by static and interference. The use of OFDM means we now have "room" for the extra bits required for FEC, so there is little cost in adding it, apart from latency.
8890

91+
1. 2020A and 2020B use unequal error protection, only 11 bits from each 52 bit vocoder frame are protected by FEC. This provides strong protection of the most important bits. The effect is a gentle "slope" in the speech quality versus SNR curve. These modes will work at lower SNRs that 2020, but will still have some audible errors even at high SNRs. 2020B has a modem waveform similar to 700E - a high pilot symbol rate so it operates on fast fading channels. Compared to 2020 it has a shorter frame duration (90ms), lower latency and faster sync, but requires a few more dB SNR.
92+
8993
## FreeDV VHF Modes
9094

9195
These modes use constant amplitude modulation like FSK or FM, and are designed for VHF and above. However 800XA can be run over HF or VHF on a SSB radio.
@@ -196,6 +200,11 @@ $ ./src/freedv_tx 700D ../raw/ve9qrp.raw - --clip 0 --testframes | ./src/ch - -
196200

197201
Adjust `--clip [0|1]` and `No` argument of `ch` to obtain a PER of just less than 0.1, and note the SNR and PAPR reported by `ch`. The use of the `ve9qrp` samples makes the test run for a few minutes, in order to get reasonable multipath channel results.
198202

203+
Low SNR MPP channel 2020B command line:
204+
```
205+
cat ~/LPCNet/wav/all.wav | ~/LPCNet/build_linux/src/lpcnet_enc -x | ./src/ofdm_mod --mode 2020B --ldpc --clip --txbpf | ./src/ch - - --No -22 --mpd | ./src/ofdm_demod --mode 2020B --verbose 1 --ldpc | ~/LPCNet/build_linux/src/lpcnet_dec -x | aplay -f S16_LE -r 16000
206+
```
207+
199208
## Reading Further
200209

201210
1. [FreeDV web site](http://freedv.org)

src/freedv_2020.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void freedv_2020x_open(struct freedv *f, int vq_type) {
8484
f->ofdm_nuwbits = f->ofdm->config.nuwbits;
8585
f->ofdm_ntxtbits = f->ofdm->config.txtbits;
8686
assert(f->ofdm_ntxtbits == 4);
87-
f->verbose=1;
87+
8888
if (f->verbose) {
8989
fprintf(stderr, "f->mode = %d\n", f->mode);
9090
fprintf(stderr, "vq_type = %d\n", vq_type);

src/freedv_rx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,9 @@ int main(int argc, char *argv[]) {
308308
float uncoded_ber = (float)Terrs/Tbits;
309309
fprintf(stderr, "BER......: %5.4f Tbits: %8d Terrs: %8d\n",
310310
(double)uncoded_ber, Tbits, Terrs);
311-
if ((mode == FREEDV_MODE_700D) || (mode == FREEDV_MODE_700E) ||
312-
(mode == FREEDV_MODE_2020) || (mode == FREEDV_MODE_2020A)) {
311+
if ((mode == FREEDV_MODE_700D) || (mode == FREEDV_MODE_700E) ||
312+
(mode == FREEDV_MODE_2020) || (mode == FREEDV_MODE_2020A) ||
313+
(mode == FREEDV_MODE_2020B) ) {
313314
int Tbits_coded = freedv_get_total_bits_coded(freedv);
314315
int Terrs_coded = freedv_get_total_bit_errors_coded(freedv);
315316
float coded_ber = (float)Terrs_coded/Tbits_coded;

0 commit comments

Comments
 (0)