Commit b42aed9e authored by knopp's avatar knopp

initial testing version of L1L-L1H split (RRU-RAU)

parent 71af8ce8
......@@ -1012,6 +1012,7 @@ set(SCHED_SRC
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_eNb.c
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_ue.c
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common.c
${OPENAIR1_DIR}/SCHED/ru_procedures.c
${OPENAIR1_DIR}/SCHED/phy_mac_stub.c
${OPENAIR1_DIR}/SCHED/pucch_pc.c
${OPENAIR1_DIR}/SCHED/pusch_pc.c
......@@ -1093,7 +1094,6 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c
${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching.c
${OPENAIR1_DIR}/PHY/CODING/rate_matching.c
${OPENAIR1_DIR}/PHY/CODING/viterbi.c
${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
${OPENAIR1_DIR}/PHY/INIT/lte_init.c
......@@ -1750,6 +1750,7 @@ add_executable(lte-softmodem
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
......@@ -1873,7 +1874,7 @@ add_executable(oaisim
${x2ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
......
......@@ -206,6 +206,7 @@ void *itti_malloc(task_id_t origin_task_id, task_id_t destination_task_id, ssize
#else
ptr = malloc (size);
if (ptr) memset(ptr,0,size);
#endif
AssertFatal (ptr != NULL, "Memory allocation of %d bytes failed (%d -> %d)!\n", (int) size, origin_task_id, destination_task_id);
......
......@@ -55,6 +55,8 @@
#include "mex.h"
#endif
#include "common/ran_context.h"
#define SHUFFLE16(a,b,c,d,e,f,g,h) _mm_set_epi8(h==-1?-1:h*2+1, \
h==-1?-1:h*2, \
g==-1?-1:g*2+1, \
......@@ -122,7 +124,7 @@ void log_map8(llr_t* systematic,
{
#ifdef DEBUG_LOGMAP
msg("log_map, frame_length %d\n",frame_length);
printf("log_map, frame_length %d\n",frame_length);
#endif
if (gamma_stats) start_meas(gamma_stats) ;
......@@ -158,7 +160,7 @@ void compute_gamma8(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity,
#endif
#ifdef DEBUG_LOGMAP
msg("compute_gamma, %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length);
printf("compute_gamma, %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length);
#endif
#if defined(__x86_64__) || defined(__i386__)
......@@ -708,7 +710,7 @@ void compute_ext8(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, l
//
#ifdef DEBUG_LOGMAP
msg("compute_ext, %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length);
printf("compute_ext, %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length);
#endif
alpha_ptr = alpha128;
......@@ -843,6 +845,10 @@ void free_td8(void)
}
}
extern RAN_CONTEXT_t RC;
void init_td8()
{
......@@ -879,14 +885,14 @@ void init_td8()
pi2tab8[ind][i] = j;
// printf("pi2[%d] = %d\n",i,j);
}
for (i=0; i<n2; i++) {
pi = base_interleaver[i];//(unsigned int)threegpplte_interleaver(f1,f2,n);
pi3 = pi2tab8[ind][pi];
pi4tab8[ind][pi2tab8[ind][i]] = pi3;
pi5tab8[ind][pi3] = pi2tab8[ind][i];
pi6tab8[ind][pi] = pi2tab8[ind][i];
}
}
}
}
......@@ -958,7 +964,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
int offset8_flag=0;
if (crc_type > 3) {
msg("Illegal crc length!\n");
printf("Illegal crc length!\n");
return 255;
}
......@@ -976,7 +982,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
for (iind=0; iind < 188 && f1f2mat[iind].nb_bits != n; iind++);
if ( iind == 188 ) {
msg("Illegal frame length!\n");
printf("Illegal frame length!\n");
return 255;
}
......@@ -1306,7 +1312,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
yp1[i] = *yp;
yp++;
#ifdef DEBUG_LOGMAP
msg("Term 1 (%d): %d %d\n",i,s[i],yp1[i]);
printf("Term 1 (%d): %d %d\n",i,s[i],yp1[i]);
#endif //DEBUG_LOGMAP
}
......@@ -1318,12 +1324,12 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
yp2[i-16] = *yp;
yp++;
#ifdef DEBUG_LOGMAP
msg("Term 2 (%d): %d %d\n",i-16,s[i],yp2[i-16]);
printf("Term 2 (%d): %d %d\n",i-16,s[i],yp2[i-16]);
#endif //DEBUG_LOGMAP
}
#ifdef DEBUG_LOGMAP
msg("\n");
printf("\n");
#endif //DEBUG_LOGMAP
if (init_stats) stop_meas(init_stats);
......
......@@ -106,7 +106,7 @@ int lte_segmentation(unsigned char *input_buffer,
#endif
*Kminus = (*Kplus - 64);
} else {
msg("lte_segmentation.c: Illegal codeword size !!!\n");
printf("lte_segmentation.c: Illegal codeword size !!!\n");
return(-1);
}
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifdef DEBUG
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#endif
#include "PHY/defs.h"
//#define DEBUG_PHY 1
unsigned int ps0, ps1, ps2, pb;
//----------------------------------------------
//
/*!\brief Tausworthe Uniform Random Generator. This is based on the hardware implementation described in
Lee et al, "A Hardware Gaussian Noise Generator Usign the Box-Muller Method and its Error Analysis," IEEE Trans. on Computers, 2006.
*/
//
static inline void pset_taus_seed(unsigned int off)
{
ps0 = (unsigned int)0x1e23d852 + (off<<4);
ps1 = (unsigned int)0x81f38a1c + (off<<4);
ps2 = (unsigned int)0xfe1a133e + (off<<4);
}
static inline unsigned int ptaus(void)
{
pb = (((ps0 << 13) ^ ps0) >> 19);
ps0 = (((ps0 & 0xFFFFFFFE) << 12)^ pb);
pb = (((ps1 << 2) ^ ps1) >> 25);
ps1 = (((ps1 & 0xFFFFFFF8) << 4)^ pb);
pb = (((ps2 << 3) ^ ps2) >> 11);
ps2 = (((ps2 & 0xFFFFFFF0) << 17)^ pb);
return ps0 ^ ps1 ^ ps2;
}
int rate_matching(unsigned int N_coded,
unsigned int N_input,
unsigned char *inPtr,
unsigned char N_bps,
unsigned int off)
{
unsigned int i,j,U,Umod,rep_flag=0;
unsigned int N_coded2,N_input2,Mod_input2;
int N_punctured;
if ((9*N_coded<(N_input<<2)) || (N_input<(N_coded>>1))) {
// check validity of parameters
// the first condition represents the case where the rate is greater than 2/3
// the second condition represents the case where the rate is less than 1/4
msg("[PHY][CODING] Rate matching parameter error (N_coded %d, N_input %d, N_bps %d), exiting\n",N_coded,N_input,N_bps);
return(-1);
}
//initialize all bits as transmitted
for (i=0; i<N_input; i++)
inPtr[i] |= 0x80;
// No go puncture the bits that should be removed
i=0;
N_coded2 = N_coded/N_bps;
pset_taus_seed(off);
N_input2 = N_input/N_bps;
N_punctured = N_input2-N_coded2;
if (N_punctured < 0) { // Repeat bits instead of puncturing
N_punctured = -N_punctured;
rep_flag = 1;
}
#ifdef USER_MODE
#ifdef DEBUG_PHY
printf("rate_matching : N_coded %d, N_input %d, N_bps %d\n",N_coded,N_input,N_bps);
printf("rate_matching : N_punctured = %d (%d)\n",N_bps*N_punctured,rep_flag);
printf("rate_matching : code rate = %f\n",(double)N_input/(double)N_coded/2.0);
#endif
#endif
Mod_input2 = (1<<(1+log2_approx(N_input2)))-1;
while (i < N_punctured) {
// generate N_punctured random positions in the input vector
do { // generate a modulo-N_input2 random variable
U = ptaus();
Umod = U&Mod_input2;
// printf("i %d, N_punctured %d U %u Umod %d Iptr[Umod] %x\n",i,N_punctured,U,Umod,inPtr[Umod]);
// check if the bit is already punctured/repeated, if so skip it and generate another RV
if ((Umod < N_input2) && (((inPtr[Umod]&0x80) == 0)||((inPtr[Umod]&0xc0) == 0xc0)))
Umod=N_input2;
} while (Umod>=N_input2);
for (j=0; j<N_bps; j++) { // loop over symbol bits
if (rep_flag == 0)
inPtr[Umod + (j*N_input2)] &= 0x7f; // clear MSB to indicate bit is punctured
else
inPtr[Umod + (j*N_input2)] |= 0xc0; // set MSB-1 to indicate bit is repeated
}
/*
#ifdef USER_MODE
#ifdef DEBUG_PHY
printf("rate_matching : i= %d, U = %d\n",i,Umod);
#endif
#endif
*/
i++;
}
return(0);
}
int rate_matching_lte(unsigned int N_coded,
unsigned int N_input,
unsigned char *inPtr,
unsigned int off)
{
unsigned int i,U,Umod,rep_flag=0;
unsigned int Mod_input;
int N_punctured;
if ((9*N_coded<(N_input<<2)) || (N_input<(N_coded>>1))) {
// check validity of parameters
// the first condition represents the case where the rate is greater than 2/3
// the second condition represents the case where the rate is less than 1/4
msg("[PHY][CODING] Rate matching parameter error (N_coded %d, N_input %d), exiting\n",N_coded,N_input);
return(-1);
}
//initialize all bits as transmitted
for (i=0; i<N_input; i++)
inPtr[i] |= 0x80;
// No go puncture the bits that should be removed
i=0;
pset_taus_seed(off);
N_punctured = N_input-N_coded;
if (N_punctured < 0) { // Repeat bits instead of puncturing
N_punctured = -N_punctured;
rep_flag = 1;
}
#ifdef USER_MODE
#ifdef DEBUG_PHY
printf("rate_matching : N_coded %d, N_input %d\n",N_coded,N_input);
if (rep_flag)
printf("rate_matching : N_repeated = %d\n",N_punctured);
else
printf("rate_matching : N_punctured = %d\n",N_punctured);
printf("rate_matching : code rate = %f\n",(double)N_input/(double)N_coded/3.0);
#endif
#endif
Mod_input = (1<<(1+log2_approx(N_input)))-1;
while (i < N_punctured) {
// generate N_punctured random positions in the input vector
do { // generate a modulo-N_input2 random variable
U = ptaus();
Umod = U&Mod_input;
// printf("i %d, N_punctured %d U %u Umod %d Iptr[Umod] %x\n",i,N_punctured,U,Umod,inPtr[Umod]);
// check if the bit is already punctured/repeated, if so skip it and generate another RV
if ((Umod < N_input) && (((inPtr[Umod]&0x80) == 0)||((inPtr[Umod]&0xc0) == 0xc0)))
Umod=N_input;
} while (Umod>=N_input);
if (rep_flag == 0)
inPtr[Umod] &= 0x7f; // clear MSB to indicate bit is punctured
else
inPtr[Umod] |= 0xc0; // set MSB-1 to indicate bit is repeated
/*
#ifdef USER_MODE
#ifdef DEBUG_PHY
printf("rate_matching : i= %d, U = %d\n",i,Umod);
#endif
#endif
*/
i++;
}
return(0);
}
#ifdef MAIN
void main(int argc,char **argv)
{
unsigned char input[1024];
if (argc == 1) {
printf("Provide an input\n");
exit(-1);
}
memset(input,0,1024);
rate_matching(4*157,4*256,input,atoi(argv[1]),0);
}
#endif
......@@ -29,6 +29,7 @@
//#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
#include "PHICH-Config.h"
#include "MBSFN-SubframeConfigList.h"
#include "MobilityControlInfo.h"
#ifdef Rel10
......@@ -81,17 +82,20 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNb,
@param N_RB_DL Number of DL resource blocks
@param Nid_cell Cell ID
@param Ncp Normal/Extended Prefix flag
@param frame_type FDD/TDD framing
@param p_eNB Number of eNB TX antennas
@param phich_config Pointer to PHICH_CONFIG_COMMON
*/
void phy_config_mib(LTE_DL_FRAME_PARMS *lte_frame_parms,
uint8_t N_RB_DL,
uint8_t Nid_cell,
uint8_t Ncp,
uint8_t frame_type,
uint8_t p_eNB,
PHICH_CONFIG_COMMON *phich_config);
void phy_config_mib_eNB(int Mod_id,
int CC_id,
int eutra_band,
int N_RB_DL,
PHICH_Config_t *phich_config,
int Nid_cell,
int Ncp,
int p_eNB,
uint32_t dl_CarrierFreq,
uint32_t ul_CarrierFreq);
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1.
......
This diff is collapsed.
......@@ -82,7 +82,6 @@ void lte_param_init(unsigned char N_tx_port_eNB,
// frame_parms->Bsrs = 0;
// frame_parms->kTC = 0;44
// frame_parms->n_RRC = 0;
frame_parms->mode1_flag = (transmission_mode == 1 || transmission_mode ==7)? 1 : 0;
init_frame_parms(frame_parms,osf);
......
......@@ -204,7 +204,6 @@ void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms)
printf("frame_parms->frame_type=%d\n",frame_parms->frame_type);
printf("frame_parms->tdd_config=%d\n",frame_parms->tdd_config);
printf("frame_parms->tdd_config_S=%d\n",frame_parms->tdd_config_S);
printf("frame_parms->mode1_flag=%d\n",frame_parms->mode1_flag);
printf("frame_parms->nb_antenna_ports_eNB=%d\n",frame_parms->nb_antenna_ports_eNB);
printf("frame_parms->nb_antennas_tx=%d\n",frame_parms->nb_antennas_tx);
printf("frame_parms->nb_antennas_rx=%d\n",frame_parms->nb_antennas_rx);
......
......@@ -219,22 +219,20 @@ void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
module_id_t eNB_id,
module_id_t UE_id,
uint8_t l,
uint8_t Ns,
uint8_t cooperation_flag);
uint8_t Ns);
int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms,
int32_t *ul_ch_estimates,
uint16_t nb_rb);
int lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
LTE_eNB_COMMON *eNb_common_vars,
LTE_eNB_SRS *eNb_srs_vars,
LTE_eNB_COMMON *eNB_common_vars,
LTE_eNB_SRS *eNB_srs_vars,
SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated,
unsigned char sub_frame_number,
unsigned char eNb_id);
unsigned char sub_frame_number);
int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
LTE_eNB_SRS *lte_eNb_srs,
......
......@@ -134,23 +134,23 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
// do ifft of channel estimate
switch(frame_parms->N_RB_DL) {
case 6:
dft128((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
dft128((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
case 25:
dft512((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
dft512((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
case 50:
dft1024((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
dft1024((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
case 100:
dft2048((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
dft2048((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1);
break;
}
......@@ -158,7 +158,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
#ifdef DEBUG_PHY
sprintf(fname,"srs_ch_estimates_time_%d%d.m",ind,aa);
sprintf(vname,"srs_time_%d%d",ind,aa);
write_output(fname,vname,lte_eNB_srs->srs_ch_estimates_time[ind][aa],frame_parms->ofdm_symbol_size*2,2,1);
write_output(fname,vname,lte_eNB_srs->srs_ch_estimates_time[aa],frame_parms->ofdm_symbol_size*2,2,1);
#endif
#endif
}
......@@ -169,8 +169,8 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)lte_eNB_srs->srs_ch_estimates_time[ind][aa])[(i<<1)];
Im = ((int16_t*)lte_eNB_srs->srs_ch_estimates_time[ind][aa])[1+(i<<1)];
Re = ((int16_t*)lte_eNB_srs->srs_ch_estimates_time[aa])[(i<<1)];
Im = ((int16_t*)lte_eNB_srs->srs_ch_estimates_time[aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2);
}
......
......@@ -200,7 +200,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue->ch_est_alpha,dl_bf_ch-(frame_parms->ofdm_symbol_size<<1),
1,frame_parms->ofdm_symbol_size);
} else {
msg("lte_dl_bf_channel_estimation: beamforming channel estimation not supported for TM7 Extended CP.\n"); // phy_vars_ue->ch_est_beta should be defined equaling 1/3
LOG_E(PHY,"lte_dl_bf_channel_estimation: beamforming channel estimation not supported for TM7 Extended CP.\n"); // phy_vars_ue->ch_est_beta should be defined equaling 1/3
}
}
//estimation and interpolation
......@@ -241,11 +241,11 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
ch[1] = (short)(((int)pil[0]*rxF[17] + (int)pil[1]*rxF[16])>>15);
multadd_real_vector_complex_scalar(fr,ch,dl_bf_ch,16);
} else {
msg("lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):TM7 beamgforming channel estimation not supported for extented CP\n");
LOG_E(PHY,"lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):TM7 beamgforming channel estimation not supported for extented CP\n");
exit(-1);
}
} else {
msg("lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c): transmission mode not supported.\n");
LOG_E(PHY,"lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c): transmission mode not supported.\n");
}
}
nb_rb++;
......@@ -395,12 +395,12 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
}
} else {
msg("lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):TM7 beamgforming channel estimation not supported for extented CP\n");
exit(-1);
LOG_E(PHY,"lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):TM7 beamgforming channel estimation not supported for extented CP\n");
exit(-1);
}
} else {
msg("lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):transmission mode not supported.\n");
LOG_E(PHY,"lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):transmission mode not supported.\n");
}
}
nb_rb++;
......@@ -644,12 +644,12 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
}
} else {
msg("lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):TM7 beamgforming channel estimation not supported for extented CP\n");
LOG_E(PHY,"lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):TM7 beamgforming channel estimation not supported for extented CP\n");
exit(-1);
}
} else {
msg("lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):transmission mode not supported.\n");
LOG_E(PHY,"lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):transmission mode not supported.\n");
}
}
nb_rb++;
......@@ -732,10 +732,10 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
}
} else {
msg("lte_dl_bf_channel_estimation:temporal interpolation not supported for TM7 extented CP.\n");
LOG_E(PHY,"lte_dl_bf_channel_estimation:temporal interpolation not supported for TM7 extented CP.\n");
}
} else {
msg("lte_dl_bf_channel_estimation:temporal interpolation not supported for this beamforming mode.\n");
LOG_E(PHY,"lte_dl_bf_channel_estimation:temporal interpolation not supported for this beamforming mode.\n");
}
}
}
......
......@@ -75,7 +75,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
else if ((p==1) && (l>0))
nu = 0;
else {
msg("lte_dl_channel_estimation: p %d, l %d -> ERROR\n",p,l);
LOG_E(PHY,"lte_dl_channel_estimation: p %d, l %d -> ERROR\n",p,l);
return(-1);
}
......@@ -167,7 +167,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
break;
default:
msg("lte_dl_channel_estimation: k=%d -> ERROR\n",k);
LOG_E(PHY,"lte_dl_channel_estimation: k=%d -> ERROR\n",k);
return(-1);
break;
}
......@@ -622,7 +622,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
}
} else {
msg("channel estimation not implemented for ue->frame_parms.N_RB_DL = %d\n",ue->frame_parms.N_RB_DL);
LOG_E(PHY,"channel estimation not implemented for ue->frame_parms.N_RB_DL = %d\n",ue->frame_parms.N_RB_DL);
}
......
......@@ -29,7 +29,7 @@
#define k1 1024
#define k2 (1024-k1)
int32_t rx_power_avg_eNB[3][3];
int32_t rx_power_avg_eNB[3];
void lte_eNB_I0_measurements(PHY_VARS_eNB *eNB,
......@@ -40,7 +40,7 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *eNB,
LTE_eNB_COMMON *common_vars = &eNB->common_vars;
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
PHY_MEASUREMENTS_eNB *measurements = &eNB->measurements[eNB_id];
PHY_MEASUREMENTS_eNB *measurements = &eNB->measurements;
uint32_t *rb_mask = eNB->rb_mask_ul;
uint32_t aarx /* ,rx_power_correction */;
......@@ -54,23 +54,26 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *eNB,
measurements->n0_power_tot = 0;
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
if (clear == 1)
measurements->n0_power[aarx]=0;
measurements->n0_power[aarx] = ((k1*signal_energy(&common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
frame_parms->ofdm_symbol_size)) + k2*measurements->n0_power[aarx])>>10;
//measurements->n0_power[aarx] = (measurements->n0_power[aarx]) * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size);
measurements->n0_power_dB[aarx] = (unsigned short) dB_fixed(measurements->n0_power[aarx]);