@@ -459,7 +483,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -459,7 +483,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
dlsch0_harq->mimo_mode,
dlsch0_harq->mimo_mode,
nb_rb,
nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh0,
lte_ue_pdsch_vars[eNB_id]->log2_maxh0,
lte_ue_pdsch_vars[eNB_id]->log2_maxh1);
lte_ue_pdsch_vars[eNB_id]->log2_maxh1);
/* if (symbol == 5) {
/* if (symbol == 5) {
...
@@ -469,11 +493,11 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -469,11 +493,11 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
write_output("rxF_comp_d11.m","rxF_c_d11",<e_ue_pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][1][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be QAM
write_output("rxF_comp_d11.m","rxF_c_d11",<e_ue_pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][1][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be QAM
} */
} */
// compute correlation between signal and interference channels (rho12 and rho21)
// compute correlation between signal and interference channels (rho12 and rho21)
dlsch_dual_stream_correlation(frame_parms,// this is doing h11'*h12 and h21'*h22
dlsch_dual_stream_correlation(frame_parms,// this is doing h11'*h12 and h21'*h22
symbol,
symbol,
nb_rb,
nb_rb,
lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext,
lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext,
...
@@ -481,17 +505,17 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -481,17 +505,17 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
@@ -503,7 +527,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -503,7 +527,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
write_output("rho2_1.m","rho2_1",<e_ue_pdsch_vars[eNB_id]->dl_ch_rho2_ext[1][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be QAM
write_output("rho2_1.m","rho2_1",<e_ue_pdsch_vars[eNB_id]->dl_ch_rho2_ext[1][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be QAM
} */
} */
}
}
else{
else{
...
@@ -534,11 +558,11 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -534,11 +558,11 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
// effective channel of desired user is always stronger than interfering eff. channel
// effective channel of desired user is always stronger than interfering eff. channel
@@ -676,20 +701,20 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -676,20 +701,20 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
(dlsch0_harq->mimo_mode<=DUALSTREAM_PUSCH_PRECODING))){// TM3 or TM4
(dlsch0_harq->mimo_mode<=DUALSTREAM_PUSCH_PRECODING))){// TM3 or TM4
if(frame_parms->nb_antennas_tx_eNB==2){
if(frame_parms->nb_antennas_tx_eNB==2){
dlsch_detection_mrc_TM34(frame_parms,
dlsch_detection_mrc_TM34(frame_parms,
lte_ue_pdsch_vars[eNB_id],
lte_ue_pdsch_vars[eNB_id],
harq_pid,
harq_pid,
dlsch0_harq->round,
dlsch0_harq->round,
symbol,
symbol,
nb_rb,
nb_rb,
1);
1);
/* if (symbol == 5) {
/* if (symbol == 5) {
write_output("rho0_mrc.m","rho0_0",<e_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round][0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);// should be QAM
write_output("rho0_mrc.m","rho0_0",<e_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round][0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);// should be QAM
write_output("rho2_mrc.m","rho2_0",<e_ue_pdsch_vars[eNB_id]->dl_ch_rho2_ext[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
write_output("rho2_mrc.m","rho2_0",<e_ue_pdsch_vars[eNB_id]->dl_ch_rho2_ext[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
} */
} */
}
}
...
@@ -748,7 +773,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -748,7 +773,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
switch(dlsch0_harq->Qm){
switch(dlsch0_harq->Qm){
case2:
case2:
if(rx_type==rx_standard){
if((rx_type==rx_standard)||(codeword_TB0=1)){
dlsch_qpsk_llr(frame_parms,
dlsch_qpsk_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->llr[0],
lte_ue_pdsch_vars[eNB_id]->llr[0],
...
@@ -824,7 +849,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -824,7 +849,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
}
}
break;
break;
case4:
case4:
if(rx_type==rx_standard){
if((rx_type==rx_standard)||(codeword_TB0=1)){
dlsch_16qam_llr(frame_parms,
dlsch_16qam_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->llr[0],
lte_ue_pdsch_vars[eNB_id]->llr[0],
...
@@ -833,7 +858,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
...
@@ -833,7 +858,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
/** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation)
/** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation)
@param rxdataF_ext Frequency-domain received signal in RBs to be demodulated
@param rxdataF_ext Frequency-domain received signal in RBs to be demodulated
/** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal
/** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal
@param symbol Symbol on which to act (within sub-frame)
@param symbol Symbol on which to act (within sub-frame)
@param first_symbol_flag set to 1 on first DLSCH symbol
@param first_symbol_flag set to 1 on first DLSCH symbol
@param rx_type. rx_type=RX_IC_single_stream will enable interference cancellation of a second stream when decoding the first stream. In case of TM1, 2, 5, and this can cancel interference from a neighbouring cell given by eNB_id_i. In case of TM5, eNB_id_i should be set to n_connected_eNB to perform multi-user interference cancellation. In case of TM3, eNB_id_i should be set to eNB_id to perform co-channel interference cancellation; this option should be used together with an interference cancellation step [...]. In case of TM3, if rx_type=RX_IC_dual_stream, both streams will be decoded by applying the IC single stream receiver twice.
@param rx_type. rx_type=RX_IC_single_stream will enable interference cancellation of a second stream when decoding the first stream. In case of TM1, 2, 5, and this can cancel interference from a neighbouring cell given by eNB_id_i. In case of TM5, eNB_id_i should be set to n_connected_eNB to perform multi-user interference cancellation. In case of TM3, eNB_id_i should be set to eNB_id to perform co-channel interference cancellation; this option should be used together with an interference cancellation step [...]. In case of TM3, if rx_type=RX_IC_dual_stream, both streams will be decoded by applying the IC single stream receiver twice.
@param i_mod Modulation order of the interfering stream
@param i_mod Modulation order of the interfering stream
@@ -597,7 +602,7 @@ int main(int argc, char **argv)
...
@@ -597,7 +602,7 @@ int main(int argc, char **argv)
printf("-o Sample offset for receiver\n");
printf("-o Sample offset for receiver\n");
printf("-s Starting SNR, runs from SNR to SNR+%.1fdB in steps of %.1fdB. If n_frames is 1 then just SNR is simulated and MATLAB/OCTAVE output is generated\n",snr_int,snr_step);
printf("-s Starting SNR, runs from SNR to SNR+%.1fdB in steps of %.1fdB. If n_frames is 1 then just SNR is simulated and MATLAB/OCTAVE output is generated\n",snr_int,snr_step);
printf("-f step size of SNR, default value is 1.\n");
printf("-f step size of SNR, default value is 1.\n");
printf("-r ressource block allocation (see section 7.1.6.3 in 36.213\n");
printf("-r resource block allocation (see section 7.1.6.3 in 36.213\n");
printf("-g Channel model, possible values are 3GPP 25.814 SCM-A/B/C/D('A','B','C','D'), 36-101 EPA('E'), EVA ('F'),ETU('G'), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr('K'), Rice8('L'), Rice1('M'), AWGN('N'), Rayleigh1_orthogonal('P'), Rayleigh1_orth_eff_ch_TM4_prec_real ('Q'), Rayleigh1_orth_eff_ch_TM4_prec_imag ('R'), Rayleigh8_orth_eff_ch_TM4_prec_real ('S'),Rayleigh8_orth_eff_ch_TM4_prec_imag ('T') \n");
printf("-g Channel model, possible values are 3GPP 25.814 SCM-A/B/C/D('A','B','C','D'), 36-101 EPA('E'), EVA ('F'),ETU('G'), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr('K'), Rice8('L'), Rice1('M'), AWGN('N'), Rayleigh1_orthogonal('P'), Rayleigh1_orth_eff_ch_TM4_prec_real ('Q'), Rayleigh1_orth_eff_ch_TM4_prec_imag ('R'), Rayleigh8_orth_eff_ch_TM4_prec_real ('S'),Rayleigh8_orth_eff_ch_TM4_prec_imag ('T') \n");
printf("-F forgetting factor (0 new channel every trial, 1 channel constant\n");
printf("-F forgetting factor (0 new channel every trial, 1 channel constant\n");
printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-x Transmission mode (1,2,6 for the moment)\n");
...
@@ -607,7 +612,7 @@ int main(int argc, char **argv)
...
@@ -607,7 +612,7 @@ int main(int argc, char **argv)
printf("-R Number of HARQ rounds (fixed)\n");
printf("-R Number of HARQ rounds (fixed)\n");
printf("-A Turns on calibration mode for abstraction.\n");
printf("-A Turns on calibration mode for abstraction.\n");
printf("-N Determines the number of Channel Realizations in Abstraction mode. Default value is 1. \n");
printf("-N Determines the number of Channel Realizations in Abstraction mode. Default value is 1. \n");
printf("-O Set the percenatge of effective rate to testbench the modem performance (typically 30 and 70, range 1-100) \n");
printf("-O Set the percentage of effective rate to testbench the modem performance (typically 30 and 70, range 1-100) \n");
printf("-I Input filename for TrCH data (binary)\n");
printf("-I Input filename for TrCH data (binary)\n");
printf("-u Receiver type: 0=standard, 1 = single stream IC (for TM3,4,5,6), 2 = dual stream IC (for TM3,4), 3 = SIC (for TM3,4) \n");
printf("-u Receiver type: 0=standard, 1 = single stream IC (for TM3,4,5,6), 2 = dual stream IC (for TM3,4), 3 = SIC (for TM3,4) \n");
exit(1);
exit(1);
...
@@ -736,22 +741,26 @@ int main(int argc, char **argv)
...
@@ -736,22 +741,26 @@ int main(int argc, char **argv)
printf("RX level in null symbol %d\n",dB_fixed(signal_energy(&PHY_vars_UE->lte_ue_common_vars.rxdata[0][160+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
printf("RX level in null symbol %d\n",dB_fixed(signal_energy(&PHY_vars_UE->lte_ue_common_vars.rxdata[0][160+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
printf("RX level in data symbol %d\n",dB_fixed(signal_energy(&PHY_vars_UE->lte_ue_common_vars.rxdata[0][160+(2*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES)],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
printf("RX level in data symbol %d\n",dB_fixed(signal_energy(&PHY_vars_UE->lte_ue_common_vars.rxdata[0][160+(2*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES)],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
printf("rx_level Null symbol %f\n",10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2,256+(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES))));
printf("rx_level Null symbol %f\n",10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2,256+(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES))));
...
@@ -3116,7 +3086,7 @@ n(tikz_fname,"w");
...
@@ -3116,7 +3086,7 @@ n(tikz_fname,"w");
// Inner receiver scheduling for 3 slots
// Inner receiver scheduling for 3 slots
for(Ns=(2*subframe);Ns<((2*subframe)+3);Ns++){
for(Ns=(2*subframe);Ns<((2*subframe)+3);Ns++){
for(l=0;l<pilot2;l++){
for(l=0;l<pilot2;l++){
if(n_frames==1)
if(n_frames==2)
printf("Ns %d, l %d, l2 %d\n",Ns,l,l+(Ns%2)*pilot2);
printf("Ns %d, l %d, l2 %d\n",Ns,l,l+(Ns%2)*pilot2);
/*
/*
This function implements the OFDM front end processor (FEP).
This function implements the OFDM front end processor (FEP).