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

Added PRS TD impulse response for Comb size 2 and 4

parent 8b4d21d9
...@@ -337,11 +337,13 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ...@@ -337,11 +337,13 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
// PRS channel estimates // PRS channel estimates
ue->prs_ch_estimates = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); 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_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++) { 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); 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_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] = { ...@@ -41,6 +41,9 @@ short filt16a_mm1[16] = {
short filt16a_ml1[16] = { short filt16a_ml1[16] = {
-4096,0,4096,8192,12288,16384,12288,8192,4096,0,0,0,0,0,0,0}; -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] = { short filt16a_r1[16] = {
0,0,0,0,0,0,4096,8192,12288,16384,20480,24576,0,0,0,0}; 0,0,0,0,0,0,4096,8192,12288,16384,20480,24576,0,0,0,0};
...@@ -56,6 +59,9 @@ short filt16a_mm2[16] = { ...@@ -56,6 +59,9 @@ short filt16a_mm2[16] = {
short filt16a_ml2[16] = { short filt16a_ml2[16] = {
-8192,-4096,0,4096,8192,12288,16384,12288,8192,4096,0,0,0,0,0,0}; -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] = { short filt16a_r2[16] = {
0,0,0,0,0,0,0,4096,8192,12288,16384,20480,0,0,0,0}; 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]= { ...@@ -169,7 +175,7 @@ short filt8_dcr0_h[8]= {
0,4096,8192,12288,16384,0,0,0}; 0,4096,8192,12288,16384,0,0,0};
short filt8_l1[8] = { short filt8_l1[8] = {
24576,16384,0,0,0,0,0,0}; 24576,16384,8192,0,0,0,0,0};
short filt8_ml1[8] = { short filt8_ml1[8] = {
-8192,0,8192,16384,8192,0,0,0}; -8192,0,8192,16384,8192,0,0,0};
......
...@@ -38,6 +38,8 @@ extern short filt16a_m1[16]; ...@@ -38,6 +38,8 @@ extern short filt16a_m1[16];
extern short filt16a_mm1[16]; extern short filt16a_mm1[16];
extern short filt16a_mr1[16];
extern short filt16a_ml1[16]; extern short filt16a_ml1[16];
extern short filt16a_l2[16]; extern short filt16a_l2[16];
...@@ -48,6 +50,8 @@ extern short filt16a_m2[16]; ...@@ -48,6 +50,8 @@ extern short filt16a_m2[16];
extern short filt16a_mm2[16]; extern short filt16a_mm2[16];
extern short filt16a_mr2[16];
extern short filt16a_ml2[16]; extern short filt16a_ml2[16];
extern short filt16a_l3[16]; extern short filt16a_l3[16];
......
...@@ -824,6 +824,8 @@ typedef struct { ...@@ -824,6 +824,8 @@ typedef struct {
NR_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_gNB_MAX];
prs_data_t prs_cfg; prs_data_t prs_cfg;
int32_t **prs_ch_estimates;
int32_t **prs_ch_estimates_time;
//Paging parameters //Paging parameters
uint32_t IMSImod1024; uint32_t IMSImod1024;
...@@ -846,7 +848,6 @@ typedef struct { ...@@ -846,7 +848,6 @@ typedef struct {
#endif #endif
int32_t **prs_ch_estimates;
/// PBCH DMRS sequence /// PBCH DMRS sequence
uint32_t nr_gold_pbch[2][64][NR_PBCH_DMRS_LENGTH_DWORD]; 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_ ...@@ -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[0]=40; // PRS resource slot period
prs_data.PRSResourceSetPeriod[1]=0; // resource slot offset prs_data.PRSResourceSetPeriod[1]=0; // resource slot offset
prs_data.SymbolStart=7; prs_data.SymbolStart=7;
prs_data.NumPRSSymbols=6; prs_data.NumPRSSymbols=4;
prs_data.NumRB=8; prs_data.NumRB=273;
prs_data.RBOffset=0; prs_data.RBOffset=0;
prs_data.CombSize=4; prs_data.CombSize=4;
prs_data.REOffset=0; prs_data.REOffset=0;
......
...@@ -154,7 +154,6 @@ int main(int argc, char **argv) ...@@ -154,7 +154,6 @@ int main(int argc, char **argv)
int **txdata; int **txdata;
double **s_re,**s_im,**r_re,**r_im; double **s_re,**s_im,**r_re,**r_im;
//double iqim = 0.0; //double iqim = 0.0;
double DS_TDL = .03;
double ip =0.0; double ip =0.0;
//unsigned char pbch_pdu[6]; //unsigned char pbch_pdu[6];
// int sync_pos, sync_pos_slot; // int sync_pos, sync_pos_slot;
...@@ -258,21 +257,6 @@ int main(int argc, char **argv) ...@@ -258,21 +257,6 @@ int main(int argc, char **argv)
channel_model=ETU; channel_model=ETU;
break; 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: default:
printf("Unsupported channel model! Exiting.\n"); printf("Unsupported channel model! Exiting.\n");
exit(-1); exit(-1);
...@@ -521,8 +505,10 @@ int main(int argc, char **argv) ...@@ -521,8 +505,10 @@ int main(int argc, char **argv)
channel_model, channel_model,
fs, fs,
bw, bw,
DS_TDL, 300e-9,
0, 0, 0, 0); 0,
0,
0, 0);
if (gNB2UE==NULL) { if (gNB2UE==NULL) {
printf("Problem generating channel model. Exiting.\n"); printf("Problem generating channel model. Exiting.\n");
...@@ -670,8 +656,8 @@ int main(int argc, char **argv) ...@@ -670,8 +656,8 @@ int main(int argc, char **argv)
for (i=0; i<frame_length_complex_samples; i++) { for (i=0; i<frame_length_complex_samples; i++) {
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]); r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]); r_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
} }
} }
...@@ -681,17 +667,8 @@ int main(int argc, char **argv) ...@@ -681,17 +667,8 @@ int main(int argc, char **argv)
n_errors_payload = 0; n_errors_payload = 0;
for (trial=0; trial<n_trials; trial++) { for (trial=0; trial<n_trials; trial++) {
if (channel_model != AWGN) {
// multipath channel // multipath channel
multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0,0); //multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,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));
}
}
//AWGN //AWGN
sigma2_dB = 20*log10((double)AMP/4)-SNR; sigma2_dB = 20*log10((double)AMP/4)-SNR;
...@@ -762,8 +739,8 @@ int main(int argc, char **argv) ...@@ -762,8 +739,8 @@ int main(int argc, char **argv)
UE->prs_cfg.PRSResourceSetPeriod[0]=40; // PRS resource slot period UE->prs_cfg.PRSResourceSetPeriod[0]=40; // PRS resource slot period
UE->prs_cfg.PRSResourceSetPeriod[1]=0; // resource slot offset UE->prs_cfg.PRSResourceSetPeriod[1]=0; // resource slot offset
UE->prs_cfg.SymbolStart=7; UE->prs_cfg.SymbolStart=7;
UE->prs_cfg.NumPRSSymbols=6; UE->prs_cfg.NumPRSSymbols=4;
UE->prs_cfg.NumRB=8; UE->prs_cfg.NumRB=273;
UE->prs_cfg.RBOffset=0; UE->prs_cfg.RBOffset=0;
UE->prs_cfg.CombSize=4; UE->prs_cfg.CombSize=4;
UE->prs_cfg.REOffset=0; 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