From: drowe67 Date: Sat, 21 Apr 2018 04:00:41 +0000 (+0000) Subject: refactoring mod functions that can be used for freedv_api 700D mode X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=5e37dd1e0490f59138eb12b01618599349e962b7;p=freetel-svn-tracking.git refactoring mod functions that can be used for freedv_api 700D mode git-svn-id: https://svn.code.sf.net/p/freetel/code@3516 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/src/interldpc.c b/codec2-dev/src/interldpc.c index 4c5c6904..716c4c7f 100644 --- a/codec2-dev/src/interldpc.c +++ b/codec2-dev/src/interldpc.c @@ -173,3 +173,65 @@ int count_uncoded_errors(struct LDPC *ldpc, int Nerrs_raw[], int interleave_fram return Terrs; } + +int count_errors(int tx_bits[], char rx_bits[], int n) { + int i; + int Nerrs = 0; + + Nerrs = 0; + for(i=0; icoded_syms_per_frame; + int coded_bits_per_frame = ldpc->coded_bits_per_frame; + int data_bits_per_frame = ldpc->data_bits_per_frame; + + int codeword[coded_bits_per_frame]; + COMP coded_symbols[interleave_frames*coded_syms_per_frame]; + COMP coded_symbols_inter[interleave_frames*coded_syms_per_frame]; + int Nsamperframe = ofdm_get_samples_per_frame(); + + int i,j; + + for (j=0; jtx_uw[i]; + } + /* clear txt bits for now, they can be added in later */ + for(j=0; j #include "comp.h" #include "mpdecode_core.h" #include "ofdm_internal.h" @@ -46,5 +47,8 @@ void interleaver_sync_state_machine(struct OFDM *ofdm, float EsNo, int interleave_frames, int *inter, int *parityCheckCount, int *Nerrs_coded); int count_uncoded_errors(struct LDPC *ldpc, int Nerrs_raw[], int interleave_frames, COMP codeword_symbols_de[]); +int count_errors(int tx_bits[], char rx_bits[], int n); +void ofdm_ldpc_interleave_tx(struct OFDM *ofdm, struct LDPC *ldpc, complex float tx_sams[], uint8_t tx_bits_char[], complex float tx_symbols[], int interleave_frames); +void build_modulated_uw(struct OFDM *ofdm, complex float tx_symbols[]); #endif diff --git a/codec2-dev/src/ofdm_demod.c b/codec2-dev/src/ofdm_demod.c index e4c7a3b7..dd784dbd 100644 --- a/codec2-dev/src/ofdm_demod.c +++ b/codec2-dev/src/ofdm_demod.c @@ -260,14 +260,8 @@ int main(int argc, char *argv[]) iter[j] = run_ldpc_decoder(&ldpc, out_char, llr, &parityCheckCount[j]); //fprintf(stderr,"j: %d iter: %d pcc: %d\n", j, iter[j], parityCheckCount[j]); if (testframes) { - Nerrs = 0; - for(i=0; itx_uw[i]; - } - for(j=0; j