From: drowe67 Date: Mon, 27 Jul 2015 03:47:12 +0000 (+0000) Subject: fixed occasional wild bit error counts for cohpsk test frames X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=be20ccab53bae10255a832fce155ec8d6e91498e;p=freetel-svn-tracking.git fixed occasional wild bit error counts for cohpsk test frames git-svn-id: https://svn.code.sf.net/p/freetel/code@2245 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/src/cohpsk.c b/codec2-dev/src/cohpsk.c index 502969ce..25425734 100644 --- a/codec2-dev/src/cohpsk.c +++ b/codec2-dev/src/cohpsk.c @@ -1210,6 +1210,9 @@ void cohpsk_put_test_bits(struct COHPSK *coh, int *state, short error_pattern[], *bit_errors = 0; for(i=0; iptest_bits_coh_rx[i]; + if ((anerror < 0) || (anerror > 1)) { + fprintf(stderr, "i: %d rx_bits: %d ptest_bits_coh_rx: %d\n", i, rx_bits[i], coh->ptest_bits_coh_rx[i]); + } *bit_errors += anerror; error_pattern[i] = anerror; } @@ -1222,6 +1225,9 @@ void cohpsk_put_test_bits(struct COHPSK *coh, int *state, short error_pattern[], if (*bit_errors < 4) { next_state = 1; coh->ptest_bits_coh_rx += COHPSK_BITS_PER_FRAME; + if (coh->ptest_bits_coh_rx >= coh->ptest_bits_coh_end) { + coh->ptest_bits_coh_rx = (int*)test_bits_coh; + } } } diff --git a/codec2-dev/src/fm.c b/codec2-dev/src/fm.c index 18f0a532..bdccd8a8 100644 --- a/codec2-dev/src/fm.c +++ b/codec2-dev/src/fm.c @@ -124,7 +124,7 @@ void fm_demod(struct FM *fm_states, float rx_out[], float rx[]) float mag; int i,k; - wc_rect.real = cos(wc); wc_rect.imag = -sin(wc); + wc_rect.real = cosf(wc); wc_rect.imag = -sinf(wc); for(i=0; ilo_phase.real, fm_states->lo_phase.imag); //printf("%f %f %f\n", rx[i], rx_bb[i].real, rx_bb[i].imag); @@ -153,7 +156,7 @@ void fm_demod(struct FM *fm_states, float rx_out[], float rx[]) rx_bb_diff = cmult(rx_bb_filt, cconj(fm_states->rx_bb_filt_prev)); fm_states->rx_bb_filt_prev = rx_bb_filt; - rx_dem = atan2(rx_bb_diff.imag, rx_bb_diff.real); + rx_dem = atan2f(rx_bb_diff.imag, rx_bb_diff.real); /* limit maximum phase jumps, to remove static type noise at low SNRs */ @@ -166,10 +169,12 @@ void fm_demod(struct FM *fm_states, float rx_out[], float rx[]) //printf("%f %f\n", rx_bb_diff.real, rx_bb_diff.imag); rx_dem_mem[i] = rx_dem; acc = 0; - for(k=0; k