You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-30Lines changed: 52 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,13 @@
6
6
7
7
## Overview
8
8
9
-
This repository aims to solve the following problem. Suppose Alice and Bob each have a bit-string of length _N_.
10
-
Bobs bit-string is the result of randomly flipping each bit of Alice with probability _p_, i.e., it is the output of a binary symmetric channel with **channel parameter**_p_.
11
-
(Note: the same considerations apply for soft inputs instead of bit-strings and a Gaussian channel.) The goal is for Alice to send (via a noise-less channel) to Bob a message (called syndrome), such that Bob can recover Alice's bit-string given his bit-string and the syndrome received from Alice. There are two important metrics, which we want to minimize:
9
+
This repository aims to solve the following problem: Suppose Alice and Bob each have a bit-string of length _N_.
10
+
Bobs bit-string is the result of randomly flipping each bit of Alice with probability _p_.
11
+
I.e., it is the output of a [binary symmetric channel](https://en.wikipedia.org/wiki/Binary_symmetric_channel) with **channel parameter**_p_.
12
+
(Note: similar considerations apply for soft inputs instead of bit-strings and a [Gaussian channel](https://en.wikipedia.org/wiki/Additive_white_Gaussian_noise).)
13
+
The goal is for Alice to send (via a noise-less channel) to Bob a message (called syndrome), such that Bob can recover Alice's bit-string given his bit-string and the syndrome received from Alice.
14
+
15
+
There are two important metrics, which we want to minimize:
12
16
13
17
- the probability that Bob will fail to recover Alice's bit-string, which is called the frame error rate (FER)
14
18
- the length of the syndrome
@@ -22,17 +26,18 @@ Limits for finite block sizes also exist but are more complicated).
22
26
23
27
### Contrast with forward error correction
24
28
25
-
Contrary to how forward error correction works, generator matrices for the LDPC code are not used at all for distributed source coding.
26
-
This repository does not provide generator matrices (calculating them from the parity check matrices is straightforward).
29
+
Contrary to how forward error correction works, distributed source coding does not use generator matrices for the LDPC code.
30
+
This repository does not provide generator matrices (though calculating them from the parity check matrices is straightforward).
31
+
27
32
Our decoder implementation operates on a bit-string (noisy version of true message) and its correct syndrome.
28
-
This is slightly different from what is used for forward error correction (as in e.g. [AFF3CT](https://github.com/aff3ct/aff3ct)), where the decoder operates on only the noisy codeword.
29
-
The noisy codeword is the result of transmitting the codeword (true message encoded using a generator matrix) via a noisy channel.
33
+
This is different from what is used for forward error correction (as in e.g. [AFF3CT](https://github.com/aff3ct/aff3ct)), where the decoder operates on only the noisy codeword.
34
+
(The noisy codeword is the result of transmitting the codeword (true message encoded using a generator matrix) via a noisy channel.)
30
35
31
36
32
37
## How to use
33
38
In order to use all the functionality provided in this repository, install
34
39
- CMake (at least version 3.19)
35
-
- C++ compiler (supporting C++17)
40
+
- C++ compiler (supporting C++20; parts of the project also work with only C++17)
36
41
- Julia (at least version 1.6)
37
42
38
43
For how to use the provided Julia code, see directory `codes`. No familiarity with the Julia programming language is required.
@@ -48,7 +53,9 @@ All executables will be built inside the `build` folder.
48
53
49
54
For a demo of how to use the C++ header-only library, see the `examples` directory, which shows a basic example ("demo_error_correction") of how to use the C++ header containing the decoder.
50
55
This example is built by CMake (executable `build/examples/demo_error_correction`.
51
-
Note: the executable produces no output; look at the C++ source code to see how the header can be used).
56
+
Note: the executable produces no output; look at the C++ source code to see how the header can be used.
57
+
58
+
For more advanced examples, looking at the unit tests may be helpful.
52
59
53
60
## How to contribute
54
61
This repository is actively maintained.
@@ -59,29 +66,49 @@ Let us know if you're having problems with the provided materials, wish to contr
59
66
## List of contents
60
67
61
68
### Data files
62
-
- A number of LDPC codes (a list and the actual LDPC matrices are in the folder `codes`).
69
+
- A number of LDPC codes (a list and the actual LDPC matrices are in the folder `codes`).
63
70
Their parity check matrices are stored in a custom file format (called `qccsc.json`).
71
+
64
72
- Simulations results done using [AFF3CT](https://github.com/aff3ct/aff3ct), showing FER of the LDPC matrices at various channel parameters.
73
+
65
74
- Simulation results done using the decoder in this repository, showing FER of LDPC matrices, their rate adapted versions, and average rate under rate adaption (Work in progress!).
75
+
66
76
- For each LDPC matrix, a specification of rate adaption.
67
77
This is a list of pairs of row indices of the matrix that are combined (added mod 2) in each rate adaption step.
68
78
69
79
### Julia code
70
80
- Contained in the folder `codes`.
71
-
- Enables loading the LDPC matrices from `CSCMAT` files (using our custom Julia library ``)
72
-
- Enables saving the compressed sparse column (CSC) representation and also exporting to other standard formats, such as `alist`.
81
+
82
+
- Enables loading the LDPC matrices from files.
83
+
This uses our custom Julia library [LDPCStorage.jl](https://github.com/XQP-Munich/LDPCStorage.jl)) (installed automatically by the Julia package manager).
84
+
85
+
- Enables saving the compressed sparse column (CSC) representation (both binary and quasi-cyclic).
86
+
Also supports exporting to other standard formats, such as `alist`.
73
87
74
88
### C++ code
75
-
- Basic LDPC decoder using belief propagation (BP). Contained in a single header file (`src/rate_adaptive_code.hpp`) and easy to use. Can perform syndrome computation as well.
89
+
- Basic LDPC decoder using belief propagation (BP).
90
+
Contained in a single header file (`src/rate_adaptive_code.hpp`) and easy to use.
91
+
Can perform syndrome computation as well.
76
92
The LDPC code can be embedded into the executable or loaded from a file at program runtime.
77
-
- Utility functions for reading LDPC matrices (from `.cscmat` files) and rate adaption (from `.csv` files). These functions are contained in `src/read_cscmat_format.hpp`.
78
-
Note that these functions require the fully explicit binary form of the LDPC matrix. The LDPC codes given inside `codes/ldpc` use an even more memory-efficient storage
79
-
- For applications that only require syndrome computation but no decoding, we provide a separate implementation for multiplication of a sparse binary matrix and a dense binary vector (LDPC syndrome computation). This is also contained in a single header file (`src/encoder.hpp`).
80
-
This is a very specific application, which you probably don't care about initially.
81
-
- A LDPC matrix can be stored within the executable.
82
-
It is included as a header file defining constant data (for example `tests/fortest_autogen_ldpc_matrix_csc.hpp`).
83
-
Julia code (see folder `codes`) is provided to generate such a C++ header file for any LDPC matrix.
84
93
94
+
- Utility functions for reading LDPC matrices (from `.cscmat` files) and rate adaption (from `.csv` files).
95
+
These functions are contained in `src/read_cscmat_format.hpp`.
96
+
Note that these functions require the fully explicit binary form of the LDPC matrix.
97
+
The LDPC codes given inside `codes/ldpc` use an even more memory-efficient storage.
98
+
99
+
- LDPC matrices can be stored within the executable.
100
+
There are two ways:
101
+
- include as a header file defining constant data (for example `tests/fortest_autogen_ldpc_matrix_csc.hpp`).
102
+
Julia code (see folder `codes`) is provided to generate such a C++ header file for any LDPC matrix.
103
+
- C++ headers storing QC-LDPC matrices in terms of their quasi-cyclic exponents.
104
+
This is very efficient in terms of binary size.
105
+
See `src/autogen_ldpc_QC.hpp` (partially auto-generated using the Julia code).
106
+
Note: this part is new and may still change significantly in future versions.
107
+
It also requires C++20 and `src/encoder_advanced.hpp`.
108
+
109
+
- For applications that only require syndrome computation but no decoding, we provide a separate implementation for multiplication of a sparse binary matrix and a dense binary vector (LDPC syndrome computation).
110
+
See `src/encoder.hpp` (old) or `src/encoder_advanced.hpp` (new).
111
+
**This is a very specific application, which you probably don't care about initially.**
85
112
86
113
## Planned features and improvements
87
114
@@ -90,23 +117,18 @@ If you need some feature for your applications, let us know, e.g. by creating an
90
117
-[ ] Reports and benchmarks on LDPC code quality and decoding performance
91
118
+[x] Simulation programs with command line interfaces
92
119
+[x] Frame error rate simulations for rate adapted codes (including special case of no rate adaption)
93
-
+[x] Critical rate (codeword-averaged minimum leak rate for successful decoding) computation for rate adapted codes
94
-
+[ ] Automatic running of simulations
95
-
+[ ] Automatic reports with plots
96
-
+[ ] Simulations on multiple threads and/or multiprocessing
120
+
+[x] Critical rate (codeword-averaged minimum leak rate for successful decoding) computation for rate adapted codes
121
+
+[ ] Automatic performance reports with code that generates plots
97
122
-[ ] LDPC codes
98
123
+[x] 3 LDPC codes each (different block sizes) for leak rates 1/2 and 1/3
99
-
+[ ] More sizes, more rates
100
-
+[ ] Very high leak rate codes (for very low signal-to-noise ratios)
124
+
+[ ] More sizes, more rates (coming soon!)
101
125
-[ ] Decoding and decoding algorithms
102
126
+[x] Basic belief propagation (BP) decoder for Slepian-Wolf setting
103
127
+[ ] Decoder performance improvements (look at [AFF3CT](https://github.com/aff3ct/aff3ct) for inspiration), plausibly achieve 2x runtime speedup at same decoding accuracy
104
128
+[ ] Decoding on GPU
105
129
+[x] Encoder that can be used separately from encoder (e.g. for embedded applications)
106
-
+[ ] Using compressed sparse row format may have advantages over the current compressed sparse column (CSC) format. This needs to be tested.
107
-
+[ ] Save memory by storing QC-exponents of structured codes, rather than CSC storage
108
-
+[ ] Encoder speedup may be possible using QC-exponents by densely packed bits and using bit-shifts (not a priority, as syndrome computation, i.e., sparse matrix-vector multiplication, is fast anyway)
109
-
130
+
+[x] Save memory by storing QC-exponents of structured codes, rather than CSC storage
131
+
+[x] Encoder that directly uses CSC-storage of QC-exponents instead of expanding to CSC storage of binary matrix
0 commit comments