From 3f48fb0b0c6591c785f59d7511107a12ccea5170 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Mon, 12 Sep 2016 09:19:45 +0000 Subject: [PATCH] tested over 1000 frames git-svn-id: https://svn.code.sf.net/p/freetel/code@2857 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2-dev/src/ldpc_enc.c | 55 +++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/codec2-dev/src/ldpc_enc.c b/codec2-dev/src/ldpc_enc.c index d6753bfc..a371c59c 100644 --- a/codec2-dev/src/ldpc_enc.c +++ b/codec2-dev/src/ldpc_enc.c @@ -9,6 +9,8 @@ #include #include +#include +#include /* generated by ldpc_fsk_lib.m:ldpc_decode() */ @@ -30,38 +32,45 @@ void encode(unsigned char ibits[], unsigned char pbits[]) { tmp &= 1; // only retain the lsb prev = tmp; - pbits[p] =tmp; + pbits[p] = tmp; } } -int main(void) +int main(int argc, char *argv[]) { unsigned char ibits[NUMBERROWSHCOLS]; unsigned char pbits[NUMBERPARITYBITS]; - short k; - unsigned int x; - - printf("Test C Encoder\n"); - - FILE *infp, *opfp; - infp = fopen("dat_in2064.txt", "r"); // read info bits from file - if (infp == NULL) {printf("Unable to open file.\n"); exit(1);} - - for (k=0; k