diff --git a/srslte/include/srslte/agc/agc.h b/srslte/include/srslte/agc/agc.h index c40a5d56a..4fd1b15ed 100644 --- a/srslte/include/srslte/agc/agc.h +++ b/srslte/include/srslte/agc/agc.h @@ -25,7 +25,14 @@ * */ - +/********************************************************************************************** + * File: agc.h + * + * Description: Automatic gain control + * This module is not currently used + * + * Reference: + *********************************************************************************************/ #ifndef AGC_ #define AGC_ @@ -36,10 +43,6 @@ #include "srslte/config.h" -/* Automatic Gain Control - * - */ - #define SRSLTE_AGC_DEFAULT_BW (5e-2) typedef struct SRSLTE_API{ diff --git a/srslte/include/srslte/ch_estimation/chest_dl.h b/srslte/include/srslte/ch_estimation/chest_dl.h index 978bffb40..259f69b2f 100644 --- a/srslte/include/srslte/ch_estimation/chest_dl.h +++ b/srslte/include/srslte/ch_estimation/chest_dl.h @@ -25,7 +25,19 @@ * */ - +/********************************************************************************************** + * File: chest_dl.h + * + * Description: 3GPP LTE Downlink channel estimator and equalizer. + * Estimates the channel in the resource elements transmitting references and + * interpolates for the rest of the resource grid. + * The equalizer uses the channel estimates to produce an estimation of the + * transmitted symbol. + * This object depends on the srslte_refsignal_t object for creating the LTE + * CSR signal. + * + * Reference: + *********************************************************************************************/ #ifndef CHEST_DL_ #define CHEST_DL_ @@ -38,15 +50,6 @@ #include "srslte/ch_estimation/refsignal_dl.h" #include "srslte/common/phy_common.h" -/** 3GPP LTE Downlink channel estimator and equalizer. - * Estimates the channel in the resource elements transmitting references and interpolates for the rest - * of the resource grid. - * - * The equalizer uses the channel estimates to produce an estimation of the transmitted symbol. - * - * This object depends on the srslte_refsignal_t object for creating the LTE CSR signal. -*/ - #define SRSLTE_CHEST_MAX_FILTER_FREQ_LEN 10 #define SRSLTE_CHEST_MAX_FILTER_TIME_LEN 4 @@ -110,4 +113,4 @@ SRSLTE_API float srslte_chest_dl_get_rsrq(srslte_chest_dl_t *q); SRSLTE_API float srslte_chest_dl_get_rsrp(srslte_chest_dl_t *q); -#endif \ No newline at end of file +#endif diff --git a/srslte/include/srslte/ch_estimation/refsignal_dl.h b/srslte/include/srslte/ch_estimation/refsignal_dl.h index 2f744b0a3..c7e3c03ff 100644 --- a/srslte/include/srslte/ch_estimation/refsignal_dl.h +++ b/srslte/include/srslte/ch_estimation/refsignal_dl.h @@ -25,13 +25,17 @@ * */ +/********************************************************************************************** + * File: refsignal_dl.h + * + * Description: Object to manage downlink reference signals for channel estimation. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.10 + *********************************************************************************************/ + #ifndef SRSLTE_REFSIGNAL_DL_ #define SRSLTE_REFSIGNAL_DL_ -/* Object to manage Downlink reference signals for channel estimation. - * - */ - #include "srslte/config.h" #include "srslte/common/phy_common.h" diff --git a/srslte/include/srslte/ch_estimation/refsignal_ul.h b/srslte/include/srslte/ch_estimation/refsignal_ul.h index 79d487946..a61262d7d 100644 --- a/srslte/include/srslte/ch_estimation/refsignal_ul.h +++ b/srslte/include/srslte/ch_estimation/refsignal_ul.h @@ -25,13 +25,17 @@ * */ +/********************************************************************************************** + * File: refsignal_ul.h + * + * Description: Object to manage uplink reference signals for channel estimation. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.5 + *********************************************************************************************/ + #ifndef SRSLTE_REFSIGNAL_UL_ #define SRSLTE_REFSIGNAL_UL_ -/* Object to manage Downlink reference signals for channel estimation. - * - */ - #include "srslte/config.h" #include "srslte/phch/pucch.h" #include "srslte/common/phy_common.h" diff --git a/srslte/include/srslte/channel/ch_awgn.h b/srslte/include/srslte/channel/ch_awgn.h index 4d945be28..e323978bf 100644 --- a/srslte/include/srslte/channel/ch_awgn.h +++ b/srslte/include/srslte/channel/ch_awgn.h @@ -25,6 +25,13 @@ * */ +/********************************************************************************************** + * File: ch_awgn.h + * + * Description: Additive white gaussian noise channel object + * + * Reference: + *********************************************************************************************/ #include #include diff --git a/srslte/include/srslte/common/phy_common.h b/srslte/include/srslte/common/phy_common.h index 0810a08ac..b4ae2f3db 100644 --- a/srslte/include/srslte/common/phy_common.h +++ b/srslte/include/srslte/common/phy_common.h @@ -25,6 +25,13 @@ * */ +/********************************************************************************************** + * File: phy_common.h + * + * Description: Common parameters and lookup functions for PHY + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 + *********************************************************************************************/ #ifndef _LTEBASE_ #define _LTEBASE_ diff --git a/srslte/include/srslte/common/sequence.h b/srslte/include/srslte/common/sequence.h index 5637fcd6c..5b8fceddf 100644 --- a/srslte/include/srslte/common/sequence.h +++ b/srslte/include/srslte/common/sequence.h @@ -25,6 +25,15 @@ * */ +/********************************************************************************************** + * File: sequence.h + * + * Description: Pseudo Random Sequence generation. Sequences are defined by a length-31 Gold + * sequence. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 7.2 + *********************************************************************************************/ + #ifndef LTESEQ_ #define LTESEQ_ diff --git a/srslte/include/srslte/common/timestamp.h b/srslte/include/srslte/common/timestamp.h index a7b0d69a3..26f8c736a 100644 --- a/srslte/include/srslte/common/timestamp.h +++ b/srslte/include/srslte/common/timestamp.h @@ -25,6 +25,15 @@ * */ +/********************************************************************************************** + * File: timestamp.h + * + * Description: A simple timestamp struct with separate variables for full and frac seconds. + * Separate variables are used to avoid loss of precision in our frac seconds. + * Only positive timestamps are supported. + * + * Reference: + *********************************************************************************************/ #ifndef TIMESTAMP_ #define TIMESTAMP_ @@ -32,13 +41,6 @@ #include #include "srslte/config.h" -/*! - * A simple timestamp struct with separate variables for full and frac seconds. - * - * Separate variables are used to avoid loss of precision in our frac seconds. - * Only positive timestamps are supported. - */ - typedef struct SRSLTE_API{ time_t full_secs; double frac_secs; diff --git a/srslte/include/srslte/dft/dft.h b/srslte/include/srslte/dft/dft.h index fec958baf..680e8575d 100644 --- a/srslte/include/srslte/dft/dft.h +++ b/srslte/include/srslte/dft/dft.h @@ -32,18 +32,23 @@ #include #include "srslte/config.h" - -/* Generic DFT module. - * Supports one-dimensional complex and real transforms. Options are set - * using the dft_plan_set_x functions. +/********************************************************************************************** + * File: dft.h * - * Options (default is false): - * mirror - Rearranges negative and positive frequency bins. Swaps after - * transform for FORWARD, swaps before transform for BACKWARD. - * db - Provides output in dB (10*log10(x)). - * norm - Normalizes output (by sqrt(len) for complex, len for real). - * dc - Handles insertion and removal of null DC carrier internally. - */ + * Description: Generic DFT module. + * Supports one-dimensional complex and real transforms. Options are set + * using the dft_plan_set_x functions. + * + * Options (default is false): + * + * mirror - Rearranges negative and positive frequency bins. Swaps after + * transform for FORWARD, swaps before transform for BACKWARD. + * db - Provides output in dB (10*log10(x)). + * norm - Normalizes output (by sqrt(len) for complex, len for real). + * dc - Handles insertion and removal of null DC carrier internally. + * + * Reference: + *********************************************************************************************/ typedef enum { SRSLTE_DFT_COMPLEX, SRSLTE_REAL diff --git a/srslte/include/srslte/dft/dft_precoding.h b/srslte/include/srslte/dft/dft_precoding.h index 9465fb273..c5dbc17a5 100644 --- a/srslte/include/srslte/dft/dft_precoding.h +++ b/srslte/include/srslte/dft/dft_precoding.h @@ -25,6 +25,14 @@ * */ +/********************************************************************************************** + * File: dft_precoding.h + * + * Description: DFT-based transform precoding object. + * Used in generation of uplink SCFDMA signals. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.3.3 + *********************************************************************************************/ #ifndef DFTPREC_ #define DFTPREC_ diff --git a/srslte/include/srslte/dft/ofdm.h b/srslte/include/srslte/dft/ofdm.h index a46fcb971..36964c53f 100644 --- a/srslte/include/srslte/dft/ofdm.h +++ b/srslte/include/srslte/dft/ofdm.h @@ -29,6 +29,14 @@ #ifndef LTEFFT_ #define LTEFFT_ +/********************************************************************************************** + * File: ofdm.h + * + * Description: OFDM modulation object. + * Used in generation of downlink OFDM signals. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6 + *********************************************************************************************/ #include #include diff --git a/srslte/include/srslte/fec/convcoder.h b/srslte/include/srslte/fec/convcoder.h index 5621ced11..9117070b3 100644 --- a/srslte/include/srslte/fec/convcoder.h +++ b/srslte/include/srslte/fec/convcoder.h @@ -25,7 +25,15 @@ * */ - +/********************************************************************************************** + * File: convcoder.h + * + * Description: Convolutional encoder. + * LTE uses a tail biting convolutional code with constraint length 7 + * and coding rate 1/3. + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.3.1 + *********************************************************************************************/ #ifndef CONVCODER_ #define CONVCODER_ diff --git a/srslte/include/srslte/fec/crc.h b/srslte/include/srslte/fec/crc.h index 0bc94c24b..6ec73b7d5 100644 --- a/srslte/include/srslte/fec/crc.h +++ b/srslte/include/srslte/fec/crc.h @@ -25,6 +25,15 @@ * */ +/********************************************************************************************** + * File: convcoder.h + * + * Description: Cyclic Redundancy Check + * LTE requires CRC lengths 8, 16, 24A and 24B, each with it's own generator + * polynomial. + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.1 + *********************************************************************************************/ #ifndef CRC_ #define CRC_ diff --git a/srslte/include/srslte/fec/rm_conv.h b/srslte/include/srslte/fec/rm_conv.h index dc924fedd..178f42685 100644 --- a/srslte/include/srslte/fec/rm_conv.h +++ b/srslte/include/srslte/fec/rm_conv.h @@ -25,6 +25,15 @@ * */ +/********************************************************************************************** + * File: rm_conv.h + * + * Description: Rate matching for convolutionally coded transport channels and control + * information. + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.4.2 + *********************************************************************************************/ + #ifndef RM_CONV_ #define RM_CONV_ diff --git a/srslte/include/srslte/fec/rm_turbo.h b/srslte/include/srslte/fec/rm_turbo.h index 200b5e6ac..ff01ecea6 100644 --- a/srslte/include/srslte/fec/rm_turbo.h +++ b/srslte/include/srslte/fec/rm_turbo.h @@ -25,6 +25,14 @@ * */ +/********************************************************************************************** + * File: rm_turbo.h + * + * Description: Rate matching for turbo coded transport channels. + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.4.1 + *********************************************************************************************/ + #ifndef RM_TURBO_ #define RM_TURBO_ diff --git a/srslte/include/srslte/fec/tc_interl.h b/srslte/include/srslte/fec/tc_interl.h index e91697f9c..27300fe69 100644 --- a/srslte/include/srslte/fec/tc_interl.h +++ b/srslte/include/srslte/fec/tc_interl.h @@ -25,6 +25,14 @@ * */ +/********************************************************************************************** + * File: tc_interl.h + * + * Description: Turbo code interleaver. + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.3.2.3 + *********************************************************************************************/ + #ifndef _TC_INTERL_H #define _TC_INTERL_H diff --git a/srslte/include/srslte/fec/turbocoder.h b/srslte/include/srslte/fec/turbocoder.h index 860d04830..945862f25 100644 --- a/srslte/include/srslte/fec/turbocoder.h +++ b/srslte/include/srslte/fec/turbocoder.h @@ -25,6 +25,17 @@ * */ +/********************************************************************************************** + * File: turbocoder.h + * + * Description: Turbo coder. + * Parallel Concatenated Convolutional Code (PCCC) with two 8-state constituent + * encoders and one turbo code internal interleaver. The coding rate of turbo + * encoder is 1/3. + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.3.2 + *********************************************************************************************/ + #ifndef TURBOCODER_ #define TURBOCODER_ diff --git a/srslte/include/srslte/fec/turbodecoder.h b/srslte/include/srslte/fec/turbodecoder.h index 5a363ba5d..afd3905ad 100644 --- a/srslte/include/srslte/fec/turbodecoder.h +++ b/srslte/include/srslte/fec/turbodecoder.h @@ -25,6 +25,18 @@ * */ +/********************************************************************************************** + * File: turbodecoder.h + * + * Description: Turbo Decoder. + * Parallel Concatenated Convolutional Code (PCCC) with two 8-state constituent + * encoders and one turbo code internal interleaver. The coding rate of turbo + * encoder is 1/3. + * MAP_GEN is the MAX-LOG-MAP generic implementation of the decoder. + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.3.2 + *********************************************************************************************/ + #ifndef TURBODECODER_ #define TURBODECODER_ diff --git a/srslte/include/srslte/fec/viterbi.h b/srslte/include/srslte/fec/viterbi.h index 1674b248a..d12237c75 100644 --- a/srslte/include/srslte/fec/viterbi.h +++ b/srslte/include/srslte/fec/viterbi.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: viterbi.h + * + * Description: Viterbi decoder for convolutionally encoded data. + * Used for decoding of PBCH and PDCCH (type 37 decoder). + * + * Reference: + *****************************************************************************/ #ifndef VITERBI_ #define VITERBI_ diff --git a/srslte/include/srslte/io/binsource.h b/srslte/include/srslte/io/binsource.h index 049f8fa3d..fbc601894 100644 --- a/srslte/include/srslte/io/binsource.h +++ b/srslte/include/srslte/io/binsource.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: binsource.h + * + * Description: Pseudo-random binary source. + * + * Reference: + *****************************************************************************/ #ifndef BINSOURCE_ #define BINSOURCE_ diff --git a/srslte/include/srslte/io/filesink.h b/srslte/include/srslte/io/filesink.h index 5e16de20d..fa76b89df 100644 --- a/srslte/include/srslte/io/filesink.h +++ b/srslte/include/srslte/io/filesink.h @@ -25,6 +25,15 @@ * */ +/****************************************************************************** + * File: filesink.h + * + * Description: File sink. + * Supports writing floats, complex floats and complex shorts + * to file in text or binary formats. + * + * Reference: + *****************************************************************************/ #ifndef FILESINK_ #define FILESINK_ diff --git a/srslte/include/srslte/io/filesource.h b/srslte/include/srslte/io/filesource.h index 3907213ed..4903090d5 100644 --- a/srslte/include/srslte/io/filesource.h +++ b/srslte/include/srslte/io/filesource.h @@ -25,6 +25,15 @@ * */ +/****************************************************************************** + * File: filesource.h + * + * Description: File source. + * Supports reading floats, complex floats and complex shorts + * from file in text or binary formats. + * + * Reference: + *****************************************************************************/ #ifndef FILESOURCE_ #define FILESOURCE_ diff --git a/srslte/include/srslte/io/netsink.h b/srslte/include/srslte/io/netsink.h index 03f697a28..0783e47d8 100644 --- a/srslte/include/srslte/io/netsink.h +++ b/srslte/include/srslte/io/netsink.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: netsink.h + * + * Description: Network socket sink. + * Supports writing binary data to a TCP or UDP socket. + * + * Reference: + *****************************************************************************/ #ifndef NETSINK_ #define NETSINK_ diff --git a/srslte/include/srslte/io/netsource.h b/srslte/include/srslte/io/netsource.h index d192dbe86..bf8dccc66 100644 --- a/srslte/include/srslte/io/netsource.h +++ b/srslte/include/srslte/io/netsource.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: netsource.h + * + * Description: Network socket source. + * Supports reading binary data from a TCP or UDP socket. + * + * Reference: + *****************************************************************************/ #ifndef NETSOURCE_ #define NETSOURCE_ diff --git a/srslte/include/srslte/mimo/layermap.h b/srslte/include/srslte/mimo/layermap.h index 697c61846..be6bb6ebb 100644 --- a/srslte/include/srslte/mimo/layermap.h +++ b/srslte/include/srslte/mimo/layermap.h @@ -25,6 +25,15 @@ * */ +/****************************************************************************** + * File: layermap.h + * + * Description: MIMO layer mapping and demapping. + * Single antenna, tx diversity and spatial multiplexing are + * supported. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.3.3 + *****************************************************************************/ #ifndef LAYERMAP_H_ #define LAYERMAP_H_ diff --git a/srslte/include/srslte/mimo/precoding.h b/srslte/include/srslte/mimo/precoding.h index 4336a65e0..20cec2671 100644 --- a/srslte/include/srslte/mimo/precoding.h +++ b/srslte/include/srslte/mimo/precoding.h @@ -25,6 +25,15 @@ * */ +/****************************************************************************** + * File: precoding.h + * + * Description: MIMO precoding and deprecoding. + * Single antenna and tx diversity supported. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.3.4 + *****************************************************************************/ + #ifndef PRECODING_H_ #define PRECODING_H_ diff --git a/srslte/include/srslte/modem/demod_hard.h b/srslte/include/srslte/modem/demod_hard.h index 76c1af0d2..5fe112c03 100644 --- a/srslte/include/srslte/modem/demod_hard.h +++ b/srslte/include/srslte/modem/demod_hard.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: demod_hard.h + * + * Description: Hard demodulator. + * Supports BPSK, QPSK, 16QAM and 64QAM. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 7.1 + *****************************************************************************/ #ifndef DEMOD_HARD_ #define DEMOD_HARD_ diff --git a/srslte/include/srslte/modem/demod_soft.h b/srslte/include/srslte/modem/demod_soft.h index 5c0f53dd9..942441caa 100644 --- a/srslte/include/srslte/modem/demod_soft.h +++ b/srslte/include/srslte/modem/demod_soft.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: demod_soft.h + * + * Description: Soft demodulator. + * Supports BPSK, QPSK, 16QAM and 64QAM. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 7.1 + *****************************************************************************/ #ifndef DEMOD_SOFT_ #define DEMOD_SOFT_ @@ -43,7 +51,7 @@ typedef enum SRSLTE_API { typedef struct SRSLTE_API { float sigma; // noise power srslte_demod_soft_alg_t alg_type; // soft demapping algorithm (SRSLTE_DEMOD_SOFT_ALG_EXACT or SRSLTE_DEMOD_SOFT_ALG_APPROX) - srslte_srslte_modem_table_t *table; // symbol mapping table (see modem_table.h) + srslte_modem_table_t *table; // symbol mapping table (see modem_table.h) uint32_t *zones; float *dd; uint32_t max_symbols; @@ -55,7 +63,7 @@ SRSLTE_API int srslte_demod_soft_init(srslte_demod_soft_t *q, SRSLTE_API void srslte_demod_soft_free(srslte_demod_soft_t *q); SRSLTE_API void srslte_demod_soft_table_set(srslte_demod_soft_t *q, - srslte_srslte_modem_table_t *table); + srslte_modem_table_t *table); SRSLTE_API void srslte_demod_soft_alg_set(srslte_demod_soft_t *q, srslte_demod_soft_alg_t alg_type); @@ -72,7 +80,7 @@ SRSLTE_API int srslte_demod_soft_demodulate(srslte_demod_soft_t *q, /* High-level API */ typedef struct SRSLTE_API { srslte_demod_soft_t obj; - srslte_srslte_modem_table_t table; + srslte_modem_table_t table; struct srslte_demod_soft_init{ srslte_mod_t std; // symbol mapping standard (see modem_table.h) diff --git a/srslte/include/srslte/modem/mod.h b/srslte/include/srslte/modem/mod.h index 627b47de1..2295c088e 100644 --- a/srslte/include/srslte/modem/mod.h +++ b/srslte/include/srslte/modem/mod.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: mod.h + * + * Description: Modulation. + * Supports BPSK, QPSK, 16QAM and 64QAM. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 7.1 + *****************************************************************************/ #ifndef MOD_ #define MOD_ @@ -35,14 +43,14 @@ #include "srslte/config.h" #include "modem_table.h" -SRSLTE_API int srslte_mod_modulate(srslte_srslte_modem_table_t* table, +SRSLTE_API int srslte_mod_modulate(srslte_modem_table_t* table, uint8_t *bits, cf_t* symbols, uint32_t nbits); /* High-level API */ typedef struct SRSLTE_API { - srslte_srslte_modem_table_t obj; + srslte_modem_table_t obj; struct mod_init { srslte_mod_t std; // symbol mapping standard (see modem_table.h) } init; diff --git a/srslte/include/srslte/modem/modem_table.h b/srslte/include/srslte/modem/modem_table.h index 42b14a8f9..3a349b297 100644 --- a/srslte/include/srslte/modem/modem_table.h +++ b/srslte/include/srslte/modem/modem_table.h @@ -25,7 +25,14 @@ * */ - +/****************************************************************************** + * File: modem_table.h + * + * Description: Modem tables used for modulation/demodulation. + * Supports BPSK, QPSK, 16QAM and 64QAM. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 7.1 + *****************************************************************************/ #ifndef MODEM_TABLE_ #define MODEM_TABLE_ @@ -49,22 +56,22 @@ typedef struct SRSLTE_API { srslte_soft_table_t soft_table; // symbol-to-bit mapping (used in soft demodulating) uint32_t nsymbols; // number of modulation symbols uint32_t nbits_x_symbol; // number of bits per symbol -}srslte_srslte_modem_table_t; +}srslte_modem_table_t; -SRSLTE_API void srslte_modem_table_init(srslte_srslte_modem_table_t* q); +SRSLTE_API void srslte_modem_table_init(srslte_modem_table_t* q); -SRSLTE_API void srslte_modem_table_free(srslte_srslte_modem_table_t* q); +SRSLTE_API void srslte_modem_table_free(srslte_modem_table_t* q); -SRSLTE_API void srslte_modem_table_reset(srslte_srslte_modem_table_t* q); +SRSLTE_API void srslte_modem_table_reset(srslte_modem_table_t* q); -SRSLTE_API int srslte_modem_table_set(srslte_srslte_modem_table_t* q, +SRSLTE_API int srslte_modem_table_set(srslte_modem_table_t* q, cf_t* table, srslte_soft_table_t *soft_table, uint32_t nsymbols, uint32_t nbits_x_symbol); -SRSLTE_API int srslte_modem_table_lte(srslte_srslte_modem_table_t* q, +SRSLTE_API int srslte_modem_table_lte(srslte_modem_table_t* q, srslte_mod_t modulation, bool compute_soft_demod); diff --git a/srslte/include/srslte/phch/cqi.h b/srslte/include/srslte/phch/cqi.h index ff2a14309..183021a60 100644 --- a/srslte/include/srslte/phch/cqi.h +++ b/srslte/include/srslte/phch/cqi.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: cqi.h + * + * Description: Channel quality indicator message packing. + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.2.2.6, 5.2.3.3 + *****************************************************************************/ + #ifndef CQI_ #define CQI_ @@ -33,11 +41,6 @@ #include "srslte/config.h" #include "srslte/common/phy_common.h" -/** - * CQI message generation according to 36.212 Sections 5.2.2.6 and 5.2.3.3 - * - */ - /* Table 5.2.2.6.2-1: Fields for channel quality information feedback for higher layer configured subband CQI reports diff --git a/srslte/include/srslte/phch/dci.h b/srslte/include/srslte/phch/dci.h index 831d7e132..412bb4d8f 100644 --- a/srslte/include/srslte/phch/dci.h +++ b/srslte/include/srslte/phch/dci.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: dci.h + * + * Description: Downlink control information (DCI) + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.3.3 + *****************************************************************************/ + #ifndef DCI_ #define DCI_ @@ -34,13 +42,6 @@ #include "srslte/common/phy_common.h" #include "srslte/phch/ra.h" -/** - * DCI message generation according to the formats, as specified in - * 36.212 Section 5.3.3.1 - * - */ - - #define DCI_MAX_BITS 57 typedef enum { diff --git a/srslte/include/srslte/phch/harq.h b/srslte/include/srslte/phch/harq.h index 9466035b4..5d1c19cbc 100644 --- a/srslte/include/srslte/phch/harq.h +++ b/srslte/include/srslte/phch/harq.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: harq.h + * + * Description: Hybrid Automatic Repeat Request (HARQ) + * + * Reference: + *****************************************************************************/ #ifndef HARQ_ #define HARQ_ @@ -88,4 +95,4 @@ SRSLTE_API int srslte_harq_codeblock_segmentation(srslte_harq_cbsegm_t *s, uint32_t tbs); -#endif \ No newline at end of file +#endif diff --git a/srslte/include/srslte/phch/pbch.h b/srslte/include/srslte/phch/pbch.h index 9bcf92c14..aeb4bf9b1 100644 --- a/srslte/include/srslte/phch/pbch.h +++ b/srslte/include/srslte/phch/pbch.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: pbch.h + * + * Description: Physical broadcast channel. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.6 + *****************************************************************************/ #ifndef PBCH_ #define PBCH_ @@ -69,7 +76,7 @@ typedef struct SRSLTE_API { uint32_t frame_idx; /* tx & rx objects */ - srslte_srslte_modem_table_t mod; + srslte_modem_table_t mod; srslte_demod_soft_t demod; srslte_sequence_t seq; srslte_viterbi_t decoder; diff --git a/srslte/include/srslte/phch/pcfich.h b/srslte/include/srslte/phch/pcfich.h index 1cd97c274..15457c7b1 100644 --- a/srslte/include/srslte/phch/pcfich.h +++ b/srslte/include/srslte/phch/pcfich.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: pcfich.h + * + * Description: Physical control format indicator channel + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.7 + *****************************************************************************/ + #ifndef PCFICH_ #define PCFICH_ @@ -64,7 +72,7 @@ typedef struct SRSLTE_API { float data_f[PCFICH_CFI_LEN]; /* tx & rx objects */ - srslte_srslte_modem_table_t mod; + srslte_modem_table_t mod; srslte_demod_soft_t demod; srslte_sequence_t seq[SRSLTE_NSUBFRAMES_X_FRAME]; srslte_precoding_t precoding; diff --git a/srslte/include/srslte/phch/pdcch.h b/srslte/include/srslte/phch/pdcch.h index 4a9694585..7e61ae344 100644 --- a/srslte/include/srslte/phch/pdcch.h +++ b/srslte/include/srslte/phch/pdcch.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: pdcch.h + * + * Description: Physical downlink control channel. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.8 + *****************************************************************************/ + #ifndef PDCCH_ #define PDCCH_ @@ -69,7 +77,7 @@ typedef struct SRSLTE_API { float *llr; /* tx & rx objects */ - srslte_srslte_modem_table_t mod; + srslte_modem_table_t mod; srslte_demod_soft_t demod; srslte_sequence_t seq[SRSLTE_NSUBFRAMES_X_FRAME]; srslte_viterbi_t decoder; diff --git a/srslte/include/srslte/phch/pdsch.h b/srslte/include/srslte/phch/pdsch.h index a3a923b13..32b99a261 100644 --- a/srslte/include/srslte/phch/pdsch.h +++ b/srslte/include/srslte/phch/pdsch.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: pdsch.h + * + * Description: Physical downlink shared channel + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.4 + *****************************************************************************/ #ifndef PDSCH_ #define PDSCH_ @@ -62,7 +69,7 @@ typedef struct SRSLTE_API { void *e; /* tx & rx objects */ - srslte_srslte_modem_table_t mod[4]; + srslte_modem_table_t mod[4]; srslte_demod_soft_t demod; srslte_sequence_t seq[SRSLTE_NSUBFRAMES_X_FRAME]; srslte_precoding_t precoding; diff --git a/srslte/include/srslte/phch/phich.h b/srslte/include/srslte/phch/phich.h index 20e9da050..58828e962 100644 --- a/srslte/include/srslte/phch/phich.h +++ b/srslte/include/srslte/phch/phich.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: phich.h + * + * Description: Physical Hybrid ARQ indicator channel. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.9 + *****************************************************************************/ #ifndef PHICH_ #define PHICH_ @@ -76,7 +83,7 @@ typedef struct SRSLTE_API { uint8_t data[SRSLTE_PHICH_NBITS]; /* tx & rx objects */ - srslte_srslte_modem_table_t mod; + srslte_modem_table_t mod; srslte_demod_hard_t demod; srslte_sequence_t seq[SRSLTE_NSUBFRAMES_X_FRAME]; srslte_precoding_t precoding; diff --git a/srslte/include/srslte/phch/prach.h b/srslte/include/srslte/phch/prach.h index 6b001b600..515f6de15 100644 --- a/srslte/include/srslte/phch/prach.h +++ b/srslte/include/srslte/phch/prach.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: prach.h + * + * Description: Physical random access channel. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.7 + *****************************************************************************/ + #ifndef PRACH_ #define PRACH_ diff --git a/srslte/include/srslte/phch/pucch.h b/srslte/include/srslte/phch/pucch.h index 6b7128da2..e12812678 100644 --- a/srslte/include/srslte/phch/pucch.h +++ b/srslte/include/srslte/phch/pucch.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: pucch.h + * + * Description: Physical uplink control channel. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.4 + *****************************************************************************/ #ifndef PUCCH_ #define PUCCH_ diff --git a/srslte/include/srslte/phch/pusch.h b/srslte/include/srslte/phch/pusch.h index e8d559162..94a81c607 100644 --- a/srslte/include/srslte/phch/pusch.h +++ b/srslte/include/srslte/phch/pusch.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: pusch.h + * + * Description: Physical uplink shared channel. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.3 + *****************************************************************************/ #ifndef PUSCH_ #define PUSCH_ @@ -81,7 +88,7 @@ typedef struct SRSLTE_API { void *g; /* tx & rx objects */ - srslte_srslte_modem_table_t mod[4]; + srslte_modem_table_t mod[4]; srslte_demod_soft_t demod; srslte_sequence_t seq[SRSLTE_NSUBFRAMES_X_FRAME]; srslte_sequence_t seq_type2_fo; diff --git a/srslte/include/srslte/phch/ra.h b/srslte/include/srslte/phch/ra.h index 956734e90..2d835e5e1 100644 --- a/srslte/include/srslte/phch/ra.h +++ b/srslte/include/srslte/phch/ra.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: ra.h + * + * Description: Structures and utility functions for DL/UL resource allocation. + * + * Reference: 3GPP TS 36.213 version 10.0.1 Release 10 + *****************************************************************************/ + #ifndef RB_ALLOC_H_ #define RB_ALLOC_H_ @@ -34,10 +42,6 @@ #include "srslte/config.h" #include "srslte/common/phy_common.h" -/** Structures and utility functions for DL/UL resource - * allocation. - */ - typedef struct SRSLTE_API { srslte_mod_t mod; int tbs; diff --git a/srslte/include/srslte/phch/regs.h b/srslte/include/srslte/phch/regs.h index 9b57fada8..04d899412 100644 --- a/srslte/include/srslte/phch/regs.h +++ b/srslte/include/srslte/phch/regs.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: regs.h + * + * Description: Resource element mapping functions. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 + *****************************************************************************/ #ifndef _REGS_H_ #define _REGS_H_ diff --git a/srslte/include/srslte/phch/sch.h b/srslte/include/srslte/phch/sch.h index c8ad8c654..8ea6e4815 100644 --- a/srslte/include/srslte/phch/sch.h +++ b/srslte/include/srslte/phch/sch.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: sch.h + * + * Description: Common UL and DL shared channel encode/decode functions. + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 + *****************************************************************************/ #ifndef SCH_ #define SCH_ diff --git a/srslte/include/srslte/phch/uci.h b/srslte/include/srslte/phch/uci.h index 5eb0e77e2..61fdb4f48 100644 --- a/srslte/include/srslte/phch/uci.h +++ b/srslte/include/srslte/phch/uci.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: uci.h + * + * Description: Uplink control information. + * + * Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.2.3, 5.2.4 + *****************************************************************************/ #ifndef UCI_ #define UCI_ @@ -88,4 +95,4 @@ SRSLTE_API int srslte_uci_encode_ri(uint8_t data, uint8_t *q_bits); -#endif \ No newline at end of file +#endif diff --git a/srslte/include/srslte/resampling/decim.h b/srslte/include/srslte/resampling/decim.h index 7897cfb14..44e144c3c 100644 --- a/srslte/include/srslte/resampling/decim.h +++ b/srslte/include/srslte/resampling/decim.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: decim.h + * + * Description: Integer linear decimation + * + * Reference: + *****************************************************************************/ + #ifndef DECIM_H #define DECIM_H diff --git a/srslte/include/srslte/resampling/interp.h b/srslte/include/srslte/resampling/interp.h index 353f91371..49b103bcc 100644 --- a/srslte/include/srslte/resampling/interp.h +++ b/srslte/include/srslte/resampling/interp.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: interp.h + * + * Description: Linear and vector interpolation + * + * Reference: + *****************************************************************************/ + #ifndef INTERP_H #define INTERP_H diff --git a/srslte/include/srslte/resampling/resample_arb.h b/srslte/include/srslte/resampling/resample_arb.h index d22192bfb..0d7a6b672 100644 --- a/srslte/include/srslte/resampling/resample_arb.h +++ b/srslte/include/srslte/resampling/resample_arb.h @@ -25,6 +25,16 @@ * */ +/****************************************************************************** + * File: resample_arb.h + * + * Description: Arbitrary rate resampler using a polyphase filter bank + * implementation. + * + * Reference: Multirate Signal Processing for Communication Systems + * fredric j. harris + *****************************************************************************/ + #ifndef RESAMPLE_ARB_ #define RESAMPLE_ARB_ diff --git a/srslte/include/srslte/scrambling/scrambling.h b/srslte/include/srslte/scrambling/scrambling.h index c4d285c58..8f5c7e9ae 100644 --- a/srslte/include/srslte/scrambling/scrambling.h +++ b/srslte/include/srslte/scrambling/scrambling.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: scrambling.h + * + * Description: Generic scrambling functions used by UL and DL channels. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.3.1, 6.3.1 + *****************************************************************************/ #ifndef SCRAMBLING_ #define SCRAMBLING_ diff --git a/srslte/include/srslte/sync/cfo.h b/srslte/include/srslte/sync/cfo.h index df33fb888..de85ebdd5 100644 --- a/srslte/include/srslte/sync/cfo.h +++ b/srslte/include/srslte/sync/cfo.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: cfo.h + * + * Description: Carrier frequency offset correction using complex exponentials. + * + * Reference: + *****************************************************************************/ #ifndef CFO_ #define CFO_ diff --git a/srslte/include/srslte/sync/pss.h b/srslte/include/srslte/sync/pss.h index e27e42db0..3ea092c35 100644 --- a/srslte/include/srslte/sync/pss.h +++ b/srslte/include/srslte/sync/pss.h @@ -25,6 +25,23 @@ * */ +/****************************************************************************** + * File: pss.h + * + * Description: Primary synchronization signal (PSS) generation and detection. + * + * The srslte_pss_synch_t object provides functions for fast + * computation of the crosscorrelation between the PSS and received + * signal and CFO estimation. Also, the function srslte_pss_synch_tperiodic() + * is designed to be called periodically every subframe, taking + * care of the correct data alignment with respect to the PSS sequence. + * + * The object is designed to work with signals sampled at 1.92 Mhz + * centered at the carrier frequency. Thus, downsampling is required + * if the signal is sampled at higher frequencies. + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.11.1 + *****************************************************************************/ #ifndef PSS_ #define PSS_ @@ -50,17 +67,6 @@ #define SRSLTE_PSS_RETURN_PSR // If enabled returns peak to side-lobe ratio, otherwise returns absolute peak value -/** - * The srslte_pss_synch_t object provides functions for fast computation of the crosscorrelation - * between the PSS and received signal and CFO estimation. Also, the function srslte_pss_synch_tperiodic() is designed - * to be called periodically every subframe, taking care of the correct data alignment with respect - * to the PSS sequence. - * - * The object is designed to work with signals sampled at 1.92 Mhz centered at the carrier frequency. - * Thus, downsampling is required if the signal is sampled at higher frequencies. - * - */ - /* Low-level API */ typedef struct SRSLTE_API { diff --git a/srslte/include/srslte/sync/sfo.h b/srslte/include/srslte/sync/sfo.h index a50252fe5..d17e7c482 100644 --- a/srslte/include/srslte/sync/sfo.h +++ b/srslte/include/srslte/sync/sfo.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: sfo.h + * + * Description: Sampling frequency offset estimation. + * + * Reference: + *****************************************************************************/ #ifndef SFO_ #define SFO_ diff --git a/srslte/include/srslte/sync/sss.h b/srslte/include/srslte/sync/sss.h index f7535576d..d57d27398 100644 --- a/srslte/include/srslte/sync/sss.h +++ b/srslte/include/srslte/sync/sss.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: sss.h + * + * Description: Secondary synchronization signal (SSS) generation and detection. + * + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.11.2 + *****************************************************************************/ #ifndef SSS_ #define SSS_ diff --git a/srslte/include/srslte/sync/sync.h b/srslte/include/srslte/sync/sync.h index 91d30a1fb..697645aae 100644 --- a/srslte/include/srslte/sync/sync.h +++ b/srslte/include/srslte/sync/sync.h @@ -25,6 +25,23 @@ * */ +/****************************************************************************** + * File: sync.h + * + * Description: Time and frequency synchronization using the PSS and SSS signals. + * + * The object is designed to work with signals sampled at 1.92 Mhz + * centered at the carrier frequency. Thus, downsampling is required + * if the signal is sampled at higher frequencies. + * + * Correlation peak is detected comparing the maximum at the output + * of the correlator with a threshold. The comparison accepts two + * modes: absolute value or peak-to-mean ratio, which are configured + * with the functions sync_pss_det_absolute() and sync_pss_det_peakmean(). + * + * + * Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.11.1, 6.11.2 + *****************************************************************************/ #ifndef SYNC_ #define SYNC_ @@ -40,18 +57,6 @@ #define SRSLTE_SYNC_FFT_SZ_MIN 64 #define SRSLTE_SYNC_FFT_SZ_MAX 2048 -/** - * - * This object performs time and frequency synchronization using the PSS and SSS signals. - * - * The object is designed to work with signals sampled at 1.92 Mhz centered at the carrier frequency. - * Thus, downsampling is required if the signal is sampled at higher frequencies. - * - * Correlation peak is detected comparing the maximum at the output of the correlator with a threshold. - * The comparison accepts two modes: absolute value or peak-to-mean ratio, which are configured with the - * functions sync_pss_det_absolute() and sync_pss_det_peakmean(). - */ - typedef enum {SSS_DIFF=0, SSS_PARTIAL_3=2, SSS_FULL=1} sss_alg_t; typedef struct SRSLTE_API { diff --git a/srslte/include/srslte/ue/ue_cell_search.h b/srslte/include/srslte/ue/ue_cell_search.h index b80dbcfbb..3b37d21b4 100644 --- a/srslte/include/srslte/ue/ue_cell_search.h +++ b/srslte/include/srslte/ue/ue_cell_search.h @@ -25,6 +25,22 @@ * */ +/****************************************************************************** + * File: ue_cell_search.h + * + * Description: Wrapper for the ue_sync object. + * + * This object is a wrapper to the ue_sync object. It receives + * several synchronized frames and obtains the most common cell_id + * and cp length. + * + * The I/O stream device sampling frequency must be set to 1.92 MHz + * (SRSLTE_CS_SAMP_FREQ constant) before calling to + * srslte_ue_cellsearch_scan() functions. + * + * Reference: + *****************************************************************************/ + #ifndef UE_CELLSEARCH_ #define UE_CELLSEARCH_ @@ -38,17 +54,6 @@ #include "srslte/phch/pbch.h" #include "srslte/dft/ofdm.h" -/************************************************************ - * - * This object is a wrapper to the ue_sync object. It receives - * several synchronized frames and obtains the most common cell_id - * and cp length. - * - * The I/O stream device sampling frequency must be set to 1.92 MHz (SRSLTE_CS_SAMP_FREQ constant) - * before calling to srslte_ue_cellsearch_scan() functions. - * - ************************************************************/ - /** * TODO: Check also peak offset */ diff --git a/srslte/include/srslte/ue/ue_dl.h b/srslte/include/srslte/ue/ue_dl.h index f078d712c..4207c74a9 100644 --- a/srslte/include/srslte/ue/ue_dl.h +++ b/srslte/include/srslte/ue/ue_dl.h @@ -25,17 +25,20 @@ * */ +/****************************************************************************** + * File: ue_dl.h + * + * Description: UE downlink object. + * + * This module is a frontend to all the downlink data and control + * channel processing modules. + * + * Reference: + *****************************************************************************/ + #ifndef UEDL_H #define UEDL_H -/******************************************************* - * - * This module is a frontend to all the data and control channels processing - * modules. - ********************************************************/ - - - #include "srslte/ch_estimation/chest_dl.h" #include "srslte/dft/ofdm.h" #include "srslte/common/phy_common.h" @@ -126,4 +129,4 @@ SRSLTE_API void srslte_ue_dl_reset(srslte_ue_dl_t *q); SRSLTE_API void srslte_ue_dl_set_rnti(srslte_ue_dl_t *q, uint16_t rnti); -#endif \ No newline at end of file +#endif diff --git a/srslte/include/srslte/ue/ue_mib.h b/srslte/include/srslte/ue/ue_mib.h index dea6031ee..ef77cadc5 100644 --- a/srslte/include/srslte/ue/ue_mib.h +++ b/srslte/include/srslte/ue/ue_mib.h @@ -25,27 +25,28 @@ * */ +/****************************************************************************** + * File: ue_mib.h + * + * Description: This object decodes the MIB from the PBCH of an LTE signal. + * + * The function srslte_ue_mib_decode() shall be called multiple + * times, each passing a number of samples multiple of 19200, + * sampled at 1.92 MHz (that is, 10 ms of samples). + * + * The function uses the sync_t object to find the PSS sequence and + * decode the PBCH to obtain the MIB. + * + * The function returns 0 until the MIB is decoded. + * + * See ue_cell_detect.c for an example. + * + * Reference: + *****************************************************************************/ + #ifndef UE_MIB_ #define UE_MIB_ - -/************************************************************ - * - * This object decodes the MIB from the PBCH of an LTE signal. - * - * The function srslte_ue_mib_decode() shall be called multiple times, - * each passing a number of samples multiple of 19200, sampled at 1.92 MHz - * (that is, 10 ms of samples). - * - * The function uses the sync_t object to find the PSS sequence and - * decode the PBCH to obtain the MIB. - * - * The function returns 0 until the MIB is decoded. - * - * See ue_cell_detect.c for an example. - * - ************************************************************/ - #include #include "srslte/config.h" diff --git a/srslte/include/srslte/ue/ue_phy.h b/srslte/include/srslte/ue/ue_phy.h index d7a56acae..c1b9e950c 100644 --- a/srslte/include/srslte/ue/ue_phy.h +++ b/srslte/include/srslte/ue/ue_phy.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: ue_phy.h + * + * Description: Top-level class wrapper for PHY layer. + * + * Reference: + *****************************************************************************/ + #include "srslte/srslte.h" #include "srslte/utils/queue.h" @@ -158,4 +166,4 @@ private: }; } -#endif \ No newline at end of file +#endif diff --git a/srslte/include/srslte/ue/ue_sync.h b/srslte/include/srslte/ue/ue_sync.h index 45667a461..3f5984a9f 100644 --- a/srslte/include/srslte/ue/ue_sync.h +++ b/srslte/include/srslte/ue/ue_sync.h @@ -25,6 +25,28 @@ * */ +/****************************************************************************** + * File: ue_sync.h + * + * Description: This object automatically manages the cell synchronization + * procedure. + * + * The main function is srslte_ue_sync_get_buffer(), which returns + * a pointer to the aligned subframe of samples (before FFT). This + * function should be called regularly, returning every 1 ms. + * It reads from the USRP, aligns the samples to the subframe and + * performs time/freq synch. + * + * It is also possible to read the signal from a file using the + * init function srslte_ue_sync_init_file(). The sampling frequency + * is derived from the number of PRB. + * + * The function returns 1 when the signal is correctly acquired and + * the returned buffer is aligned with the subframe. + * + * Reference: + *****************************************************************************/ + #ifndef UE_SYNC_ #define UE_SYNC_ @@ -39,22 +61,6 @@ #include "srslte/common/timestamp.h" #include "srslte/io/filesource.h" -/************************************************************** - * - * This object automatically manages the cell synchronization procedure. - * - * The main function is srslte_ue_sync_get_buffer(), which returns a pointer - * to the aligned subframe of samples (before FFT). This function - * should be called regularly, returning every 1 ms. It reads from the - * USRP, aligns the samples to the subframe and performs time/freq synch. - * - * It is also possible to read the signal from a file using the init function - * srslte_ue_sync_init_file(). The sampling frequency is derived from the number of PRB. - * - * The function returns 1 when the signal is correctly acquired and the - * returned buffer is aligned with the subframe. - * - *************************************************************/ typedef enum SRSLTE_API { SF_FIND, SF_TRACK} srslte_ue_sync_state_t; diff --git a/srslte/include/srslte/ue/ue_ul.h b/srslte/include/srslte/ue/ue_ul.h index d1865a067..f0d949f25 100644 --- a/srslte/include/srslte/ue/ue_ul.h +++ b/srslte/include/srslte/ue/ue_ul.h @@ -25,16 +25,20 @@ * */ +/****************************************************************************** + * File: ue_ul.h + * + * Description: UE uplink object. + * + * This module is a frontend to all the uplink data and control + * channel processing modules. + * + * Reference: + *****************************************************************************/ + #ifndef UEUL_H #define UEUL_H -/******************************************************* - * - * This module is a frontend to all the data and control channels processing - * modules. - ********************************************************/ - - #include "srslte/common/phy_common.h" #include "srslte/ch_estimation/chest_dl.h" #include "srslte/dft/ofdm.h" @@ -119,4 +123,4 @@ SRSLTE_API void srslte_ue_ul_reset(srslte_ue_ul_t *q); SRSLTE_API void srslte_ue_ul_set_rnti(srslte_ue_ul_t *q, uint16_t rnti); -#endif \ No newline at end of file +#endif diff --git a/srslte/include/srslte/utils/bit.h b/srslte/include/srslte/utils/bit.h index a1971dd93..8df7d40b8 100644 --- a/srslte/include/srslte/utils/bit.h +++ b/srslte/include/srslte/utils/bit.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: bit.h + * + * Description: Bit-level utilities. + * + * Reference: + *****************************************************************************/ #ifndef BIT_ #define BIT_ diff --git a/srslte/include/srslte/utils/cexptab.h b/srslte/include/srslte/utils/cexptab.h index 9e6cb7764..e89de4395 100644 --- a/srslte/include/srslte/utils/cexptab.h +++ b/srslte/include/srslte/utils/cexptab.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: cexptab.h + * + * Description: Utility module for generation of complex exponential tables. + * + * Reference: + *****************************************************************************/ #ifndef CEXPTAB_ #define CEXPTAB_ diff --git a/srslte/include/srslte/utils/convolution.h b/srslte/include/srslte/utils/convolution.h index 3dd6f0507..f788f45e9 100644 --- a/srslte/include/srslte/utils/convolution.h +++ b/srslte/include/srslte/utils/convolution.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: convolution.h + * + * Description: Utility module for fast convolution using FFT. + * + * Reference: + *****************************************************************************/ #ifndef CONVOLUTION_H_ #define CONVOLUTION_H_ diff --git a/srslte/include/srslte/utils/debug.h b/srslte/include/srslte/utils/debug.h index c0218f0cb..fd0be1e35 100644 --- a/srslte/include/srslte/utils/debug.h +++ b/srslte/include/srslte/utils/debug.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: debug.h + * + * Description: Debug output utilities. + * + * Reference: + *****************************************************************************/ + #ifndef DEBUG_H #define DEBUG_H diff --git a/srslte/include/srslte/utils/queue.h b/srslte/include/srslte/utils/queue.h index 37e4433be..18d4ac0f1 100644 --- a/srslte/include/srslte/utils/queue.h +++ b/srslte/include/srslte/utils/queue.h @@ -25,6 +25,14 @@ * */ +/****************************************************************************** + * File: queue.h + * + * Description: Queue used at interface of PHY/MAC + * + * Reference: + *****************************************************************************/ + #ifndef QUEUE_H #define QUEUE_H @@ -83,4 +91,4 @@ private: } -#endif \ No newline at end of file +#endif diff --git a/srslte/include/srslte/utils/vector.h b/srslte/include/srslte/utils/vector.h index 9d5aceb51..121afa9f2 100644 --- a/srslte/include/srslte/utils/vector.h +++ b/srslte/include/srslte/utils/vector.h @@ -25,6 +25,13 @@ * */ +/****************************************************************************** + * File: vector.h + * + * Description: Vector functions using SIMD instructions where possible. + * + * Reference: + *****************************************************************************/ #ifndef VECTOR_ #define VECTOR_ diff --git a/srslte/lib/modem/src/demod_soft.c b/srslte/lib/modem/src/demod_soft.c index 3ee03877a..b824aed0f 100644 --- a/srslte/lib/modem/src/demod_soft.c +++ b/srslte/lib/modem/src/demod_soft.c @@ -71,7 +71,7 @@ void srslte_demod_soft_free(srslte_demod_soft_t *q) { bzero((void*)q,sizeof(srslte_demod_soft_t)); } -void srslte_demod_soft_table_set(srslte_demod_soft_t *q, srslte_srslte_modem_table_t *table) { +void srslte_demod_soft_table_set(srslte_demod_soft_t *q, srslte_modem_table_t *table) { q->table = table; } diff --git a/srslte/lib/modem/src/mod.c b/srslte/lib/modem/src/mod.c index bddd7cb49..b8dcec8ee 100644 --- a/srslte/lib/modem/src/mod.c +++ b/srslte/lib/modem/src/mod.c @@ -35,7 +35,7 @@ /** Low-level API */ -int srslte_mod_modulate(srslte_srslte_modem_table_t* q, uint8_t *bits, cf_t* symbols, uint32_t nbits) { +int srslte_mod_modulate(srslte_modem_table_t* q, uint8_t *bits, cf_t* symbols, uint32_t nbits) { uint32_t i,j,idx; uint8_t *b_ptr=(uint8_t*) bits; j=0; diff --git a/srslte/lib/modem/src/modem_table.c b/srslte/lib/modem/src/modem_table.c index 85cf89472..37d53bab0 100644 --- a/srslte/lib/modem/src/modem_table.c +++ b/srslte/lib/modem/src/modem_table.c @@ -38,26 +38,26 @@ #include "lte_tables.h" /** Internal functions */ -static int table_create(srslte_srslte_modem_table_t* q) { +static int table_create(srslte_modem_table_t* q) { q->symbol_table = malloc(q->nsymbols*sizeof(cf_t)); return q->symbol_table==NULL; } -void srslte_modem_table_init(srslte_srslte_modem_table_t* q) { - bzero((void*)q,sizeof(srslte_srslte_modem_table_t)); +void srslte_modem_table_init(srslte_modem_table_t* q) { + bzero((void*)q,sizeof(srslte_modem_table_t)); } -void srslte_modem_table_free(srslte_srslte_modem_table_t* q) { +void srslte_modem_table_free(srslte_modem_table_t* q) { if (q->symbol_table) { free(q->symbol_table); } - bzero(q, sizeof(srslte_srslte_modem_table_t)); + bzero(q, sizeof(srslte_modem_table_t)); } -void srslte_modem_table_reset(srslte_srslte_modem_table_t* q) { +void srslte_modem_table_reset(srslte_modem_table_t* q) { srslte_modem_table_free(q); srslte_modem_table_init(q); } -int srslte_modem_table_set(srslte_srslte_modem_table_t* q, cf_t* table, srslte_soft_table_t *soft_table, uint32_t nsymbols, uint32_t nbits_x_symbol) { +int srslte_modem_table_set(srslte_modem_table_t* q, cf_t* table, srslte_soft_table_t *soft_table, uint32_t nsymbols, uint32_t nbits_x_symbol) { if (q->nsymbols) { return SRSLTE_ERROR; } @@ -71,7 +71,7 @@ int srslte_modem_table_set(srslte_srslte_modem_table_t* q, cf_t* table, srslte_s return SRSLTE_SUCCESS; } -int srslte_modem_table_lte(srslte_srslte_modem_table_t* q, srslte_mod_t modulation, bool compute_soft_demod) { +int srslte_modem_table_lte(srslte_modem_table_t* q, srslte_mod_t modulation, bool compute_soft_demod) { switch(modulation) { case SRSLTE_MOD_BPSK: q->nbits_x_symbol = 1; diff --git a/srslte/lib/modem/test/modem_test.c b/srslte/lib/modem/test/modem_test.c index 0d3802b33..d053d23e6 100644 --- a/srslte/lib/modem/test/modem_test.c +++ b/srslte/lib/modem/test/modem_test.c @@ -94,7 +94,7 @@ void parse_args(int argc, char **argv) { int main(int argc, char **argv) { int i; - srslte_srslte_modem_table_t mod; + srslte_modem_table_t mod; srslte_demod_hard_t demod_hard; srslte_demod_soft_t demod_soft; uint8_t *input, *output; diff --git a/srslte/lib/modem/test/soft_demod_test.c b/srslte/lib/modem/test/soft_demod_test.c index f28951bca..895878568 100644 --- a/srslte/lib/modem/test/soft_demod_test.c +++ b/srslte/lib/modem/test/soft_demod_test.c @@ -108,7 +108,7 @@ float mse_threshold() { int main(int argc, char **argv) { int i; - srslte_srslte_modem_table_t mod; + srslte_modem_table_t mod; srslte_demod_soft_t demod_soft; uint8_t *input, *output; cf_t *symbols;