impl_defs_lte.h 45 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 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

/*! \file PHY/impl_defs_lte.h
* \brief LTE Physical channel configuration and variable structure definitions
* \author R. Knopp, F. Kaltenberger
* \date 2011
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
* \note
* \warning
*/

#ifndef __PHY_IMPLEMENTATION_DEFS_LTE_H__
#define __PHY_IMPLEMENTATION_DEFS_LTE_H__


#include "types.h"
//#include "defs.h"

#define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10
#define LTE_SLOTS_PER_FRAME  20
#define LTE_CE_FILTER_LENGTH 5
#define LTE_CE_OFFSET LTE_CE_FILTER_LENGTH
44
#define TX_RX_SWITCH_SYMBOL (NUMBER_OF_SYMBOLS_PER_FRAME>>1)
45 46 47 48 49 50 51 52 53 54 55 56
#define PBCH_PDU_SIZE 3 //bytes

#define PRACH_SYMBOL 3 //position of the UL PSS wrt 2nd slot of special subframe

#define NUMBER_OF_FREQUENCY_GROUPS (lte_frame_parms->N_RB_DL)

#define SSS_AMP 1148

#define MAX_NUM_PHICH_GROUPS 56  //110 RBs Ng=2, p.60 36-212, Sec. 6.9

#define MAX_MBSFN_AREA 8

laurent's avatar
laurent committed
57 58 59
#ifdef OCP_FRAMEWORK
#include "enums.h"
#else
60 61 62 63
typedef enum {TDD=1,FDD=0} lte_frame_type_t;

typedef enum {EXTENDED=1,NORMAL=0} lte_prefix_type_t;

64 65
typedef enum {LOCALIZED=0,DISTRIBUTED=1} vrb_t;

66
/// Enumeration for parameter PHICH-Duration \ref PHICH_CONFIG_COMMON::phich_duration.
67 68 69 70 71
typedef enum {
  normal=0,
  extended=1
} PHICH_DURATION_t;

72
/// Enumeration for parameter Ng \ref PHICH_CONFIG_COMMON::phich_resource.
73 74 75 76 77 78
typedef enum {
  oneSixth=1,
  half=3,
  one=6,
  two=12
} PHICH_RESOURCE_t;
laurent's avatar
laurent committed
79
#endif
80
/// PHICH-Config from 36.331 RRC spec
81
typedef struct {
82
  /// Parameter: PHICH-Duration, see TS 36.211 (Table 6.9.3-1).
83
  PHICH_DURATION_t phich_duration;
84
  /// Parameter: Ng, see TS 36.211 (6.9). \details Value oneSixth corresponds to 1/6, half corresponds to 1/2 and so on.
85 86 87
  PHICH_RESOURCE_t phich_resource;
} PHICH_CONFIG_COMMON;

88
/// PRACH-ConfigInfo from 36.331 RRC spec
89
typedef struct {
90
  /// Parameter: prach-ConfigurationIndex, see TS 36.211 (5.7.1). \vr{[0..63]}
91
  uint8_t prach_ConfigIndex;
92
  /// Parameter: High-speed-flag, see TS 36.211 (5.7.2). \vr{[0..1]} 1 corresponds to Restricted set and 0 to Unrestricted set.
93
  uint8_t highSpeedFlag;
94
  /// Parameter: \f$N_\text{CS}\f$, see TS 36.211 (5.7.2). \vr{[0..15]}\n Refer to table 5.7.2-2 for preamble format 0..3 and to table 5.7.2-3 for preamble format 4.
95
  uint8_t zeroCorrelationZoneConfig;
96
  /// Parameter: prach-FrequencyOffset, see TS 36.211 (5.7.1). \vr{[0..94]}\n For TDD the value range is dependent on the value of \ref prach_ConfigIndex.
97
  uint8_t prach_FreqOffset;
98 99
} PRACH_CONFIG_INFO;

100
/// PRACH-ConfigSIB or PRACH-Config from 36.331 RRC spec
101
typedef struct {
102
  /// Parameter: RACH_ROOT_SEQUENCE, see TS 36.211 (5.7.1). \vr{[0..837]}
103
  uint16_t rootSequenceIndex;
104
  /// prach_Config_enabled=1 means enabled. \vr{[0..1]}
105
  uint8_t prach_Config_enabled;
106
  /// PRACH Configuration Information
107 108 109
  PRACH_CONFIG_INFO prach_ConfigInfo;
} PRACH_CONFIG_COMMON;

110
/// Enumeration for parameter \f$N_\text{ANRep}\f$ \ref PUCCH_CONFIG_DEDICATED::repetitionFactor.
111 112 113 114 115 116
typedef enum {
  n2=0,
  n4,
  n6
} ACKNAKREP_t;

117
/// Enumeration for \ref PUCCH_CONFIG_DEDICATED::tdd_AckNackFeedbackMode.
118 119 120 121 122
typedef enum {
  bundling=0,
  multiplexing
} ANFBmode_t;

123
/// PUCCH-ConfigDedicated from 36.331 RRC spec
124
typedef struct {
125
  /// Flag to indicate ACK NAK repetition activation, see TS 36.213 (10.1). \vr{[0..1]}
126
  uint8_t ackNackRepetition;
127
  /// Parameter: \f$N_\text{ANRep}\f$, see TS 36.213 (10.1).
128
  ACKNAKREP_t repetitionFactor;
129
  /// Parameter: \f$n^{(1)}_\text{PUCCH,ANRep}\f$, see TS 36.213 (10.1). \vr{[0..2047]}
130
  uint16_t n1PUCCH_AN_Rep;
131
  /// Feedback mode, see TS 36.213 (7.3). \details Applied to both PUCCH and PUSCH feedback. For TDD, should always be set to bundling.
132 133 134 135 136
  ANFBmode_t tdd_AckNackFeedbackMode;
} PUCCH_CONFIG_DEDICATED;

/// PUCCH-ConfigCommon from 36.331 RRC spec
typedef struct {
137
  /// Parameter: \f$\Delta^\text{PUCCH}_\text{shift}\f$, see TS 36.211 (5.4.1). \vr{[1..3]} \note the specification sais it is an enumerated value.
138
  uint8_t deltaPUCCH_Shift;
139
  /// Parameter: \f$N^{(2)}_\text{RB}\f$, see TS 36.211 (5.4). \vr{[0..98]}
140
  uint8_t nRB_CQI;
141
  /// Parameter: \f$N^{(1)}_\text{CS}\f$, see TS 36.211 (5.4). \vr{[0..7]}
142
  uint8_t nCS_AN;
143
  /// Parameter: \f$N^{(1)}_\text{PUCCH}\f$ see TS 36.213 (10.1). \vr{[0..2047]}
144
  uint16_t n1PUCCH_AN;
145 146 147 148
} PUCCH_CONFIG_COMMON;

/// UL-ReferenceSignalsPUSCH from 36.331 RRC spec
typedef struct {
149
  /// Parameter: Group-hopping-enabled, see TS 36.211 (5.5.1.3). \vr{[0..1]}
150
  uint8_t groupHoppingEnabled;
151
  /// Parameter: \f$\Delta SS\f$, see TS 36.211 (5.5.1.3). \vr{[0..29]}
152
  uint8_t groupAssignmentPUSCH;
153
  /// Parameter: Sequence-hopping-enabled, see TS 36.211 (5.5.1.4). \vr{[0..1]}
154
  uint8_t sequenceHoppingEnabled;
155
  /// Parameter: cyclicShift, see TS 36.211 (Table 5.5.2.1.1-2). \vr{[0..7]}
156
  uint8_t cyclicShift;
157
  /// nPRS for cyclic shift of DRS \note not part of offical UL-ReferenceSignalsPUSCH ASN1 specification.
158
  uint8_t nPRS[20];
159
  /// group hopping sequence for DRS \note not part of offical UL-ReferenceSignalsPUSCH ASN1 specification.
160
  uint8_t grouphop[20];
161
  /// sequence hopping sequence for DRS \note not part of offical UL-ReferenceSignalsPUSCH ASN1 specification.
162
  uint8_t seqhop[20];
163
} UL_REFERENCE_SIGNALS_PUSCH_t;
164

165
/// Enumeration for parameter Hopping-mode \ref PUSCH_CONFIG_COMMON::hoppingMode.
laurent's avatar
laurent committed
166
#ifndef OCP_FRAMEWORK
167
typedef enum {
168
  interSubFrame=0,
169 170
  intraAndInterSubFrame=1
} PUSCH_HOPPING_t;
laurent's avatar
laurent committed
171
#endif
172

173
/// PUSCH-ConfigCommon from 36.331 RRC spec.
174
typedef struct {
175
  /// Parameter: \f$N_{sb}\f$, see TS 36.211 (5.3.4). \vr{[1..4]}
176
  uint8_t n_SB;
177
  /// Parameter: Hopping-mode, see TS 36.211 (5.3.4).
178
  PUSCH_HOPPING_t hoppingMode;
179
  /// Parameter: \f$N^{HO}_{RB}\f$, see TS 36.211 (5.3.4). \vr{[0..98]}
180
  uint8_t pusch_HoppingOffset;
181
  /// See TS 36.213 (8.6.1). \vr{[0..1]} 1 indicates 64QAM is allowed, 0 not allowed.
182
  uint8_t enable64QAM;
183 184 185 186
  /// Ref signals configuration
  UL_REFERENCE_SIGNALS_PUSCH_t ul_ReferenceSignalsPUSCH;
} PUSCH_CONFIG_COMMON;

187
/// UE specific PUSCH configuration.
188
typedef struct {
189
  /// Parameter: \f$I^\text{HARQ-ACK}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-1). \vr{[0..15]}
190
  uint16_t betaOffset_ACK_Index;
191
  /// Parameter: \f$I^{RI}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-2). \vr{[0..15]}
192
  uint16_t betaOffset_RI_Index;
193
  /// Parameter: \f$I^{CQI}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-3). \vr{[0..15]}
194
  uint16_t betaOffset_CQI_Index;
195 196
} PUSCH_CONFIG_DEDICATED;

197
/// lola CBA information
198
typedef struct {
199
  ///
200
  uint16_t betaOffset_CA_Index;
201
  ///
202
  uint16_t cShift;
203 204 205 206
} PUSCH_CA_CONFIG_DEDICATED;

/// PDSCH-ConfigCommon from 36.331 RRC spec
typedef struct {
207
  /// Parameter: Reference-signal power, see TS 36.213 (5.2). \vr{[-60..50]}\n Provides the downlink reference-signal EPRE. The actual value in dBm.
208
  int8_t referenceSignalPower;
209
  /// Parameter: \f$P_B\f$, see TS 36.213 (Table 5.2-1). \vr{[0..3]}
210
  uint8_t p_b;
211 212
} PDSCH_CONFIG_COMMON;

213
/// Enumeration for Parameter \f$P_A\f$ \ref PDSCH_CONFIG_DEDICATED::p_a.
214
typedef enum {
215 216 217 218 219 220 221 222
  dBm6=0, ///< (dB-6) corresponds to -6 dB
  dBm477, ///< (dB-4dot77) corresponds to -4.77 dB
  dBm3,   ///< (dB-3) corresponds to -3 dB
  dBm177, ///< (dB-1dot77) corresponds to -1.77 dB
  dB0,    ///< corresponds to 0 dB
  dB1,    ///< corresponds to 1 dB
  dB2,    ///< corresponds to 2 dB
  dB3     ///< corresponds to 3 dB
223 224
} PA_t;

225
/// PDSCH-ConfigDedicated from 36.331 RRC spec
226
typedef struct {
227 228
  /// Parameter: \f$P_A\f$, see TS 36.213 (5.2).
  PA_t p_a;
229 230 231 232
} PDSCH_CONFIG_DEDICATED;

/// SoundingRS-UL-ConfigCommon Information Element from 36.331 RRC spec
typedef struct {
233
  /// enabled flag=1 means SRS is enabled. \vr{[0..1]}
234
  uint8_t enabled_flag;
235
  /// Parameter: SRS Bandwidth Configuration, see TS 36.211 (table 5.5.3.2-1, 5.5.3.2-2, 5.5.3.2-3 and 5.5.3.2-4). \vr{[0..7]}\n Actual configuration depends on UL bandwidth. \note the specification sais it is an enumerated value.
236
  uint8_t srs_BandwidthConfig;
237
  /// Parameter: SRS SubframeConfiguration, see TS 36.211 (table 5.5.3.3-1 for FDD, table 5.5.3.3-2 for TDD). \vr{[0..15]} \note the specification sais it is an enumerated value.
238
  uint8_t srs_SubframeConfig;
239
  /// Parameter: Simultaneous-AN-and-SRS, see TS 36.213 (8.2). \vr{[0..1]}
240
  uint8_t ackNackSRS_SimultaneousTransmission;
241
  /// Parameter: srsMaxUpPts, see TS 36.211 (5.5.3.2). \details If this field is present, reconfiguration of \f$m^\text{max}_\text{SRS,0}\f$ applies for UpPts, otherwise reconfiguration does not apply.
242
  uint8_t srs_MaxUpPts;
243 244
} SOUNDINGRS_UL_CONFIG_COMMON;

245
/// \note UNUSED
246 247 248 249 250 251 252 253 254 255 256
typedef enum {
  ulpc_al0=0,
  ulpc_al04=1,
  ulpc_al05=2,
  ulpc_al06=3,
  ulpc_al07=4,
  ulpc_al08=5,
  ulpc_al09=6,
  ulpc_al11=7
} UL_POWER_CONTROL_COMMON_alpha_t;

257
/// Enumeration for \ref deltaFList_PUCCH_t::deltaF_PUCCH_Format1.
258
typedef enum {
259 260 261
  deltaF_PUCCH_Format1_deltaF_2  = 0,
  deltaF_PUCCH_Format1_deltaF0   = 1,
  deltaF_PUCCH_Format1_deltaF2   = 2
262
} deltaF_PUCCH_Format1_t;
263 264

/// Enumeration for \ref deltaFList_PUCCH_t::deltaF_PUCCH_Format1b.
265
typedef enum {
266 267 268
  deltaF_PUCCH_Format1b_deltaF1  = 0,
  deltaF_PUCCH_Format1b_deltaF3  = 1,
  deltaF_PUCCH_Format1b_deltaF5  = 2
269
} deltaF_PUCCH_Format1b_t;
270 271

/// Enumeration for \ref deltaFList_PUCCH_t::deltaF_PUCCH_Format2.
272
typedef enum {
273 274 275 276
  deltaF_PUCCH_Format2_deltaF_2  = 0,
  deltaF_PUCCH_Format2_deltaF0   = 1,
  deltaF_PUCCH_Format2_deltaF1   = 2,
  deltaF_PUCCH_Format2_deltaF2   = 3
277
} deltaF_PUCCH_Format2_t;
278 279

/// Enumeration for \ref deltaFList_PUCCH_t::deltaF_PUCCH_Format2a.
280
typedef enum {
281 282 283
  deltaF_PUCCH_Format2a_deltaF_2 = 0,
  deltaF_PUCCH_Format2a_deltaF0  = 1,
  deltaF_PUCCH_Format2a_deltaF2  = 2
284
} deltaF_PUCCH_Format2a_t;
285 286

/// Enumeration for \ref deltaFList_PUCCH_t::deltaF_PUCCH_Format2b.
287
typedef enum {
288 289 290
  deltaF_PUCCH_Format2b_deltaF_2 = 0,
  deltaF_PUCCH_Format2b_deltaF0  = 1,
  deltaF_PUCCH_Format2b_deltaF2  = 2
291 292
} deltaF_PUCCH_Format2b_t;

293
/// DeltaFList-PUCCH from 36.331 RRC spec
294
typedef struct {
295 296 297 298 299
  deltaF_PUCCH_Format1_t   deltaF_PUCCH_Format1;
  deltaF_PUCCH_Format1b_t  deltaF_PUCCH_Format1b;
  deltaF_PUCCH_Format2_t   deltaF_PUCCH_Format2;
  deltaF_PUCCH_Format2a_t  deltaF_PUCCH_Format2a;
  deltaF_PUCCH_Format2b_t  deltaF_PUCCH_Format2b;
300 301 302 303
} deltaFList_PUCCH_t;

/// SoundingRS-UL-ConfigDedicated Information Element from 36.331 RRC spec
typedef struct {
304
  /// Parameter: \f$B_\text{SRS}\f$, see TS 36.211 (table 5.5.3.2-1, 5.5.3.2-2, 5.5.3.2-3 and 5.5.3.2-4). \vr{[0..3]} \note the specification sais it is an enumerated value.
305
  uint8_t srs_Bandwidth;
306
  /// Parameter: SRS hopping bandwidth \f$b_\text{hop}\in\{0,1,2,3\}\f$, see TS 36.211 (5.5.3.2) \vr{[0..3]} \note the specification sais it is an enumerated value.
307
  uint8_t srs_HoppingBandwidth;
308
  /// Parameter: \f$n_\text{RRC}\f$, see TS 36.211 (5.5.3.2). \vr{[0..23]}
309
  uint8_t freqDomainPosition;
310
  /// Parameter: Duration, see TS 36.213 (8.2). \vr{[0..1]} 0 corresponds to "single" and 1 to "indefinite".
311
  uint8_t duration;
312
  /// Parameter: \f$k_\text{TC}\in\{0,1\}\f$, see TS 36.211 (5.5.3.2). \vr{[0..1]}
313
  uint8_t transmissionComb;
314
  /// Parameter: \f$I_\text{SRS}\f$, see TS 36.213 (table 8.2-1). \vr{[0..1023]}
315
  uint16_t srs_ConfigIndex;
316
  /// Parameter: \f$n^\text{CS}_\text{SRS}\f$. See TS 36.211 (5.5.3.1). \vr{[0..7]} \note the specification sais it is an enumerated value.
317
  uint8_t cyclicShift;
318 319
} SOUNDINGRS_UL_CONFIG_DEDICATED;

320
/// UplinkPowerControlDedicated Information Element from 36.331 RRC spec
321
typedef struct {
322
  /// Parameter: \f$P_\text{0\_UE\_PUSCH}(1)\f$, see TS 36.213 (5.1.1.1), unit dB. \vr{[-8..7]}\n This field is applicable for non-persistent scheduling, only.
323
  int8_t p0_UE_PUSCH;
324
  /// Parameter: Ks, see TS 36.213 (5.1.1.1). \vr{[0..1]}\n en0 corresponds to value 0 corresponding to state “disabled”. en1 corresponds to value 1.25 corresponding to “enabled”. \note the specification sais it is an enumerated value. \warning the enumeration values do not correspond to the given values in the specification (en1 should be 1.25).
325
  uint8_t deltaMCS_Enabled;
326
  /// Parameter: Accumulation-enabled, see TS 36.213 (5.1.1.1). \vr{[0..1]} 1 corresponds to "enabled" whereas 0 corresponds to "disabled".
327
  uint8_t accumulationEnabled;
328
  /// Parameter: \f$P_\text{0\_UE\_PUCCH}(1)\f$, see TS 36.213 (5.1.2.1), unit dB. \vr{[-8..7]}
329
  int8_t p0_UE_PUCCH;
330
  /// Parameter: \f$P_\text{SRS\_OFFSET}\f$, see TS 36.213 (5.1.3.1). \vr{[0..15]}\n For Ks=1.25 (\ref deltaMCS_Enabled), the actual parameter value is pSRS_Offset value - 3. For Ks=0, the actual parameter value is -10.5 + 1.5*pSRS_Offset value.
331
  int8_t pSRS_Offset;
332
  /// Specifies the filtering coefficient for RSRP measurements used to calculate path loss, as specified in TS 36.213 (5.1.1.1).\details The same filtering mechanism applies as for quantityConfig described in 5.5.3.2. \note the specification sais it is an enumerated value.
333
  uint8_t filterCoefficient;
334 335
} UL_POWER_CONTROL_DEDICATED;

laurent's avatar
laurent committed
336
#ifndef OCP_FRAMEWORK
337
/// Enumeration for parameter \f$\alpha\f$ \ref UL_POWER_CONTROL_CONFIG_COMMON::alpha.
338 339 340 341 342 343 344 345 346 347
typedef enum {
  al0=0,
  al04=1,
  al05=2,
  al06=3,
  al07=4,
  al08=5,
  al09=6,
  al1=7
} PUSCH_alpha_t;
laurent's avatar
laurent committed
348
#endif
349

350
/// \note UNUSED
351 352 353 354 355 356
typedef enum {
  deltaFm2=0,
  deltaF0,
  deltaF1,
  deltaF2,
  deltaF3,
357
  deltaF5
358 359
} deltaF_PUCCH_t;

360
/// UplinkPowerControlCommon Information Element from 36.331 RRC spec \note this structure does not currently make use of \ref deltaFList_PUCCH_t.
361
typedef struct {
362
  /// Parameter: \f$P_\text{0\_NOMINAL\_PUSCH}(1)\f$, see TS 36.213 (5.1.1.1), unit dBm. \vr{[-126..24]}\n This field is applicable for non-persistent scheduling, only.
363
  int8_t p0_NominalPUSCH;
364
  /// Parameter: \f$\alpha\f$, see TS 36.213 (5.1.1.1) \warning the enumeration values do not correspond to the given values in the specification (al04 should be 0.4, ...)!
365
  PUSCH_alpha_t alpha;
366
  /// Parameter: \f$P_\text{0\_NOMINAL\_PUCCH}\f$ See TS 36.213 (5.1.2.1), unit dBm. \vr{[-127..-96]}
367
  int8_t p0_NominalPUCCH;
368
  /// Parameter: \f$\Delta_\text{PREAMBLE\_Msg3}\f$ see TS 36.213 (5.1.1.1). \vr{[-1..6]}\n Actual value = IE value * 2 [dB].
369
  int8_t deltaPreambleMsg3;
370
  /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 1, see TS 36.213 (5.1.2). \vr{[0..2]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value.
371
  long deltaF_PUCCH_Format1;
372
  /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 1a, see TS 36.213 (5.1.2). \vr{[0..2]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value.
373
  long deltaF_PUCCH_Format1a;
374
  /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 1b, see TS 36.213 (5.1.2). \vr{[0..2]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value.
375
  long deltaF_PUCCH_Format1b;
376
  /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 2, see TS 36.213 (5.1.2). \vr{[0..3]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value.
377
  long deltaF_PUCCH_Format2;
378
  /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 2a, see TS 36.213 (5.1.2). \vr{[0..2]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value.
379
  long deltaF_PUCCH_Format2a;
380
  /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 2b, see TS 36.213 (5.1.2). \vr{[0..2]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value.
381 382 383
  long deltaF_PUCCH_Format2b;
} UL_POWER_CONTROL_CONFIG_COMMON;

384
/// Union for \ref TPC_PDCCH_CONFIG::tpc_Index.
385
typedef union {
386 387 388 389
  /// Index of N when DCI format 3 is used. See TS 36.212 (5.3.3.1.6). \vr{[1..15]}
  uint8_t indexOfFormat3;
  /// Index of M when DCI format 3A is used. See TS 36.212 (5.3.3.1.7). \vr{[1..31]}
  uint8_t indexOfFormat3A;
390 391
} TPC_INDEX_t;

392
/// TPC-PDCCH-Config Information Element from 36.331 RRC spec
393
typedef struct {
394
  /// RNTI for power control using DCI format 3/3A, see TS 36.212. \vr{[0..65535]}
395
  uint16_t rnti;
396
  /// Index of N or M, see TS 36.212 (5.3.3.1.6 and 5.3.3.1.7), where N or M is dependent on the used DCI format (i.e. format 3 or 3a).
397 398 399
  TPC_INDEX_t tpc_Index;
} TPC_PDCCH_CONFIG;

400
/// Enumeration for parameter SR transmission \ref SCHEDULING_REQUEST_CONFIG::dsr_TransMax.
401 402 403 404 405 406 407 408
typedef enum {
  sr_n4=0,
  sr_n8=1,
  sr_n16=2,
  sr_n32=3,
  sr_n64=4
} DSR_TRANSMAX_t;

409
/// SchedulingRequestConfig Information Element from 36.331 RRC spec
410
typedef struct {
411
  /// Parameter: \f$n^{(1)}_\text{PUCCH,SRI}\f$, see TS 36.213 (10.1). \vr{[0..2047]}
412
  uint16_t sr_PUCCH_ResourceIndex;
413
  /// Parameter: \f$I_\text{SR}\f$, see TS 36.213 (10.1). \vr{[0..155]}
414
  uint8_t sr_ConfigIndex;
415
  /// Parameter for SR transmission in TS 36.321 (5.4.4). \details The value n4 corresponds to 4 transmissions, n8 corresponds to 8 transmissions and so on.
416 417 418
  DSR_TRANSMAX_t dsr_TransMax;
} SCHEDULING_REQUEST_CONFIG;

419
/// CQI-ReportPeriodic
420
typedef struct {
421
  /// Parameter: \f$n^{(2)}_\text{PUCCH}\f$, see TS 36.213 (7.2). \vr{[0..1185]}
422
  uint16_t cqi_PUCCH_ResourceIndex;
423
  /// Parameter: CQI/PMI Periodicity and Offset Configuration Index \f$I_\text{CQI/PMI}\f$, see TS 36.213 (tables 7.2.2-1A and 7.2.2-1C). \vr{[0..1023]}
424
  uint16_t cqi_PMI_ConfigIndex;
425
  /// Parameter: K, see 36.213 (4.2.2). \vr{[1..4]}
426
  uint8_t K;
427
  /// Parameter: RI Config Index \f$I_\text{RI}\f$, see TS 36.213 (7.2.2-1B). \vr{[0..1023]}
428
  uint16_t ri_ConfigIndex;
429
  /// Parameter: Simultaneous-AN-and-CQI, see TS 36.213 (10.1). \vr{[0..1]} 1 indicates that simultaneous transmission of ACK/NACK and CQI is allowed.
430
  uint8_t simultaneousAckNackAndCQI;
431 432
} CQI_REPORTPERIODIC;

433 434 435 436 437 438 439 440 441 442
/// Enumeration for parameter reporting mode \ref CQI_REPORT_CONFIG::cqi_ReportModeAperiodic.
typedef enum {
  rm12=0,
  rm20=1,
  rm22=2,
  rm30=3,
  rm31=4
} CQI_REPORTMODEAPERIODIC;

/// CQI-ReportConfig Information Element from 36.331 RRC spec
443
typedef struct {
444
  /// Parameter: reporting mode. Value rm12 corresponds to Mode 1-2, rm20 corresponds to Mode 2-0, rm22 corresponds to Mode 2-2 etc. PUSCH reporting modes are described in TS 36.213 [23, 7.2.1].
445
  CQI_REPORTMODEAPERIODIC cqi_ReportModeAperiodic;
446
  /// Parameter: \f$\Delta_\text{offset}\f$, see TS 36.213 (7.2.3). \vr{[-1..6]}\n Actual value = IE value * 2 [dB].
447
  int8_t nomPDSCH_RS_EPRE_Offset;
448 449 450
  CQI_REPORTPERIODIC CQI_ReportPeriodic;
} CQI_REPORT_CONFIG;

451
/// MBSFN-SubframeConfig Information Element from 36.331 RRC spec \note deviates from specification.
452
typedef struct {
453
  /// MBSFN subframe occurance. \details Radio-frames that contain MBSFN subframes occur when equation SFN mod radioFrameAllocationPeriod = radioFrameAllocationOffset is satisfied. When fourFrames is used for subframeAllocation, the equation defines the first radio frame referred to in the description below. Values n1 and n2 are not applicable when fourFrames is used. \note the specification sais it is an enumerated value {n1, n2, n4, n8, n16, n32}.
454
  int radioframeAllocationPeriod;
455
  /// MBSFN subframe occurance. \vr{[0..7]}\n Radio-frames that contain MBSFN subframes occur when equation SFN mod radioFrameAllocationPeriod = radioFrameAllocationOffset is satisfied. When fourFrames is used for subframeAllocation, the equation defines the first radio frame referred to in the description below. Values n1 and n2 are not applicable when fourFrames is used.
456
  int radioframeAllocationOffset;
457
  /// oneFrame or fourFrames. \vr{[0..1]}
458
  int fourFrames_flag;
459 460 461 462 463
  /// Subframe configuration. \vr{[0..63]} (\ref fourFrames_flag == 0) or \vr{[0..16777215]} (\ref fourFrames_flag == 1)
  /// \par fourFrames_flag == 0
  /// "1" denotes that the corresponding subframe is allocated for MBSFN. The following mapping applies:\n FDD: The first/leftmost bit defines the MBSFN allocation for subframe #1, the second bit for #2, third bit for #3 , fourth bit for #6, fifth bit for #7, sixth bit for #8.\n TDD: The first/leftmost bit defines the allocation for subframe #3, the second bit for #4, third bit for #7, fourth bit for #8, fifth bit for #9. Uplink subframes are not allocated. The last bit is not used.
  /// \par fourFrames_flag == 1
  /// A bit-map indicating MBSFN subframe allocation in four consecutive radio frames, "1" denotes that the corresponding subframe is allocated for MBSFN. The bitmap is interpreted as follows:\n FDD: Starting from the first radioframe and from the first/leftmost bit in the bitmap, the allocation applies to subframes #1, #2, #3 , #6, #7, and #8 in the sequence of the four radio-frames.\n TDD: Starting from the first radioframe and from the first/leftmost bit in the bitmap, the allocation applies to subframes #3, #4, #7, #8, and #9 in the sequence of the four radio-frames. The last four bits are not used. Uplink subframes are not allocated.
464 465 466 467 468
  int mbsfn_SubframeConfig;
} MBSFN_config_t;

typedef struct {
  /// Number of resource blocks (RB) in DL
469
  uint8_t N_RB_DL;
470
  /// Number of resource blocks (RB) in UL
471
  uint8_t N_RB_UL;
472 473 474
  ///  total Number of Resource Block Groups: this is ceil(N_PRB/P)
  uint8_t N_RBG;
  /// Total Number of Resource Block Groups SubSets: this is P
475
  uint8_t N_RBGS;
476
  /// Cell ID
477
  uint16_t Nid_cell;
478
  /// MBSFN Area ID
479
  uint16_t Nid_cell_mbsfn;
480 481 482
  /// Cyclic Prefix for DL (0=Normal CP, 1=Extended CP)
  lte_prefix_type_t Ncp;
  /// Cyclic Prefix for UL (0=Normal CP, 1=Extended CP)
483
  lte_prefix_type_t Ncp_UL;
484
  /// shift of pilot position in one RB
485
  uint8_t nushift;
486 487 488
  /// Frame type (0 FDD, 1 TDD)
  lte_frame_type_t frame_type;
  /// TDD subframe assignment (0-7) (default = 3) (254=RX only, 255=TX only)
489
  uint8_t tdd_config;
490
  /// TDD S-subframe configuration (0-9)
491
  uint8_t tdd_config_S;
492
  /// indicates if node is a UE (NODE=2) or eNB (PRIMARY_CH=0).
493
  uint8_t node_id;
494
  /// Frequency index of CBMIMO1 card
495
  uint8_t freq_idx;
496
  /// RX Frequency for ExpressMIMO/LIME
497
  uint32_t carrier_freq[4];
498
  /// TX Frequency for ExpressMIMO/LIME
499
  uint32_t carrier_freqtx[4];
500
  /// RX gain for ExpressMIMO/LIME
501
  uint32_t rxgain[4];
502
  /// TX gain for ExpressMIMO/LIME
503
  uint32_t txgain[4];
504
  /// RF mode for ExpressMIMO/LIME
505
  uint32_t rfmode[4];
506
  /// RF RX DC Calibration for ExpressMIMO/LIME
507
  uint32_t rxdc[4];
508
  /// RF TX DC Calibration for ExpressMIMO/LIME
509
  uint32_t rflocal[4];
510
  /// RF VCO calibration for ExpressMIMO/LIME
511
  uint32_t rfvcolocal[4];
512
  /// Turns on second TX of CBMIMO1 card
513
  uint8_t dual_tx;
514
  /// flag to indicate SISO transmission
515
  uint8_t mode1_flag;
516 517
  /// Indicator that 20 MHz channel uses 3/4 sampling frequency
  uint8_t threequarter_fs;
518
  /// Size of FFT
519
  uint16_t ofdm_symbol_size;
520
  /// Number of prefix samples in all but first symbol of slot
521
  uint16_t nb_prefix_samples;
522
  /// Number of prefix samples in first symbol of slot
523
  uint16_t nb_prefix_samples0;
524
  /// Carrier offset in FFT buffer for first RE in PRB0
525
  uint16_t first_carrier_offset;
526
  /// Number of samples in a subframe
527
  uint32_t samples_per_tti;
528
  /// Number of OFDM/SC-FDMA symbols in one subframe (to be modified to account for potential different in UL/DL)
529
  uint16_t symbols_per_tti;
530
  /// Number of Transmit antennas in node
531
  uint8_t nb_antennas_tx;
532
  /// Number of Receive antennas in node
533
  uint8_t nb_antennas_rx;
534
  /// Number of Transmit antennas in eNodeB
535
  uint8_t nb_antennas_tx_eNB;
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551
  /// PRACH_CONFIG
  PRACH_CONFIG_COMMON prach_config_common;
  /// PUCCH Config Common (from 36-331 RRC spec)
  PUCCH_CONFIG_COMMON pucch_config_common;
  /// PDSCH Config Common (from 36-331 RRC spec)
  PDSCH_CONFIG_COMMON pdsch_config_common;
  /// PUSCH Config Common (from 36-331 RRC spec)
  PUSCH_CONFIG_COMMON pusch_config_common;
  /// PHICH Config (from 36-331 RRC spec)
  PHICH_CONFIG_COMMON phich_config_common;
  /// SRS Config (from 36-331 RRC spec)
  SOUNDINGRS_UL_CONFIG_COMMON soundingrs_ul_config_common;
  /// UL Power Control (from 36-331 RRC spec)
  UL_POWER_CONTROL_CONFIG_COMMON ul_power_control_config_common;
  /// Number of MBSFN Configurations
  int num_MBSFN_config;
552
  /// Array of MBSFN Configurations (max 8 (maxMBSFN-Allocations) elements as per 36.331)
553 554
  MBSFN_config_t MBSFN_config[8];
  /// Maximum Number of Retransmissions of RRCConnectionRequest (from 36-331 RRC Spec)
555
  uint8_t maxHARQ_Msg3Tx;
556
  /// Size of SI windows used for repetition of one SI message (in frames)
557
  uint8_t SIwindowsize;
558
  /// Period of SI windows used for repetition of one SI message (in frames)
559
  uint16_t SIPeriod;
560
  /// REGs assigned to PCFICH
561
  uint16_t pcfich_reg[4];
562
  /// Index of first REG assigned to PCFICH
563
  uint8_t pcfich_first_reg_idx;
564
  /// REGs assigned to PHICH
565
  uint16_t phich_reg[MAX_NUM_PHICH_GROUPS][3];
566 567 568 569 570 571

  struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[MAX_MBSFN_AREA];

} LTE_DL_FRAME_PARMS;

typedef enum {
572
  /// TM1
573
  SISO=0,
574
  /// TM2
575
  ALAMOUTI=1,
576
  /// TM3
577
  LARGE_CDD=2,
578
  /// the next 6 entries are for TM5
579 580 581 582 583 584
  UNIFORM_PRECODING11=3,
  UNIFORM_PRECODING1m1=4,
  UNIFORM_PRECODING1j=5,
  UNIFORM_PRECODING1mj=6,
  PUSCH_PRECODING0=7,
  PUSCH_PRECODING1=8,
585
  /// the next 3 entries are for TM4
586 587
  DUALSTREAM_UNIFORM_PRECODING1=9,
  DUALSTREAM_UNIFORM_PRECODINGj=10,
588 589 590
  DUALSTREAM_PUSCH_PRECODING=11,
  TM8=12,
  TM9_10=13
591 592
} MIMO_mode_t;

593
typedef struct {
594 595 596 597 598
  /// \brief Holds the transmit data in time domain.
  /// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
  /// - first index: eNB id [0..2] (hard coded)
  /// - second index: tx antenna [0..nb_antennas_tx[
  /// - third index:
599
  int32_t **txdata[3];
600 601 602 603 604
  /// \brief holds the transmit data in the frequency domain.
  /// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
  /// - first index: eNB id [0..2] (hard coded)
  /// - second index: tx antenna [0..nb_antennas_tx[
  /// - third index: sample [0..]
605
  int32_t **txdataF[3];
606 607
  /// \brief Holds the received data in time domain.
  /// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
608
  /// - first index: sector id [0..2] (hard coded)
609 610
  /// - second index: rx antenna [0..nb_antennas_rx[
  /// - third index: sample [0..]
611
  int32_t **rxdata[3];
612
  /// \brief Holds the last subframe of received data in time domain after removal of 7.5kHz frequency offset.
613
  /// - first index: secotr id [0..2] (hard coded)
614 615
  /// - second index: rx antenna [0..nb_antennas_rx[
  /// - third index: sample [0..samples_per_tti[
616
  int32_t **rxdata_7_5kHz[3];
617
  /// \brief Holds the received data in the frequency domain.
618
  /// - first index: sector id [0..2] (hard coded)
619 620
  /// - second index: rx antenna [0..nb_antennas_rx[
  /// - third index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[
621
  int32_t **rxdataF[3];
622
  /// \brief Holds output of the sync correlator.
623
  /// - first index: sector id [0..2] (hard coded)
624
  /// - second index: sample [0..samples_per_tti*10[
625
  uint32_t *sync_corr[3];
626 627
} LTE_eNB_COMMON;

628
typedef struct {
629
  /// \brief Hold the channel estimates in frequency domain based on SRS.
630
  /// - first index: sector id [0..2] (hard coded)
631 632
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..ofdm_symbol_size[
633
  int32_t **srs_ch_estimates[3];
634
  /// \brief Hold the channel estimates in time domain based on SRS.
635
  /// - first index: sector id [0..2] (hard coded)
636 637
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..2*ofdm_symbol_size[
638
  int32_t **srs_ch_estimates_time[3];
639 640
  /// \brief Holds the SRS for channel estimation at the RX.
  /// - first index: ? [0..ofdm_symbol_size[
641
  int32_t *srs;
642 643
} LTE_eNB_SRS;

644
typedef struct {
645
  /// \brief Holds the received data in the frequency domain for the allocated RBs in repeated format.
646
  /// - first index: sector id [0..2] (hard coded)
647 648 649 650
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..2*ofdm_symbol_size[
  /// - third index (definition from phy_init_lte_eNB()): ? [0..24*N_RB_UL*frame_parms->symbols_per_tti[
  /// \warning inconsistent third index definition
651
  int32_t **rxdataF_ext[3];
652
  /// \brief Holds the received data in the frequency domain for the allocated RBs in normal format.
653
  /// - first index: sector id [0..2] (hard coded)
654 655
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index (definition from phy_init_lte_eNB()): ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
656
  int32_t **rxdataF_ext2[3];
657
  /// \brief Hold the channel estimates in time domain based on DRS.
658
  /// - first index: sector id [0..2] (hard coded)
659 660
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..4*ofdm_symbol_size[
661
  int32_t **drs_ch_estimates_time[3];
662
  /// \brief Hold the channel estimates in frequency domain based on DRS.
663
  /// - first index: sector id [0..2] (hard coded)
664 665
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
666
  int32_t **drs_ch_estimates[3];
667
  /// \brief Hold the channel estimates for UE0 in case of Distributed Alamouti Scheme.
668
  /// - first index: sector id [0..2] (hard coded)
669 670
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
671
  int32_t **drs_ch_estimates_0[3];
672
  /// \brief Hold the channel estimates for UE1 in case of Distributed Almouti Scheme.
673
  /// - first index: sector id [0..2] (hard coded)
674 675
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
676
  int32_t **drs_ch_estimates_1[3];
677
  /// \brief Holds the compensated signal.
678
  /// - first index: sector id [0..2] (hard coded)
679 680
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
681
  int32_t **rxdataF_comp[3];
682
  /// \brief Hold the compensated data (y)*(h0*) in case of Distributed Alamouti Scheme.
683
  /// - first index: sector id [0..2] (hard coded)
684 685
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
686
  int32_t **rxdataF_comp_0[3];
687
  /// \brief Hold the compensated data (y*)*(h1) in case of Distributed Alamouti Scheme.
688
  /// - first index: sector id [0..2] (hard coded)
689 690
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
691
  int32_t **rxdataF_comp_1[3];
692
  /// \brief ?.
693
  /// - first index: sector id [0..2] (hard coded)
694 695
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
696
  int32_t **ul_ch_mag[3];
697 698 699 700
  /// \brief ?.
  /// - first index: eNB id [0..2] (hard coded)
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
701
  int32_t **ul_ch_magb[3];
702 703 704 705
  /// \brief Hold the channel mag for UE0 in case of Distributed Alamouti Scheme.
  /// - first index: eNB id [0..2] (hard coded)
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
706
  int32_t **ul_ch_mag_0[3];
707 708 709 710
  /// \brief Hold the channel magb for UE0 in case of Distributed Alamouti Scheme.
  /// - first index: eNB id [0..2] (hard coded)
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
711
  int32_t **ul_ch_magb_0[3];
712 713 714 715
  /// \brief Hold the channel mag for UE1 in case of Distributed Alamouti Scheme.
  /// - first index: eNB id [0..2] (hard coded)
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
716
  int32_t **ul_ch_mag_1[3];
717 718 719 720
  /// \brief Hold the channel magb for UE1 in case of Distributed Alamouti Scheme.
  /// - first index: eNB id [0..2] (hard coded)
  /// - second index: rx antenna id [0..nb_antennas_rx[
  /// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
721
  int32_t **ul_ch_magb_1[3];
722 723 724 725 726 727
  /// measured RX power based on DRS
  int ulsch_power[2];
  /// measured RX power based on DRS for UE0 in case of Distributed Alamouti Scheme
  int ulsch_power_0[2];
  /// measured RX power based on DRS for UE0 in case of Distributed Alamouti Scheme
  int ulsch_power_1[2];
728 729
  /// \brief llr values.
  /// - first index: ? [0..1179743] (hard coded)
730
  int16_t *llr;
731 732 733 734 735 736
#ifdef LOCALIZATION
  /// number of active subcarrier for a specific UE
  int32_t active_subcarrier;
  /// subcarrier power in dBm
  int32_t *subcarrier_power;
#endif
737 738 739
} LTE_eNB_PUSCH;

typedef struct {
740 741 742 743
  /// \brief Holds the transmit data in time domain.
  /// For IFFT_FPGA this points to the same memory as PHY_vars->tx_vars[a].TX_DMA_BUFFER.
  /// - first index: tx antenna [0..nb_antennas_tx[
  /// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES[
744
  int32_t **txdata;
745 746 747 748
  /// \brief Holds the transmit data in the frequency domain.
  /// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
  /// - first index: tx antenna [0..nb_antennas_tx[
  /// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[
749
  int32_t **txdataF;
750 751 752 753
  /// \brief Holds the received data in time domain.
  /// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
  /// - first index: rx antenna [0..nb_antennas_rx[
  /// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES+2048[
754
  int32_t **rxdata;
755 756 757
  /// \brief Holds the received data in the frequency domain.
  /// - first index: rx antenna [0..nb_antennas_rx[
  /// - second index: symbol [0..28*ofdm_symbol_size[
758
  int32_t **rxdataF;
759 760 761
  /// \brief ?.
  /// - first index: rx antenna [0..nb_antennas_rx[
  /// - second index: ? [0..20*ofdm_symbol_size*symbols_per_tti[
762
  int32_t **rxdataF2;
763 764 765 766
  /// \brief Hold the channel estimates in frequency domain.
  /// - first index: eNB id [0..6] (hard coded)
  /// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - third index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
767
  int32_t **dl_ch_estimates[7];
768 769 770 771
  /// \brief Hold the channel estimates in time domain (used for tracking).
  /// - first index: eNB id [0..6] (hard coded)
  /// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - third index: samples? [0..2*ofdm_symbol_size[
772
  int32_t **dl_ch_estimates_time[7];
773
  /// holds output of the sync correlator
774
  int32_t *sync_corr;
775
  /// estimated frequency offset (in radians) for all subcarriers
776
  int32_t freq_offset;
777
  /// eNb_id user is synched to
778
  int32_t eNb_id;
779 780 781
} LTE_UE_COMMON;

typedef struct {
782 783 784
  /// \brief Received frequency-domain signal after extraction.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
785
  int32_t **rxdataF_ext;
786 787 788
  /// \brief Received frequency-domain signal after extraction and channel compensation.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
789
  int32_t **rxdataF_comp0;
790
  /// \brief Received frequency-domain signal after extraction and channel compensation.
791 792
  /// - first index: ? [0..7] (hard coded) accessed via \c round
  /// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
793
  /// - third index: ? [0..168*N_RB_DL[
knopp's avatar
knopp committed
794
  int32_t **rxdataF_comp1[8];
795 796 797
  /// \brief Downlink channel estimates extracted in PRBS.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
798
  int32_t **dl_ch_estimates_ext;
799 800 801
  /// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
802
  int32_t **dl_ch_rho_ext;
803 804 805 806
  /// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
  int32_t **dl_ch_rho2_ext;
807 808
  /// \brief Downlink PMIs extracted in PRBS and grouped in subbands.
  /// - first index: ressource block [0..N_RB_DL[
809
  uint8_t *pmi_ext;
810 811 812
  /// \brief Magnitude of Downlink Channel first layer (16QAM level/First 64QAM level).
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
813
  int32_t **dl_ch_mag0;
814 815 816
  /// \brief Magnitude of Downlink Channel second layer (16QAM level/First 64QAM level).
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
817
  int32_t **dl_ch_mag1;
818 819 820
  /// \brief Magnitude of Downlink Channel, first layer (2nd 64QAM level).
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
821
  int32_t **dl_ch_magb0;
822 823 824
  /// \brief Magnitude of Downlink Channel second layer (2nd 64QAM level).
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
825
  int32_t **dl_ch_magb1;
826 827 828
  /// \brief Cross-correlation of two eNB signals.
  /// - first index: rx antenna [0..nb_antennas_rx[
  /// - second index: symbol [0..]
829
  int32_t **rho;
830
  /// never used... always send dl_ch_rho_ext instead...
831
  int32_t **rho_i;
832 833 834
  /// \brief Pointers to llr vectors (2 TBs).
  /// - first index: ? [0..1] (hard coded)
  /// - second index: ? [0..1179743] (hard coded)
835
  int16_t *llr[2];
836
  /// \f$\log_2(\max|H_i|^2)\f$
837
  int16_t log2_maxh;
838 839
  /// \brief LLR shifts for subband scaling.
  /// - first index: ? [0..168*N_RB_DL[
840
  uint8_t *llr_shifts;
841 842
  /// \brief Pointer to LLR shifts.
  /// - first index: ? [0..168*N_RB_DL[
843
  uint8_t *llr_shifts_p;
844 845 846
  /// \brief Pointers to llr vectors (128-bit alignment).
  /// - first index: ? [0..0] (hard coded)
  /// - second index: ? [0..]
847
  int16_t **llr128;
848 849 850 851
  /// \brief Pointers to llr vectors (128-bit alignment).
  /// - first index: ? [0..0] (hard coded)
  /// - second index: ? [0..]
  int16_t **llr128_2ndstream;
852 853
  //uint32_t *rb_alloc;
  //uint8_t Qm[2];
854 855 856 857
  //MIMO_mode_t mimo_mode;
} LTE_UE_PDSCH;

typedef struct {
858 859 860
  /// \brief Received frequency-domain signal after extraction.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..]
861
  int32_t **rxdataF_ext;
862 863 864
  /// \brief Received frequency-domain signal after extraction and channel compensation.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..]
865
  double **rxdataF_comp;
866 867 868
  /// \brief Downlink channel estimates extracted in PRBS.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..]
869
  int32_t **dl_ch_estimates_ext;
870 871 872
  ///  \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..]
873
  double **dl_ch_rho_ext;
874 875
  /// \brief Downlink PMIs extracted in PRBS and grouped in subbands.
  /// - first index: ressource block [0..N_RB_DL[
876
  uint8_t *pmi_ext;
877 878 879
  /// \brief Magnitude of Downlink Channel (16QAM level/First 64QAM level).
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..]
880
  double **dl_ch_mag;
881 882 883
  /// \brief Magnitude of Downlink Channel (2nd 64QAM level).
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..]
884
  double **dl_ch_magb;
885 886 887
  /// \brief Cross-correlation of two eNB signals.
  /// - first index: rx antenna [0..nb_antennas_rx[
  /// - second index: ? [0..]
888 889
  double **rho;
  /// never used... always send dl_ch_rho_ext instead...
890
  double **rho_i;
891 892 893
  /// \brief Pointers to llr vectors (2 TBs).
  /// - first index: ? [0..1] (hard coded)
  /// - second index: ? [0..1179743] (hard coded)
894
  int16_t *llr[2];
895
  /// \f$\log_2(\max|H_i|^2)\f$
896
  uint8_t log2_maxh;
897 898 899
  /// \brief Pointers to llr vectors (128-bit alignment).
  /// - first index: ? [0..0] (hard coded)
  /// - second index: ? [0..]
900 901 902
  int16_t **llr128;
  //uint32_t *rb_alloc;
  //uint8_t Qm[2];
903 904 905 906
  //MIMO_mode_t mimo_mode;
} LTE_UE_PDSCH_FLP;

typedef struct {
907
  /// \brief Pointers to extracted PDCCH symbols in frequency-domain.
908 909
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
910
  int32_t **rxdataF_ext;
911 912 913
  /// \brief Pointers to extracted and compensated PDCCH symbols in frequency-domain.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
914
  int32_t **rxdataF_comp;
915 916 917
  /// \brief Pointers to extracted channel estimates of PDCCH symbols.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
918
  int32_t **dl_ch_estimates_ext;
919 920 921
  /// \brief Pointers to channel cross-correlation vectors for multi-eNB detection.
  /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
  /// - second index: ? [0..168*N_RB_DL[
922
  int32_t **dl_ch_rho_ext;
923 924 925
  /// \brief Pointers to channel cross-correlation vectors for multi-eNB detection.
  /// - first index: rx antenna [0..nb_antennas_rx[
  /// - second index: ? [0..]
926
  int32_t **rho;