/** * * \section COPYRIGHT * * Copyright 2013-2015 The srsLTE Developers. See the * COPYRIGHT file at the top-level directory of this distribution. * * \section LICENSE * * This file is part of the srsLTE library. * * srsLTE is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * srsLTE 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 Affero General Public License for more details. * * A copy of the GNU Affero 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 "srslte/srslte.h" srslte_cell_t cell = { 100, // nof_prb SRSLTE_MAX_PORTS, // nof_ports 1, // cell_id SRSLTE_CP_NORM // cyclic prefix }; void usage(char *prog) { printf("Usage: %s [recv]\n", prog); printf("\t-r nof_prb [Default %d]\n", cell.nof_prb); printf("\t-e extended cyclic prefix [Default normal]\n"); printf("\t-c cell_id (1000 tests all). [Default %d]\n", cell.id); printf("\t-v increase verbosity\n"); } void parse_args(int argc, char **argv) { int opt; while ((opt = getopt(argc, argv, "recv")) != -1) { switch(opt) { case 'r': cell.nof_prb = atoi(argv[optind]); break; case 'e': cell.cp = SRSLTE_CP_EXT; break; case 'c': cell.id = atoi(argv[optind]); break; case 'v': srslte_verbose++; break; default: usage(argv[0]); exit(-1); } } } int main(int argc, char **argv) { srslte_refsignal_ul_t refs; srslte_refsignal_dmrs_pusch_cfg_t pusch_cfg; cf_t *signal = NULL; int ret = -1; parse_args(argc,argv); signal = malloc(2 * SRSLTE_NRE * cell.nof_prb * sizeof(cf_t)); if (!signal) { perror("malloc"); goto do_exit; } if (srslte_refsignal_ul_init(&refs, cell)) { fprintf(stderr, "Error initializing UL reference signal\n"); goto do_exit; } printf("Running tests for %d PRB\n", cell.nof_prb); for (int n=6;n