General cleanup - moving prach code to phch folder, moving common ret vals to config.h, renamed phy_common files

This commit is contained in:
Paul Sutton 2014-06-26 12:13:05 +01:00
parent de13adbc85
commit 507dc8b6cb
42 changed files with 80 additions and 152 deletions

View File

@ -52,4 +52,10 @@
#define LIBLTE_API LIBLTE_IMPORT
#endif
// Common error codes
#define LIBLTE_SUCCESS 0
#define LIBLTE_ERROR -1
#define LIBLTE_ERROR_INVALID_INPUTS -2
#endif // CONFIG_H

View File

@ -1,37 +0,0 @@
/**
*
* \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/.
*
*/
#ifndef ERROR_H
#define ERROR_H
typedef enum{
LIBLTE_SUCCESS = 0,
LIBLTE_ERROR,
LIBLTE_ERROR_INVALID_INPUTS
}LIBLTE_ERROR_ENUM;
#endif // ERROR_H

View File

@ -35,7 +35,7 @@
#include "liblte/config.h"
#include "liblte/phy/ch_estimation/refsignal.h"
#include "liblte/phy/filter/filter2d.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
typedef _Complex float cf_t; /* this is only a shortcut */

View File

@ -38,7 +38,7 @@
*/
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
typedef _Complex float cf_t;

View File

@ -34,7 +34,7 @@
#include <stdlib.h>
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/dft.h"
typedef _Complex float cf_t; /* this is only a shortcut */

View File

@ -29,7 +29,7 @@
#define LTESEQ_
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
typedef struct LIBLTE_API {
char *c;

View File

@ -31,7 +31,7 @@
#include <stdint.h>
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/phch/ra.h"
typedef _Complex float cf_t;

View File

@ -30,7 +30,7 @@
#define PBCH_
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/mimo/precoding.h"
#include "liblte/phy/mimo/layermap.h"
#include "liblte/phy/modem/mod.h"

View File

@ -29,7 +29,7 @@
#define PCFICH_
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/mimo/precoding.h"
#include "liblte/phy/mimo/layermap.h"
#include "liblte/phy/modem/mod.h"

View File

@ -29,7 +29,7 @@
#define PDCCH_
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/mimo/precoding.h"
#include "liblte/phy/mimo/layermap.h"
#include "liblte/phy/modem/mod.h"

View File

@ -30,7 +30,7 @@
#define PDSCH_
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/mimo/precoding.h"
#include "liblte/phy/mimo/layermap.h"
#include "liblte/phy/modem/mod.h"

View File

@ -30,7 +30,7 @@
#define PHICH_
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/mimo/precoding.h"
#include "liblte/phy/mimo/layermap.h"
#include "liblte/phy/modem/mod.h"

View File

@ -31,7 +31,7 @@
#include <stdbool.h>
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#define REGS_PHICH_NSYM 12
#define REGS_PHICH_REGS_X_GROUP 3

View File

@ -48,7 +48,7 @@
#include "liblte/phy/utils/pack.h"
#include "liblte/phy/utils/vector.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/common/fft.h"
#include "liblte/phy/common/sequence.h"

View File

@ -31,7 +31,7 @@
#include "liblte/config.h"
#include "liblte/phy/common/sequence.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
typedef _Complex float cf_t;

View File

@ -33,7 +33,7 @@
#include <stdbool.h>
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/convolution.h"
typedef _Complex float cf_t; /* this is only a shortcut */

View File

@ -33,7 +33,7 @@
#include <stdbool.h>
#include "liblte/config.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/dft.h"
typedef _Complex float cf_t; /* this is only a shortcut */

View File

@ -32,7 +32,7 @@
#include <stdlib.h>
#include <complex.h>
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/ch_estimation/refsignal.h"
#include "liblte/phy/utils/vector.h"
#include "liblte/phy/utils/debug.h"

View File

@ -29,7 +29,7 @@
#include <strings.h>
#include <stdlib.h>
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/dft.h"
#include "liblte/phy/common/fft.h"
#include "liblte/phy/utils/debug.h"

View File

@ -32,7 +32,7 @@
#include <stdlib.h>
#include <string.h>
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
const int tc_cb_sizes[NOF_TC_CB_SIZES] = { 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120,
128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232,

View File

@ -28,7 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/fec/tc_interl.h"
#include "liblte/phy/fec/turbocoder.h"
#include "liblte/phy/utils/debug.h"

View File

@ -30,7 +30,7 @@
#include <assert.h>
#include <string.h>
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/mimo/layermap.h"

View File

@ -31,7 +31,7 @@
#include <string.h>
#include <math.h>
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/mimo/precoding.h"
#include "liblte/phy/utils/vector.h"

View File

@ -35,7 +35,7 @@
#include <math.h>
#include "liblte/phy/phch/dci.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/bit.h"
#include "liblte/phy/utils/vector.h"
#include "liblte/phy/utils/debug.h"

View File

@ -36,7 +36,7 @@
#include "prb.h"
#include "liblte/phy/phch/pbch.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/bit.h"
#include "liblte/phy/utils/vector.h"
#include "liblte/phy/utils/debug.h"

View File

@ -36,7 +36,7 @@
#include "liblte/phy/phch/regs.h"
#include "liblte/phy/phch/pcfich.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/bit.h"
#include "liblte/phy/utils/vector.h"
#include "liblte/phy/utils/debug.h"

View File

@ -37,7 +37,7 @@
#include "liblte/phy/phch/dci.h"
#include "liblte/phy/phch/regs.h"
#include "liblte/phy/phch/pdcch.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/bit.h"
#include "liblte/phy/utils/vector.h"
#include "liblte/phy/utils/debug.h"

View File

@ -36,7 +36,7 @@
#include "prb.h"
#include "liblte/phy/phch/pdsch.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/bit.h"
#include "liblte/phy/utils/debug.h"
#include "liblte/phy/utils/vector.h"

View File

@ -37,7 +37,7 @@
#include "prb.h"
#include "liblte/phy/phch/regs.h"
#include "liblte/phy/phch/phich.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/bit.h"
#include "liblte/phy/utils/vector.h"
#include "liblte/phy/utils/debug.h"

View File

@ -27,8 +27,7 @@
#include <math.h>
#include <string.h>
#include "liblte/error.h"
#include "liblte/phy/prach/prach.h"
#include "liblte/phy/phch/prach.h"
#include "liblte/phy/utils/debug.h"
#define N_SEQS 64 // Number of prach sequences available
@ -279,7 +278,7 @@ int prach_init(prach_t *p,
bool high_speed_flag,
uint32_t zero_corr_zone_config)
{
LIBLTE_ERROR_ENUM ret = LIBLTE_ERROR;
int ret = LIBLTE_ERROR;
if(p != NULL &&
N_ifft_ul < 2049 &&
preamble_format < 4 && // Currently supporting formats 0-3
@ -372,7 +371,7 @@ int prach_gen(prach_t *p,
uint32_t freq_offset,
cf_t *signal)
{
LIBLTE_ERROR_ENUM ret = LIBLTE_ERROR;
int ret = LIBLTE_ERROR;
if(p != NULL &&
seq_index < N_SEQS &&
signal != NULL)
@ -414,7 +413,7 @@ int prach_detect(prach_t *p,
uint32_t *indices,
uint32_t *n_indices)
{
LIBLTE_ERROR_ENUM ret = LIBLTE_ERROR;
int ret = LIBLTE_ERROR;
if(p != NULL &&
signal != NULL &&
sig_len > 0 &&

View File

@ -30,7 +30,7 @@
#include <string.h>
#include "prb.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
void prb_cp_ref(cf_t **input, cf_t **output, int offset, int nof_refs,
int nof_prb, bool advance_output) {

View File

@ -29,7 +29,7 @@
#include <string.h>
#include <strings.h>
#include <math.h>
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/utils/bit.h"
#include "liblte/phy/utils/vector.h"
#include "liblte/phy/utils/debug.h"

View File

@ -30,7 +30,7 @@
#include <stdlib.h>
#include <math.h>
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/phch/regs.h"
#include "liblte/phy/utils/debug.h"

View File

@ -27,7 +27,7 @@
#include <strings.h>
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/common/sequence.h"
/**

View File

@ -118,5 +118,41 @@ ADD_TEST(phich_file_test phich_file_test -c 150 -n 50 -p 2 -i ${CMAKE_CURRENT_SO
ADD_TEST(pdcch_file_test pdcch_file_test -c 1 -f 3 -n 6 -p 1 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.amar.dat)
ADD_TEST(pdsch_file_test pdsch_file_test -c 1 -f 3 -n 6 -p 1 -i ${CMAKE_CURRENT_SOURCE_DIR}/signal.1.92M.amar.dat)
########################################################################
# PRACH TEST
########################################################################
ADD_EXECUTABLE(prach_test prach_test.c)
TARGET_LINK_LIBRARIES(prach_test lte_phy)
ADD_TEST(prach prach_test)
ADD_TEST(prach_256 prach_test -N 256)
ADD_TEST(prach_512 prach_test -N 512)
ADD_TEST(prach_1024 prach_test -N 1024)
ADD_TEST(prach_1536 prach_test -N 1536)
ADD_TEST(prach_2048 prach_test -N 2048)
ADD_TEST(prach_f0 prach_test -f 0)
ADD_TEST(prach_f1 prach_test -f 1)
ADD_TEST(prach_f2 prach_test -f 2)
ADD_TEST(prach_f3 prach_test -f 3)
ADD_TEST(prach_rs1 prach_test -r 1)
ADD_TEST(prach_rs2 prach_test -r 2)
ADD_TEST(prach_rs3 prach_test -r 3)
ADD_TEST(prach_zc0 prach_test -z 0)
ADD_TEST(prach_zc2 prach_test -z 2)
ADD_TEST(prach_zc3 prach_test -z 3)
ADD_EXECUTABLE(prach_test_multi prach_test_multi.c)
TARGET_LINK_LIBRARIES(prach_test_multi lte_phy)
ADD_TEST(prach_test_multi prach_test_multi)
ADD_TEST(prach_test_multi_n32 prach_test_multi -n 32)
ADD_TEST(prach_test_multi_n16 prach_test_multi -n 16)
ADD_TEST(prach_test_multi_n8 prach_test_multi -n 8)
ADD_TEST(prach_test_multi_n4 prach_test_multi -n 4)

View File

@ -6,7 +6,7 @@
#include <time.h>
#include <complex.h>
#include "liblte/phy/prach/prach.h"
#include "liblte/phy/phch/prach.h"
#define MAX_LEN 70176
typedef _Complex float cf_t;

View File

@ -6,7 +6,7 @@
#include <time.h>
#include <complex.h>
#include "liblte/phy/prach/prach.h"
#include "liblte/phy/phch/prach.h"
#define MAX_LEN 70176
typedef _Complex float cf_t;

View File

@ -1,61 +0,0 @@
#
# Copyright 2012-2013 The libLTE Developers. See the
# COPYRIGHT file at the top-level directory of this distribution.
#
# 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/.
#
########################################################################
# PRACH TEST
########################################################################
ADD_EXECUTABLE(prach_test prach_test.c)
TARGET_LINK_LIBRARIES(prach_test lte_phy)
ADD_EXECUTABLE(prach_bench prach_bench.c)
TARGET_LINK_LIBRARIES(prach_bench lte_phy)
ADD_TEST(prach prach_test)
ADD_TEST(prach_256 prach_test -N 256)
ADD_TEST(prach_512 prach_test -N 512)
ADD_TEST(prach_1024 prach_test -N 1024)
ADD_TEST(prach_1536 prach_test -N 1536)
ADD_TEST(prach_2048 prach_test -N 2048)
ADD_TEST(prach_f0 prach_test -f 0)
ADD_TEST(prach_f1 prach_test -f 1)
ADD_TEST(prach_f2 prach_test -f 2)
ADD_TEST(prach_f3 prach_test -f 3)
ADD_TEST(prach_rs1 prach_test -r 1)
ADD_TEST(prach_rs2 prach_test -r 2)
ADD_TEST(prach_rs3 prach_test -r 3)
ADD_TEST(prach_zc0 prach_test -z 0)
ADD_TEST(prach_zc2 prach_test -z 2)
ADD_TEST(prach_zc3 prach_test -z 3)
ADD_EXECUTABLE(prach_test_multi prach_test_multi.c)
TARGET_LINK_LIBRARIES(prach_test_multi lte_phy)
ADD_TEST(prach_test_multi prach_test_multi)
ADD_TEST(prach_test_multi_n32 prach_test_multi -n 32)
ADD_TEST(prach_test_multi_n16 prach_test_multi -n 16)
ADD_TEST(prach_test_multi_n8 prach_test_multi -n 8)
ADD_TEST(prach_test_multi_n4 prach_test_multi -n 4)

View File

@ -1,15 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
#include "liblte/phy/prach/prach.h"
typedef _Complex float cf_t;
int main(int argc, char **argv) {
exit(0);
}

View File

@ -30,7 +30,7 @@
#include <strings.h>
#include "liblte/phy/utils/debug.h"
#include "liblte/phy/common/base.h"
#include "liblte/phy/common/phy_common.h"
#include "liblte/phy/sync/sync.h"
int sync_init(sync_t *q, int frame_size) {