/* LDPC Encoder, using a 'RA' encoder written by Bill Cowley VK5DSP in March 2016. Compile with: gcc -fPIC -shared -o ldpc_enc.so ldpc_enc.c */ #include #include #include /* LDPC Encoder Functions */ #define Nibits 2064 #define Npbits 516 #define Nwt 12 unsigned short hrows[] = { // read from file created via make_Hrows_txt.m // use the new code of March 2016 #include "Hrow2064.txt" }; void encode(unsigned char *ibits, unsigned char *pbits) { unsigned int p, i, tmp, par, prev=0; char c; for (p=0; p