Commit b8a37a34 authored by Raymond Knopp's avatar Raymond Knopp

pucch format 2/2a/2b UE TX

parent 2d73663b
...@@ -518,7 +518,8 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC, ...@@ -518,7 +518,8 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
// if (rvidx==3) // if (rvidx==3)
// for (cnt=0;cnt<Ncb;cnt++) // for (cnt=0;cnt<Ncb;cnt++)
// counter_buffer[rvidx][cnt]=0; // counter_buffer[rvidx][cnt]=0;
AssertFatal(Ncb>=(3*RTC<<5),"Exiting, RM condition (Ncb %d, Nir/C %d, Nsoft %d, Kw %d\n",Ncb,Nir/C,Nsoft,3*(RTC<<5)); if (Ncb>(3*(RTC<<5)))
AssertFatal(1==0,"Exiting, RM condition (Ncb %d, RTC %d, Nir/C %d, Nsoft %d, Kw %d)\n",Ncb,RTC,Nir/C,Nsoft,3*(RTC<<5));
Gp = G/Nl/Qm; Gp = G/Nl/Qm;
......
...@@ -1679,6 +1679,7 @@ inline int check_skip_dc(int rb,LTE_DL_FRAME_PARMS *frame_parms) { ...@@ -1679,6 +1679,7 @@ inline int check_skip_dc(int rb,LTE_DL_FRAME_PARMS *frame_parms) {
return(0); return(0);
} }
int dlsch_modulation(int32_t **txdataF, int dlsch_modulation(int32_t **txdataF,
int16_t amp, int16_t amp,
uint32_t subframe_offset, uint32_t subframe_offset,
......
...@@ -319,8 +319,8 @@ void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a) ...@@ -319,8 +319,8 @@ void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a)
AMP); AMP);
if (dlsch_encoding(a, if (dlsch_encoding(eNB,
&eNB->frame_parms, a,
1, 1,
eNB->dlsch_MCH, eNB->dlsch_MCH,
proc->frame_tx, proc->frame_tx,
......
...@@ -1709,13 +1709,12 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -1709,13 +1709,12 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
void init_ncs_cell(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]); void init_ncs_cell(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]);
void generate_pucch(int32_t **txdataF, void generate_pucch1x(int32_t **txdataF,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
uint8_t ncs_cell[20][7], uint8_t ncs_cell[20][7],
PUCCH_FMT_t fmt, PUCCH_FMT_t fmt,
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
uint16_t n1_pucch, uint16_t n1_pucch,
uint16_t n2_pucch,
uint8_t shortened_format, uint8_t shortened_format,
uint8_t *payload, uint8_t *payload,
int16_t amp, int16_t amp,
......
This diff is collapsed.
...@@ -1189,13 +1189,12 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1189,13 +1189,12 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
if (abstraction_flag == 0) { if (abstraction_flag == 0) {
generate_pucch(ue->common_vars.txdataF, generate_pucch1x(ue->common_vars.txdataF,
&ue->frame_parms, &ue->frame_parms,
ue->ncs_cell, ue->ncs_cell,
format, format,
&ue->pucch_config_dedicated[eNB_id], &ue->pucch_config_dedicated[eNB_id],
n1_pucch, n1_pucch,
0, // n2_pucch
1, // shortened format 1, // shortened format
pucch_ack_payload, pucch_ack_payload,
tx_amp, tx_amp,
...@@ -1240,13 +1239,12 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1240,13 +1239,12 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
if (abstraction_flag == 0) { if (abstraction_flag == 0) {
generate_pucch(ue->common_vars.txdataF, generate_pucch1x(ue->common_vars.txdataF,
&ue->frame_parms, &ue->frame_parms,
ue->ncs_cell, ue->ncs_cell,
pucch_format1, pucch_format1,
&ue->pucch_config_dedicated[eNB_id], &ue->pucch_config_dedicated[eNB_id],
ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex, ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex,
0, // n2_pucch
1, // shortened format 1, // shortened format
pucch_ack_payload, // this is ignored anyway, we just need a pointer pucch_ack_payload, // this is ignored anyway, we just need a pointer
tx_amp, tx_amp,
......
...@@ -66,7 +66,7 @@ int main(int argc, char **argv) ...@@ -66,7 +66,7 @@ int main(int argc, char **argv)
uint8_t snr1set=0; uint8_t snr1set=0;
//mod_sym_t **txdataF; //mod_sym_t **txdataF;
int **txdata; int **txdata;
double **s_re,**s_im,**r_re,**r_im; double s_re[2][30720],s_im[2][30720],r_re[2][30720],r_im[2][30720];
double ricean_factor=0.0000005,iqim=0.0; double ricean_factor=0.0000005,iqim=0.0;
int trial, n_trials, ntrials=1, n_errors; int trial, n_trials, ntrials=1, n_errors;
...@@ -325,10 +325,6 @@ int main(int argc, char **argv) ...@@ -325,10 +325,6 @@ int main(int argc, char **argv)
txdata = eNB->common_vars.txdata[eNB_id]; txdata = eNB->common_vars.txdata[eNB_id];
s_re = malloc(2*sizeof(double*));
s_im = malloc(2*sizeof(double*));
r_re = malloc(2*sizeof(double*));
r_im = malloc(2*sizeof(double*));
nsymb = (frame_parms->Ncp == 0) ? 14 : 12; nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d\n",NUMBER_OF_OFDM_CARRIERS, printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d\n",NUMBER_OF_OFDM_CARRIERS,
...@@ -352,19 +348,6 @@ int main(int argc, char **argv) ...@@ -352,19 +348,6 @@ int main(int argc, char **argv)
exit(-1); exit(-1);
} }
for (i=0; i<2; i++) {
s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_re[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
s_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(s_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
r_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(r_re[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
r_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
}
init_ncs_cell(&eNB->frame_parms,eNB->ncs_cell); init_ncs_cell(&eNB->frame_parms,eNB->ncs_cell);
init_ncs_cell(&UE->frame_parms,UE->ncs_cell); init_ncs_cell(&UE->frame_parms,UE->ncs_cell);
...@@ -378,13 +361,12 @@ int main(int argc, char **argv) ...@@ -378,13 +361,12 @@ int main(int argc, char **argv)
pucch_payload = 0; pucch_payload = 0;
generate_pucch(UE->common_vars.txdataF, generate_pucch1x(UE->common_vars.txdataF,
frame_parms, frame_parms,
UE->ncs_cell, UE->ncs_cell,
pucch_format, pucch_format,
&pucch_config_dedicated, &pucch_config_dedicated,
n1_pucch, n1_pucch,
n2_pucch,
0, //shortened_format, 0, //shortened_format,
&pucch_payload, &pucch_payload,
AMP, //amp, AMP, //amp,
...@@ -453,7 +435,7 @@ int main(int argc, char **argv) ...@@ -453,7 +435,7 @@ int main(int argc, char **argv)
multipath_channel(UE2eNB,s_re,s_im,r_re,r_im, multipath_channel(UE2eNB,s_re,s_im,r_re,r_im,
2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0); eNB->frame_parms.samples_per_tti,0);
sigma2_dB = N0;//10*log10((double)tx_lev) - SNR; sigma2_dB = N0;//10*log10((double)tx_lev) - SNR;
tx_gain = sqrt(pow(10.0,.1*(N0+SNR))/(double)tx_lev); tx_gain = sqrt(pow(10.0,.1*(N0+SNR))/(double)tx_lev);
...@@ -509,8 +491,7 @@ int main(int argc, char **argv) ...@@ -509,8 +491,7 @@ int main(int argc, char **argv)
if (sig==1) { if (sig==1) {
((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) (((tx_gain*r_re[aa][i]) +sqrt(sigma2/2)*gaussdouble(0.0,1.0))); ((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) (((tx_gain*r_re[aa][i]) +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) (((tx_gain*r_im[aa][i]) + (iqim*r_re[aa][i]*tx_gain) + sqrt(sigma2/2)*gaussdouble( ((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) (((tx_gain*r_im[aa][i]) + (iqim*r_re[aa][i]*tx_gain) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
0.0,1.0)));
} else { } else {
((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0))); ((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0))); ((short*) &eNB->common_vars.rxdata[0][aa][subframe*frame_parms->samples_per_tti])[2*i+1] = (short) ((sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
...@@ -603,18 +584,6 @@ int main(int argc, char **argv) ...@@ -603,18 +584,6 @@ int main(int argc, char **argv)
} }
for (i=0; i<2; i++) {
free(s_re[i]);
free(s_im[i]);
free(r_re[i]);
free(r_im[i]);
}
free(s_re);
free(s_im);
free(r_re);
free(r_im);
lte_sync_time_free(); lte_sync_time_free();
return(n_errors); return(n_errors);
......
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