SDR(Software Defined Radio) |
|||||
srsRAN - API Reference
There is no official API documents for this library yet, so I decided to create my own API manual mainly for my study purpose. Since I still don't have the complete understanding of these APIs and has not verified with hardware on my own, the explanation may not be perfect. This is just beginning.. I will keep updating new API and revising the previous documents. I will get confirmation and advice as often as possible from Ismael Gomez who is a main author of the project.
NOTE : This description is based on the source code released long time ago (2016). I noticed that a lot of API function name has changed in later release. If you are looking into the source code of later release, you may look into the function starting with srsran_ instead of srslte. I think the overal function is same as described here, only name and some details within the code changed.
< API Description >
Followings are the list of APIs that are described in this page. The list will keep getting added.
Definition : static float cfo_estimate(srslte_sync_t *q, cf_t *input)
Function : Calculate the phase value(arg) of the symbol that gives the maximum correlation from CP correlation process. This will be used as the indicator of frequency offset
Definition : static void crc_set_mask_rnti(uint8_t *crc, uint16_t rnti)
Function : This function mask crc with rnti. That is, Do XOR rnti onto crc and overwrite crc array with the result. (Refer to how RNTI value is informed section)
Definition : static int dci_encode(srslte_pdcch_t *q, uint8_t *data, uint8_t *e, uint32_t nof_bits, uint32_t E, uint16_t rnti)
Function : This function performs CRC attach(36.212 - 5.3.3.2), Channel Coding(36.212 - 5.3.3.3) and Rate Maching (36.212 - 5.3.3.4) for PDCCH. Refer to Physical Channel : PDCCH page.
Definition : int decode_frame(srslte_pbch_t *q, uint32_t src, uint32_t dst, uint32_t n, uint32_t nof_bits, uint32_t nof_ports)
Function : [ TO BE INVESTIGATED ]
Definition : void generate_c(int *c, int *c_tilde, uint32_t N_id_2, bool is_c0)
Function : Generate c1 for a given N_id_2 based on the given c_tilde and c0 and store the result as the single value (c) as described in 36.211 - 6.11.2 (Refer to Physical Layer Signal : SSS (Secondary Synchronization Signal) for the details).
Definition : void generate_m0m1(uint32_t N_id_1, uint32_t *m0, uint32_t *m1)
Function : Calculate m0 and m1 of the equation described in 36.211 - 6.11.2 (Refer to Physical Layer Signal : SSS (Secondary Synchronization Signal) for the details)
Definition : void generate_N_id_1_table(uint32_t table[30][30])
Function : Generate m0 and m1 for all the possible N_id_1 (168 difference sequences) using generate_m0m1() and store the result into the two dimmensional array of table[][]. The relationship between the index of the array and N_id_1 is described as table[m0][m1-1]=N_id_1.
Definition :void generate_s(int *s, int *s_tilde, uint32_t m0_m1)
Function : Generate s0 or s1 based on the given s_tilde and m0_m1 and store the result as the single value (s) as described in 36.211 - 6.11.2 (Refer to Physical Layer Signal : SSS (Secondary Synchronization Signal) for the details).
Definition :void generate_s_all(int s[SRSLTE_SSS_N][SRSLTE_SSS_N], int *s_tilde)
Function : Generate all the possible s0 or s1 value based on all the possible m0_m1 and a given s_tilde as described in 36.211 - 6.11.2 (Refer to Physical Layer Signal : SSS (Secondary Synchronization Signal) for the details)
Definition :void generate_sss_all_tables(srslte_sss_tables_t *tables, uint32_t N_id_2)
Function : Generate all the possible SSS for a given N_id_2 using srslte_sss_generate_s_all(), srslte_sss_generate_z_all() and srslte_sss_generate_c() .
Definition : void generate_z(int *z, int *z_tilde, uint32_t m0_m1)
Function : Generate z1_m0 or z1_m1 based on the given z_tilde and m0_m1 and store the result as the single value (z) as described in 36.211 - 6.11.2 (Refer to Physical Layer Signal : SSS (Secondary Synchronization Signal) for the details).
Definition : void generate_z_all(int z[SRSLTE_SSS_N][SRSLTE_SSS_N], int *z_tilde)
Function : Generate all the possible z1_m0 or z1_m1 value based on all the possible m0_m1 and a given s_tilde as described in 36.211 - 6.11.2 (Refer to Physical Layer Signal : SSS (Secondary Synchronization Signal) for the details)
Definition : void generate_zsc_tilde(int *z_tilde, int *s_tilde, int *c_tilde)
Function : Generate z_tilde, s_tilde and c_tilde as described in 36.211 - 6.11.2 (Refer to Physical Layer Signal : SSS (Secondary Synchronization Signal) for the details)
Definition : void mod_bpsk_bytes(srslte_modem_table_t* q, uint8_t *bits, cf_t* symbols, uint32_t nbits)
Function : Convert the bit stream data (bits) into BPSK modulated symbols and store it into the array (symbols). nbits indicates the number of bit data to be modulated. The data in (bits) is stored as byte stream.
Definition : void mod_qpsk_bytes(srslte_modem_table_t* q, uint8_t *bits, cf_t* symbols, uint32_t nbits)
Function : Convert the bit stream data (bits) into QPSK modulated symbols and store it into the array (symbols). nbits indicates the number of bit data to be modulated. The data in (bits) is stored as byte stream.
Definition : void mod_16qam_bytes(srslte_modem_table_t* q, uint8_t *bits, cf_t* symbols, uint32_t nbits)
Function : Convert the bit stream data (bits) into 16QAM modulated symbols and store it into the array (symbols). nbits indicates the number of bit data to be modulated. The data in (bits) is stored as byte stream.
Definition : void mod_64qam_bytes(srslte_modem_table_t* q, uint8_t *bits, cf_t* symbols, uint32_t nbits)
Function : Convert the bit stream data (bits) into 64QAM modulated symbols and store it into the array (symbols). nbits indicates the number of bit data to be modulated. The data in (bits) is stored as byte stream.
Definition : void prb_cp(cf_t **input, cf_t **output, int nof_prb)
Function : Copy the Resource Elements from the entire RB from current PRB position (set by other API) in multiples of nof_prb and store them into the array (output). For example, if nof_prb = 1, it copies all the REs from a single PRB (meaning it copies 12 sub carriers) and if nof_prb = 2, it copies all the REs from two PRBs (meaning it copies 24 sub carriers) and store them into the array (output).
Definition : void prb_cp_half(cf_t **input, cf_t **output, int nof_prb)
Function : Copy the Resource Elements from the half RB from current position (set by other API) in multiples of nof_prb and store them into the array (output). For example, if nof_prb = 1, it copies all the REs from a half PRB (meaning it copies 6 sub carriers)and if nof_prb = 2, it copies all the REs from one PRB (meaning it copies 12 sub carriers) and store them into the array (output).
Definition : void prb_cp_ref(cf_t **input, cf_t **output, int offset, int nof_refs, int nof_intervals, bool advance_output)
Function : Copy the Resource Elements except Reference Signal from the entire RB from current PRB position (set by other API) in multiples of nof_prb and store them into the array (output). For example, if nof_prb = 1, it copies all the REs except Reference Signal from a single PRB and if nof_prb = 2, it copies all the REs except Reference Signal from two PRBs and store them into the array (output).
Definition : void prb_get_ref_(cf_t **input, cf_t **output, int offset, int nof_refs, int nof_intervals)
Function : Extract the Reference Signal Resource Element and store them into the array (output). offset is the position of 1st reference, nof_refs is the number of references in the prb and nof_intervals number of groups 1ref+3RE shall be copied
Definition : void prb_put_ref_(cf_t **input, cf_t **output, int offset, int nof_refs, int nof_intervals)
Function : Put the reference signal stored in the array (input) and place them into the PRB REs stored in the array output. offset is the position of 1st reference, nof_refs is the number of references in the prb and nof_intervals number of groups 1ref+3RE shall be copied
Definition : void print_indexes(cf_t *offset, int len)
Function : [ TO BE INVESTIGATED ]
Definition : int regs_add_reg(srslte_regs_reg_t *reg, cf_t *reg_data, cf_t *slot_symbols, uint32_t nof_prb)
Function : This function add(multiplex) one REG data (4 symbols, stored in reg_data) in the slot symbols array (slot_symbols). It adds the specified reg_data to the data that has been already assigned in the slot_symbols array and this is mainly used to assign PHICH data to each REG. srslte_regs_reg_t specifies the exact REG parameters(k,k0,l) described in Resource Element Group page. As additional reference, refer to 36.211 6.9.3 (PHICH RE mapping)
Definition : int regs_get_reg(srslte_regs_reg_t *reg, cf_t *slot_symbols, cf_t *reg_data, uint32_t nof_prb)
Function : This function extracts one REG data (4 symbols) from the slot symbols array and store them into reg_data.
Definition : int regs_num_x_symbol(uint32_t symbol, uint32_t nof_port, srslte_cp_t cp)
Function : This function gives the number of REGs at a specified OFDM symbol (symbol) within a PRB. To determined this, the additional information the nof_port and CP type are used. (Refer to 36.211 Section 6.2.4 or Resource Element Group page)
Definition : int regs_put_reg(srslte_regs_reg_t *reg, cf_t *reg_data, cf_t *slot_symbols, uint32_t nof_prb)
Function : This function puts one REG data (4 symbols, stored in reg_data) in the slot symbols array (slot_symbols). srslte_regs_reg_t specifies the exact REG parameters(k,k0,l) described in Resource Element Group page.
Definition : int regs_put_reg(srslte_regs_reg_t *reg, cf_t *reg_data, cf_t *slot_symbols, uint32_t nof_prb)
Function : This function initializes REGs structure. Sets all REG indices and initializes PCFICH, PHICH and PDCCH REGs. Returns 0 if OK, -1 on error
Definition : int regs_reset_reg(srslte_regs_reg_t *reg, cf_t *slot_symbols, uint32_t nof_prb)
Function : This function resets (assign 0) to one REG in a PRB stored in slot_symbols
Definition : void scrambling_b(uint8_t *c, uint8_t *data, int offset, int len)
Function : Do XOR on a word basis. Offset is applied to the array (c). The result of XOR overwrites the array (data).
Definition : uint32_t srslte_bit_pack(uint8_t **bits, int nof_bits)
Function : Convert a segment of a bit stream into a unit32 value. nof_bits specifies how many bits (digits) are converted into a single unit32 value.
Definition : void srslte_bit_unpack(uint32_t value, uint8_t **bits, int nof_bits)
Function : Convert a unit32 value into a bit stream. nof_bits specifies the length (number of binary digits) of the converted binary.
Definition : int srslte_cbsegm(srslte_cbsegm_t *s, uint32_t tbs)
Function : This function calculate Codeblock Segmentation as in Section 5.1.2 of 36.212. Refer to Channel Coding Processing for DL SCH/PCH/MCH page.
Definition : int srslte_chest_dl_init(srslte_chest_dl_t *q, srslte_cell_t cell)
Function : This function initialize the resources (arrays and reference signals etc) that is required to perform channel estimation
Definition : int srslte_convcoder_encode(srslte_convcoder_t *q, uint8_t *input, uint8_t *output, uint32_t frame_length)
Function : Do the convolution coding as per 36.212-5.1.3.1 Tail biting convolutional coding. The array (input) is the input to the encoder and the array (output) is the output from the encoder. The structure (q) contains parameters (e.g, R, K, Poly[], request for tailbit) for the encoder.
Definition : int srslte_conv_fft_cc_init(srslte_conv_fft_cc_t *q, uint32_t input_len, uint32_t filter_len)
Function : Reserve memory for fft output and set dft properperty for the result (basically inializing the srslte_conv_fft_cc_t array (q) ).
Definition :uint32_t uint32_t srslte_cp_synch(srslte_cp_synch_t *q, cf_t *input, uint32_t max_offset, uint32_t nof_symbols, uint32_t cp_len)
Function : Searches OFDM Symbol boundary using CP Correlation. This is an important steps in establishing Timing Sync. After calculating the correlation, it returns the index of the data that produce the max correlation.
Definition : cf_t srslte_cp_synch_corr_output(srslte_cp_synch_t *q, uint32_t offset)
Function : Returns the 'corr' value of the specific elements in the array of srslte_cp_synch_t
Definition :void srslte_cp_synch_free(srslte_cp_synch_t *q)
Function : Remove (clear) the memory reserved for the array of srslte_cp_synch_t
Definition : int srslte_cp_synch_init(srslte_cp_synch_t *q, uint32_t symbol_sz)
Function : Reserve the memory for the array of srslte_cp_synch_t and set the initial value for the array elements
Definition : uint32_t srslte_crc_attach(srslte_crc_t *h, uint8_t *data, int len)
Function : Calculate CRC Checksum for the array (data) and append the result to the array (data)
Definition : void srslte_crc_set_mask(uint8_t *data, int nof_ports)
Function : Do XOR crc mask onto the CRC portions of the sequence (PBCH data | CRC, which is the output of CRC Attachement : 36.212-5.3.1) . (Refer to How to specify Antenna configuration in PBCH ?)
Definition : void srslte_dft_run_c(srslte_dft_plan_t *plan, cf_t *in, cf_t *out)
Function : Do dft of the complex array (in) according to the dft plan (plan) and save the result into the complex array (out)
Definition : int srslte_filesource_read(srslte_filesource_t *q, void *buffer, int nsamples)
Function : Read nsamples of data from the file specified in q in the form of data type specified in q and store them in buffer.
Definition : int srslte_layerdemap_single(cf_t *x, cf_t *d, int nof_symbols)
Function : This function perform the layer demapping for SISO and convert the layer mapped arry (x) into the data symbol array (d).
Definition : int srslte_layerdemap_diversity(cf_t *x[SRSLTE_MAX_LAYERS], cf_t *d, int nof_layers, int nof_layer_symbols)
Function : This function perform the layer demapping for Diversity and convert the layer mapped arry (x) into the data symbol array (d).
Definition : int srslte_layerdemap_multiplex(cf_t *x[SRSLTE_MAX_LAYERS], cf_t *d[SRSLTE_MAX_CODEWORDS], int nof_layers, int nof_cw, int nof_layer_symbols, int nof_symbols[SRSLTE_MAX_CODEWORDS])
Function : This function perform the layer demapping for MIMO and convert the layer mapped arry (x) into the data symbol array (d).
Definition : int srslte_layerdemap_type(cf_t *x[SRSLTE_MAX_LAYERS], cf_t *d[SRSLTE_MAX_CODEWORDS], int nof_layers, int nof_cw, int nof_layer_symbols, int nof_symbols[SRSLTE_MAX_CODEWORDS], srslte_mimo_type_t type)
Function : This function generates the vector of data symbols "d" based on the vector of layer-mapped symbols "x" based on 36.211 6.3.3. It returns 0 on ok and saves the number of symbols per codeword (M_symb^(q) in the specs) in nof_symbols. Returns -1 on error. This performs layer de-mapping for SISO, Diversity, MIMO depending on the type specified by srslte_mimo_type_t. It calls srslte_layerdemap_single, srslte_layerdemap_diversity, srslte_layerdemap_multiplex depending on the specified type.
Definition : int srslte_layermap_single(cf_t *d, cf_t *x, int nof_symbols)
Function : This function perform the layer mapping for SISO and convert the data symbol (d) into the layer mapped array (x).
Definition : int srslte_layermap_diversity(cf_t *d, cf_t *x[SRSLTE_MAX_LAYERS], int nof_layers, int nof_symbols)
Function : This function perform the layer mapping for Diversity and convert the data symbol (d) into the layer mapped array (x).
Definition : int srslte_layermap_multiplex(cf_t *d[SRSLTE_MAX_CODEWORDS], cf_t *x[SRSLTE_MAX_LAYERS], int nof_cw, int nof_layers, int nof_symbols[SRSLTE_MAX_CODEWORDS])
Function : This function perform the layer mapping for MIMO and convert the data symbol (d) into the layer mapped array (x).
Definition : int srslte_layermap_type(cf_t *d[SRSLTE_MAX_CODEWORDS], cf_t *x[SRSLTE_MAX_LAYERS], int nof_cw, int nof_layers, int nof_symbols[SRSLTE_MAX_CODEWORDS], srslte_mimo_type_t type)
Function : This function generates the vector of layer-mapped symbols "x" based on the vector of data symbols "d" based on 36.211 6.3.3. It returns the number of symbols per layer (M_symb^layer in the specs). This performs layer mapping for SISO, Diversity, MIMO depending on the type specified by srslte_mimo_type_t. It calls srslte_layermap_single, srslte_layermap_diversity, srslte_layermap_multiplex depending on the specified type.
Definition : int srslte_mod_modulate(srslte_modem_table_t* q, uint8_t *bits, cf_t* symbols, uint32_t nbits)
Function : Convert a bit stream(bits) into an array of modulated symbols (symbols). The modulation depth (modulation scheme) is specified by nbits_x_symbol parameter of srslte_modem_table_t object. The data in (bits) is stored as bit stream.
Definition : int srslte_mod_modulate_bytes(srslte_modem_table_t* q, uint8_t *bits, cf_t* symbols, uint32_t nbits)
Function : Convert a bit stream(bits) into an array of modulated symbols (symbols). The modulation depth (modulation scheme) is specified by nbits_x_symbol parameter of srslte_modem_table_t object. The data in (bits) is stored as byte stream.
Definition :int srslte_pbch_cp(cf_t *input, cf_t *output, srslte_cell_t cell, bool put)
Function : [ TO BE INVESTIGATED ]
Definition : uint32_t srslte_pbch_crc_check(srslte_pbch_t *q, uint8_t *bits, uint32_t nof_ports)
Function : Checks CRC after applying the mask for the given number of ports. The bits buffer size must be at least 40 bytes. Returns 0 if the data is correct, -1 otherwise
Definition :int srslte_pbch_decode(srslte_pbch_t *q, cf_t *slot1_symbols, cf_t *ce_slot1[SRSLTE_MAX_PORTS], float noise_estimate, uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN], uint32_t *nof_tx_ports, uint32_t *sfn_offset)
Function : Decodes the PBCH channel. The PBCH spans in 40 ms. This function is called every 10 ms. It tries to decode the MIB given the symbols of a subframe (1 ms). Successive calls will use more subframes to help the decoding process. Returns 1 if successfully decoded MIB, 0 if not and -1 on error
Definition :void srslte_pbch_decode_reset(srslte_pbch_t *q)
Function : Reset the frame index of srslte_pbch_t data structure (q->frame_idx = 0).
Definition : int srslte_pbch_encode(srslte_pbch_t *q, uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN], cf_t *slot1_symbols[SRSLTE_MAX_PORTS])
Function : Converts the MIB message to symbols mapped to SLOT #1 ready for transmission. It performs all of the steps decribed in LTE Physical Channel : PBCH Page.
Definition : bool srslte_pbch_exists(int nframe, int nslot)
Function : Checks if a given subframe and slot is the one that carries PBCH or not.
Definition : int srslte_pbch_init(srslte_pbch_t *q, srslte_cell_t cell
Function : Initializes the PBCH transmitter and receiver. At the receiver, the field nof_ports in the cell structure indicates the maximum number of BS transmitter ports to look for.
Definition :int srslte_pbch_get(cf_t *slot1_data, cf_t *pbch, srslte_cell_t cell)
Function : Extract PBCH symbols from slot number 1 and Returns the number of symbols written to pbch based on 36.211 10.3 section 6.6.4. (Refer to LTE Physical Channel : PBCH - Resource Element Mapping page for the details)
Definition :void srslte_pbch_mib_pack(srslte_cell_t *cell, uint32_t sfn, uint8_t *msg)
Function : Unpacks MIB into PBCH message. msg buffer must be 24 byte length at least
Definition : void srslte_pbch_mib_unpack(uint8_t *msg, srslte_cell_t *cell, uint32_t *sfn)
Function : Unpacks MIB from PBCH message. msg buffer must be 24 byte length at least
Definition : int srslte_pbch_put(cf_t *pbch, cf_t *slot1_data, srslte_cell_t cell)
Function : Puts PBCH in slot number 1 and Returns the number of symbols written to slot1_data based on 36.211 10.3 section 6.6.4. (Refer to LTE Physical Channel : PBCH - Resource Element Mapping page for the details)
Definition : int srslte_pcfich_cfi_encode(int cfi, uint8_t bits[PCFICH_CFI_LEN])
Function : This function encodes the CFI producing a vector of 32 bits. It performs the step 1 (Channel Coding) part of Physical channel : PCFICH page
Definition : int srslte_pcfich_encode(srslte_pcfich_t *q, uint32_t cfi, cf_t *slot_symbols[SRSLTE_MAX_PORTS], uint32_t subframe)
Function : This function encodes CFI and maps symbols to the slot. This performs the whole process described in Physical channel : PCFICH page.
Definition : uint32_t srslte_pdcch_common_locations(srslte_pdcch_t *q, srslte_dci_location_t *c, uint32_t max_candidates, uint32_t cfi)
Function : This function computes Common candidates for DCI messages up to the number specified by max_candidates and saves them in the structure pointed by c. and it gives the number of the candiates it calculated as the return values.
Definition : int srslte_pdcch_encode(srslte_pdcch_t *q, srslte_dci_msg_t *msg, srslte_dci_location_t location, uint16_t rnti, cf_t *sf_symbols[SRSLTE_MAX_PORTS], uint32_t nsubframe, uint32_t cfi)
Function : This function Encodes ONE DCI message and allocates the encoded bits to the srslte_dci_location_t indicated by the parameter location. The CRC is scrambled with the RNTI parameter. This function can be called multiple times and encoded DCI messages will be allocated to the sf_symbols buffer ready for transmission. If the same location is provided in multiple messages, the encoded bits will be overwritten.
Definition : uint32_t srslte_pdcch_ue_locations(srslte_pdcch_t *q, srslte_dci_location_t *c, uint32_t max_candidates, uint32_t nsubframe, uint32_t cfi, uint16_t rnti)
Function : This function computes UE-specific candidates for DCI messages up to the number specified by max_candidates and saves them in the structure pointed by c. and it gives the number of the candiates it calculated as the return values.
Definition : float srslte_pdsch_average_noi(srslte_pdsch_t *q)
Function : This function just returns the value of average_nof_iterations in dl_sch object.
Definition : int srslte_pdsch_cfg(srslte_pdsch_cfg_t *cfg, srslte_cell_t cell, srslte_ra_dl_grant_t *grant, uint32_t cfi, uint32_t sf_idx, uint32_t rvidx)
Function : This function configures the structure srslte_pdsch_cfg_t from the DL DCI allocation dci_msg. If dci_msg is NULL, the grant is assumed to be already stored in cfg->grant.
Definition : int srslte_pdsch_cp(srslte_pdsch_t *q, cf_t *input, cf_t *output, srslte_ra_dl_grant_t *grant, uint32_t lstart_grant, uint32_t nsubframe, bool put)
Function :This function copies 1 PDSCH PRB from contiguous memory to the resource grid (and vice versa). In the resource grid, resource elements occupied by reference signals, synchronization signals or PBCH are taken into account.
Definition : int srslte_pdsch_encode(srslte_pdsch_t *q, srslte_pdsch_cfg_t *cfg, srslte_softbuffer_tx_t *softbuffer, uint8_t *data, cf_t *sf_symbols[SRSLTE_MAX_PORTS])
Function : This function checks if q, cfg, data are set (not NULL) and rnti is assigned, it calls srslte_pdsch_encode_rnti() to converts PDSCH data bits to OFDM symbols.
Definition : int srslte_pdsch_encode_rnti(srslte_pdsch_t *q, srslte_pdsch_cfg_t *cfg, srslte_softbuffer_tx_t *softbuffer, uint8_t *data, uint16_t rnti, cf_t *sf_symbols[SRSLTE_MAX_PORTS])
Function : This function converts the PDSCH data bits to symbols mapped to the slot ready for transmission
Definition : int srslte_pdsch_init(srslte_pdsch_t *q, srslte_cell_t cell)
Function : This function initializes the PDCCH transmitter and receiver
Definition : uint32_t srslte_pdsch_last_noi(srslte_pdsch_t *q)
Function :
Definition : int srslte_pdsch_put(srslte_pdsch_t *q, cf_t *symbols, cf_t *sf_symbols, srslte_ra_dl_grant_t *grant, uint32_t lstart, uint32_t subframe)
Function : This function puts PDSCH in the resource grid. it returns the number of symbols written to sf_symbols (Refer to 36.211 10.3 section 6.3.5)
Definition : int srslte_pdsch_set_rnti(srslte_pdsch_t *q, uint16_t rnti)
Function : This function precalculate the PDSCH scramble sequences for a given RNTI. This function takes a while to execute, so shall be called once the final C-RNTI has been allocated for the session.
Definition : void srslte_phich_ack_encode(uint8_t ack, uint8_t bits[SRSLTE_PHICH_NBITS])
Function : This function encode 'Ack' into the array 'bits'.
Definition : int srslte_phich_encode(srslte_phich_t *q, uint8_t ack, uint32_t ngroup, uint32_t nseq, uint32_t subframe, cf_t *slot_symbols[SRSLTE_MAX_PORTS])
Function : This function encodes ACK/NACK bits, modulates and inserts into resource.The parameter ack is an array of srslte_phich_ngroups() pointers to buffers of nof_sequences uint8_ts. The final result would be mapped onto the slot_symbols.
Definition : uint32_t srslte_phich_ngroups(srslte_phich_t *q)
Function :
Definition : uint32_t srslte_phich_nsf(srslte_phich_t *q)
Function : This function gives you the length of PHICH Orthogonal Sequence. It gives '4' if Normal CP is used and gives 2 if Extended CP is used (Refer to < Multiplexing of PHICH > section in Physical Channel : PHICH page)
Definition :
Function :
Definition : int srslte_precoding_single(srslte_precoding_t *q, cf_t *x, cf_t *y, int nof_symbols)
Function : Perform Precoding for SISO onto the array (x) and save the result into the array (y)
Definition :int srslte_precoding_diversity(srslte_precoding_t *q, cf_t *x[SRSLTE_MAX_LAYERS], cf_t *y[SRSLTE_MAX_PORTS], int nof_ports, int nof_symbols)
Function : Perform Precoding for Diversity onto the array (x) and save the result into the array (y)
Definition :int srslte_precoding_type(srslte_precoding_t *q, cf_t *x[SRSLTE_MAX_LAYERS], cf_t *y[SRSLTE_MAX_PORTS], int nof_layers, int nof_ports, int nof_symbols, srslte_mimo_type_t type)
Function : Perform Precoding onto the array (x) based on the Transmission Type defined in srslte_mimo_t and save the result into the array (y) (NOTE : Precoding for MIMO is not supported yet)
Definition : int srslte_pss_generate(cf_t *signal, uint32_t N_id_2)
Function : Generate PSS with N_id_2 and store the result in the complex array (signal). Refer to PSS page for the details.
Definition : void srslte_pss_put_slot(cf_t *pss_signal, cf_t *slot, uint32_t nof_prb, srslte_cp_t cp)
Function : Rearrange the generated PSS signal (pss_signal) for resource block mapping and store the rearranged PSS into the array (slot). Basically this function implements 36.211 10.3 section 6.11.1.2 Mapping to resource elements.
Definition : int srslte_pss_synch_find_pss(srslte_pss_synch_t *q, cf_t *input, float *corr_peak_value)
Function : Performs time-domain PSS correlation. Returns the index of the PSS correlation peak in a subframe.The frame starts at corr_peak_pos-subframe_size/2. The value of the correlation is stored in corr_peak_value.Input buffer must be subframe_size long.
Definition : int srslte_pss_synch_init(srslte_pss_synch_t *q, uint32_t frame_size)
Function : Special case for srslte_pss_synch_init_fft(). It is the case of "frame_size = 128" in srslte_pss_synch_init_fft()
Definition : int srslte_pss_synch_init_fft(srslte_pss_synch_t *q, uint32_t frame_size, uint32_t fft_size)
Function : Special case for srslte_pss_synch_init_fft_offset(). It is the case of "offset = 0" in srslte_pss_synch_init_fft_offset()
srslte_pss_synch_init_fft_offset
Definition : int srslte_pss_synch_init_fft_offset(srslte_pss_synch_t *q, uint32_t frame_size, uint32_t fft_size, int offset)
Function : This function creates the PSS in time and freq domain as in srslte_pss_synch_init_N_id_2() but this adds an frequency shift by integer multiples of the intercarrier spacing. This is used for integer CFO detection.
Definition : int srslte_pss_synch_init_N_id_2(cf_t *pss_signal_freq, cf_t *pss_signal_time, uint32_t N_id_2, uint32_t fft_size, int cfo_i)
Function : Generate a PSS sequence for N_id_2 and save it to pss_signal_freq, and do idft of pss_signal_freq to convert it into time domain and store the result to pss_signal_time.
Definition : void srslte_ra_dl_grant_to_nbits(srslte_ra_dl_grant_t *grant, uint32_t cfi, srslte_cell_t cell, uint32_t sf_idx, srslte_ra_nbits_t *nbits)
Function : This function converts the information from DCI into the information representing physical resource allocation map. Given a resource allocation grant, the function computes the number of RE, number of soft bits and number of OFDM symbols
Definition : uint32_t srslte_ra_type0_P(uint32_t nof_prb)
Function : Calculate the RBG size (P) for type0 scheduling as in table 7.1.6.1-1 of 36.213. Refer to Resource Allocation Type page for the details of RA Type 0
Definition : inline uint32_t srslte_refsignal_cs_fidx(srslte_cell_t cell, uint32_t l, uint32_t port_id, uint32_t m)
Function : Calculate the value k described in 36.211 6.10.1. (Refer to Reference Signal : Downlink page for the details)
Definition :int srslte_refsignal_cs_get_sf(srslte_cell_t cell, uint32_t port_id, cf_t *sf_symbols, cf_t *pilots)
Function :Copies the RE containing references from an array of subframe symbols to the pilots array
Definition : int srslte_refsignal_cs_init(srslte_refsignal_cs_t * q, srslte_cell_t cell)
Function : Allocates and precomputes the Cell-Specific Reference (CSR) signal for the 20 slots in a subframe.
srslte_refsignal_cs_nof_symbols
Definition :uint32_t srslte_refsignal_cs_nof_symbols(uint32_t port_id)
Function : This function tells us how many OFDM symbols within a subframe contains CRS in it for a given antenna port id. (Look at the Rersource Element mapping at Downlink FrameStructure : Cell Specific Reference Signal . You may need some time to have clear association between the figure and the return value of this function)
Definition :inline uint32_t srslte_refsignal_cs_nsymbol(uint32_t l, srslte_cp_t cp, uint32_t port_id)
Function : Tells us which OFDM symbols(out of 0~13) contains the CRS in it for a given antenna port id. The parameter l can only be 0,1,3,4. (Look at the Rersource Element mapping at Downlink FrameStructure : Cell Specific Reference Signal . You may need some time to have clear association between the figure and the return value of this function)
Definition : int srslte_refsignal_cs_put_sf(srslte_cell_t cell, uint32_t port_id, cf_t *pilots, cf_t *sf_symbols)
Function : Maps a reference signal initialized with srslte_refsignal_cs_init() into an array of subframe symbols. The resulting signal will be stored in the array sf_symbols.
Definition : uint32_t srslte_refsignal_cs_v(uint32_t port_id, uint32_t ref_symbol_idx)
Function : Calculate v value as described in 36.211-6.10.1.2. (Refer to Reference Signal : Downlink for the details)
Definition : int srslte_regs_pcfich_put(srslte_regs_t *h, cf_t symbols[REGS_PCFICH_NSYM], cf_t *slot_symbols)
Function : This function maps the PCFICH symbols to the resource grid pointed by slot_symbols. It returns the number of written symbols, or -1 on error
Definition : uint32_t srslte_regs_phich_ngroups(srslte_regs_t *h)
Function : This function return the ngroups_phich element value of srslte_regs_t. ngroups_phich indicates the max number of PHICH groups for a specified system Bandwidth. (Refer to < What is PHICH Group > of Physical Channel : PHICH page)
Definition : int srslte_rm_conv_rx(float *input, uint32_t in_len, float *output, uint32_t out_len)
Function : Undo Convolutional Code Rate Matching specified in 36.212 - 5.1.4.2 (Refer to LTE Physical Channel : PBCH - Rate Matching). It does the reversed process of srslte_rm_conv_tx().
Definition : int srslte_rm_conv_tx(uint8_t *input, uint32_t in_len, uint8_t *output, uint32_t out_len)
Function : Do Convolutional Code Rate Matching specified in 36.212 - 5.1.4.2 (Refer to LTE Physical Channel : PBCH - Rate Matching).
Definition : void srslte_scrambling_b(srslte_sequence_t *s, uint8_t *data)
Function : Scramble the data array with the sequence stored in the srslte_sequence_t object pointed by s (Do XOR between the array (data) and the array (s) in the unit of uint8). The object (s) is initialized with srslte_sequence_init(). The result overwrites the array (data).
Definition : void srslte_scrambling_b_offset(srslte_sequence_t *s, uint8_t *data, int offset, int len)
Function : Scramble the data array with the sequence stored in the srslte_sequence_t object pointed by s(Do XOR between the array (data) and the array (s) in the unit of uint8). The object (s) is initialized with srslte_sequence_init(). Offset is applied to the array (s). The result of XOR overwrites the array (data).
Definition : void srslte_scrambling_bytes(srslte_sequence_t *s, uint8_t *data)
Function : Scramble the data array with the sequence stored in the srslte_sequence_t object pointed by s(Do XOR between the array (data) and the array (s) in the unit of byte). The object (s) is initialized with srslte_sequence_init(). The result overwrites the array (data).
srslte_scrambling_bytes_offset
Definition : void srslte_scrambling_bytes_offset(srslte_sequence_t *s, uint8_t *data, int offset, int len)
Function : Scramble the data array with the sequence stored in the srslte_sequence_t object pointed by s(Do XOR between the array (data) and the array (s) in the unit of uint8). The object (s) is initialized with srslte_sequence_init(). Offset is applied to the array (s). The result of XOR overwrites the array (data).
Definition : void srslte_scrambling_c(srslte_sequence_t *s, cf_t *data)
Function : Scramble the data array with the sequence stored in the srslte_sequence_t object pointed by s(Do XOR between the complex array (data) and the array (s)). The object (s) is initialized with srslte_sequence_init(). The result overwrites the array (data).
Definition : void srslte_scrambling_c_offset(srslte_sequence_t *s, cf_t *data, int offset, int len)
Function : Scramble the data array with the sequence stored in the srslte_sequence_t object pointed by s(Do XOR between the complex array (data) and the array (s)). The object (s) is initialized with srslte_sequence_init(). Offset is applied to the array (s). The result of XOR overwrites the array (data).
Definition : void srslte_scrambling_f(srslte_sequence_t *s, float *data)
Function : Scramble the data array with the sequence stored in the srslte_sequence_t object pointed by s(Do XOR between the float array (data) and the array (s)). The object (s) is initialized with srslte_sequence_init(). The result overwrites the array (data).
Definition : void srslte_scrambling_f_offset(srslte_sequence_t *s, float *data, int offset, int len)
Function : Scramble the data array with the sequence stored in the srslte_sequence_t object pointed by s(Do XOR between the float array (data) and the array (s)). The object (s) is initialized with srslte_sequence_init(). Offset is applied to the array (s). The result of XOR overwrites the array (data).
Definition : void srslte_scrambling_s(srslte_sequence_t *s, short *data)
Function : Scramble the data array with the sequence stored in the srslte_sequence_t object pointed by s(Do XOR between the short array (data) and the array (s)). The object (s) is initialized with srslte_sequence_init(). The result overwrites the array (data).
Definition : void srslte_scrambling_s_offset(srslte_sequence_t *s, short *data, int offset, int len)
Function : Scramble the data array with the sequence stored in the srslte_sequence_t object pointed by s(Do XOR between the short array (data) and the array (s)). The object (s) is initialized with srslte_sequence_init(). Offset is applied to the array (s). The result of XOR overwrites the array (data).
Definition : void srslte_sequence_set_LTE_pr(srslte_sequence_t *q, uint32_t seed)
Function : Generate Pseudo Random Sequence based on 36.211 7.2
Definition : void srslte_sss_generate(float *signal0, float *signal5, uint32_t cell_id)
Function : Generate SSS for Subframe 0 and Subframe 5 for a given cell_id. The SSS for Subframe 0 will be stored in the array signal0 and The SSS for Subframe 5 will be stored in the array signal5.
Definition : int srslte_symbol_sz(uint32_t nof_prb)
Function : Calculate the number of FFT bins required for the specified system bandwidth. It derives system bandwidth from nof_prb and then figure out FFT size based on the derived BW.
Definition : srslte_sync_find_ret_t srslte_sync_find(srslte_sync_t *q, cf_t *input, uint32_t find_offset, uint32_t *peak_position)
Function : Finds the PSS sequence previously defined by a call to srslte_sync_set_N_id_2() around the position find_offset in the buffer input. It returns 1 if the correlation peak exceeds the threshold set by srslte_sync_set_threshold() or 0 otherwise. Returns a negative number on error (if N_id_2 has not been set) . The maximum of the correlation peak is always stored in *peak_position
Definition : int srslte_ue_dl_init(srslte_ue_dl_t *q, srslte_cell_t cell)
Function : This function initialize all the resources (Arrays, Channels) to decode all the downlink channels (PCFICH, PHICH, PDCCH, PDSCH). A lot of initialization routine for ofdm, channel estimation, and other physical channels ( (PCFICH, PHICH, PDCCH, PDSCH) are called within this function.
Definition : void srslte_ue_dl_set_rnti(srslte_ue_dl_t *q, uint16_t rnti)
Function : This function precalculate the PDSCH scramble sequences for a given RNTI. This function takes a while to execute, so shall be called once the final C-RNTI has been allocated for the session. For the connection procedure, use srslte_pusch_encode_rnti() or srslte_pusch_decode_rnti() functions
Definition : int srslte_ue_mib_init(srslte_ue_mib_t * q, srslte_cell_t cell)
Function : Initialize various resources (hardware, arrays etc) that is necessary to detect/decode MIB
Definition : srslte_ue_sync_init_file(srslte_ue_sync_t *q, uint32_t nof_prb, char *file_name, int offset_time, float offset_freq)
Function : This function reads data with the length of nof_prb from a file (file_name) and store the data into a global array dummy_offset_buffer[] of complex numbers. You can apply timing offset and frequency offset when you read the data via offset_time and offset_freq
Definition : void srslte_vec_conj_cc(cf_t *x, cf_t *y, uint32_t len)
Function : Get the complex conjugate of complex array x and store the result to the array y
Definition : Definition : void srslte_vec_interleave_cf(float *real, float *imag, cf_t *x, uint32_t len)
Function : Split a complex number array (x) into a float real number array(real) and a float imaginary number array(imag).
Definition : cf_t srslte_vec_dot_prod_conj_ccc(cf_t *x, cf_t *y, uint32_t len)
Function : Calculate innerproduct of a complex number array (x) and conjugate of another complex number array (y) over the length len. This is mostly used to find cross correlation of two complex number arrays.
Definition : void srslte_vec_interleave_cf(float *real, float *imag, cf_t *x, uint32_t len)
Function : Combine a float real number array(real) and a float imaginary number array(imag) into a complex number array (x)
Definition : void srslte_vec_load_file(char *filename, void *buffer, uint32_t len)
Function : read the data from the file specified by file name and save them into buffer. The number of data read to be read is specified by len.
Definition : uint32_t srslte_vec_max_abs_ci(cf_t *x, uint32_t len)
Function : find the complex number whose absolute value (magnitude) is the largest in the array (In short, finding the max complex number). 'ci' implies 'complex - integer' and operation goes 'complex -> integer'.
Definition : void srslte_vec_prod_cfc(cf_t *x, float *y, cf_t *z, uint32_t len)
Function : Perform the element by element multiplication of complex array (x) and real array (y), and put the result into a complex array (z). 'cfc' implies 'complex - float - complext' and the operation goes like 'complex * float -> complex'.
Definition : void srslte_vec_prod_fff(float *x, float *y, float *z, uint32_t len)
Function : Perform the element by element multiplication of float array (x) and float array (y), and put the result into a float array (z). 'cfc' implies 'float - float - float' and the operation goes like 'float * float -> float'.
Definition : void srslte_vec_prod_sss(short *x, short *y, short *z, uint32_t len)
Function : Perform the element by element multiplication of short array (x) and short array (y), and put the result into a short array (z). 'sss' implies 'short - short - short' and the operation goes like 'short * short -> short.
Definition : void srslte_vec_save_file(char *filename, void *buffer, uint32_t len)
Function : save the data (stored in buffer) into the file specified by file name. The number of data read to be saved is specified by len.
Definition : void srslte_vec_sc_prod_cfc(cf_t *x, float h, cf_t *z, uint32_t len)
Function : Perform the multiplication of complex array (x) and a single real value (h), and put the result into a complex array (z). 'cfc' implies 'complex - float - complext' and the operation goes like 'complex * float -> complex'.
|
|||||