Commit 55c64483 authored by Sagar Parsawar's avatar Sagar Parsawar

Added PRS TD impulse response for Comb size 2 and 4

parent 8b4d21d9
......@@ -336,12 +336,14 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
pbch_vars[gNB_id] = (NR_UE_PBCH *)malloc16_clear(sizeof(NR_UE_PBCH));
// PRS channel estimates
ue->prs_ch_estimates = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
AssertFatal(ue->prs_ch_estimates!=NULL, "NR UE init: PRS channel estimates malloc failed\n");
ue->prs_ch_estimates = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
ue->prs_ch_estimates_time = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
AssertFatal(((ue->prs_ch_estimates!=NULL) || (ue->prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed\n");
for (i=0; i<fp->nb_antennas_rx; i++) {
ue->prs_ch_estimates[i] = (int32_t *)malloc16(2*fp->ofdm_symbol_size*NR_MAX_NUM_PRS_SYMB);
AssertFatal(ue->prs_ch_estimates[i]!=NULL, "NR UE init: PRS channel estimates malloc failed %d\n", i);
ue->prs_ch_estimates[i] = (int32_t *)malloc16(2*fp->ofdm_symbol_size*NR_MAX_NUM_PRS_SYMB);
ue->prs_ch_estimates_time[i] = (int32_t *)malloc16(2*fp->ofdm_symbol_size*NR_MAX_NUM_PRS_SYMB);
AssertFatal(((ue->prs_ch_estimates[i]!=NULL) || (ue->prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed %d\n", i);
}
......
......@@ -41,6 +41,9 @@ short filt16a_mm1[16] = {
short filt16a_ml1[16] = {
-4096,0,4096,8192,12288,16384,12288,8192,4096,0,0,0,0,0,0,0};
short filt16a_mr1[16] = {
0,0,4096,8192,12288,16384,12288,8192,4096,0,-4096,-8192,0,0,0,0};
short filt16a_r1[16] = {
0,0,0,0,0,0,4096,8192,12288,16384,20480,24576,0,0,0,0};
......@@ -56,6 +59,9 @@ short filt16a_mm2[16] = {
short filt16a_ml2[16] = {
-8192,-4096,0,4096,8192,12288,16384,12288,8192,4096,0,0,0,0,0,0};
short filt16a_mr2[16] = {
0,0,0,4096,8192,12288,16384,12288,8192,4096,0,-4096,0,0,0,0};
short filt16a_r2[16] = {
0,0,0,0,0,0,0,4096,8192,12288,16384,20480,0,0,0,0};
......@@ -169,7 +175,7 @@ short filt8_dcr0_h[8]= {
0,4096,8192,12288,16384,0,0,0};
short filt8_l1[8] = {
24576,16384,0,0,0,0,0,0};
24576,16384,8192,0,0,0,0,0};
short filt8_ml1[8] = {
-8192,0,8192,16384,8192,0,0,0};
......
......@@ -38,6 +38,8 @@ extern short filt16a_m1[16];
extern short filt16a_mm1[16];
extern short filt16a_mr1[16];
extern short filt16a_ml1[16];
extern short filt16a_l2[16];
......@@ -48,6 +50,8 @@ extern short filt16a_m2[16];
extern short filt16a_mm2[16];
extern short filt16a_mr2[16];
extern short filt16a_ml2[16];
extern short filt16a_l3[16];
......
......@@ -824,6 +824,8 @@ typedef struct {
NR_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_gNB_MAX];
prs_data_t prs_cfg;
int32_t **prs_ch_estimates;
int32_t **prs_ch_estimates_time;
//Paging parameters
uint32_t IMSImod1024;
......@@ -846,7 +848,6 @@ typedef struct {
#endif
int32_t **prs_ch_estimates;
/// PBCH DMRS sequence
uint32_t nr_gold_pbch[2][64][NR_PBCH_DMRS_LENGTH_DWORD];
......
......@@ -105,8 +105,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
prs_data.PRSResourceSetPeriod[0]=40; // PRS resource slot period
prs_data.PRSResourceSetPeriod[1]=0; // resource slot offset
prs_data.SymbolStart=7;
prs_data.NumPRSSymbols=6;
prs_data.NumRB=8;
prs_data.NumPRSSymbols=4;
prs_data.NumRB=273;
prs_data.RBOffset=0;
prs_data.CombSize=4;
prs_data.REOffset=0;
......
......@@ -154,7 +154,6 @@ int main(int argc, char **argv)
int **txdata;
double **s_re,**s_im,**r_re,**r_im;
//double iqim = 0.0;
double DS_TDL = .03;
double ip =0.0;
//unsigned char pbch_pdu[6];
// int sync_pos, sync_pos_slot;
......@@ -257,21 +256,6 @@ int main(int argc, char **argv)
case 'G':
channel_model=ETU;
break;
case 'H':
channel_model = TDL_C;
DS_TDL = .030; // 30 ns
break;
case 'I':
channel_model = TDL_C;
DS_TDL = .3; // 300ns
break;
case 'J':
channel_model=TDL_D;
DS_TDL = .03;
break;
default:
printf("Unsupported channel model! Exiting.\n");
......@@ -521,8 +505,10 @@ int main(int argc, char **argv)
channel_model,
fs,
bw,
DS_TDL,
0, 0, 0, 0);
300e-9,
0,
0,
0, 0);
if (gNB2UE==NULL) {
printf("Problem generating channel model. Exiting.\n");
......@@ -670,8 +656,8 @@ int main(int argc, char **argv)
for (i=0; i<frame_length_complex_samples; i++) {
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
r_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
}
}
......@@ -681,18 +667,9 @@ int main(int argc, char **argv)
n_errors_payload = 0;
for (trial=0; trial<n_trials; trial++) {
if (channel_model != AWGN) {
// multipath channel
multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0,0);
}
else {
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
memcpy(r_re[aa],s_re[aa],frame_length_complex_samples*sizeof(double));
memcpy(r_im[aa],s_im[aa],frame_length_complex_samples*sizeof(double));
}
}
// multipath channel
//multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0);
//AWGN
sigma2_dB = 20*log10((double)AMP/4)-SNR;
sigma2 = pow(10,sigma2_dB/10);
......@@ -762,8 +739,8 @@ int main(int argc, char **argv)
UE->prs_cfg.PRSResourceSetPeriod[0]=40; // PRS resource slot period
UE->prs_cfg.PRSResourceSetPeriod[1]=0; // resource slot offset
UE->prs_cfg.SymbolStart=7;
UE->prs_cfg.NumPRSSymbols=6;
UE->prs_cfg.NumRB=8;
UE->prs_cfg.NumPRSSymbols=4;
UE->prs_cfg.NumRB=273;
UE->prs_cfg.RBOffset=0;
UE->prs_cfg.CombSize=4;
UE->prs_cfg.REOffset=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