Commit cd2c6ec9 authored by Florian Kaltenberger's avatar Florian Kaltenberger
Browse files

fixed serious bug in unitary simulators: noise was not calcluated correctly...

fixed serious bug in unitary simulators: noise was not calcluated correctly due to missing floating point conversion


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4088 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent b01793ef
......@@ -1725,10 +1725,10 @@ int main(int argc, char **argv) {
//AWGN
// This is the SNR on the PDSCH for OFDM symbols without pilots -> rho_A
sigma2_dB = 10*log10((double)tx_lev) +10*log10(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(NB_RB*12)) - SNR - get_pa_dB(PHY_vars_eNB->pdsch_config_dedicated);
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(double)(NB_RB*12)) - SNR - get_pa_dB(PHY_vars_eNB->pdsch_config_dedicated);
sigma2 = pow(10,sigma2_dB/10);
if (n_frames==1)
printf("Sigma2 %f (sigma2_dB %f)\n",sigma2,sigma2_dB);
printf("Sigma2 %f (sigma2_dB %f,%f,%f )\n",sigma2,sigma2_dB,10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(double)(NB_RB*12)),get_pa_dB(PHY_vars_eNB->pdsch_config_dedicated));
for (i=0; i<2*frame_parms->samples_per_tti; i++) {
for (aa=0;aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx;aa++) {
......
......@@ -880,7 +880,7 @@ int main(int argc, char **argv) {
}
}
sigma2_dB = 10*log10((double)tx_lev) +10*log10(PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size/(12*NB_RB)) - SNR;
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR;
if (n_frames==1)
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f\n",sigma2_dB,SNR,
10*log10((double)tx_lev),
......
......@@ -1082,7 +1082,7 @@ int main(int argc, char **argv) {
// scale by path_loss = NOW - P_noise
//sigma2 = pow(10,sigma2_dB/10);
//N0W = -95.87;
sigma2_dB = (double)tx_lev_dB +10*log10(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(12*PHY_vars_eNB->lte_frame_parms.N_RB_DL)) - SNR;
sigma2_dB = (double)tx_lev_dB +10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(double)(12*PHY_vars_eNB->lte_frame_parms.N_RB_DL)) - SNR;
if (n_frames==1)
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %d\n",sigma2_dB,SNR,tx_lev_dB);
//AWGN
......
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