\brief This function generates a dummy interleaved sequence (first row) for receiver (convolutionally-coded data), in order to identify the NULL positions used to make the matrix complete.
\param D Number of systematic bits plus 4 (plus 4 for termination)
\param w This is the dummy sequence (first row), it will contain zeros and at most 31 "LTE_NULL" values
\returns Interleaving matrix cardinality (\f$K_{\pi}\f$ from 36-212)
\brief This is the LTE rate matching algorithm for Turbo-coded channels (e.g. DLSCH,ULSCH). It is taken directly from 36-212 (Rel 8 8.6, 2009-03), pages 16-18 )
\param RTC R^TC_subblock from subblock interleaver (number of rows in interleaving matrix) for up to 8 segments
\param G This the number of coded transport bits allocated in sub-frame
\param w This is a pointer to the w-sequence (second interleaver output)
\param e This is a pointer to the e-sequence (rate matching output, channel input/output bits)
\param C Number of segments (codewords) in the sub-frame
\param Nsoft Total number of soft bits (from UE capabilities in 36-306)
\param Mdlharq Number of HARQ rounds
\param Kmimo MIMO capability for this DLSCH (0 = no MIMO)
\param rvidx round index (0-3)
\param Qm modulation order (2,4,6)
\param Nl number of layers (1,2)
\param r segment number
\returns \f$E\f$, the number of coded bits per segment */
uint32_tlte_rate_matching_turbo(uint32_tRTC,
uint32_tG,
uint8_t*w,
uint8_t*e,
uint8_tC,
uint32_tNsoft,
uint8_tMdlharq,
uint8_tKmimo,
uint8_trvidx,
uint8_tQm,
uint8_tNl,
uint8_tr,
uint8_tnb_rb,
uint8_tm);
/**
\brief This is the LTE rate matching algorithm for Convolutionally-coded channels (e.g. BCH,DCI,UCI). It is taken directly from 36-212 (Rel 8 8.6, 2009-03), pages 16-18 )
\param RCC R^CC_subblock from subblock interleaver (number of rows in interleaving matrix) for up to 8 segments
\param E Number of coded channel bits
\param w This is a pointer to the w-sequence (second interleaver output)
\param e This is a pointer to the e-sequence (rate matching output, channel input/output bits)
\returns \f$E\f$, the number of coded bits per segment */
uint32_tlte_rate_matching_cc(uint32_tRCC,
uint16_tE,
uint8_t*w,
uint8_t*e);
/**
\brief This is the LTE rate matching algorithm for Turbo-coded channels (e.g. DLSCH,ULSCH). It is taken directly from 36-212 (Rel 8 8.6, 2009-03), pages 16-18 )
\param RTC R^TC_subblock from subblock interleaver (number of rows in interleaving matrix)
\param G This the number of coded transport bits allocated in sub-frame
\param w This is a pointer to the soft w-sequence (second interleaver output) with soft-combined outputs from successive HARQ rounds
\param dummy_w This is the first row of the interleaver matrix for identifying/discarding the "LTE-NULL" positions
\param soft_input This is a pointer to the soft channel output
\param C Number of segments (codewords) in the sub-frame
\param Nsoft Total number of soft bits (from UE capabilities in 36-306)
\param Mdlharq Number of HARQ rounds
\param Kmimo MIMO capability for this DLSCH (0 = no MIMO)
\param rvidx round index (0-3)
\param clear 1 means clear soft buffer (start of HARQ round)
\brief This is the LTE rate matching algorithm for Convolutionally-coded channels (e.g. BCH,DCI,UCI). It is taken directly from 36-212 (Rel 8 8.6, 2009-03), pages 16-18 )
\param RCC R^CC_subblock from subblock interleaver (number of rows in interleaving matrix)
\param E This the number of coded bits allocated for channel
\param w This is a pointer to the soft w-sequence (second interleaver output) with soft-combined outputs from successive HARQ rounds
\param dummy_w This is the first row of the interleaver matrix for identifying/discarding the "LTE-NULL" positions
\param soft_input This is a pointer to the soft channel output
\returns \f$E\f$, the number of coded bits per segment
//mprime = 0; // mprime = 0,1 for NB_IoT // for LTE , maximum number of resources blocks (110) - the total number of RB in the selected bandwidth (.... 15 , 25 , 50, 100)
//mprime = 0; // mprime = 0,1 for NB_IoT // for LTE , maximum number of resources blocks (110) - the total number of RB in the selected bandwidth (.... 15 , 25 , 50, 100)
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU] = (int16_t*)malloc(sizeof(int16_t)*(2*sequence_length[index_Nsc_RU]*12+24)); // *12 is mandatory to fit channel estimation functions
// NB-IoT: for same reason, +24 is added in order to fit the possible subcarrier start shift when index_Nsc_RU = 0, 1, 2 --> see ul_sc_start in channel estimation function
ul_ref_sigs_rx_NB_IoT[u][index_Nsc_RU]=(int16_t*)malloc(sizeof(int16_t)*(2*sequence_length[index_Nsc_RU]*12+24));// *12 is mandatory to fit channel estimation functions
ul_ref_sigs_f2_rx_NB_IoT[u]=(int16_t*)malloc(sizeof(int16_t)*(2*12*12+24));// first "*12" is mandatory to fit channel estimation functions; first "*12" is the length of pilot sequence for format 2
// NB-IoT: for same reason, +24 is added in order to fit the possible subcarrier start shift when index_Nsc_RU = 0, 1, 2 --> see ul_sc_start in channel estimation function
ndlcch->counter_repetition_number[ncce_index]=DCIrep_to_real_rep(DCIRep,16);////??????? should be repalce by the value in spec table 16.6-3, check also Rmax
ndlcch->counter_repetition_number[ncce_index]=DCIrep_to_real_rep(DCIRep,4);////??????? should be repalce by the value in spec table 16.6-3, check also Rmax
//ndlsch_harq->B; we don-t have now my is given when we receive the dlsch data
//ndlsch->error_treshold
//ndlsch->G??
//ndlsc->nsoft?? //set in new_eNB_dlsch (initialization)
ndlcch->counter_repetition_number[ncce_index]=DCIrep_to_real_rep(DCIRep,4);////??????? should be repalce by the value in spec table 16.6-3, check also Rmax
//}
//ndlcch->frame[ncce_index] = frame;
//ndlcch->subframe[ncce_index] = subframe;
break;
caseDCIFormatN2_Ind://MP: for the moment is not implemented
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file PHY/LTE_TRANSPORT/nsss_NB_IoT.c
* \Generation of Narrowband Secondary Synchronisation Signal(NSSS) for NB-IoT, TS 36-212, V13.4.0 2017-02
* \author M. KANJ
* \date 2017
* \version 0.0
* \company bcom
* \email: matthieu.kanj@b-com.com
* \note
* \warning
*/
//#include <math.h>
#include "PHY/defs_L1_NB_IoT.h"
#include "proto_NB_IoT.h"
//#include "PHY/defs_NB_IoT.h" // not can be replaced by impl_defs_lte_NB_IoT & impl_defs_top_NB_IoT if "msg" function is not used
//#include "defs.h"
//#include "PHY/extern_NB_IoT.h"
//#include "PHY/extern.h"
#include "PHY/impl_defs_lte_NB_IoT.h"
//#include "PHY/impl_defs_top_NB_IoT.h"
#include "nsss_NB_IoT.h"
intgenerate_sss_NB_IoT(int32_t**txdataF,
int16_tamp,
NB_IoT_DL_FRAME_PARMS*frame_parms,
uint16_tsymbol_offset,// symbol_offset = 3 for NB-IoT
uint16_tslot_offset,
unsignedshortframe_number,// new attribute (Get value from higher layer), it does not exist for LTE
unsignedshortRB_IoT_ID)// new attribute (values are between 0.. Max_RB_number-1), it does not exist for LTE
{
uint8_taa,Nid2,f,q,s,c,u;
int16_t*d;
uint16_tn_f,Nid_NB_IoT;
unsignedshorta;
uint16_tslot_id;// slot_id = 17 in NB_IoT
unsignedshortbandwidth_even_odd;
unsignedshortNB_IoT_start;
frame_parms->flag_free_sf=1;
n_f=frame_number;
Nid_NB_IoT=frame_parms->Nid_cell;// supposing Cell_Id of LTE = Cell_Id of NB-IoT // if different , NB_IOT_DL_FRAME_PARMS should be includes as attribute
if(eNB->ndlsch[(uint8_t)UE_id]!=NULL&&eNB->ndlsch[(uint8_t)UE_id]->active==1&&(eNB->ndlsch_SIB1->harq_process->status!=ACTIVE_NB_IoT||subframe!=4))//condition on sib1-NB
{
if(frame%2==0)//condition on NSSS (subframe 9 not available)