Commit 6f51b930 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta Committed by luis_pereira87

Put the correlation level (low, medium or high) as input of new_channel_desc_scm()

parent 3d966b09
......@@ -1192,9 +1192,11 @@ int main(int argc, char **argv) {
N_RB2sampling_rate(eNB->frame_parms.N_RB_DL),
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
DS_TDL,
CORR_LEVEL_LOW,
forgetting_factor,
rx_sample_offset,
0, 0);
0,
0);
reset_meas(&eNB2UE[0]->random_channel);
reset_meas(&eNB2UE[0]->interp_time);
......@@ -1206,9 +1208,11 @@ int main(int argc, char **argv) {
N_RB2sampling_rate(eNB->frame_parms.N_RB_DL),
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
DS_TDL,
CORR_LEVEL_LOW,
forgetting_factor,
rx_sample_offset,
0, 0);
0,
0);
reset_meas(&eNB2UE[n]->random_channel);
reset_meas(&eNB2UE[n]->interp_time);
}
......
......@@ -741,9 +741,11 @@ int main(int argc, char **argv) {
N_RB2sampling_rate(eNB->frame_parms.N_RB_UL),
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_UL),
30e-9,
CORR_LEVEL_LOW,
forgetting_factor,
delay,
0, 0);
0,
0);
// set Doppler
UE2eNB->max_Doppler = maxDoppler;
......
......@@ -340,7 +340,11 @@ int main(int argc, char **argv)
61.44e6, //N_RB2sampling_rate(N_RB_DL),
40e6, //N_RB2channel_bandwidth(N_RB_DL),
DS_TDL,
0, 0, 0, 0);
CORR_LEVEL_LOW,
0,
0,
0,
0);
if (gNB2UE == NULL) {
printf("Problem generating channel model. Exiting.\n");
......
......@@ -903,9 +903,11 @@ int main(int argc, char **argv)
fs/1e6,//sampling frequency in MHz
txbw,
30e-9,
CORR_LEVEL_LOW,
0,
0,
0, 0);
0,
0);
if (gNB2UE==NULL) {
printf("Problem generating channel model. Exiting.\n");
......
......@@ -537,9 +537,11 @@ int main(int argc, char **argv)
fs,
bw,
300e-9,
CORR_LEVEL_LOW,
0,
0,
0, 0);
0,
0);
if (gNB2UE==NULL) {
printf("Problem generating channel model. Exiting.\n");
......
......@@ -734,9 +734,11 @@ int main(int argc, char **argv){
fs,
bw,
DS_TDL,
CORR_LEVEL_LOW,
0.0,
delay,
0, 0);
0,
0);
if (UE2gNB==NULL) {
printf("Problem generating channel model. Exiting.\n");
......
......@@ -415,7 +415,7 @@ int main(int argc, char **argv)
&txbw,
&rxbw);
UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, fs, txbw, DS_TDL,0, 0, 0, 0);
UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, fs, txbw, DS_TDL, CORR_LEVEL_LOW, 0, 0, 0, 0);
if (UE2gNB==NULL) {
printf("Problem generating channel model. Exiting.\n");
......
......@@ -383,7 +383,11 @@ int main(int argc, char **argv)
61.44e6, //N_RB2sampling_rate(N_RB_DL),
40e6, //N_RB2channel_bandwidth(N_RB_DL),
DS_TDL,
0,0,0, 0);
CORR_LEVEL_LOW,
0,
0,
0,
0);
if (gNB2UE == NULL) {
printf("Problem generating channel model. Exiting.\n");
......
......@@ -699,12 +699,17 @@ int main(int argc, char **argv)
LOG_I( PHY,"++++++++++++++++++++++++++++++++++++++++++++++%i+++++++++++++++++++++++++++++++++++++++++",loglvl);
UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model,
corr_level_t corr_level = CORR_LEVEL_MEDIUM; // FIXME: Remove this hardcoded value
UE2gNB = new_channel_desc_scm(n_tx,
n_rx, channel_model,
sampling_frequency/1e6,
tx_bandwidth,
DS_TDL,
0, 0, 0, 0);
corr_level,
0,
0,
0,
0);
if (UE2gNB == NULL) {
printf("Problem generating channel model. Exiting.\n");
......
......@@ -386,9 +386,6 @@ void tdlModel(int tdl_paths, double *tdl_delays, double *tdl_amps_dB, double DS
for (int i = 0; i<chan_desc->nb_taps; i++)
chan_desc->a[i] = (struct complexd *) malloc(nb_tx*nb_rx * sizeof(struct complexd));
// FIXME: Remove this hardcoded value
chan_desc->corr_level = CORR_LEVEL_LOW;
int matrix_size = nb_tx*nb_rx;
double *correlation_matrix[matrix_size];
if (chan_desc->corr_level!=CORR_LEVEL_LOW) {
......@@ -459,6 +456,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
double sampling_rate,
double channel_bandwidth,
double DS_TDL,
const corr_level_t corr_level,
double forgetting_factor,
int32_t channel_offset,
double path_loss_dB,
......@@ -486,6 +484,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
chan_desc->nb_rx = nb_rx;
chan_desc->sampling_rate = sampling_rate;
chan_desc->channel_bandwidth = channel_bandwidth;
chan_desc->corr_level = corr_level;
chan_desc->forgetting_factor = forgetting_factor;
chan_desc->channel_offset = channel_offset;
chan_desc->path_loss_dB = path_loss_dB;
......@@ -2009,10 +2008,17 @@ int load_channellist(uint8_t nb_tx, uint8_t nb_rx, double sampling_rate, double
AssertFatal(0, "\n Choose a valid model type\n");
}
channel_desc_t *channeldesc_p = new_channel_desc_scm(nb_tx,nb_rx,modid,sampling_rate,channel_bandwidth,
*(channel_list.paramarray[i][pindex_DT].dblptr), *(channel_list.paramarray[i][pindex_FF].dblptr),
*(channel_list.paramarray[i][pindex_CO].iptr), *(channel_list.paramarray[i][pindex_PL].dblptr),
*(channel_list.paramarray[i][pindex_NP].dblptr) );
channel_desc_t *channeldesc_p = new_channel_desc_scm(nb_tx,
nb_rx,
modid,
sampling_rate,
channel_bandwidth,
*(channel_list.paramarray[i][pindex_DT].dblptr),
CORR_LEVEL_LOW,
*(channel_list.paramarray[i][pindex_FF].dblptr),
*(channel_list.paramarray[i][pindex_CO].iptr),
*(channel_list.paramarray[i][pindex_PL].dblptr),
*(channel_list.paramarray[i][pindex_NP].dblptr));
AssertFatal( (channeldesc_p!= NULL), "Could not allocate channel %s type %s \n",*(channel_list.paramarray[i][pindex_NAME].strptr), *(channel_list.paramarray[i][pindex_TYPE].strptr));
channeldesc_p->model_name = strdup(*(channel_list.paramarray[i][pindex_NAME].strptr));
LOG_I(OCM,"Model %s type %s allocated from config file, list %s\n",*(channel_list.paramarray[i][pindex_NAME].strptr),
......
......@@ -314,7 +314,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
SCM_t channel_model,
double sampling_rate,
double channel_bandwidth,
double TDL_DS,
double DS_TDL,
const corr_level_t corr_level,
double forgetting_factor,
int32_t channel_offset,
double path_loss_dB,
......
......@@ -347,11 +347,11 @@ static int rfsimu_setchanmod_cmd(char *buff, int debug, telnet_printfunc_t prnt,
t->sample_rate,
t->tx_bw,
30e-9, // TDL delay-spread parameter
CORR_LEVEL_LOW,
t->chan_forgetfact, // forgetting_factor
t->chan_offset, // maybe used for TA
t->chan_pathloss,
t->noise_power_dB
); // path_loss in dB
t->noise_power_dB); // path_loss in dB
set_channeldesc_owner(newmodel, RFSIMU_MODULEID);
set_channeldesc_name(newmodel,modelname);
random_channel(newmodel,false);
......
......@@ -359,6 +359,7 @@ void init_ocm(void) {
N_RB2sampling_rate(RC.ru[ru_id]->frame_parms->N_RB_DL),
N_RB2channel_bandwidth(RC.ru[ru_id]->frame_parms->N_RB_DL),
DS_TDL,
CORR_LEVEL_LOW,
0.0,
0,
0,
......@@ -373,6 +374,7 @@ void init_ocm(void) {
N_RB2sampling_rate(RC.ru[ru_id]->frame_parms->N_RB_UL),
N_RB2channel_bandwidth(RC.ru[ru_id]->frame_parms->N_RB_UL),
DS_TDL,
CORR_LEVEL_LOW,
0.0,
0,
0,
......
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