dlsch_demodulation.c 241 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.0  (the "License"); you may not use this file
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
21
22
23

/*! \file PHY/LTE_TRANSPORT/dlsch_demodulation.c
 * \brief Top-level routines for demodulating the PDSCH physical channel from 36-211, V8.6 2009-03
24
 * \author R. Knopp, F. Kaltenberger,A. Bhamri, S. Aubert, X. Xiang
25
 * \date 2011
26
 * \version 0.1
27
28
29
30
31
 * \company Eurecom
 * \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,ankit.bhamri@eurecom.fr,sebastien.aubert@eurecom.fr
 * \note
 * \warning
 */
32
//#include "PHY/defs.h"
33
34
35
#include "PHY/extern.h"
#include "defs.h"
#include "extern.h"
36
#include "PHY/sse_intrin.h"
Bilel's avatar
Bilel committed
37
#include "T.h"
38
39
40
41

#ifndef USER_MODE
#define NOCYGWIN_STATIC static
#else
42
#define NOCYGWIN_STATIC
43
44
#endif

45
extern int16_t dlsch_demod_shift;
46
47
//#define DEBUG_HARQ

Elena Lukashova's avatar
Elena Lukashova committed
48
49
50
//#undef LOG_D
//#define LOG_D LOG_I

51
//#define DEBUG_PHY 1
52
//#define DEBUG_DLSCH_DEMOD 1
53

54
int avg[4];
55
56
int avg_0[2];
int avg_1[2];
57
58

// [MCS][i_mod (0,1,2) = (2,4,6)]
59
unsigned char offset_mumimo_llr_drange_fix=0;
Elena Lukashova's avatar
Elena Lukashova committed
60
61
62
uint8_t interf_unaw_shift0=0;
uint8_t interf_unaw_shift1=0;
uint8_t interf_unaw_shift=0;
63
//inferference-free case
64
unsigned char interf_unaw_shift_tm4_mcs[29]={5, 3, 4, 3, 3, 2, 1, 1, 2, 0, 1, 1, 1, 1, 0, 0,
65
                                             1, 1, 1, 1, 0, 2, 1, 0, 1, 0, 1, 0, 0} ;
66
unsigned char interf_unaw_shift_tm1_mcs[29]={5, 5, 4, 3, 3, 3, 2, 2, 4, 4, 2, 3, 3, 3, 1, 1,
67
                                             0, 1, 1, 2, 5, 4, 4, 6, 5, 1, 0, 5, 6} ; // mcs 21, 26, 28 seem to be errorneous
68

69
70
71
/*
//original values from sebastion + same hand tuning
unsigned char offset_mumimo_llr_drange[29][3]={{8,8,8},{7,7,7},{7,7,7},{7,7,7},{6,6,6},{6,6,6},{6,6,6},{5,5,5},{4,4,4},{1,2,4}, // QPSK
72
73
{5,5,4},{5,5,5},{5,5,5},{3,3,3},{2,2,2},{2,2,2},{2,2,2}, // 16-QAM
{2,2,1},{3,3,3},{3,3,3},{3,3,1},{2,2,2},{2,2,2},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}; //64-QAM
74
*/
75
76
77
78
79
80
81
82
 /*
 //first optimization try
 unsigned char offset_mumimo_llr_drange[29][3]={{7, 8, 7},{6, 6, 7},{6, 6, 7},{6, 6, 6},{5, 6, 6},{5, 5, 6},{5, 5, 6},{4, 5, 4},{4, 3, 4},{3, 2, 2},{6, 5, 5},{5, 4, 4},{5, 5, 4},{3, 3, 2},{2, 2, 1},{2, 1, 1},{2, 2, 2},{3, 3, 3},{3, 3, 2},{3, 3, 2},{3, 2, 1},{2, 2, 2},{2, 2, 2},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0}};
 */
 //second optimization try
 /*
   unsigned char offset_mumimo_llr_drange[29][3]={{5, 8, 7},{4, 6, 8},{3, 6, 7},{7, 7, 6},{4, 7, 8},{4, 7, 4},{6, 6, 6},{3, 6, 6},{3, 6, 6},{1, 3, 4},{1, 1, 0},{3, 3, 2},{3, 4, 1},{4, 0, 1},{4, 2, 2},{3, 1, 2},{2, 1, 0},{2, 1, 1},{1, 0, 1},{1, 0, 1},{0, 0, 0},{1, 0, 0},{0, 0, 0},{0, 1, 0},{1, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0}};  w
 */
83
unsigned char offset_mumimo_llr_drange[29][3]= {{0, 6, 5},{0, 4, 5},{0, 4, 5},{0, 5, 4},{0, 5, 6},{0, 5, 3},{0, 4, 4},{0, 4, 4},{0, 3, 3},{0, 1, 2},{1, 1, 0},{1, 3, 2},{3, 4, 1},{2, 0, 0},{2, 2, 2},{1, 1, 1},{2, 1, 0},{2, 1, 1},{1, 0, 1},{1, 0, 1},{0, 0, 0},{1, 0, 0},{0, 0, 0},{0, 1, 0},{1, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0}};
84
85


86
extern void print_shorts(char *s,int16_t *x);
87

88

89
int rx_pdsch(PHY_VARS_UE *ue,
90
91
             PDSCH_t type,
             unsigned char eNB_id,
92
             unsigned char eNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference
Bilel's avatar
Bilel committed
93
             uint32_t frame,
gauthier's avatar
gauthier committed
94
             uint8_t subframe,
95
96
             unsigned char symbol,
             unsigned char first_symbol_flag,
97
             RX_type_t rx_type,
98
             unsigned char i_mod,
99
100
101
             unsigned char harq_pid)
{

102
103
104
  LTE_UE_COMMON *common_vars  = &ue->common_vars;
  LTE_UE_PDSCH **pdsch_vars;
  LTE_DL_FRAME_PARMS *frame_parms    = &ue->frame_parms;
105
  PHY_MEASUREMENTS *measurements = &ue->measurements;
106
  LTE_UE_DLSCH_t   **dlsch;
107

Elena Lukashova's avatar
Elena Lukashova committed
108

109
  unsigned char aatx,aarx;
110

111
  unsigned short nb_rb = 0, round;
112
  int avgs, rb;
113
  LTE_DL_UE_HARQ_t *dlsch0_harq,*dlsch1_harq = 0;
Elena Lukashova's avatar
Elena Lukashova committed
114

115
  uint8_t beamforming_mode;
116
  uint32_t *rballoc;
117

118
119
  int32_t **rxdataF_comp_ptr;
  int32_t **dl_ch_mag_ptr;
120
121
122
123
  int32_t codeword_TB0;
  int32_t codeword_TB1;


124

Bilel's avatar
Bilel committed
125

126
127
  switch (type) {
  case SI_PDSCH:
128
    pdsch_vars = &ue->pdsch_vars_SI[eNB_id];
129
130
    dlsch = &ue->dlsch_SI[eNB_id];
    dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
131
    beamforming_mode  = 0;
132
    break;
133

134
  case RA_PDSCH:
135
    pdsch_vars = &ue->pdsch_vars_ra[eNB_id];
136
137
    dlsch = &ue->dlsch_ra[eNB_id];
    dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
138
    beamforming_mode  = 0;
139
    break;
140

141
  case PDSCH:
142
    pdsch_vars = &ue->pdsch_vars[subframe&0x1][eNB_id];
Bilel's avatar
Bilel committed
143
144
145
146
147
148
    dlsch = ue->dlsch[subframe&0x1][eNB_id];
    LOG_D(PHY,"AbsSubframe %d.%d / Sym %d harq_pid %d,  harq status %d.%d \n",
                   frame,subframe,symbol,harq_pid,
                   dlsch[0]->harq_processes[harq_pid]->status,
                   dlsch[1]->harq_processes[harq_pid]->status);

149
150
151
152
153
154
    if ((dlsch[0]->harq_processes[harq_pid]->status == ACTIVE) &&
        (dlsch[1]->harq_processes[harq_pid]->status == ACTIVE)){
      codeword_TB0 = dlsch[0]->harq_processes[harq_pid]->codeword;
      codeword_TB1 = dlsch[1]->harq_processes[harq_pid]->codeword;
      dlsch0_harq = dlsch[codeword_TB0]->harq_processes[harq_pid];
      dlsch1_harq = dlsch[codeword_TB1]->harq_processes[harq_pid];
155
    }
156
157
158
159
160
161
     else if ((dlsch[0]->harq_processes[harq_pid]->status == ACTIVE) &&
              (dlsch[1]->harq_processes[harq_pid]->status != ACTIVE) ) {
      codeword_TB0 = dlsch[0]->harq_processes[harq_pid]->codeword;
      dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
      dlsch1_harq = NULL;
      codeword_TB1 = -1;
162
    }
163
164
165
     else if ((dlsch[0]->harq_processes[harq_pid]->status != ACTIVE) &&
              (dlsch[1]->harq_processes[harq_pid]->status == ACTIVE) ){
      codeword_TB1 = dlsch[1]->harq_processes[harq_pid]->codeword;
Bilel's avatar
Bilel committed
166
167
      dlsch0_harq  = dlsch[1]->harq_processes[harq_pid];
      dlsch1_harq  = NULL;
168
      codeword_TB0 = -1;
169
    }
170
171
172
173
    else {
      LOG_E(PHY,"[UE][FATAL] Frame %d subframe %d: no active DLSCH\n",ue->proc.proc_rxtx[0].frame_rx,subframe);
      return(-1);
    }
174
    beamforming_mode  = ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id];
175
176
177
    break;

  default:
Cedric Roux's avatar
Cedric Roux committed
178
    LOG_E(PHY,"[UE][FATAL] Frame %d subframe %d: Unknown PDSCH format %d\n",ue->proc.proc_rxtx[0].frame_rx,subframe,type);
179
180
181
    return(-1);
    break;
  }
182
183
184
185
#ifdef DEBUG_HARQ
  printf("[DEMOD] MIMO mode = %d\n", dlsch0_harq->mimo_mode);
  printf("[DEMOD] cw for TB0 = %d, cw for TB1 = %d\n", codeword_TB0, codeword_TB1);
#endif
186

187
188
  DevAssert(dlsch0_harq);
  round = dlsch0_harq->round;
189

190
  if (eNB_id > 2) {
jiangx's avatar
jiangx committed
191
    LOG_W(PHY,"dlsch_demodulation.c: Illegal eNB_id %d\n",eNB_id);
192
193
    return(-1);
  }
194

195
196
  if (!common_vars) {
    LOG_W(PHY,"dlsch_demodulation.c: Null common_vars\n");
197
198
199
    return(-1);
  }

200
  if (!dlsch[0]) {
jiangx's avatar
jiangx committed
201
    LOG_W(PHY,"dlsch_demodulation.c: Null dlsch_ue pointer\n");
202
203
204
    return(-1);
  }

205
206
  if (!pdsch_vars) {
    LOG_W(PHY,"dlsch_demodulation.c: Null pdsch_vars pointer\n");
207
208
    return(-1);
  }
209

210
  if (!frame_parms) {
211
    LOG_W(PHY,"dlsch_demodulation.c: Null frame_parms\n");
212
213
    return(-1);
  }
214

215
216
217
218
219
  if (((frame_parms->Ncp == NORMAL) && (symbol>=7)) ||
      ((frame_parms->Ncp == EXTENDED) && (symbol>=6)))
    rballoc = dlsch0_harq->rb_alloc_odd;
  else
    rballoc = dlsch0_harq->rb_alloc_even;
220

221

Elena Lukashova's avatar
Elena Lukashova committed
222
  if (dlsch0_harq->mimo_mode>DUALSTREAM_PUSCH_PRECODING) {
223
224
225
    LOG_E(PHY,"This transmission mode is not yet supported!\n");
    return(-1);
  }
226
227
228



229
230
231
232
233
234
235
236
  if ((dlsch0_harq->mimo_mode==LARGE_CDD) || ((dlsch0_harq->mimo_mode>=DUALSTREAM_UNIFORM_PRECODING1) && (dlsch0_harq->mimo_mode<=DUALSTREAM_PUSCH_PRECODING)))  {
    DevAssert(dlsch1_harq);
    if (eNB_id!=eNB_id_i) {
      LOG_E(PHY,"TM3/TM4 requires to set eNB_id==eNB_id_i!\n");
      return(-1);
    }
  }

Bilel's avatar
Bilel committed
237
238
239
  //LOG_I(PHY,"[rx_pdsch %d] AbsSubframe %d.%d symbol %d rxType %d beamformingMode %d, antennaPorts %d, eNB_id_i %d, n_connected_eNB %d\n",
  //        harq_pid, frame,subframe, symbol,rx_type, beamforming_mode, frame_parms->nb_antenna_ports_eNB,eNB_id_i,ue->n_connected_eNB);

Xiwen JIANG's avatar
Xiwen JIANG committed
240
  if (frame_parms->nb_antenna_ports_eNB>1 && beamforming_mode==0) {
241
#ifdef DEBUG_DLSCH_MOD
242
    LOG_I(PHY,"dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch[0],dlsch0_harq->rb_alloc_even[0]);
243
#endif
244

245
246
    nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
                                   common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
247
248
                                   pdsch_vars[eNB_id]->rxdataF_ext,
                                   pdsch_vars[eNB_id]->dl_ch_estimates_ext,
249
                                   dlsch0_harq->pmi_alloc,
250
                                   pdsch_vars[eNB_id]->pmi_ext,
251
                                   rballoc,
252
253
                                   symbol,
                                   subframe,
254
                                   ue->high_speed_flag,
Elena Lukashova's avatar
Elena Lukashova committed
255
                                   frame_parms,
256
                                   dlsch0_harq->mimo_mode);
257
//#ifdef DEBUG_DLSCH_MOD
258
259
    /*   printf("dlsch: using pmi %lx, rb_alloc %x, pmi_ext ",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),*rballoc);
       for (rb=0;rb<nb_rb;rb++)
260
          printf("%d",pdsch_vars[eNB_id]->pmi_ext[rb]);
261
       printf("\n");*/
262
//#endif
263

Elena Lukashova's avatar
Elena Lukashova committed
264
   if (rx_type >= rx_IC_single_stream) {
265
      if (eNB_id_i<ue->n_connected_eNB) // we are in TM5
266
      nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
267
                                       common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i],
268
269
                                       pdsch_vars[eNB_id_i]->rxdataF_ext,
                                       pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
270
                                       dlsch0_harq->pmi_alloc,
271
                                       pdsch_vars[eNB_id_i]->pmi_ext,
272
                                       rballoc,
273
274
                                       symbol,
                                       subframe,
275
                                       ue->high_speed_flag,
Elena Lukashova's avatar
Elena Lukashova committed
276
                                       frame_parms,
277
                                       dlsch0_harq->mimo_mode);
278
      else
279
280
        nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
                                       common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
281
282
                                       pdsch_vars[eNB_id_i]->rxdataF_ext,
                                       pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
283
                                       dlsch0_harq->pmi_alloc,
284
                                       pdsch_vars[eNB_id_i]->pmi_ext,
285
                                       rballoc,
286
287
                                       symbol,
                                       subframe,
288
                                       ue->high_speed_flag,
Elena Lukashova's avatar
Elena Lukashova committed
289
                                       frame_parms,
290
                                       dlsch0_harq->mimo_mode);
291
    }
292
  } else if (beamforming_mode==0) { //else if nb_antennas_ports_eNB==1 && beamforming_mode == 0
293
294
    nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
                                     common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
295
296
                                     pdsch_vars[eNB_id]->rxdataF_ext,
                                     pdsch_vars[eNB_id]->dl_ch_estimates_ext,
297
                                     dlsch0_harq->pmi_alloc,
298
                                     pdsch_vars[eNB_id]->pmi_ext,
299
                                     rballoc,
300
301
                                     symbol,
                                     subframe,
302
                                     ue->high_speed_flag,
303
                                     frame_parms);
304

Elena Lukashova's avatar
Elena Lukashova committed
305
   if (rx_type==rx_IC_single_stream) {
306
     if (eNB_id_i<ue->n_connected_eNB)
307
308
        nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
                                         common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i],
309
                                         pdsch_vars[eNB_id_i]->rxdataF_ext,
310
                                         pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
311
                                         dlsch0_harq->pmi_alloc,
312
                                         pdsch_vars[eNB_id_i]->pmi_ext,
313
                                         rballoc,
314
315
                                         symbol,
                                         subframe,
316
                                         ue->high_speed_flag,
317
                                         frame_parms);
318
      else
319
320
        nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
                                         common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
321
                                         pdsch_vars[eNB_id_i]->rxdataF_ext,
322
                                         pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
323
                                         dlsch0_harq->pmi_alloc,
324
                                         pdsch_vars[eNB_id_i]->pmi_ext,
325
                                         rballoc,
326
327
                                         symbol,
                                         subframe,
328
                                         ue->high_speed_flag,
329
                                         frame_parms);
330
    }
331
  } else if (beamforming_mode==7) { //else if beamforming_mode == 7
332
    nb_rb = dlsch_extract_rbs_TM7(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
333
334
335
                                  pdsch_vars[eNB_id]->dl_bf_ch_estimates,
                                  pdsch_vars[eNB_id]->rxdataF_ext,
                                  pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
336
                                  rballoc,
337
338
                                  symbol,
                                  subframe,
339
                                  ue->high_speed_flag,
340
                                  frame_parms);
341

342
  } else if(beamforming_mode>7) {
343
    LOG_W(PHY,"dlsch_demodulation: beamforming mode not supported yet.\n");
344
  }
345

Bilel's avatar
Bilel committed
346
  //printf("nb_rb = %d, eNB_id %d\n",nb_rb,eNB_id);
347
  if (nb_rb==0) {
348
    LOG_D(PHY,"dlsch_demodulation.c: nb_rb=0\n");
349
350
    return(-1);
  }
351

Elena Lukashova's avatar
Elena Lukashova committed
352

353
#ifdef DEBUG_PHY
354
355
  LOG_D(PHY,"[DLSCH] log2_maxh = %d (%d,%d)\n",pdsch_vars[eNB_id]->log2_maxh,avg[0],avgs);
  LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
356
357
#endif

358
  aatx = frame_parms->nb_antenna_ports_eNB;
Elena Lukashova's avatar
Elena Lukashova committed
359
360
  aarx = frame_parms->nb_antennas_rx;

361
  dlsch_scale_channel(pdsch_vars[eNB_id]->dl_ch_estimates_ext,
362
363
364
365
                      frame_parms,
                      dlsch,
                      symbol,
                      nb_rb);
366

367
368
  if ((dlsch0_harq->mimo_mode<DUALSTREAM_UNIFORM_PRECODING1) && (rx_type==rx_IC_single_stream) && (eNB_id_i==ue->n_connected_eNB) && (dlsch0_harq->dl_power_off==0))  // TM5 two-user
    dlsch_scale_channel(pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
369
                        frame_parms,
370
                        dlsch,
371
372
                        symbol,
                        nb_rb);
373

374
  if (first_symbol_flag==1) {
375
376
377
    if (beamforming_mode==0){
      if (dlsch0_harq->mimo_mode<LARGE_CDD) {
        dlsch_channel_level(pdsch_vars[eNB_id]->dl_ch_estimates_ext,
378
379
380
381
                           frame_parms,
                           avg,
                           symbol,
                           nb_rb);
382
383
384
385
386
387
388
389
390
391
392
        avgs = 0;
        for (aatx=0;aatx<frame_parms->nb_antenna_ports_eNB;aatx++)
          for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
            avgs = cmax(avgs,avg[(aatx<<1)+aarx]);

        pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2)+1;
     }
     else if ((dlsch0_harq->mimo_mode == LARGE_CDD) ||
           ((dlsch0_harq->mimo_mode >=DUALSTREAM_UNIFORM_PRECODING1) &&
            (dlsch0_harq->mimo_mode <=DUALSTREAM_PUSCH_PRECODING)))
     {
Bilel's avatar
Bilel committed
393
      //LOG_I(PHY,"Channel Level TM34 !!!!!!!! \n");
394
395
396
397
398
399
400
401
402
      dlsch_channel_level_TM34(pdsch_vars[eNB_id]->dl_ch_estimates_ext,
                                 frame_parms,
                                 pdsch_vars[eNB_id]->pmi_ext,
                                 avg_0,
                                 avg_1,
                                 symbol,
                                 nb_rb,
                                 dlsch0_harq->mimo_mode);

Bilel's avatar
Bilel committed
403
404
      LOG_D(PHY,"Channel Level TM34  avg_0 %d, avg_1 %d, rx_type %d, rx_standard %d, interf_unaw_shift %d \n", avg_0[0],
              avg_1[0], rx_type, rx_standard, interf_unaw_shift);
405
        if (rx_type>rx_standard) {
406
407
          avg_0[0] = (log2_approx(avg_0[0])/2) + dlsch_demod_shift;// + 2 ;//+ 4;
          avg_1[0] = (log2_approx(avg_1[0])/2) + dlsch_demod_shift;// + 2 ;//+ 4;
408
409
          pdsch_vars[eNB_id]->log2_maxh0 = cmax(avg_0[0],0);
          pdsch_vars[eNB_id]->log2_maxh1 = cmax(avg_1[0],0);
Bilel's avatar
Bilel committed
410
411
          //printf("TM4 I-A log2_maxh0 = %d\n", pdsch_vars[eNB_id]->log2_maxh0);
          //printf("TM4 I-A log2_maxh1 = %d\n", pdsch_vars[eNB_id]->log2_maxh1);
412
413
414
415
416
417
         }
          else {
          avg_0[0] = (log2_approx(avg_0[0])/2) - 13 + interf_unaw_shift;
          avg_1[0] = (log2_approx(avg_1[0])/2) - 13 + interf_unaw_shift;
          pdsch_vars[eNB_id]->log2_maxh0 = cmax(avg_0[0],0);
          pdsch_vars[eNB_id]->log2_maxh1 = cmax(avg_1[0],0);
Bilel's avatar
Bilel committed
418
419
          //printf("TM4 I-UA log2_maxh0 = %d\n", pdsch_vars[eNB_id]->log2_maxh0);
          //printf("TM4 I-UA log2_maxh1 = %d\n", pdsch_vars[eNB_id]->log2_maxh1);
420
421
422
423
424
425
426
427
428
429
430
431
        }
      }
      else if (dlsch0_harq->mimo_mode<DUALSTREAM_UNIFORM_PRECODING1) {// single-layer precoding (TM5, TM6)
        if ((rx_type==rx_IC_single_stream) && (eNB_id_i==ue->n_connected_eNB) && (dlsch0_harq->dl_power_off==0)) {
            dlsch_channel_level_TM56(pdsch_vars[eNB_id]->dl_ch_estimates_ext,
                                frame_parms,
                                pdsch_vars[eNB_id]->pmi_ext,
                                avg,
                                symbol,
                                nb_rb);
            avg[0] = log2_approx(avg[0]) - 13 + offset_mumimo_llr_drange[dlsch0_harq->mcs][(i_mod>>1)-1];
            pdsch_vars[eNB_id]->log2_maxh = cmax(avg[0],0);
432

433
434
        }
        else if (dlsch0_harq->dl_power_off==1) { //TM6
435

436
437
438
439
440
          dlsch_channel_level(pdsch_vars[eNB_id]->dl_ch_estimates_ext,
                                   frame_parms,
                                   avg,
                                   symbol,
                                   nb_rb);
441

442
443
444
445
          avgs = 0;
          for (aatx=0;aatx<frame_parms->nb_antenna_ports_eNB;aatx++)
            for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
              avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
446

447
448
          pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2) + 1;
          pdsch_vars[eNB_id]->log2_maxh++;
449

450
        }
451
      }
452

453
454
455
456
457
458
459
    }
    else if (beamforming_mode==7)
       dlsch_channel_level_TM7(pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
                              frame_parms,
                              avg,
                              symbol,
                              nb_rb);
460
#ifdef DEBUG_PHY
Bilel's avatar
Bilel committed
461
462
463
464
465
    LOG_I(PHY,"[DLSCH] log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n",pdsch_vars[eNB_id]->log2_maxh,
                                                 pdsch_vars[eNB_id]->log2_maxh0,
                                                 pdsch_vars[eNB_id]->log2_maxh1,
                                                 avg[0],avgs);
    LOG_I(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
466
467
#endif
  }
468

469
470
471
472
473
474
475
#if T_TRACER
    if (type == PDSCH)
    {
      T(T_UE_PHY_PDSCH_ENERGY, T_INT(eNB_id),  T_INT(0), T_INT(frame%1024), T_INT(subframe),
                               T_INT(avg[0]), T_INT(avg[1]),    T_INT(avg[2]),             T_INT(avg[3]));
    }
#endif
476

477
478
// Now channel compensation
  if (dlsch0_harq->mimo_mode<LARGE_CDD) {
479
480
481
482
483
484
    dlsch_channel_compensation(pdsch_vars[eNB_id]->rxdataF_ext,
                               pdsch_vars[eNB_id]->dl_ch_estimates_ext,
                               pdsch_vars[eNB_id]->dl_ch_mag0,
                               pdsch_vars[eNB_id]->dl_ch_magb0,
                               pdsch_vars[eNB_id]->rxdataF_comp0,
                               (aatx>1) ? pdsch_vars[eNB_id]->rho : NULL,
485
486
487
                               frame_parms,
                               symbol,
                               first_symbol_flag,
Elena Lukashova's avatar
Elena Lukashova committed
488
                               dlsch0_harq->Qm,
489
                               nb_rb,
490
                               pdsch_vars[eNB_id]->log2_maxh,
491
                               measurements); // log2_maxh+I0_shift
492
 /*if (symbol == 5) {
493
     write_output("rxF_comp_d.m","rxF_c_d",&pdsch_vars[eNB_id]->rxdataF_comp0[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);
494
 } */
495
    if ((rx_type==rx_IC_single_stream) &&
496
        (eNB_id_i<ue->n_connected_eNB)) {
497
         dlsch_channel_compensation(pdsch_vars[eNB_id_i]->rxdataF_ext,
498
499
500
501
502
                                 pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
                                 pdsch_vars[eNB_id_i]->dl_ch_mag0,
                                 pdsch_vars[eNB_id_i]->dl_ch_magb0,
                                 pdsch_vars[eNB_id_i]->rxdataF_comp0,
                                 (aatx>1) ? pdsch_vars[eNB_id_i]->rho : NULL,
503
504
505
506
507
                                 frame_parms,
                                 symbol,
                                 first_symbol_flag,
                                 i_mod,
                                 nb_rb,
508
                                 pdsch_vars[eNB_id]->log2_maxh,
509
                                 measurements); // log2_maxh+I0_shift
510
511
#ifdef DEBUG_PHY
      if (symbol == 5) {
512
        write_output("rxF_comp_d.m","rxF_c_d",&pdsch_vars[eNB_id]->rxdataF_comp0[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);
513
        write_output("rxF_comp_i.m","rxF_c_i",&pdsch_vars[eNB_id_i]->rxdataF_comp0[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);
514
      }
515
#endif
516

517
      dlsch_dual_stream_correlation(frame_parms,
518
519
                                    symbol,
                                    nb_rb,
520
521
                                    pdsch_vars[eNB_id]->dl_ch_estimates_ext,
                                    pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
522
                                    pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
523
                                    pdsch_vars[eNB_id]->log2_maxh);
524
    }
525
526
  } else if ((dlsch0_harq->mimo_mode == LARGE_CDD) || ((dlsch0_harq->mimo_mode >=DUALSTREAM_UNIFORM_PRECODING1) &&
            (dlsch0_harq->mimo_mode <=DUALSTREAM_PUSCH_PRECODING))){
Bilel's avatar
Bilel committed
527
      //LOG_I(PHY,"channel compensation TM34 !!!!!!!!!!!!!!!!!\n");
528
      dlsch_channel_compensation_TM34(frame_parms,
529
                                     pdsch_vars[eNB_id],
530
                                     measurements,
531
532
533
                                     eNB_id,
                                     symbol,
                                     dlsch0_harq->Qm,
Elena Lukashova's avatar
Elena Lukashova committed
534
                                     dlsch1_harq->Qm,
535
536
537
                                     harq_pid,
                                     dlsch0_harq->round,
                                     dlsch0_harq->mimo_mode,
538
                                     nb_rb,
539
                                     pdsch_vars[eNB_id]->log2_maxh0,
540
                                     pdsch_vars[eNB_id]->log2_maxh1);
541
  /*   if (symbol == 5) {
542
543
544
545
     write_output("rxF_comp_d00.m","rxF_c_d00",&pdsch_vars[eNB_id]->rxdataF_comp0[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);// should be QAM
     write_output("rxF_comp_d01.m","rxF_c_d01",&pdsch_vars[eNB_id]->rxdataF_comp0[1][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
     write_output("rxF_comp_d10.m","rxF_c_d10",&pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
     write_output("rxF_comp_d11.m","rxF_c_d11",&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
546
        } */
547
      // compute correlation between signal and interference channels (rho12 and rho21)
548
        dlsch_dual_stream_correlation(frame_parms, // this is doing h11'*h12 and h21'*h22
549
550
                                    symbol,
                                    nb_rb,
551
552
                                    pdsch_vars[eNB_id]->dl_ch_estimates_ext,
                                    &(pdsch_vars[eNB_id]->dl_ch_estimates_ext[2]),
553
554
555
                                    pdsch_vars[eNB_id]->dl_ch_rho2_ext,
                                    pdsch_vars[eNB_id]->log2_maxh0);
        //printf("rho stream1 =%d\n", &pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round] );
556
      //to be optimized (just take complex conjugate)
557
      dlsch_dual_stream_correlation(frame_parms, // this is doing h12'*h11 and h22'*h21
558
559
                                    symbol,
                                    nb_rb,
560
                                    &(pdsch_vars[eNB_id]->dl_ch_estimates_ext[2]),
561
                                    pdsch_vars[eNB_id]->dl_ch_estimates_ext,
562
563
                                    pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
                                    pdsch_vars[eNB_id]->log2_maxh1);
564
    //  printf("rho stream2 =%d\n",&pdsch_vars[eNB_id]->dl_ch_rho2_ext );
565
      //printf("TM3 log2_maxh : %d\n",pdsch_vars[eNB_id]->log2_maxh);
566
  /*     if (symbol == 5) {
567
568
569
570
     write_output("rho0_0.m","rho0_0",&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_0.m","rho2_0",&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("rho0_1.m.m","rho0_1",&pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round][1][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
     write_output("rho2_1.m","rho2_1",&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
571
        } */
572

573
574
575
    } else if (dlsch0_harq->mimo_mode<DUALSTREAM_UNIFORM_PRECODING1) {// single-layer precoding (TM5, TM6)
        if ((rx_type==rx_IC_single_stream) && (eNB_id_i==ue->n_connected_eNB) && (dlsch0_harq->dl_power_off==0)) {
          dlsch_channel_compensation_TM56(pdsch_vars[eNB_id]->rxdataF_ext,
576
577
578
579
580
                                      pdsch_vars[eNB_id]->dl_ch_estimates_ext,
                                      pdsch_vars[eNB_id]->dl_ch_mag0,
                                      pdsch_vars[eNB_id]->dl_ch_magb0,
                                      pdsch_vars[eNB_id]->rxdataF_comp0,
                                      pdsch_vars[eNB_id]->pmi_ext,
581
                                      frame_parms,
582
                                      measurements,
583
584
                                      eNB_id,
                                      symbol,
585
                                      dlsch0_harq->Qm,
586
                                      nb_rb,
587
                                      pdsch_vars[eNB_id]->log2_maxh,
588
                                      dlsch0_harq->dl_power_off);
589

590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
        for (rb=0; rb<nb_rb; rb++) {
          switch(pdsch_vars[eNB_id]->pmi_ext[rb]) {
          case 0:
            pdsch_vars[eNB_id_i]->pmi_ext[rb]=1;
            break;
         case 1:
            pdsch_vars[eNB_id_i]->pmi_ext[rb]=0;
            break;
         case 2:
            pdsch_vars[eNB_id_i]->pmi_ext[rb]=3;
            break;
          case 3:
            pdsch_vars[eNB_id_i]->pmi_ext[rb]=2;
            break;
          }
Elena Lukashova's avatar
Elena Lukashova committed
605
       //  if (rb==0)
606
        //    printf("pmi %d, pmi_i %d\n",pdsch_vars[eNB_id]->pmi_ext[rb],pdsch_vars[eNB_id_i]->pmi_ext[rb]);
607
      }
608
609
610
611
612
613
      dlsch_channel_compensation_TM56(pdsch_vars[eNB_id_i]->rxdataF_ext,
                                      pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
                                      pdsch_vars[eNB_id_i]->dl_ch_mag0,
                                      pdsch_vars[eNB_id_i]->dl_ch_magb0,
                                      pdsch_vars[eNB_id_i]->rxdataF_comp0,
                                      pdsch_vars[eNB_id_i]->pmi_ext,
614
                                      frame_parms,
615
                                      measurements,
616
617
618
619
                                      eNB_id_i,
                                      symbol,
                                      i_mod,
                                      nb_rb,
620
                                      pdsch_vars[eNB_id]->log2_maxh,
621
                                      dlsch0_harq->dl_power_off);
622
623
#ifdef DEBUG_PHY
      if (symbol==5) {
624
        write_output("rxF_comp_d.m","rxF_c_d",&pdsch_vars[eNB_id]->rxdataF_comp0[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);
625
       write_output("rxF_comp_i.m","rxF_c_i",&pdsch_vars[eNB_id_i]->rxdataF_comp0[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);
626
      }
627
#endif
628
629
630
      dlsch_dual_stream_correlation(frame_parms,
                                    symbol,
                                    nb_rb,
631
632
633
634
                                    pdsch_vars[eNB_id]->dl_ch_estimates_ext,
                                    pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
                                    pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
                                    pdsch_vars[eNB_id]->log2_maxh);
635
    }  else if (dlsch0_harq->dl_power_off==1)  {
636
637
638
639
640
641
      dlsch_channel_compensation_TM56(pdsch_vars[eNB_id]->rxdataF_ext,
                                      pdsch_vars[eNB_id]->dl_ch_estimates_ext,
                                      pdsch_vars[eNB_id]->dl_ch_mag0,
                                      pdsch_vars[eNB_id]->dl_ch_magb0,
                                      pdsch_vars[eNB_id]->rxdataF_comp0,
                                      pdsch_vars[eNB_id]->pmi_ext,
642
                                      frame_parms,
643
                                      measurements,
644
645
                                      eNB_id,
                                      symbol,
646
                                      dlsch0_harq->Qm,
647
                                      nb_rb,
648
                                      pdsch_vars[eNB_id]->log2_maxh,
649
                                      1);
Elena Lukashova's avatar
Elena Lukashova committed
650

651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
      }


    } else if (dlsch0_harq->mimo_mode==TM7) { //TM7

      dlsch_channel_compensation(pdsch_vars[eNB_id]->rxdataF_ext,
                                 pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
                                 pdsch_vars[eNB_id]->dl_ch_mag0,
                                 pdsch_vars[eNB_id]->dl_ch_magb0,
                                 pdsch_vars[eNB_id]->rxdataF_comp0,
                                 (aatx>1) ? pdsch_vars[eNB_id]->rho : NULL,
                                 frame_parms,
                                 symbol,
                                 first_symbol_flag,
                                 get_Qm(dlsch0_harq->mcs),
                                 nb_rb,
                                 //9,
                                 pdsch_vars[eNB_id]->log2_maxh,
                                 measurements); // log2_maxh+I0_shift
670
671
  }

672
673
674
675
// MRC


   if (frame_parms->nb_antennas_rx > 1) {
676
    if ((dlsch0_harq->mimo_mode == LARGE_CDD) ||
677
        ((dlsch0_harq->mimo_mode >=DUALSTREAM_UNIFORM_PRECODING1) &&
678
         (dlsch0_harq->mimo_mode <=DUALSTREAM_PUSCH_PRECODING))){  // TM3 or TM4
Xiwen JIANG's avatar
Xiwen JIANG committed
679
      if (frame_parms->nb_antenna_ports_eNB == 2) {
Bilel's avatar
Bilel committed
680
          //LOG_I(PHY,"MRC Detection TM34 !!!!!!!!!\n");
681
        dlsch_detection_mrc_TM34(frame_parms,
682
                                 pdsch_vars[eNB_id],
683
                                 harq_pid,
684
                                 dlsch0_harq->round,
685
686
687
                                 symbol,
                                 nb_rb,
                                 1);
688
    /*   if (symbol == 5) {
689
690
     write_output("rho0_mrc.m","rho0_0",&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",&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
691
        } */
692
      }
693
    } else {
694
      dlsch_detection_mrc(frame_parms,
695
696
697
                          pdsch_vars[eNB_id]->rxdataF_comp0,
                          pdsch_vars[eNB_id_i]->rxdataF_comp0,
                          pdsch_vars[eNB_id]->rho,
698
                          pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
699
700
701
702
                          pdsch_vars[eNB_id]->dl_ch_mag0,
                          pdsch_vars[eNB_id]->dl_ch_magb0,
                          pdsch_vars[eNB_id_i]->dl_ch_mag0,
                          pdsch_vars[eNB_id_i]->dl_ch_magb0,
703
704
                          symbol,
                          nb_rb,
705
                          rx_type==rx_IC_single_stream);
706
707
708
709
710
    }
  }
  //  printf("Combining");
  if ((dlsch0_harq->mimo_mode == SISO) ||
      ((dlsch0_harq->mimo_mode >= UNIFORM_PRECODING11) &&
711
712
       (dlsch0_harq->mimo_mode <= PUSCH_PRECODING0)) ||
       (dlsch0_harq->mimo_mode == TM7)) {
713
714
    /*
      dlsch_siso(frame_parms,
715
716
      pdsch_vars[eNB_id]->rxdataF_comp,
      pdsch_vars[eNB_id_i]->rxdataF_comp,
717
718
719
720
721
      symbol,
      nb_rb);
    */
  } else if (dlsch0_harq->mimo_mode == ALAMOUTI) {
    dlsch_alamouti(frame_parms,
722
723
724
                   pdsch_vars[eNB_id]->rxdataF_comp0,
                   pdsch_vars[eNB_id]->dl_ch_mag0,
                   pdsch_vars[eNB_id]->dl_ch_magb0,
725
726
                   symbol,
                   nb_rb);
727
728
  }

729
  //    printf("LLR");
730
731
  if ((dlsch0_harq->mimo_mode == LARGE_CDD) ||
      ((dlsch0_harq->mimo_mode >=DUALSTREAM_UNIFORM_PRECODING1) &&
732
       (dlsch0_harq->mimo_mode <=DUALSTREAM_PUSCH_PRECODING)))  {
733
    rxdataF_comp_ptr = pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round];
734
    dl_ch_mag_ptr = pdsch_vars[eNB_id]->dl_ch_mag1[harq_pid][round];
735
736
  }
  else {
737
738
    rxdataF_comp_ptr = pdsch_vars[eNB_id_i]->rxdataF_comp0;
    dl_ch_mag_ptr = pdsch_vars[eNB_id_i]->dl_ch_mag0;
739
    //i_mod should have been passed as a parameter
740
  }
741

Bilel's avatar
Bilel committed
742
743
744
745
  //LOG_I(PHY,"compute LLRs rx_type dual ? %d rx_standard %d codeword_TB0 %d codeword_TB1 %d\n", rx_type==rx_IC_dual_stream, rx_standard, codeword_TB0, codeword_TB1);
  //if (rx_type >= rx_IC_single_stream)
    //LOG_I(PHY,"LLR0 Qm ? %d LLR1 Qm \n", dlsch0_harq->Qm, dlsch1_harq->Qm);

746
  switch (dlsch0_harq->Qm) {
747
  case 2 :
748
    if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) {
749
        dlsch_qpsk_llr(frame_parms,
750
751
                       pdsch_vars[eNB_id]->rxdataF_comp0,
                       pdsch_vars[eNB_id]->llr[0],
752
753
754
                       symbol,
                       first_symbol_flag,
                       nb_rb,
755
                       adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol),
756
                       pdsch_vars[eNB_id]->llr128,
757
                       beamforming_mode);
758
    }
Elena Lukashova's avatar
Elena Lukashova committed
759
      else if (rx_type >= rx_IC_single_stream) {
Elena Lukashova's avatar
Elena Lukashova committed
760
        if (dlsch1_harq->Qm == 2) {
761
          dlsch_qpsk_qpsk_llr(frame_parms,
762
                              pdsch_vars[eNB_id]->rxdataF_comp0,
763
                              rxdataF_comp_ptr,
764
765
                              pdsch_vars[eNB_id]->dl_ch_rho2_ext,
                              pdsch_vars[eNB_id]->llr[0],
766
                              symbol,first_symbol_flag,nb_rb,
Elena Lukashova's avatar
Elena Lukashova committed
767
                              adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol),
768
                              pdsch_vars[eNB_id]->llr128);
769
770
771
          if (rx_type==rx_IC_dual_stream) {
            dlsch_qpsk_qpsk_llr(frame_parms,
                                rxdataF_comp_ptr,
772
773
774
                                pdsch_vars[eNB_id]->rxdataF_comp0,
                                pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
                                pdsch_vars[eNB_id]->llr[1],
775
                                symbol,first_symbol_flag,nb_rb,
776
                                adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol),
777
                                pdsch_vars[eNB_id]->llr128_2ndstream);
778
779
          }
        }
780
        else if (dlsch1_harq->Qm == 4) {
781
          dlsch_qpsk_16qam_llr(frame_parms,
782
                               pdsch_vars[eNB_id]->rxdataF_comp0,
783
784
                               rxdataF_comp_ptr,//i
                               dl_ch_mag_ptr,//i
785
786
                               pdsch_vars[eNB_id]->dl_ch_rho2_ext,
                               pdsch_vars[eNB_id]->llr[0],
787
                               symbol,first_symbol_flag,nb_rb,
Elena Lukashova's avatar
Elena Lukashova committed
788
                               adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol),
789
                               pdsch_vars[eNB_id]->llr128);
790
791
792
          if (rx_type==rx_IC_dual_stream) {
            dlsch_16qam_qpsk_llr(frame_parms,
                                 rxdataF_comp_ptr,
793
                                 pdsch_vars[eNB_id]->rxdataF_comp0,//i
794
                                 dl_ch_mag_ptr,
795
796
                                 pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
                                 pdsch_vars[eNB_id]->llr[1],
797
                                 symbol,first_symbol_flag,nb_rb,