Commit 8afa1e59 authored by Raymond Knopp's avatar Raymond Knopp

more fixes for oaisim, TM2.

parent 7b1a2cfa
......@@ -296,10 +296,10 @@ int32_t subcarrier_energy(int32_t *,uint32_t, int32_t* subcarrier_energy, uint16
*/
int32_t signal_energy_nodc(int32_t *,uint32_t);
/*!\fn double signal_energy_fp(double s_re[2][30720], double s_im[2][30720],uint32_t, uint32_t,uint32_t);
/*!\fn double signal_energy_fp(double *s_re[2], double *s_im[2],uint32_t, uint32_t,uint32_t);
\brief Computes the signal energy per subcarrier
*/
double signal_energy_fp(double s_re[2][30720], double s_im[2][30720], uint32_t nb_antennas, uint32_t length,uint32_t offset);
double signal_energy_fp(double *s_re[2], double *s_im[2], uint32_t nb_antennas, uint32_t length,uint32_t offset);
/*!\fn double signal_energy_fp2(struct complex *, uint32_t);
\brief Computes the signal energy per subcarrier
......
......@@ -255,7 +255,7 @@ int32_t signal_energy_nodc(int32_t *input,uint32_t length)
}
#endif
double signal_energy_fp(double s_re[2][30720],double s_im[2][30720],uint32_t nb_antennas,uint32_t length,uint32_t offset)
double signal_energy_fp(double *s_re[2],double *s_im[2],uint32_t nb_antennas,uint32_t length,uint32_t offset)
{
int32_t aa,i;
......
......@@ -26,8 +26,8 @@
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
void adc(double r_re[2][30720],
double r_im[2][30720],
void adc(double *r_re[2],
double *r_im[2],
unsigned int input_offset,
unsigned int output_offset,
unsigned int **output,
......
......@@ -31,8 +31,8 @@
#include <stdio.h>
#include "PHY/TOOLS/defs.h"
void dac(double s_re[2][30720],
double s_im[2][30720],
void dac(double *s_re[2],
double *s_im[2],
uint32_t **input,
uint32_t input_offset,
uint32_t nb_tx_antennas,
......@@ -81,8 +81,8 @@ void dac(double s_re[2][30720],
}
}
double dac_fixed_gain(double s_re[2][30720],
double s_im[2][30720],
double dac_fixed_gain(double *s_re[2],
double *s_im[2],
uint32_t **input,
uint32_t input_offset,
uint32_t nb_tx_antennas,
......
......@@ -64,16 +64,16 @@ void rf_rx(double **r_re,
double IQ_imb_dB,
double IQ_phase);
void rf_rx_simple(double r_re[2][30720],
double r_im[2][30720],
void rf_rx_simple(double *r_re[2],
double *r_im[2],
unsigned int nb_rx_antennas,
unsigned int length,
double s_time,
double rx_gain_dB);
void adc(double r_re[2][30720],
double r_im[2][30720],
void adc(double *r_re[2],
double *r_im[2],
unsigned int input_offset,
unsigned int output_offset,
int **output,
......@@ -81,8 +81,8 @@ void adc(double r_re[2][30720],
unsigned int length,
unsigned char B);
void dac(double s_re[2][30720],
double s_im[2][30720],
void dac(double *s_re[2],
double *s_im[2],
int **input,
unsigned int input_offset,
unsigned int nb_tx_antennas,
......@@ -92,8 +92,8 @@ void dac(double s_re[2][30720],
unsigned int meas_length,
unsigned int meas_offset);
double dac_fixed_gain(double s_re[2][30720],
double s_im[2][30720],
double dac_fixed_gain(double *s_re[2],
double *s_im[2],
int **input,
unsigned int input_offset,
unsigned int nb_tx_antennas,
......
......@@ -206,8 +206,8 @@ void rf_rx(double **r_re,
}
}
void rf_rx_simple(double r_re[2][30720],
double r_im[2][30720],
void rf_rx_simple(double *r_re[2],
double *r_im[2],
unsigned int nb_rx_antennas,
unsigned int length,
double s_time,
......
......@@ -219,10 +219,10 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
int random_channel(channel_desc_t *desc, uint8_t abstraction_flag);
/**\fn void multipath_channel(channel_desc_t *desc,
double tx_sig_re[2][30720*2],
double tx_sig_im[2][30720*2],
double rx_sig_re[2][30720*2],
double rx_sig_im[2][30720*2],
double tx_sig_re[2],
double tx_sig_im[2],
double rx_sig_re[2],
double rx_sig_im[2],
uint32_t length,
uint8_t keep_channel)
......@@ -237,10 +237,10 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag);
*/
void multipath_channel(channel_desc_t *desc,
double tx_sig_re[2][30720*2],
double tx_sig_im[2][30720*2],
double rx_sig_re[2][30720*2],
double rx_sig_im[2][30720*2],
double *tx_sig_re[2],
double *tx_sig_im[2],
double *rx_sig_re[2],
double *rx_sig_im[2],
uint32_t length,
uint8_t keep_channel);
/*
......
......@@ -150,10 +150,10 @@ void multipath_channel(channel_desc_t *desc,
#else
void multipath_channel(channel_desc_t *desc,
double tx_sig_re[2][30720*2],
double tx_sig_im[2][30720*2],
double rx_sig_re[2][30720*2],
double rx_sig_im[2][30720*2],
double *tx_sig_re[2],
double *tx_sig_im[2],
double *rx_sig_re[2],
double *rx_sig_im[2],
uint32_t length,
uint8_t keep_channel)
{
......
......@@ -23,6 +23,9 @@ eNBs =
component_carriers = (
{
node_function = "eNodeB_3GPP";
node_timing = "synch_to_ext_device";
node_synch_ref = 0;
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
......
......@@ -108,12 +108,28 @@ void do_DL_sig(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_N
uint8_t nb_antennas_rx = eNB2UE[0][0][CC_id]->nb_rx; // number of rx antennas at UE
uint8_t nb_antennas_tx = eNB2UE[0][0][CC_id]->nb_tx; // number of tx antennas at eNB
double s_re[2][30720];//PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti];
double s_im[2][30720];//PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti];
double r_re0[2][30720];//PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti];
double r_im0[2][30720];//PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti];
double s_re0[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double s_re1[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double *s_re[2];
double s_im0[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double s_im1[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double *s_im[2];
double r_re00[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double r_re01[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double *r_re0[2];
double r_im00[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double r_im01[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double *r_im0[2];
s_re[0] = s_re0;
s_im[0] = s_im0;
s_re[1] = s_re1;
s_im[1] = s_im1;
r_re0[0] = r_re00;
r_im0[0] = r_im00;
r_re0[1] = r_re01;
r_im0[1] = r_im01;
if (subframe==0)
hold_channel = 0;
......@@ -319,16 +335,20 @@ void do_DL_sig(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_N
eNB_output_mask[UE_id]=0;
double *r_re_p[2] = {r_re_DL[eNB_id][0],r_re_DL[eNB_id][1]};
double *r_im_p[2] = {r_im_DL[eNB_id][0],r_im_DL[eNB_id][1]};
#ifdef DEBUG_SIM
rx_pwr = signal_energy_fp((double**)r_re_DL[UE_id],(double**)r_im_DL[UE_id],nb_antennas_rx,frame_parms->ofdm_symbol_size,sf_offset)/(12.0*frame_parms->N_RB_DL);
rx_pwr = signal_energy_fp(r_re_p,r_im_p,nb_antennas_rx,frame_parms->ofdm_symbol_size,sf_offset)/(12.0*frame_parms->N_RB_DL);
LOG_D(OCM,"[SIM][DL] UE %d : ADC in %f dBm for subframe %d\n",UE_id,10*log10(rx_pwr),subframe);
#endif
rxdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.rxdata;
sf_offset = subframe*frame_parms->samples_per_tti;
adc(r_re_DL[UE_id],
r_im_DL[UE_id],
adc(r_re_p,
r_im_p,
0,
sf_offset,
rxdata,
......@@ -384,10 +404,28 @@ void do_UL_sig(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_N
int ulfrrb2 ;
uint8_t harq_pid;
#endif
double s_re[2][30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double s_im[2][30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double r_re0[2][30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double r_im0[2][30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double s_re0[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double s_re1[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double *s_re[2];
double s_im0[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double s_im1[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double *s_im[2];
double r_re00[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double r_re01[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double *r_re0[2];
double r_im00[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double r_im01[30720];//PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti];
double *r_im0[2];
s_re[0] = s_re0;
s_im[0] = s_im0;
s_re[1] = s_re1;
s_im[1] = s_im1;
r_re0[0] = r_re00;
r_im0[0] = r_im00;
r_re0[1] = r_re01;
r_im0[1] = r_im01;
if (abstraction_flag!=0) {
#ifdef PHY_ABSTRACTION_UL
......@@ -447,7 +485,6 @@ void do_UL_sig(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_N
PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe],
subframe,sf_offset);
} else {
tx_pwr = dac_fixed_gain((double**)s_re,
(double**)s_im,
txdata,
......@@ -467,7 +504,7 @@ void do_UL_sig(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_N
subframe,sf_offset);
multipath_channel(UE2eNB[UE_id][eNB_id][CC_id],(double**)s_re,(double**)s_im,(double**)r_re0,(double**)r_im0,
multipath_channel(UE2eNB[UE_id][eNB_id][CC_id],s_re,s_im,r_re0,r_im0,
frame_parms->samples_per_tti,hold_channel);
......@@ -498,23 +535,27 @@ void do_UL_sig(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_N
}
} //UE_id
rf_rx_simple(r_re_UL[eNB_id],
r_im_UL[eNB_id],
double *r_re_p[2] = {r_re_UL[eNB_id][0],r_re_UL[eNB_id][1]};
double *r_im_p[2] = {r_im_UL[eNB_id][0],r_im_UL[eNB_id][1]};
rf_rx_simple(r_re_p,
r_im_p,
nb_antennas_rx,
frame_parms->samples_per_tti,
1e3/UE2eNB[0][eNB_id][CC_id]->sampling_rate, // sampling time (ns)
(double)PHY_vars_eNB_g[eNB_id][CC_id]->rx_total_gain_dB - 66.227); // rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
#ifdef DEBUG_SIM
rx_pwr = signal_energy_fp(r_re_UL[eNB_id],r_im_UL[eNB_id],nb_antennas_rx,frame_parms->samples_per_tti,0)*(double)frame_parms->ofdm_symbol_size/(12.0*frame_parms->N_RB_DL);
rx_pwr = signal_energy_fp(r_re_p,r_im_p,nb_antennas_rx,frame_parms->samples_per_tti,0)*(double)frame_parms->ofdm_symbol_size/(12.0*frame_parms->N_RB_DL);
LOG_D(OCM,"[SIM][UL] rx_pwr (ADC in) %f dB for subframe %d\n",10*log10(rx_pwr),subframe);
#endif
rxdata = PHY_vars_eNB_g[eNB_id][CC_id]->common_vars.rxdata[0];
sf_offset = subframe*frame_parms->samples_per_tti;
adc(r_re_UL[eNB_id],
r_im_UL[eNB_id],
adc(r_re_p,
r_im_p,
0,
sf_offset,
rxdata,
......
......@@ -1120,7 +1120,6 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
UE_id,
CC_id);
printf("Signaling main thread: UE subframe mask %x\n",subframe_UE_mask);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment