Put the center_freq and maxDoppler as input of new_channel_desc_scm() function
This commit is contained in:
@@ -135,7 +135,7 @@ uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex)
|
||||
const uint64_t dl_freq_khz = downlink_frequency / 1000;
|
||||
const int32_t delta_duplex_khz = delta_duplex / 1000;
|
||||
|
||||
uint64_t center_freq_diff_khz = 999999999999999999; // 2^64
|
||||
uint64_t center_freq_diff_khz = UINT64_MAX; // 2^64
|
||||
uint16_t current_band = 0;
|
||||
|
||||
for (int ind = 0; ind < sizeofArray(nr_bandtable); ind++) {
|
||||
|
||||
@@ -1190,8 +1190,10 @@ int main(int argc, char **argv) {
|
||||
UE->frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
N_RB2sampling_rate(eNB->frame_parms.N_RB_DL),
|
||||
0,
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
DS_TDL,
|
||||
0.0,
|
||||
CORR_LEVEL_LOW,
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
@@ -1206,8 +1208,10 @@ int main(int argc, char **argv) {
|
||||
UE->frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
N_RB2sampling_rate(eNB->frame_parms.N_RB_DL),
|
||||
0,
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL),
|
||||
DS_TDL,
|
||||
0.0,
|
||||
CORR_LEVEL_LOW,
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
|
||||
@@ -739,15 +739,15 @@ int main(int argc, char **argv) {
|
||||
n_rx,
|
||||
channel_model,
|
||||
N_RB2sampling_rate(eNB->frame_parms.N_RB_UL),
|
||||
0,
|
||||
N_RB2channel_bandwidth(eNB->frame_parms.N_RB_UL),
|
||||
30e-9,
|
||||
maxDoppler,
|
||||
CORR_LEVEL_LOW,
|
||||
forgetting_factor,
|
||||
delay,
|
||||
0,
|
||||
0);
|
||||
// set Doppler
|
||||
UE2eNB->max_Doppler = maxDoppler;
|
||||
|
||||
// NN: N_RB_UL has to be defined in ulsim
|
||||
for (int k=0; k<NUMBER_OF_ULSCH_MAX; k++) eNB->ulsch[k] = new_eNB_ulsch(max_turbo_iterations,N_RB_DL,0);
|
||||
|
||||
@@ -334,10 +334,14 @@ int main(int argc, char **argv)
|
||||
if (ouput_vcd)
|
||||
vcd_signal_dumper_init("/tmp/openair_dump_nr_dlschsim.vcd");
|
||||
|
||||
gNB2UE = new_channel_desc_scm(n_tx, n_rx, channel_model,
|
||||
gNB2UE = new_channel_desc_scm(n_tx,
|
||||
n_rx,
|
||||
channel_model,
|
||||
61.44e6, //N_RB2sampling_rate(N_RB_DL),
|
||||
0,
|
||||
40e6, //N_RB2channel_bandwidth(N_RB_DL),
|
||||
DS_TDL,
|
||||
0.0,
|
||||
CORR_LEVEL_LOW,
|
||||
0,
|
||||
0,
|
||||
|
||||
@@ -900,8 +900,10 @@ int main(int argc, char **argv)
|
||||
n_rx,
|
||||
channel_model,
|
||||
fs/1e6,//sampling frequency in MHz
|
||||
0,
|
||||
txbw,
|
||||
30e-9,
|
||||
0.0,
|
||||
CORR_LEVEL_LOW,
|
||||
0,
|
||||
0,
|
||||
|
||||
@@ -533,8 +533,10 @@ int main(int argc, char **argv)
|
||||
n_rx,
|
||||
channel_model,
|
||||
fs,
|
||||
0,
|
||||
bw,
|
||||
300e-9,
|
||||
0.0,
|
||||
CORR_LEVEL_LOW,
|
||||
0,
|
||||
0,
|
||||
|
||||
@@ -729,8 +729,10 @@ int main(int argc, char **argv){
|
||||
gNB->frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
fs,
|
||||
0,
|
||||
bw,
|
||||
DS_TDL,
|
||||
0.0,
|
||||
CORR_LEVEL_LOW,
|
||||
0.0,
|
||||
delay,
|
||||
|
||||
@@ -421,7 +421,7 @@ int main(int argc, char **argv)
|
||||
&txbw,
|
||||
&rxbw);
|
||||
|
||||
UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, fs, txbw, DS_TDL, CORR_LEVEL_LOW, 0, 0, 0, 0);
|
||||
UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, fs, 0, txbw, DS_TDL, 0.0, CORR_LEVEL_LOW, 0, 0, 0, 0);
|
||||
|
||||
if (UE2gNB==NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
|
||||
@@ -381,8 +381,10 @@ int main(int argc, char **argv)
|
||||
n_rx,
|
||||
channel_model,
|
||||
61.44e6, //N_RB2sampling_rate(N_RB_DL),
|
||||
0,
|
||||
40e6, //N_RB2channel_bandwidth(N_RB_DL),
|
||||
DS_TDL,
|
||||
0.0,
|
||||
CORR_LEVEL_LOW,
|
||||
0,
|
||||
0,
|
||||
|
||||
@@ -683,26 +683,6 @@ int main(int argc, char **argv)
|
||||
&tx_bandwidth,
|
||||
&rx_bandwidth);
|
||||
|
||||
LOG_I( PHY,"++++++++++++++++++++++++++++++++++++++++++++++%i+++++++++++++++++++++++++++++++++++++++++",loglvl);
|
||||
|
||||
UE2gNB = new_channel_desc_scm(n_tx,
|
||||
n_rx, channel_model,
|
||||
sampling_frequency/1e6,
|
||||
tx_bandwidth,
|
||||
DS_TDL,
|
||||
corr_level,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
|
||||
if (UE2gNB == NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
UE2gNB->max_Doppler = maxDoppler;
|
||||
|
||||
RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *));
|
||||
RC.gNB[0] = calloc(1,sizeof(PHY_VARS_gNB));
|
||||
gNB = RC.gNB[0];
|
||||
@@ -809,8 +789,27 @@ int main(int argc, char **argv)
|
||||
|
||||
NR_BWP_Uplink_t *ubwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[0];
|
||||
|
||||
// Configure channel model
|
||||
UE2gNB = new_channel_desc_scm(n_tx,
|
||||
n_rx,
|
||||
channel_model,
|
||||
sampling_frequency / 1e6,
|
||||
frame_parms->ul_CarrierFreq,
|
||||
tx_bandwidth,
|
||||
DS_TDL,
|
||||
maxDoppler,
|
||||
corr_level,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
|
||||
//configure UE
|
||||
if (UE2gNB == NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// Configure UE
|
||||
UE = malloc(sizeof(PHY_VARS_NR_UE));
|
||||
memset((void*)UE,0,sizeof(PHY_VARS_NR_UE));
|
||||
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_NR_UE**));
|
||||
|
||||
@@ -559,18 +559,20 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
uint8_t nb_rx,
|
||||
SCM_t channel_model,
|
||||
double sampling_rate,
|
||||
uint64_t center_freq,
|
||||
double channel_bandwidth,
|
||||
double DS_TDL,
|
||||
double maxDoppler,
|
||||
const corr_level_t corr_level,
|
||||
double forgetting_factor,
|
||||
int32_t channel_offset,
|
||||
double path_loss_dB,
|
||||
float noise_power_dB) {
|
||||
|
||||
float noise_power_dB)
|
||||
{
|
||||
// To create tables for normal distribution
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
tableNor((long)(t.tv_nsec%INT_MAX));
|
||||
tableNor((long) (t.tv_nsec % INT_MAX));
|
||||
|
||||
channel_desc_t *chan_desc = (channel_desc_t *)calloc(1,sizeof(channel_desc_t));
|
||||
|
||||
@@ -587,14 +589,16 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
|
||||
uint16_t i,j;
|
||||
double sum_amps;
|
||||
double aoa,ricean_factor,Td,maxDoppler;
|
||||
double aoa, ricean_factor, Td;
|
||||
int channel_length,nb_taps;
|
||||
struct complexd *R_sqrt_ptr2;
|
||||
chan_desc->modelid = channel_model;
|
||||
chan_desc->nb_tx = nb_tx;
|
||||
chan_desc->nb_rx = nb_rx;
|
||||
chan_desc->sampling_rate = sampling_rate;
|
||||
chan_desc->center_freq = center_freq;
|
||||
chan_desc->channel_bandwidth = channel_bandwidth;
|
||||
chan_desc->max_Doppler = maxDoppler;
|
||||
chan_desc->corr_level = corr_level;
|
||||
chan_desc->forgetting_factor = forgetting_factor;
|
||||
chan_desc->channel_offset = channel_offset;
|
||||
@@ -2161,8 +2165,10 @@ int load_channellist(uint8_t nb_tx, uint8_t nb_rx, double sampling_rate, double
|
||||
nb_rx,
|
||||
modid,
|
||||
sampling_rate,
|
||||
0,
|
||||
channel_bandwidth,
|
||||
*(channel_list.paramarray[i][pindex_DT].dblptr),
|
||||
0.0,
|
||||
CORR_LEVEL_LOW,
|
||||
*(channel_list.paramarray[i][pindex_FF].dblptr),
|
||||
*(channel_list.paramarray[i][pindex_CO].iptr),
|
||||
|
||||
@@ -317,8 +317,10 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
uint8_t nb_rx,
|
||||
SCM_t channel_model,
|
||||
double sampling_rate,
|
||||
uint64_t center_freq,
|
||||
double channel_bandwidth,
|
||||
double DS_TDL,
|
||||
double maxDoppler,
|
||||
const corr_level_t corr_level,
|
||||
double forgetting_factor,
|
||||
int32_t channel_offset,
|
||||
|
||||
@@ -341,17 +341,19 @@ static int rfsimu_setchanmod_cmd(char *buff, int debug, telnet_printfunc_t prnt,
|
||||
if (b->channel_model->model_name==NULL)
|
||||
continue;
|
||||
if (b->conn_sock >= 0 && (strcmp(b->channel_model->model_name,modelname)==0)) {
|
||||
|
||||
channel_desc_t *newmodel=new_channel_desc_scm(t->tx_num_channels,t->rx_num_channels,
|
||||
channelmod,
|
||||
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
|
||||
channel_desc_t *newmodel = new_channel_desc_scm(t->tx_num_channels,
|
||||
t->rx_num_channels,
|
||||
channelmod,
|
||||
t->sample_rate,
|
||||
0,
|
||||
t->tx_bw,
|
||||
30e-9, // TDL delay-spread parameter
|
||||
0.0,
|
||||
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
|
||||
set_channeldesc_owner(newmodel, RFSIMU_MODULEID);
|
||||
set_channeldesc_name(newmodel,modelname);
|
||||
random_channel(newmodel,false);
|
||||
|
||||
Reference in New Issue
Block a user