From ac7c48b4dee99d4c772f133d70d8d1b38262fcd2 Mon Sep 17 00:00:00 2001 From: Author Name Date: Fri, 7 Jul 2023 12:20:59 +0930 Subject: shallow zip-file copy from codec2 e9d726bf20 --- src/ofdm_put_test_bits.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 src/ofdm_put_test_bits.c (limited to 'src/ofdm_put_test_bits.c') diff --git a/src/ofdm_put_test_bits.c b/src/ofdm_put_test_bits.c new file mode 100644 index 0000000..88f61d7 --- /dev/null +++ b/src/ofdm_put_test_bits.c @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------*\ + + FILE........: ofdm_put_test_bits.c + AUTHOR......: David Rowe + DATE CREATED: Mar 2018 + + Slurps up a stream of test bits generated by ofdm_get_test_bits, useful for + testing ofdm_mod and ofdm_demod. + +\*---------------------------------------------------------------------------*/ + +/* + Copyright (C) 2018 David Rowe + + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License version 2.1, as + published by the Free Software Foundation. This program is + distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, see . +*/ + +#include +#include +#include +#include +#include +#include + +#include "codec2_ofdm.h" +#include "ofdm_internal.h" +#include "test_bits_ofdm.h" + +#define LOG_FRAMES 100 +#define NDISCARD 20 + +static struct OFDM *ofdm; + +int opt_exists(char *argv[], int argc, char opt[]) { + int i; + for (i=0; i= NDISCARD) { + Terrs2 += Nerrs; + Tbits2 += Nbitsperframe; + } + + if (verbose) { + printf("f: %d Nerrs: %d aber: %3.2f\n", f, Nerrs, aber); + } + } + + fclose(fin); + + fprintf(stderr, "BER..: %5.4f Tbits: %5d Terrs: %5d\n", (float)Terrs/Tbits, Tbits, Terrs); + + if (Tbits2 != 0) { + fprintf(stderr, "BER2.: %5.4f Tbits: %5d Terrs: %5d\n", (float)Terrs2/Tbits2, Tbits2, Terrs2); + } + + ofdm_destroy(ofdm); + + return 0; +} + -- cgit v1.2.3