From 01a380084db49b30250bcf3be8ceed86fdb2118b Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Wed, 30 May 2018 10:24:59 -0500 Subject: [PATCH] Changes to make it easier to test different codes. --- lib/fsk4hf/bpdecode174_91.f90 | 284 +------------------------ lib/fsk4hf/encode174_91.f90 | 6 +- lib/fsk4hf/ldpc_174_91_a_colorder.f90 | 11 + lib/fsk4hf/ldpc_174_91_a_generator.f90 | 87 ++++++++ lib/fsk4hf/ldpc_174_91_a_parity.f90 | 269 +++++++++++++++++++++++ lib/fsk4hf/ldpcsim174_91.f90 | 29 +-- lib/fsk4hf/osd174_91.f90 | 8 +- lib/ft8/ldpcsim174.f90 | 5 +- 8 files changed, 391 insertions(+), 308 deletions(-) create mode 100644 lib/fsk4hf/ldpc_174_91_a_colorder.f90 create mode 100644 lib/fsk4hf/ldpc_174_91_a_generator.f90 create mode 100644 lib/fsk4hf/ldpc_174_91_a_parity.f90 diff --git a/lib/fsk4hf/bpdecode174_91.f90 b/lib/fsk4hf/bpdecode174_91.f90 index 01f5fbe49..16fac52a3 100644 --- a/lib/fsk4hf/bpdecode174_91.f90 +++ b/lib/fsk4hf/bpdecode174_91.f90 @@ -15,288 +15,10 @@ real tanhtoc(7,M) real zn(N) real llr(N) real Tmn -integer nrw(M) +integer nrw(M),ncw -data colorder/ & - 0, 1, 2, 3, 28, 4, 5, 6, 7, 8, 9, 10, 11, 34, 12, 32, 13, 14, 15, 16,& - 17, 18, 36, 29, 40, 19, 20, 38, 21, 41, 30, 42, 22, 44, 37, 47, 48, 23, 33, 43,& - 49, 45, 56, 39, 25, 26, 46, 50, 51, 52, 24, 57, 58, 61, 31, 54, 64, 35, 27, 62,& - 59, 53, 60, 63, 55, 70, 66, 67, 68, 65, 71, 74, 72, 73, 77, 75, 69, 76, 79, 82,& - 83, 78, 81, 80, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,& - 100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,& - 120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,& - 140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,& - 160,161,162,163,164,165,166,167,168,169,170,171,172,173/ - -data Mn/ & - 1, 24, 66, & - 2, 5, 70, & - 3, 31, 65, & - 4, 49, 58, & - 6, 60, 67, & - 7, 32, 75, & - 8, 48, 82, & - 9, 35, 41, & - 10, 39, 62, & - 11, 14, 61, & - 12, 71, 74, & - 13, 23, 78, & - 15, 16, 79, & - 17, 54, 63, & - 18, 50, 57, & - 19, 30, 47, & - 20, 64, 80, & - 21, 28, 69, & - 22, 25, 43, & - 26, 34, 72, & - 27, 36, 37, & - 29, 40, 44, & - 33, 52, 53, & - 38, 55, 83, & - 42, 51, 59, & - 45, 76, 81, & - 46, 68, 77, & - 56, 67, 73, & - 1, 4, 5, & - 2, 47, 51, & - 3, 46, 82, & - 6, 24, 76, & - 7, 9, 16, & - 8, 10, 78, & - 11, 35, 55, & - 12, 38, 64, & - 13, 42, 83, & - 14, 27, 54, & - 15, 21, 34, & - 17, 44, 53, & - 18, 25, 28, & - 19, 33, 57, & - 20, 22, 73, & - 23, 40, 81, & - 26, 49, 68, & - 29, 71, 75, & - 30, 65, 79, & - 31, 36, 60, & - 32, 43, 77, & - 37, 62, 70, & - 39, 69, 74, & - 41, 52, 66, & - 45, 50, 61, & - 48, 63, 80, & - 56, 59, 72, & - 58, 64, 65, & - 1, 13, 28, & - 2, 48, 75, & - 3, 53, 69, & - 4, 11, 44, & - 5, 73, 79, & - 6, 12, 17, & - 7, 57, 60, & - 8, 15, 61, & - 9, 39, 59, & - 10, 19, 49, & - 14, 43, 52, & - 16, 54, 68, & - 18, 41, 63, & - 20, 36, 45, & - 21, 67, 77, & - 10, 22, 55, & - 23, 65, 72, & - 24, 27, 82, & - 25, 26, 29, & - 30, 35, 37, & - 31, 51, 66, & - 17, 32, 78, & - 33, 42, 76, & - 34, 70, 83, & - 38, 46, 81, & - 40, 62, 80, & - 45, 47, 74, & - 50, 56, 71, & - 7, 37, 58, & - 1, 16, 71, & - 2, 6, 61, & - 3, 22, 50, & - 4, 59, 77, & - 5, 41, 81, & - 8, 58, 74, & - 9, 20, 26, & - 11, 21, 31, & - 12, 66, 79, & - 13, 14, 57, & - 15, 33, 40, & - 18, 44, 82, & - 19, 69, 83, & - 23, 49, 63, & - 24, 29, 39, & - 25, 47, 56, & - 27, 55, 72, & - 28, 64, 70, & - 30, 48, 77, & - 32, 34, 45, & - 35, 68, 80, & - 36, 38, 52, & - 42, 43, 62, & - 46, 60, 78, & - 51, 54, 67, & - 53, 73, 75, & - 14, 73, 76, & - 1, 22, 30, & - 2, 35, 43, & - 3, 47, 63, & - 4, 25, 76, & - 5, 33, 78, & - 6, 20, 83, & - 7, 12, 72, & - 8, 54, 70, & - 9, 61, 65, & - 10, 34, 51, & - 11, 46, 75, & - 13, 39, 68, & - 15, 17, 56, & - 16, 23, 36, & - 18, 32, 55, & - 19, 31, 81, & - 21, 37, 71, & - 24, 57, 64, & - 26, 38, 48, & - 27, 49, 50, & - 28, 52, 59, & - 29, 41, 58, & - 40, 60, 74, & - 42, 44, 79, & - 51, 53, 80, & - 62, 67, 82, & - 23, 66, 69, & - 1, 53, 61, & - 2, 18, 39, & - 3, 4, 12, & - 5, 26, 74, & - 6, 30, 52, & - 7, 82, 83, & - 8, 35, 73, & - 9, 19, 67, & - 10, 64, 75, & - 11, 20, 33, & - 13, 45, 48, & - 3, 14, 40, & - 15, 43, 49, & - 16, 55, 76, & - 17, 62, 65, & - 21, 47, 78, & - 22, 59, 81, & - 24, 34, 63, & - 25, 37, 66, & - 27, 79, 80, & - 28, 60, 79, & - 29, 31, 70, & - 32, 58, 69, & - 10, 36, 77, & - 38, 50, 51, & - 13, 41, 56, & - 42, 63, 71, & - 44, 47, 68, & - 1, 46, 72, & - 54, 57, 75, & - 2, 33, 58, & - 4, 17, 83, & - 5, 14, 55, & - 6, 23, 48, & - 7, 52, 56/ - -data Nm/ & - 1, 29, 57, 86, 113, 140, 168, & - 2, 30, 58, 87, 114, 141, 170, & - 3, 31, 59, 88, 115, 142, 151, & - 4, 29, 60, 89, 116, 142, 171, & - 2, 29, 61, 90, 117, 143, 172, & - 5, 32, 62, 87, 118, 144, 173, & - 6, 33, 63, 85, 119, 145, 174, & - 7, 34, 64, 91, 120, 146, 0, & - 8, 33, 65, 92, 121, 147, 0, & - 9, 34, 66, 72, 122, 148, 163, & - 10, 35, 60, 93, 123, 149, 0, & - 11, 36, 62, 94, 119, 142, 0, & - 12, 37, 57, 95, 124, 150, 165, & - 10, 38, 67, 95, 112, 151, 172, & - 13, 39, 64, 96, 125, 152, 0, & - 13, 33, 68, 86, 126, 153, 0, & - 14, 40, 62, 78, 125, 154, 171, & - 15, 41, 69, 97, 127, 141, 0, & - 16, 42, 66, 98, 128, 147, 0, & - 17, 43, 70, 92, 118, 149, 0, & - 18, 39, 71, 93, 129, 155, 0, & - 19, 43, 72, 88, 113, 156, 0, & - 12, 44, 73, 99, 126, 139, 173, & - 1, 32, 74, 100, 130, 157, 0, & - 19, 41, 75, 101, 116, 158, 0, & - 20, 45, 75, 92, 131, 143, 0, & - 21, 38, 74, 102, 132, 159, 0, & - 18, 41, 57, 103, 133, 160, 0, & - 22, 46, 75, 100, 134, 161, 0, & - 16, 47, 76, 104, 113, 144, 0, & - 3, 48, 77, 93, 128, 161, 0, & - 6, 49, 78, 105, 127, 162, 0, & - 23, 42, 79, 96, 117, 149, 170, & - 20, 39, 80, 105, 122, 157, 0, & - 8, 35, 76, 106, 114, 146, 0, & - 21, 48, 70, 107, 126, 163, 0, & - 21, 50, 76, 85, 129, 158, 0, & - 24, 36, 81, 107, 131, 164, 0, & - 9, 51, 65, 100, 124, 141, 0, & - 22, 44, 82, 96, 135, 151, 0, & - 8, 52, 69, 90, 134, 165, 0, & - 25, 37, 79, 108, 136, 166, 0, & - 19, 49, 67, 108, 114, 152, 0, & - 22, 40, 60, 97, 136, 167, 0, & - 26, 53, 70, 83, 105, 150, 0, & - 27, 31, 81, 109, 123, 168, 0, & - 16, 30, 83, 101, 115, 155, 167, & - 7, 54, 58, 104, 131, 150, 173, & - 4, 45, 66, 99, 132, 152, 0, & - 15, 53, 84, 88, 132, 164, 0, & - 25, 30, 77, 110, 122, 137, 164, & - 23, 52, 67, 107, 133, 144, 174, & - 23, 40, 59, 111, 137, 140, 0, & - 14, 38, 68, 110, 120, 169, 0, & - 24, 35, 72, 102, 127, 153, 172, & - 28, 55, 84, 101, 125, 165, 174, & - 15, 42, 63, 95, 130, 169, 0, & - 4, 56, 85, 91, 134, 162, 170, & - 25, 55, 65, 89, 133, 156, 0, & - 5, 48, 63, 109, 135, 160, 0, & - 10, 53, 64, 87, 121, 140, 0, & - 9, 50, 82, 108, 138, 154, 0, & - 14, 54, 69, 99, 115, 157, 166, & - 17, 36, 56, 103, 130, 148, 0, & - 3, 47, 56, 73, 121, 154, 0, & - 1, 52, 77, 94, 139, 158, 0, & - 5, 28, 71, 110, 138, 147, 0, & - 27, 45, 68, 106, 124, 167, 0, & - 18, 51, 59, 98, 139, 162, 0, & - 2, 50, 80, 103, 120, 161, 0, & - 11, 46, 84, 86, 129, 166, 0, & - 20, 55, 73, 102, 119, 168, 0, & - 28, 43, 61, 111, 112, 146, 0, & - 11, 51, 83, 91, 135, 143, 0, & - 6, 46, 58, 111, 123, 148, 169, & - 26, 32, 79, 112, 116, 153, 0, & - 27, 49, 71, 89, 104, 163, 0, & - 12, 34, 78, 109, 117, 155, 0, & - 13, 47, 61, 94, 136, 159, 160, & - 17, 54, 82, 106, 137, 159, 0, & - 26, 44, 81, 90, 128, 156, 0, & - 7, 31, 74, 97, 138, 145, 0, & - 24, 37, 80, 98, 118, 145, 171/ - -data nrw/ & - 7,7,7,7,7,7,7,6,6,7,6,6,7,7,6,6,7,6, & - 6,6,6,6,7,6,6,6,6,6,6,6,6,6,7,6,6,6, & - 6,6,6,6,6,6,6,6,6,6,7,7,6,6,7,7,6,6, & - 7,7,6,7,6,6,6,6,7,6,6,6,6,6,6,6,6,6, & - 6,6,7,6,6,6,7,6,6,6,7/ - -ncw=3 +include "ldpc_174_91_a_colorder.f90" +include "ldpc_174_91_a_parity.f90" decoded=0 toc=0 diff --git a/lib/fsk4hf/encode174_91.f90 b/lib/fsk4hf/encode174_91.f90 index afe193fa5..8003afb08 100644 --- a/lib/fsk4hf/encode174_91.f90 +++ b/lib/fsk4hf/encode174_91.f90 @@ -4,16 +4,18 @@ subroutine encode174_91(message,codeword) ! The code is a (174,91) regular ldpc code with column weight 3. ! -include "ldpc_174_91_a_params.f90" +integer, parameter:: N=174, K=91, M=N-K integer*1 codeword(N) integer*1 gen(M,K) integer*1 itmp(N) integer*1 message(K) integer*1 pchecks(M) +integer colorder(N) +include "ldpc_174_91_a_generator.f90" +include "ldpc_174_91_a_colorder.f90" logical first data first/.true./ - save first,gen if( first ) then ! fill the generator matrix diff --git a/lib/fsk4hf/ldpc_174_91_a_colorder.f90 b/lib/fsk4hf/ldpc_174_91_a_colorder.f90 new file mode 100644 index 000000000..65a2314fb --- /dev/null +++ b/lib/fsk4hf/ldpc_174_91_a_colorder.f90 @@ -0,0 +1,11 @@ +data colorder/ & + 0, 1, 2, 3, 28, 4, 5, 6, 7, 8, 9, 10, 11, 34, 12, 32, 13, 14, 15, 16,& + 17, 18, 36, 29, 40, 19, 20, 38, 21, 41, 30, 42, 22, 44, 37, 47, 48, 23, 33, 43,& + 49, 45, 56, 39, 25, 26, 46, 50, 51, 52, 24, 57, 58, 61, 31, 54, 64, 35, 27, 62,& + 59, 53, 60, 63, 55, 70, 66, 67, 68, 65, 71, 74, 72, 73, 77, 75, 69, 76, 79, 82,& + 83, 78, 81, 80, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,& + 100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,& + 120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,& + 140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,& + 160,161,162,163,164,165,166,167,168,169,170,171,172,173/ + diff --git a/lib/fsk4hf/ldpc_174_91_a_generator.f90 b/lib/fsk4hf/ldpc_174_91_a_generator.f90 new file mode 100644 index 000000000..889826abe --- /dev/null +++ b/lib/fsk4hf/ldpc_174_91_a_generator.f90 @@ -0,0 +1,87 @@ +character*23 g(83) + +data g/ & + "2a6a9ab98f661b797baa21a", & + "5fda604488977fdc30ff630", & + "8a450007032409e8797b13a", & + "0f7923bfa5d559590ef6efe", & + "44dc14bc4461e645f847c78", & + "f8c66224febd3e60f5e3708", & + "6d60329e83fb0e1b1bdac2e", & + "66435a472a7837a0e5d4e12", & + "9d0feced8745a66e328c310", & + "1791b0e7c5eaa43710c4276", & + "e5cbd2d5b4d65d3a432d97e", & + "c2241f8795e0e5bc6bd9052", & + "222d861201a4697c2689576", & + "aa2ee5d6d462e206f59cbe8", & + "e486eb73894e6a0964d8c40", & + "4099d5b42d36301cff6dbd6", & + "40c50b9341f7b5ea08dabde", & + "c90359074895363d428f072", & + "ca819cb6569fbfe26b68ef8", & + "4d983341fb56b8e1dae3450", & + "2dce341bc8fd0e5de04fa52", & + "3e7b01b376e3e5f6080de0e", & + "6c8b0813ca2394c08564f94", & + "c322ca8ea866784adc9451a", & + "6378aa1a03fab3e163aa4b0", & + "3c92ea8df0003883a021d70", & + "c793729067176eca26b83c2", & + "d3fae76046a36dff711207a", & + "bc9bf3ef57137fda1c325da", & + "a4eabe2df65a083ea6387c8", & + "650e3da3a0c0349154131d8", & + "1fb4c59ffc11c648ad06760", & + "1471f9599543f13fd7eb6ae", & + "6111012405186e84cba67ce", & + "c4da3574edafefff976fc08", & + "953f854e40701063115c0f2", & + "1f7ae6982f9a5733c44fb70", & + "83e101fe5e80c1b8541728e", & + "50375654edd53054f81e228", & + "1bb03a21a6cde34dff7ec96", & + "b0b279a934342aa0e188b3a", & + "e1989846a20a09cd77b1f64", & + "4eb68e01cb07fdbc83edee2", & + "f33ac4ec36a7c8e6ea8364c", & + "99b03a21a6c5e34dfffec96", & + "e50e3de3a1c034915413158", & + "fda09f8b05b8fb80ac78600", & + "ca8709be6b193204dd25ab0", & + "35701ff0cc3a03f213a93d2", & + "c2bfdec67f7b5a4c5ee7544", & + "dc184fe7e93a65c1b4b7cd2", & + "8cf8aac820f107d6ec6b30a", & + "e74b3da5a3e43d593d680e2", & + "c1e51f79db6124243fceadc", & + "29237d5d05dc1a4cca2ddd0", & + "050e76be4749b3b279d6414", & + "dd163959ae739673cde18c6", & + "03e100fe5e81c1b85417a8e", & + "06b2b17f70e75fc365bed20", & + "6df9e72abecd3e03e4b77fa", & + "4fa5370361b4bf3cf6b1296", & + "eabbf88f0a88307629bfd1c", & + "190674f88cf69989c8b8a40", & + "37740c13cfad07f61dcac3a", & + "4e7923bfa5d579590ef4ede", & + "fe74d37b8e5a63a2905da28", & + "2101e7a95979b2c5c44257e", & + "841f3ec7a4585a159fb5796", & + "aa7ff31d4b7f859c21254c2", & + "6e69229ba0cdb7ddcd50930", & + "29cfc4288af223bea58b96e", & + "5d03eba9f51956176b87abe", & + "399cbc33a7498b31d9f79e4", & + "034967e48ab80135b1c7fca", & + "721ad006ac715928df9775e", & + "37210b395327446ac7108f8", & + "52acf6de27477ea937e5330", & + "1f3a8549435c198b68231c8", & + "ef6809edb4a3557cd173d0a", & + "09a31639fef9c7a8b6fcae2", & + "03bc87c137eeec711c68d36", & + "b09347742319f90131d3146", & + "a723c9cef1de8c97f34c94c"/ + diff --git a/lib/fsk4hf/ldpc_174_91_a_parity.f90 b/lib/fsk4hf/ldpc_174_91_a_parity.f90 new file mode 100644 index 000000000..44f36463f --- /dev/null +++ b/lib/fsk4hf/ldpc_174_91_a_parity.f90 @@ -0,0 +1,269 @@ +data Mn/ & + 1, 24, 66, & + 2, 5, 70, & + 3, 31, 65, & + 4, 49, 58, & + 6, 60, 67, & + 7, 32, 75, & + 8, 48, 82, & + 9, 35, 41, & + 10, 39, 62, & + 11, 14, 61, & + 12, 71, 74, & + 13, 23, 78, & + 15, 16, 79, & + 17, 54, 63, & + 18, 50, 57, & + 19, 30, 47, & + 20, 64, 80, & + 21, 28, 69, & + 22, 25, 43, & + 26, 34, 72, & + 27, 36, 37, & + 29, 40, 44, & + 33, 52, 53, & + 38, 55, 83, & + 42, 51, 59, & + 45, 76, 81, & + 46, 68, 77, & + 56, 67, 73, & + 1, 4, 5, & + 2, 47, 51, & + 3, 46, 82, & + 6, 24, 76, & + 7, 9, 16, & + 8, 10, 78, & + 11, 35, 55, & + 12, 38, 64, & + 13, 42, 83, & + 14, 27, 54, & + 15, 21, 34, & + 17, 44, 53, & + 18, 25, 28, & + 19, 33, 57, & + 20, 22, 73, & + 23, 40, 81, & + 26, 49, 68, & + 29, 71, 75, & + 30, 65, 79, & + 31, 36, 60, & + 32, 43, 77, & + 37, 62, 70, & + 39, 69, 74, & + 41, 52, 66, & + 45, 50, 61, & + 48, 63, 80, & + 56, 59, 72, & + 58, 64, 65, & + 1, 13, 28, & + 2, 48, 75, & + 3, 53, 69, & + 4, 11, 44, & + 5, 73, 79, & + 6, 12, 17, & + 7, 57, 60, & + 8, 15, 61, & + 9, 39, 59, & + 10, 19, 49, & + 14, 43, 52, & + 16, 54, 68, & + 18, 41, 63, & + 20, 36, 45, & + 21, 67, 77, & + 10, 22, 55, & + 23, 65, 72, & + 24, 27, 82, & + 25, 26, 29, & + 30, 35, 37, & + 31, 51, 66, & + 17, 32, 78, & + 33, 42, 76, & + 34, 70, 83, & + 38, 46, 81, & + 40, 62, 80, & + 45, 47, 74, & + 50, 56, 71, & + 7, 37, 58, & + 1, 16, 71, & + 2, 6, 61, & + 3, 22, 50, & + 4, 59, 77, & + 5, 41, 81, & + 8, 58, 74, & + 9, 20, 26, & + 11, 21, 31, & + 12, 66, 79, & + 13, 14, 57, & + 15, 33, 40, & + 18, 44, 82, & + 19, 69, 83, & + 23, 49, 63, & + 24, 29, 39, & + 25, 47, 56, & + 27, 55, 72, & + 28, 64, 70, & + 30, 48, 77, & + 32, 34, 45, & + 35, 68, 80, & + 36, 38, 52, & + 42, 43, 62, & + 46, 60, 78, & + 51, 54, 67, & + 53, 73, 75, & + 14, 73, 76, & + 1, 22, 30, & + 2, 35, 43, & + 3, 47, 63, & + 4, 25, 76, & + 5, 33, 78, & + 6, 20, 83, & + 7, 12, 72, & + 8, 54, 70, & + 9, 61, 65, & + 10, 34, 51, & + 11, 46, 75, & + 13, 39, 68, & + 15, 17, 56, & + 16, 23, 36, & + 18, 32, 55, & + 19, 31, 81, & + 21, 37, 71, & + 24, 57, 64, & + 26, 38, 48, & + 27, 49, 50, & + 28, 52, 59, & + 29, 41, 58, & + 40, 60, 74, & + 42, 44, 79, & + 51, 53, 80, & + 62, 67, 82, & + 23, 66, 69, & + 1, 53, 61, & + 2, 18, 39, & + 3, 4, 12, & + 5, 26, 74, & + 6, 30, 52, & + 7, 82, 83, & + 8, 35, 73, & + 9, 19, 67, & + 10, 64, 75, & + 11, 20, 33, & + 13, 45, 48, & + 3, 14, 40, & + 15, 43, 49, & + 16, 55, 76, & + 17, 62, 65, & + 21, 47, 78, & + 22, 59, 81, & + 24, 34, 63, & + 25, 37, 66, & + 27, 79, 80, & + 28, 60, 79, & + 29, 31, 70, & + 32, 58, 69, & + 10, 36, 77, & + 38, 50, 51, & + 13, 41, 56, & + 42, 63, 71, & + 44, 47, 68, & + 1, 46, 72, & + 54, 57, 75, & + 2, 33, 58, & + 4, 17, 83, & + 5, 14, 55, & + 6, 23, 48, & + 7, 52, 56/ + +data Nm/ & + 1, 29, 57, 86, 113, 140, 168, & + 2, 30, 58, 87, 114, 141, 170, & + 3, 31, 59, 88, 115, 142, 151, & + 4, 29, 60, 89, 116, 142, 171, & + 2, 29, 61, 90, 117, 143, 172, & + 5, 32, 62, 87, 118, 144, 173, & + 6, 33, 63, 85, 119, 145, 174, & + 7, 34, 64, 91, 120, 146, 0, & + 8, 33, 65, 92, 121, 147, 0, & + 9, 34, 66, 72, 122, 148, 163, & + 10, 35, 60, 93, 123, 149, 0, & + 11, 36, 62, 94, 119, 142, 0, & + 12, 37, 57, 95, 124, 150, 165, & + 10, 38, 67, 95, 112, 151, 172, & + 13, 39, 64, 96, 125, 152, 0, & + 13, 33, 68, 86, 126, 153, 0, & + 14, 40, 62, 78, 125, 154, 171, & + 15, 41, 69, 97, 127, 141, 0, & + 16, 42, 66, 98, 128, 147, 0, & + 17, 43, 70, 92, 118, 149, 0, & + 18, 39, 71, 93, 129, 155, 0, & + 19, 43, 72, 88, 113, 156, 0, & + 12, 44, 73, 99, 126, 139, 173, & + 1, 32, 74, 100, 130, 157, 0, & + 19, 41, 75, 101, 116, 158, 0, & + 20, 45, 75, 92, 131, 143, 0, & + 21, 38, 74, 102, 132, 159, 0, & + 18, 41, 57, 103, 133, 160, 0, & + 22, 46, 75, 100, 134, 161, 0, & + 16, 47, 76, 104, 113, 144, 0, & + 3, 48, 77, 93, 128, 161, 0, & + 6, 49, 78, 105, 127, 162, 0, & + 23, 42, 79, 96, 117, 149, 170, & + 20, 39, 80, 105, 122, 157, 0, & + 8, 35, 76, 106, 114, 146, 0, & + 21, 48, 70, 107, 126, 163, 0, & + 21, 50, 76, 85, 129, 158, 0, & + 24, 36, 81, 107, 131, 164, 0, & + 9, 51, 65, 100, 124, 141, 0, & + 22, 44, 82, 96, 135, 151, 0, & + 8, 52, 69, 90, 134, 165, 0, & + 25, 37, 79, 108, 136, 166, 0, & + 19, 49, 67, 108, 114, 152, 0, & + 22, 40, 60, 97, 136, 167, 0, & + 26, 53, 70, 83, 105, 150, 0, & + 27, 31, 81, 109, 123, 168, 0, & + 16, 30, 83, 101, 115, 155, 167, & + 7, 54, 58, 104, 131, 150, 173, & + 4, 45, 66, 99, 132, 152, 0, & + 15, 53, 84, 88, 132, 164, 0, & + 25, 30, 77, 110, 122, 137, 164, & + 23, 52, 67, 107, 133, 144, 174, & + 23, 40, 59, 111, 137, 140, 0, & + 14, 38, 68, 110, 120, 169, 0, & + 24, 35, 72, 102, 127, 153, 172, & + 28, 55, 84, 101, 125, 165, 174, & + 15, 42, 63, 95, 130, 169, 0, & + 4, 56, 85, 91, 134, 162, 170, & + 25, 55, 65, 89, 133, 156, 0, & + 5, 48, 63, 109, 135, 160, 0, & + 10, 53, 64, 87, 121, 140, 0, & + 9, 50, 82, 108, 138, 154, 0, & + 14, 54, 69, 99, 115, 157, 166, & + 17, 36, 56, 103, 130, 148, 0, & + 3, 47, 56, 73, 121, 154, 0, & + 1, 52, 77, 94, 139, 158, 0, & + 5, 28, 71, 110, 138, 147, 0, & + 27, 45, 68, 106, 124, 167, 0, & + 18, 51, 59, 98, 139, 162, 0, & + 2, 50, 80, 103, 120, 161, 0, & + 11, 46, 84, 86, 129, 166, 0, & + 20, 55, 73, 102, 119, 168, 0, & + 28, 43, 61, 111, 112, 146, 0, & + 11, 51, 83, 91, 135, 143, 0, & + 6, 46, 58, 111, 123, 148, 169, & + 26, 32, 79, 112, 116, 153, 0, & + 27, 49, 71, 89, 104, 163, 0, & + 12, 34, 78, 109, 117, 155, 0, & + 13, 47, 61, 94, 136, 159, 160, & + 17, 54, 82, 106, 137, 159, 0, & + 26, 44, 81, 90, 128, 156, 0, & + 7, 31, 74, 97, 138, 145, 0, & + 24, 37, 80, 98, 118, 145, 171/ + +data nrw/ & + 7,7,7,7,7,7,7,6,6,7,6,6,7,7,6,6,7,6, & + 6,6,6,6,7,6,6,6,6,6,6,6,6,6,7,6,6,6, & + 6,6,6,6,6,6,6,6,6,6,7,7,6,6,7,7,6,6, & + 7,7,6,7,6,6,6,6,7,6,6,6,6,6,6,6,6,6, & + 6,6,7,6,6,6,7,6,6,6,7/ + +ncw=3 diff --git a/lib/fsk4hf/ldpcsim174_91.f90 b/lib/fsk4hf/ldpcsim174_91.f90 index aecea0bdd..39b0e6b32 100644 --- a/lib/fsk4hf/ldpcsim174_91.f90 +++ b/lib/fsk4hf/ldpcsim174_91.f90 @@ -3,31 +3,23 @@ program ldpcsim174_91 use crc use packjt +integer, parameter:: N=174, K=91, M=N-K character*22 msg,msgsent,msgreceived character*8 arg character*6 grid integer*1, allocatable :: codeword(:), decoded(:), message(:) integer*1, target:: i1Msg8BitBytes(12) -integer*1 msgbits(91) -integer*1 apmask(174), cw(174) +integer*1 msgbits(K) +integer*1 apmask(N), cw(N) integer*2 checksum integer*4 i4Msg6BitWords(13) -integer colorder(174) -integer nerrtot(174),nerrdec(174),nmpcbad(91) +integer colorder(N) +integer nerrtot(N),nerrdec(N),nmpcbad(K) logical checksumok real*8, allocatable :: rxdata(:) real, allocatable :: llr(:) -data colorder/ & - 0, 1, 2, 3, 28, 4, 5, 6, 7, 8, 9, 10, 11, 34, 12, 32, 13, 14, 15, 16,& - 17, 18, 36, 29, 40, 19, 20, 38, 21, 41, 30, 42, 22, 44, 37, 47, 48, 23, 33, 43,& - 49, 45, 56, 39, 25, 26, 46, 50, 51, 52, 24, 57, 58, 61, 31, 54, 64, 35, 27, 62,& - 59, 53, 60, 63, 55, 70, 66, 67, 68, 65, 71, 74, 72, 73, 77, 75, 69, 76, 79, 82,& - 83, 78, 81, 80, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,& - 100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,& - 120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,& - 140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,& - 160,161,162,163,164,165,166,167,168,169,170,171,172,173/ +include "ldpc_174_91_a_colorder.f90" nerrtot=0 nerrdec=0 @@ -50,9 +42,6 @@ read(arg,*) ntrials call getarg(4,arg) read(arg,*) s -! don't count crc bits as data bits -N=174 -K=91 ! scale Eb/No for a (174,91) code rate=real(K)/real(N) @@ -126,11 +115,11 @@ allocate ( rxdata(N), llr(N) ) write(*,*) 'codeword' write(*,'(22(8i1,1x))') codeword -write(*,*) "Es/N0 SNR2500 ngood nundetected nbadcrc sigma" +write(*,*) "Eb/N0 SNR2500 ngood nundetected nbadcrc sigma" do idb = 20,-10,-1 !do idb = 0,0,-1 db=idb/2.0-1.0 - sigma=1/sqrt( 2*(10**(db/10.0)) ) + sigma=1/sqrt( 2*rate*(10**(db/10.0)) ) ngood=0 nue=0 nbadcrc=0 @@ -195,7 +184,7 @@ do idb = 20,-10,-1 baud=12000/1920 snr2500=db+10.0*log10((baud/2500.0)) pberr=real(nberr)/(real(ntrials*N)) - write(*,"(f4.1,4x,f5.1,1x,i8,1x,i8,1x,i8,8x,f5.2,8x,e10.3)") db,snr2500,ngood,nue,nbadcrc,ss,pberr + write(*,"(f4.1,4x,f5.1,1x,i8,1x,i8,1x,i8,8x,f5.2,8x,e10.3)") db,SNR2500,ngood,nue,nbadcrc,ss,pberr enddo diff --git a/lib/fsk4hf/osd174_91.f90 b/lib/fsk4hf/osd174_91.f90 index a48fbe412..7109ba527 100644 --- a/lib/fsk4hf/osd174_91.f90 +++ b/lib/fsk4hf/osd174_91.f90 @@ -2,18 +2,22 @@ subroutine osd174_91(llr,apmask,ndeep,decoded,cw,nhardmin,dmin) ! ! An ordered-statistics decoder for the (174,91) code. ! -include "ldpc_174_91_a_params.f90" - +integer, parameter:: N=174, K=91, M=N-K integer*1 apmask(N),apmaskr(N) integer*1 gen(K,N) integer*1 genmrb(K,N),g2(N,K) integer*1 temp(K),m0(K),me(K),mi(K),misub(K),e2sub(N-K),e2(N-K),ui(N-K) integer*1 r2pat(N-K) +integer colorder(N) integer indices(N),nxor(N) integer*1 cw(N),ce(N),c0(N),hdec(N) integer*1 decoded(K) integer indx(N) real llr(N),rx(N),absrx(N) + +include "ldpc_174_91_a_generator.f90" +include "ldpc_174_91_a_colorder.f90" + logical first,reset data first/.true./ save first,gen diff --git a/lib/ft8/ldpcsim174.f90 b/lib/ft8/ldpcsim174.f90 index 08b181ebb..e59aa1b13 100644 --- a/lib/ft8/ldpcsim174.f90 +++ b/lib/ft8/ldpcsim174.f90 @@ -129,11 +129,11 @@ allocate ( rxdata(N), llr(N) ) write(*,*) 'codeword' write(*,'(22(8i1,1x))') codeword -write(*,*) "Es/N0 SNR2500 ngood nundetected nbadcrc sigma" +write(*,*) "Eb/N0 SNR2500 ngood nundetected nbadcrc sigma" do idb = 20,-10,-1 !do idb = -3,-3,-1 db=idb/2.0-1.0 - sigma=1/sqrt( 2*(10**(db/10.0)) ) + sigma=1/sqrt( 2*rate*(10**(db/10.0)) ) ngood=0 nue=0 nbadcrc=0 @@ -163,7 +163,6 @@ do idb = 20,-10,-1 if(nerr.ge.1) nerrtot(nerr)=nerrtot(nerr)+1 nberr=nberr+nerr -! Correct signal normalization is important for this decoder. rxav=sum(rxdata)/N rx2av=sum(rxdata*rxdata)/N rxsig=sqrt(rx2av-rxav*rxav)