Commit de8ef8c5 authored by luis_pereira87's avatar luis_pereira87

Fix nr_pbchsim to avoid multiple ffo compensations for each trial on input samples

parent ebdd7e3a
...@@ -656,6 +656,13 @@ int main(int argc, char **argv) ...@@ -656,6 +656,13 @@ int main(int argc, char **argv)
printf("txlev %d (%f)\n",txlev,10*log10(txlev));*/ printf("txlev %d (%f)\n",txlev,10*log10(txlev));*/
for (SNR=snr0; SNR<snr1; SNR+=.2) {
n_errors = 0;
n_errors_payload = 0;
for (trial=0; trial<n_trials; trial++) {
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++) {
r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]); r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
...@@ -663,12 +670,6 @@ int main(int argc, char **argv) ...@@ -663,12 +670,6 @@ int main(int argc, char **argv)
} }
} }
for (SNR=snr0; SNR<snr1; SNR+=.2) {
n_errors = 0;
n_errors_payload = 0;
for (trial=0; trial<n_trials; trial++) {
// multipath channel // multipath channel
//multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0); //multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0);
...@@ -697,10 +698,8 @@ int main(int argc, char **argv) ...@@ -697,10 +698,8 @@ int main(int argc, char **argv)
0.0, // IQ imbalance (dB), 0.0, // IQ imbalance (dB),
0.0); // IQ phase imbalance (rad) 0.0); // IQ phase imbalance (rad)
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_rx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
((short*) UE->common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); ((short*) UE->common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
((short*) UE->common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); ((short*) UE->common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.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