diff --git a/decode_ft8.cpp b/decode_ft8.cpp index abd1b1b..259a098 100644 --- a/decode_ft8.cpp +++ b/decode_ft8.cpp @@ -15,8 +15,8 @@ #define LOG_LEVEL LOG_INFO -const int kMax_candidates = 100; -const int kLDPC_iterations = 20; +const int kMax_candidates = 120; +const int kLDPC_iterations = 25; const int kMax_decoded_messages = 50; const int kMax_message_length = 25; @@ -252,7 +252,9 @@ int main(int argc, char **argv) { } char message[kMax_message_length]; - ft8::unpack77(a91, message); + if (ft8::unpack77(a91, message) < 0) { + continue; + } // Check for duplicate messages (TODO: use hashing) bool found = false; diff --git a/ft8/unpack.cpp b/ft8/unpack.cpp index 35eb783..58967a9 100644 --- a/ft8/unpack.cpp +++ b/ft8/unpack.cpp @@ -54,7 +54,8 @@ int unpack28(uint32_t n28, uint8_t ip, uint8_t i3, char *result) { //n22=n28 //call hash22(n22,c13) !Retrieve result from hash table // TODO: implement - return -2; + strcpy(result, "<...>"); + return 0; } // Standard callsign @@ -76,6 +77,7 @@ int unpack28(uint32_t n28, uint8_t ip, uint8_t i3, char *result) { // Skip trailing and leading whitespace in case of a short callsign strcpy(result, trim(callsign)); + if (strlen(result) == 0) return -1; // Check if we should append /R or /P suffix if (ip) { @@ -280,10 +282,8 @@ int unpack_nonstandard(const uint8_t *a77, char *message) } char call_3[15]; - call_3[0] = '<'; - call_3[1] = '>'; - call_3[2] = '\0'; - //hash12(n12, call_3); + // should replace with hash12(n12, call_3); + strcpy(call_3, "<...>"); char * call_1 = (iflip) ? c11 : call_3; char * call_2 = (iflip) ? call_3 : c11; diff --git a/tests/191111_110115.txt b/tests/191111_110115.txt new file mode 100644 index 0000000..db85685 --- /dev/null +++ b/tests/191111_110115.txt @@ -0,0 +1 @@ +110115 6 0.9 1234 ~ GJ0KYZ RK9AX MO05 diff --git a/tests/191111_110115.wav b/tests/191111_110115.wav new file mode 100644 index 0000000..b34b358 Binary files /dev/null and b/tests/191111_110115.wav differ diff --git a/tests/191111_110130.txt b/tests/191111_110130.txt new file mode 100644 index 0000000..98956c2 --- /dev/null +++ b/tests/191111_110130.txt @@ -0,0 +1,5 @@ +110130 -6 0.7 683 ~ CQ TA6CQ KN70 AS Turkey +110130 -16 1.0 989 ~ OH3NIV ZS6S -03 +110130 -6 0.9 1291 ~ CQ R7IW LN35 EU Russia +110130 -4 0.9 2096 ~ CQ DX R6WA LN32 EU Russia +110130 -14 1.2 2479 ~ TK4LS YC1MRF 73 diff --git a/tests/191111_110130.wav b/tests/191111_110130.wav new file mode 100644 index 0000000..5703908 Binary files /dev/null and b/tests/191111_110130.wav differ diff --git a/tests/191111_110145.txt b/tests/191111_110145.txt new file mode 100644 index 0000000..6f2589d --- /dev/null +++ b/tests/191111_110145.txt @@ -0,0 +1,2 @@ +110145 -4 1.0 322 ~ <...> RY8CAA +110145 7 1.0 1234 ~ GJ0KYZ RK9AX MO05 diff --git a/tests/191111_110145.wav b/tests/191111_110145.wav new file mode 100644 index 0000000..5bb0abf Binary files /dev/null and b/tests/191111_110145.wav differ diff --git a/tests/191111_110200.txt b/tests/191111_110200.txt new file mode 100644 index 0000000..8d1684c --- /dev/null +++ b/tests/191111_110200.txt @@ -0,0 +1,5 @@ +110200 -4 0.7 683 ~ CQ TA6CQ KN70 AS Turkey +110200 -16 1.0 990 ~ OH3NIV ZS6S RR73 +110200 -17 0.6 1031 ~ CQ LZ1JZ KN22 Bulgaria +110200 -12 0.9 1292 ~ CQ R7IW LN35 EU Russia +110200 -7 0.9 2097 ~ CQ DX R6WA LN32 EU Russia diff --git a/tests/191111_110200.wav b/tests/191111_110200.wav new file mode 100644 index 0000000..d9149f5 Binary files /dev/null and b/tests/191111_110200.wav differ diff --git a/tests/191111_110215.txt b/tests/191111_110215.txt new file mode 100644 index 0000000..96f0560 --- /dev/null +++ b/tests/191111_110215.txt @@ -0,0 +1,4 @@ +110215 3 1.0 323 ~ <...> RY8CAA R-10 +110215 -12 0.1 996 ~ GJ0KYZ UA6HI -15 +110215 2 0.9 1235 ~ GJ0KYZ RK9AX MO05 +110215 -16 0.9 2059 ~ CQ DX Z33Z KN11 N. Macedonia diff --git a/tests/191111_110215.wav b/tests/191111_110215.wav new file mode 100644 index 0000000..b7d5682 Binary files /dev/null and b/tests/191111_110215.wav differ diff --git a/tests/191111_110615.txt b/tests/191111_110615.txt new file mode 100644 index 0000000..1ffa3a5 --- /dev/null +++ b/tests/191111_110615.txt @@ -0,0 +1,22 @@ +110615 -2 1.0 431 ~ VK4BLE OH8JK R-17 +110615 -14 0.9 539 ~ RK6AH JH1AJT -05 +110615 -18 0.9 656 ~ PA3EPP SP8NFO KN09 +110615 -10 1.8 700 ~ RV6K RU3XL -13 +110615 -16 0.9 756 ~ PA3EPP SP8NFO KN09 +110615 -11 1.3 810 ~ SQ8OHR UA9LL MO27 +110615 15 0.9 906 ~ PA3EPP SP8NFO KN09 +110615 10 0.9 1196 ~ ET3RFG/R IN3ADG -23 +110615 3 0.9 1284 ~ CQ F4FSY JN25 France +110615 -8 0.9 1349 ~ JR5MJS OH8NW 73 +110615 -12 1.0 1404 ~ SV1GN RK6AUV LN05 +110615 -24 0.9 1617 ~ PB5DX EI3CTB IO63 +110615 10 1.5 2191 ~ CQ IZ1ANK JN33 Italy +110615 0 0.9 2281 ~ NT6Q OH8GDU -17 +110615 -7 0.9 2447 ~ CQ DL1UDO JO31 Germany +110615 4 0.8 2576 ~ VK4BLE OH1EDK -20 +110615 8 1.0 2656 ~ CQ JA OH1LWZ KP11 Finland +110615 -11 1.0 297 ~ <...> ON7EE JO10 +110615 -17 0.8 594 ~ CQ DG0OFT JO50 Germany +110615 -16 0.8 1049 ~ CQ UB3AQS KO85 EU Russia +110615 -3 1.0 1201 ~ G1XJM HA7JIV JN97 +110615 -16 1.4 2727 ~ SP7XIF JA2GQT -15 diff --git a/tests/191111_110615.wav b/tests/191111_110615.wav new file mode 100644 index 0000000..09e052c Binary files /dev/null and b/tests/191111_110615.wav differ diff --git a/tests/191111_110630.txt b/tests/191111_110630.txt new file mode 100644 index 0000000..7a955ba --- /dev/null +++ b/tests/191111_110630.txt @@ -0,0 +1,15 @@ +110630 -20 1.1 518 ~ CQ PC2J JO22 +110630 4 1.2 809 ~ UA9LL SQ8OHR -10 +110630 15 -0.5 973 ~ JA2GQT SP7XIF JO91 +110630 -3 0.8 1034 ~ CQ EA3UV JN01 +110630 -5 1.4 1405 ~ RK6AUV SV1GN -18 +110630 -15 1.0 1485 ~ SP8NFO PA3EPP +04 +110630 -6 0.9 1670 ~ CQ PB5DX JO22 +110630 -9 0.9 1722 ~ CQ SM7HZK JO76 +110630 5 0.8 1954 ~ JH1AJT RK6AH R+07 +110630 -2 0.9 2030 ~ JL1TZQ R3BV R-18 +110630 -16 0.9 2110 ~ <...> DF1XG JO53 +110630 19 1.3 2728 ~ CQ DX IK0YVV JN62 +110630 -10 0.9 840 ~ CQ OR18RSX +110630 -24 0.3 1114 ~ CQ JR5MJS PM74 +110630 -21 1.0 1695 ~ JA2GQT F8NHF -10 diff --git a/tests/191111_110630.wav b/tests/191111_110630.wav new file mode 100644 index 0000000..b84cfd9 Binary files /dev/null and b/tests/191111_110630.wav differ diff --git a/tests/191111_110645.txt b/tests/191111_110645.txt new file mode 100644 index 0000000..cddc764 --- /dev/null +++ b/tests/191111_110645.txt @@ -0,0 +1,20 @@ +110645 0 0.9 430 ~ VK4BLE OH8JK R-17 +110645 -18 1.8 699 ~ CQ RU3XL KO84 +110645 -23 0.7 756 ~ PA3EPP SP8NFO R+01 +110645 9 0.7 906 ~ PA3EPP SP8NFO R+01 +110645 -20 0.9 1049 ~ CQ UB3AQS KO85 +110645 10 0.9 1196 ~ ET3RFG/R IN3ADG -23 +110645 -1 0.9 1283 ~ CQ F4FSY JN25 +110645 -16 1.0 1404 ~ SV1GN RK6AUV R-03 +110645 -24 0.9 1617 ~ PB5DX EI3CTB IO63 +110645 -10 1.0 2111 ~ CQ OR18TRA +110645 3 1.5 2191 ~ PC2J IZ1ANK +01 +110645 -4 0.9 2281 ~ CQ OH8GDU KP24 +110645 -10 0.9 2447 ~ CQ DL1UDO JO31 +110645 6 0.7 2576 ~ VK4BLE OH1EDK -20 +110645 5 1.0 2656 ~ CQ JA OH1LWZ KP11 +110645 -21 0.8 594 ~ CQ DG0OFT JO50 +110645 -21 0.7 1114 ~ <...> DA0FONTANE +110645 -6 1.0 1201 ~ G1XJM HA7JIV JN97 +110645 -21 0.9 2092 ~ WB2QJ ES3AT KO18 +110645 -15 1.4 2726 ~ SP7XIF JA2GQT -13 diff --git a/tests/191111_110645.wav b/tests/191111_110645.wav new file mode 100644 index 0000000..8d4d590 Binary files /dev/null and b/tests/191111_110645.wav differ diff --git a/tests/191111_110700.txt b/tests/191111_110700.txt new file mode 100644 index 0000000..c2c9fc5 --- /dev/null +++ b/tests/191111_110700.txt @@ -0,0 +1,16 @@ +110700 -17 1.1 518 ~ IZ1ANK PC2J R+10 +110700 -15 0.9 840 ~ CQ OR18RSX +110700 13 -0.5 973 ~ JA2GQT SP7XIF JO91 +110700 -2 0.8 1034 ~ CQ EA3UV JN01 +110700 -22 0.3 1115 ~ CQ JR5MJS PM74 +110700 -21 0.9 1244 ~ DG0OFT W4FGA EM83 +110700 -8 1.6 1405 ~ RK6AUV SV1GN RR73 +110700 -21 1.0 1485 ~ SP8NFO PA3EPP +04 +110700 -12 0.9 1670 ~ CQ PB5DX JO22 +110700 15 0.9 1726 ~ JH1AJT SP8BJU -04 +110700 4 1.0 1954 ~ JH1AJT RK6AH 73 +110700 -10 0.9 2030 ~ JL1TZQ R3BV R-12 +110700 -15 0.9 2111 ~ <...> IT9AAI JM67 +110700 -6 1.1 2358 ~ LA2GCA F5MXH JN07 +110700 18 1.3 2728 ~ CQ DX IK0YVV JN62 +110700 -24 0.9 1578 ~ CQ M0NPT IO92 diff --git a/tests/191111_110700.wav b/tests/191111_110700.wav new file mode 100644 index 0000000..b0e4004 Binary files /dev/null and b/tests/191111_110700.wav differ diff --git a/tests/websdr_test6.txt b/tests/websdr_test6.txt index 24e3c2b..d937024 100644 --- a/tests/websdr_test6.txt +++ b/tests/websdr_test6.txt @@ -1,30 +1,30 @@ -000000 -9 0.9 272 ~ CQ DL8ALH JN58 Germany -000000 10 0.2 457 ~ CQ HF19NY Poland -000000 -4 0.6 570 ~ 4X5MZ RA6FSD 73 -000000 -8 0.2 696 ~ EA8TH F8DBF R-04 -000000 -7 0.3 859 ~ CQ IK2YCW JN55 Italy -000000 -4 1.9 915 ~ CQ UY5AX KO70 Ukraine -000000 -4 0.2 1012 ~ CQ CU2DX HM77 Azores -000000 -2 0.4 1113 ~ CQ OE3UKW JN88 Austria -000000 6 0.2 1256 ~ CQ DM1YS JO30 Germany -000000 0 -1.4 1316 ~ CQ SP6ZJB JO80 Poland -000000 -21 0.3 1616 ~ SM2EKA UT7IS -06 -000000 -9 0.2 1667 ~ CQ DL7ACN JN49 Germany -000000 5 0.3 1716 ~ SM2EKA UT7IS -06 +000000 -7 0.9 272 ~ CQ DL8ALH JN58 +000000 14 0.2 457 ~ CQ HF19NY +000000 -1 0.6 570 ~ 4X5MZ RA6FSD 73 +000000 -4 0.2 696 ~ EA8TH F8DBF R-04 +000000 -4 0.3 859 ~ CQ IK2YCW JN55 +000000 -2 1.9 915 ~ CQ UY5AX KO70 +000000 -2 0.2 1012 ~ CQ CU2DX HM77 +000000 0 0.4 1113 ~ CQ OE3UKW JN88 +000000 8 0.2 1256 ~ CQ DM1YS JO30 +000000 1 -1.4 1316 ~ CQ SP6ZJB JO80 +000000 -20 0.3 1616 ~ SM2EKA UT7IS -06 +000000 -8 0.2 1667 ~ CQ DL7ACN JN49 +000000 6 0.3 1716 ~ SM2EKA UT7IS -06 000000 -10 0.3 1822 ~ DK5OK DB4BU 73 -000000 -11 0.2 1891 ~ JA6VQA EA8PP R-24 -000000 -1 0.1 1992 ~ CQ OM7ZM JN98 Slovak Rep. -000000 1 0.4 2105 ~ HA1BL EA2AA -09 -000000 -4 0.5 2187 ~ JH1AJT EA1RT -10 -000000 8 -0.1 2244 ~ CQ SQ7MRR JO91 Poland -000000 7 0.2 2324 ~ CQ DK7LE JO54 Germany -000000 -4 0.2 2392 ~ DJ0AH DL6WAB JO41 -000000 1 0.2 2746 ~ CQ ON8GE JO20 Belgium -000000 -19 0.4 348 ~ OM7AZA SV8EUB -11 -000000 -10 0.5 586 ~ CQ DX DO4TP JO31 Germany -000000 -11 0.6 690 ~ CQ UT9LB KN89 Ukraine -000000 -5 0.3 922 ~ CQ E74BYZ JN84 Bosnia-Herzegovina -000000 -6 1.0 968 ~ PE0TS LZ2KV -25 -000000 -14 0.2 1141 ~ CQ DK2TS JO31 Germany +000000 -10 0.2 1891 ~ JA6VQA EA8PP R-24 +000000 0 0.1 1992 ~ CQ OM7ZM JN98 +000000 2 0.4 2105 ~ HA1BL EA2AA -09 +000000 -3 0.5 2187 ~ JH1AJT EA1RT -10 +000000 10 -0.1 2244 ~ CQ SQ7MRR JO91 +000000 9 0.2 2324 ~ CQ DK7LE JO54 +000000 -2 0.2 2392 ~ DJ0AH DL6WAB JO41 +000000 4 0.2 2746 ~ CQ ON8GE JO20 +000000 -18 0.4 348 ~ OM7AZA SV8EUB -11 +000000 -8 0.5 586 ~ CQ DX DO4TP JO31 +000000 -9 0.6 690 ~ CQ UT9LB KN89 +000000 -3 0.3 922 ~ CQ E74BYZ JN84 +000000 -5 1.0 968 ~ PE0TS LZ2KV -25 +000000 -13 0.2 1140 ~ CQ DK2TS JO31 000000 -4 1.7 1715 ~ SM2EKA SV9FBN KM25 000000 -4 0.1 2132 ~ ON4FG UT8UU 73 diff --git a/tests/websdr_test7.txt b/tests/websdr_test7.txt index 7c59c62..7c051e5 100644 --- a/tests/websdr_test7.txt +++ b/tests/websdr_test7.txt @@ -1,27 +1,27 @@ -000000 -16 0.5 350 ~ DM1YS GW1YQM IO82 -000000 2 0.2 457 ~ SO5WD +04 -000000 12 0.2 570 ~ RA6FSD SP2EWQ -07 -000000 -3 -0.1 692 ~ UT9LB RZ3OA KO91 -000000 -7 0.2 787 ~ SB7W DL6CHF JO52 -000000 -9 0.2 968 ~ LZ2KV PE0TS 73 -000000 -5 0.4 1054 ~ CQ DD2XJ JO53 Germany +000000 -18 0.5 350 ~ DM1YS GW1YQM IO82 +000000 0 0.2 457 ~ <...> SO5WD +04 +000000 10 0.2 570 ~ RA6FSD SP2EWQ -07 +000000 -4 -0.1 692 ~ UT9LB RZ3OA KO91 +000000 -8 0.2 787 ~ SB7W DL6CHF JO52 +000000 -10 0.2 968 ~ LZ2KV PE0TS 73 +000000 -6 0.4 1054 ~ CQ DD2XJ JO53 000000 -14 0.5 1108 ~ OM7ZM UN7IT LO80 000000 3 0.2 1172 ~ R2ZBK UA3IBD -15 000000 6 0.2 1397 ~ SV8EUB OM7AZA JN98 -000000 -2 0.2 1494 ~ CQ F5RRS JN36 France +000000 -2 0.2 1494 ~ CQ F5RRS JN36 000000 -1 0.7 1562 ~ CU2DX DO1KHW JO30 -000000 -7 0.2 1624 ~ CQ RA3QUE KO91 EU Russia +000000 -7 0.2 1624 ~ CQ RA3QUE KO91 000000 12 0.2 1801 ~ OZ1KNX OZ5D -03 000000 -2 0.2 1884 ~ CU2DX SP9DLY JO90 -000000 -3 0.2 2133 ~ CQ ON4FG JO20 Belgium -000000 -4 0.3 2183 ~ EA8PP DL5OBC JO52 -000000 0 0.2 2392 ~ DL6WAB DJ0AH +00 +000000 -4 0.2 2133 ~ CQ ON4FG JO20 +000000 -5 0.3 2183 ~ EA8PP DL5OBC JO52 +000000 -1 0.2 2392 ~ DL6WAB DJ0AH +00 000000 -10 0.3 2479 ~ DO8OL S56ECR JN65 -000000 2 0.2 2745 ~ SP2EWQ DL8TG R+07 -000000 -9 0.0 457 ~ PA0PIW +000000 3 0.2 2745 ~ SP2EWQ DL8TG R+07 +000000 -9 0.0 457 ~ <...> PA0PIW 000000 -3 0.0 527 ~ CU2DX SP6DXH -19 -000000 -9 0.4 757 ~ OE3UKW R7IW LN35 -000000 -20 -0.6 940 ~ EA8PP JH0INP PM96 -000000 -6 0.6 1481 ~ CQ DO6AZ JO50 Germany -000000 2 0.2 1765 ~ CQ DL8FBD JO40 Germany +000000 -10 0.4 757 ~ OE3UKW R7IW LN35 +000000 -21 -0.6 940 ~ EA8PP JH0INP PM96 +000000 -6 0.6 1481 ~ CQ DO6AZ JO50 +000000 0 0.2 1765 ~ CQ DL8FBD JO40 000000 -12 0.1 2324 ~ DK7LE DO5HOK JO42 diff --git a/utils/run_tests.py b/utils/run_tests.py index 1298190..a065282 100755 --- a/utils/run_tests.py +++ b/utils/run_tests.py @@ -19,6 +19,7 @@ n_extra = 0 n_missed = 0 n_total = 0 for wav_file, txt_file in zip(wav_files, txt_files): + print(wav_file) result = subprocess.run(['./decode_ft8', wav_file], stdout=subprocess.PIPE) result = result.stdout.decode('utf-8').split('\n') result = [parse(x) for x in result if len(x) > 0] @@ -35,7 +36,8 @@ for wav_file, txt_file in zip(wav_files, txt_files): print(len(result), '/', len(expected)) if len(extra_decodes) > 0: print('Extra decodes: ', list(extra_decodes)) - #print('Missed decodes: ', list(missed_decodes)) + if len(missed_decodes) > 0: + print('Missed decodes: ', list(missed_decodes)) n_total += len(expected) n_extra += len(extra_decodes)