diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-05-04 21:31:31 +0200 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-05-04 21:31:31 +0200 |
commit | 9918eb505321183e20357221a4dcf2aa9c1e057c (patch) | |
tree | 41e33e84d51ca2aa558ab1dc248ec5109181d6c8 /controller/fw/src/ldpc_wrapper.cpp | |
parent | 82c1302756d9b8f3d5cfbd4b304411c39651dfa8 (diff) | |
download | master-thesis-9918eb505321183e20357221a4dcf2aa9c1e057c.tar.gz master-thesis-9918eb505321183e20357221a4dcf2aa9c1e057c.tar.bz2 master-thesis-9918eb505321183e20357221a4dcf2aa9c1e057c.zip |
fw: add working reed-solomon encoder/decoder
Diffstat (limited to 'controller/fw/src/ldpc_wrapper.cpp')
-rw-r--r-- | controller/fw/src/ldpc_wrapper.cpp | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/controller/fw/src/ldpc_wrapper.cpp b/controller/fw/src/ldpc_wrapper.cpp deleted file mode 100644 index da63343..0000000 --- a/controller/fw/src/ldpc_wrapper.cpp +++ /dev/null @@ -1,84 +0,0 @@ - -#include <stdlib.h> -#include <algorithm> -#include <cstdint> -#include <cmath> - -#include "ldpc/generic.hh" -#include "ldpc/layered_decoder.hh" - -static const int DEFAULT_TRIALS = 25; - -struct DVB_S2_TABLE_C9 -{ - static const int M = 360; - static const int N = 16200; - static const int K = 13320; - static const int LINKS_MIN_CN = 15; - static const int LINKS_MAX_CN = 19; - static const int LINKS_TOTAL = 49319; - static const int DEG_MAX = 13; - static const int DEG[]; - static const int LEN[]; - static const int POS[]; -}; - -const int DVB_S2_TABLE_C9::DEG[] = { - 13, 3, 0 -}; - -const int DVB_S2_TABLE_C9::LEN[] = { - 1, 36, 0 -}; - -const int DVB_S2_TABLE_C9::POS[] = { - 3, 2409, 499, 1481, 908, 559, 716, 1270, 333, 2508, 2264, 1702, 2805, - 4, 2447, 1926, - 5, 414, 1224, - 6, 2114, 842, - 7, 212, 573, - 0, 2383, 2112, - 1, 2286, 2348, - 2, 545, 819, - 3, 1264, 143, - 4, 1701, 2258, - 5, 964, 166, - 6, 114, 2413, - 7, 2243, 81, - 0, 1245, 1581, - 1, 775, 169, - 2, 1696, 1104, - 3, 1914, 2831, - 4, 532, 1450, - 5, 91, 974, - 6, 497, 2228, - 7, 2326, 1579, - 0, 2482, 256, - 1, 1117, 1261, - 2, 1257, 1658, - 3, 1478, 1225, - 4, 2511, 980, - 5, 2320, 2675, - 6, 435, 1278, - 7, 228, 503, - 0, 1885, 2369, - 1, 57, 483, - 2, 838, 1050, - 3, 1231, 1990, - 4, 1738, 68, - 5, 2392, 951, - 6, 163, 645, - 7, 2644, 1704, -}; - -extern "C" { - - int ldpc_decode(float *symbols, int trials) { - if (trials < 0) - trials = DEFAULT_TRIALS; - - LDPCDecoder<float, SumProductAlgorithm<float, SelfCorrectedUpdate<float>>, LDPC<DVB_S2_TABLE_C9>> decoder; - return decoder.run(symbols, symbols+decoder.K, trials, 1); - } - -} |