/** * * \section COPYRIGHT * * Copyright 2013-2014 The libLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * * This file is part of the libLTE library. * * libLTE is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * libLTE 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 Lesser General Public License for more details. * * A copy of the GNU Lesser General Public License can be found in * the LICENSE file in the top-level directory of this distribution * and at http://www.gnu.org/licenses/. * */ #include #include #include #include #include #include #include #include #include "lte.h" int nof_symbols = 1000; int nof_cw = 1, nof_layers = 1; char *mimo_type_name = NULL; void usage(char *prog) { printf("Usage: %s -m [single|diversity|multiplex] -c [nof_cw] -l [nof_layers]\n", prog); printf("\t-n num_symbols [Default %d]\n", nof_symbols); } void parse_args(int argc, char **argv) { int opt; while ((opt = getopt(argc, argv, "mcln")) != -1) { switch (opt) { case 'n': nof_symbols = atoi(argv[optind]); break; case 'c': nof_cw = atoi(argv[optind]); break; case 'l': nof_layers = atoi(argv[optind]); break; case 'm': mimo_type_name = argv[optind]; break; default: usage(argv[0]); exit(-1); } } if (!mimo_type_name) { usage(argv[0]); exit(-1); } } int main(int argc, char **argv) { int i, j, num_errors, symbols_layer; cf_t *d[MAX_CODEWORDS], *x[MAX_LAYERS], *dp[MAX_CODEWORDS]; mimo_type_t type; int nof_symb_cw[MAX_CODEWORDS]; int n[2]; parse_args(argc, argv); if (lte_str2mimotype(mimo_type_name, &type)) { fprintf(stderr, "Invalid MIMO type %s\n", mimo_type_name); exit(-1); } if (nof_cw > 1) { n[0] = nof_layers / nof_cw; n[1] = nof_layers - n[0]; nof_symb_cw[0] = nof_symbols * n[0]; nof_symb_cw[1] = nof_symbols * n[1]; } else { nof_symb_cw[0] = nof_symbols; nof_symb_cw[1] = 0; } for (i=0;i