Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
d2bf4ddc
Commit
d2bf4ddc
authored
Aug 21, 2014
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@5739
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
b1e97ab1
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
168 additions
and
239 deletions
+168
-239
openair1/PHY/INIT/lte_init.c
openair1/PHY/INIT/lte_init.c
+1
-4
openair1/PHY/LTE_ESTIMATION/adjust_gain.c
openair1/PHY/LTE_ESTIMATION/adjust_gain.c
+5
-2
openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
+28
-72
openair1/PHY/LTE_TRANSPORT/dci.c
openair1/PHY/LTE_TRANSPORT/dci.c
+4
-4
openair1/PHY/LTE_TRANSPORT/dci_tools.c
openair1/PHY/LTE_TRANSPORT/dci_tools.c
+1
-6
openair1/PHY/LTE_TRANSPORT/initial_sync.c
openair1/PHY/LTE_TRANSPORT/initial_sync.c
+2
-0
openair1/PHY/LTE_TRANSPORT/pbch.c
openair1/PHY/LTE_TRANSPORT/pbch.c
+1
-1
openair1/PHY/LTE_TRANSPORT/pcfich.c
openair1/PHY/LTE_TRANSPORT/pcfich.c
+1
-76
openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
+5
-4
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
+2
-2
openair1/PHY/MODULATION/defs.h
openair1/PHY/MODULATION/defs.h
+2
-0
openair1/PHY/MODULATION/ofdm_mod.c
openair1/PHY/MODULATION/ofdm_mod.c
+61
-1
openair1/PHY/MODULATION/slot_fep.c
openair1/PHY/MODULATION/slot_fep.c
+0
-45
openair1/PHY/defs.h
openair1/PHY/defs.h
+1
-0
openair1/PHY/impl_defs_top.h
openair1/PHY/impl_defs_top.h
+1
-1
openair1/SCHED/defs.h
openair1/SCHED/defs.h
+1
-1
openair1/SCHED/phy_procedures_lte_eNb.c
openair1/SCHED/phy_procedures_lte_eNb.c
+25
-7
openair1/SCHED/phy_procedures_lte_ue.c
openair1/SCHED/phy_procedures_lte_ue.c
+19
-6
openair1/SIMULATION/RF/dac.c
openair1/SIMULATION/RF/dac.c
+5
-5
openair1/SIMULATION/RF/defs.h
openair1/SIMULATION/RF/defs.h
+2
-1
openair1/SIMULATION/RF/rf.c
openair1/SIMULATION/RF/rf.c
+1
-1
No files found.
openair1/PHY/INIT/lte_init.c
View file @
d2bf4ddc
...
...
@@ -837,11 +837,8 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms) {
init_td8
();
init_td16
();
#ifdef USER_MODE
lte_sync_time_init
(
lte_frame_parms
);
#else
// lte_sync_time_init(lte_frame_parms) has to be called from the real-time thread, since it uses SSE instructions.
#endif
generate_ul_ref_sigs
();
generate_ul_ref_sigs_rx
();
...
...
openair1/PHY/LTE_ESTIMATION/adjust_gain.c
View file @
d2bf4ddc
...
...
@@ -45,9 +45,11 @@ phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id) {
exmimo_config_t
*
p_exmimo_config
=
openair0_exmimo_pci
[
card
].
exmimo_config_ptr
;
uint16_t
i
;
#endif
int
rssi
;
//rx_power_fil_dB = dB_fixed(phy_vars_ue->PHY_measurements.rssi);
rx_power_fil_dB
=
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
eNB_id
];
rssi
=
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
rssi
);
if
(
rssi
>
0
)
rx_power_fil_dB
=
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
rssi
);
else
rx_power_fil_dB
=
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
eNB_id
];
// Gain control with hysterisis
// Adjust gain in phy_vars_ue->rx_vars[0].rx_total_gain_dB
...
...
@@ -78,6 +80,7 @@ phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id) {
phy_vars_ue
->
rx_total_gain_dB
=
MIN_RF_GAIN
;
}
printf
(
"Gain control: rx_total_gain_dB = %d (max %d,rxpf %d)
\n
"
,
phy_vars_ue
->
rx_total_gain_dB
,
MAX_RF_GAIN
,
rx_power_fil_dB
);
#ifdef EXMIMO
...
...
openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
View file @
d2bf4ddc
...
...
@@ -49,7 +49,7 @@ __m128i zeroPMI;
#define k1 ((long long int) 1000)
#define k2 ((long long int) (1024-k1))
//
#define DEBUG_MEAS
#define DEBUG_MEAS
#ifdef USER_MODE
void
print_shorts
(
char
*
s
,
__m128i
*
x
)
{
...
...
@@ -84,17 +84,21 @@ int16_t get_PL(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) {
PHY_VARS_UE
*
phy_vars_ue
=
PHY_vars_UE_g
[
Mod_id
][
CC_id
];
int
RSoffset
;
LOG_D
(
PHY
,
"get_PL : Frame %d : rssi %d, eNB power %d
\n
"
,
phy_vars_ue
->
frame
,
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
rssi
)
-
phy_vars_ue
->
rx_total_gain_dB
,
phy_vars_ue
->
lte_frame_parms
.
pdsch_config_common
.
referenceSignalPower
);
if
(
phy_vars_ue
->
lte_frame_parms
.
mode1_flag
==
1
)
RSoffset
=
6
;
else
RSoffset
=
3
;
return
((
int16_t
)(
phy_vars_ue
->
rx_total_gain_dB
-
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
rssi
/
RSoffset
)
+
phy_vars_ue
->
lte_frame_parms
.
pdsch_config_common
.
referenceSignalPower
));
LOG_D
(
PHY
,
"get_PL : Frame %d : rssi %f dBm, eNB power %d dBm/RE
\n
"
,
phy_vars_ue
->
frame
,
(
1
.
0
*
dB_fixed_times10
(
phy_vars_ue
->
PHY_measurements
.
rssi
/
RSoffset
)
-
(
10
.
0
*
phy_vars_ue
->
rx_total_gain_dB
))
/
10
.
0
,
phy_vars_ue
->
lte_frame_parms
.
pdsch_config_common
.
referenceSignalPower
);
return
((
int16_t
)(((
10
*
phy_vars_ue
->
rx_total_gain_dB
)
-
dB_fixed_times10
(
phy_vars_ue
->
PHY_measurements
.
rssi
)
+
dB_fixed_times10
(
RSoffset
*
12
*
PHY_vars_UE_g
[
Mod_id
][
CC_id
]
->
lte_frame_parms
.
N_RB_DL
)
+
(
phy_vars_ue
->
lte_frame_parms
.
pdsch_config_common
.
referenceSignalPower
*
10
))
/
10
));
}
...
...
@@ -170,25 +174,8 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
uint16_t
Nid_cell
=
phy_vars_ue
->
lte_frame_parms
.
Nid_cell
;
uint8_t
eNB_offset
,
nu
,
l
,
nushift
,
k
;
uint16_t
off
;
int16_t
rx_power_correction
;
// if the fft size an odd power of 2, the output of the fft is shifted one too much, so we need to compensate for that
if
(
abstraction_flag
==
0
)
{
rx_power_correction
=
1
;
}
else
{
#ifndef NEW_FFT
if
((
phy_vars_ue
->
lte_frame_parms
.
ofdm_symbol_size
==
128
)
||
(
phy_vars_ue
->
lte_frame_parms
.
ofdm_symbol_size
==
512
))
rx_power_correction
=
2
;
else
rx_power_correction
=
1
;
#else
rx_power_correction
=
1
;
#endif
}
for
(
eNB_offset
=
0
;
eNB_offset
<
1
+
phy_vars_ue
->
PHY_measurements
.
n_adj_cells
;
eNB_offset
++
)
{
if
(
eNB_offset
==
0
)
...
...
@@ -220,13 +207,8 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
LOG_D
(
PHY
,
"[UE %d] Frame %d slot %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, k %d)
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
frame
,
slot
,
Nid_cell
,
nushift
,
eNB_offset
,
k
);
#endif
for
(
aarx
=
0
;
aarx
<
phy_vars_ue
->
lte_frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
#ifndef NEW_FFT
rxF
=
(
int16_t
*
)
&
phy_vars_ue
->
lte_ue_common_vars
.
rxdataF
[
aarx
][(
l
*
phy_vars_ue
->
lte_frame_parms
.
ofdm_symbol_size
)
<<
1
];
off
=
(
phy_vars_ue
->
lte_frame_parms
.
first_carrier_offset
+
k
)
<<
2
;
#else
rxF
=
(
int16_t
*
)
&
phy_vars_ue
->
lte_ue_common_vars
.
rxdataF
[
aarx
][(
l
*
phy_vars_ue
->
lte_frame_parms
.
ofdm_symbol_size
)];
off
=
(
phy_vars_ue
->
lte_frame_parms
.
first_carrier_offset
+
k
)
<<
1
;
#endif
if
(
l
==
(
4
-
phy_vars_ue
->
lte_frame_parms
.
Ncp
))
{
for
(
rb
=
0
;
rb
<
phy_vars_ue
->
lte_frame_parms
.
N_RB_DL
;
rb
++
)
{
...
...
@@ -234,25 +216,13 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
// printf("rb %d, off %d, off2 %d\n",rb,off,off2);
phy_vars_ue
->
PHY_measurements
.
rsrp
[
eNB_offset
]
+=
((
rxF
[
off
]
*
rxF
[
off
])
+
(
rxF
[
off
+
1
]
*
rxF
[
off
+
1
]));
#ifndef NEW_FFT
off
+=
24
;
if
(
off
>=
(
phy_vars_ue
->
lte_frame_parms
.
ofdm_symbol_size
<<
2
))
off
=
(
1
+
k
)
<<
2
;
#else
off
+=
12
;
if
(
off
>=
(
phy_vars_ue
->
lte_frame_parms
.
ofdm_symbol_size
<<
1
))
off
=
(
1
+
k
)
<<
1
;
#endif
phy_vars_ue
->
PHY_measurements
.
rsrp
[
eNB_offset
]
+=
((
rxF
[
off
]
*
rxF
[
off
])
+
(
rxF
[
off
+
1
]
*
rxF
[
off
+
1
]));
#ifndef NEW_FFT
off
+=
24
;
if
(
off
>=
(
phy_vars_ue
->
lte_frame_parms
.
ofdm_symbol_size
<<
2
))
off
=
(
1
+
k
)
<<
2
;
#else
off
+=
12
;
if
(
off
>=
(
phy_vars_ue
->
lte_frame_parms
.
ofdm_symbol_size
<<
1
))
off
=
(
1
+
k
)
<<
1
;
#endif
}
/*
...
...
@@ -273,9 +243,9 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
// 2 RE per PRB
phy_vars_ue
->
PHY_measurements
.
rsrp
[
eNB_offset
]
/=
(
24
*
phy_vars_ue
->
lte_frame_parms
.
N_RB_DL
);
phy_vars_ue
->
PHY_measurements
.
rsrp
[
eNB_offset
]
*=
rx_power_correction
;
// phy_vars_ue->PHY_measurements.rsrp[eNB_offset] = phy_vars_ue->PHY_measurements.rx_spatial_power[eNB_offset][0][0]/(2*phy_vars_ue->lte_frame_parms.N_RB_DL);
if
(
eNB_offset
==
0
)
{
// phy_vars_ue->PHY_measurements.rssi/=(24*phy_vars_ue->lte_frame_parms.N_RB_DL);
// phy_vars_ue->PHY_measurements.rssi*=rx_power_correction;
...
...
@@ -295,12 +265,13 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue
->
PHY_measurements
.
rsrq
[
eNB_offset
]
=
3
;
}
if
(((
phy_vars_ue
->
frame
%
10
)
==
0
)
&&
(
slot
==
1
))
{
if
(((
phy_vars_ue
->
frame
%
10
)
==
0
)
&&
(
slot
==
0
))
{
#ifdef DEBUG_MEAS
if
(
eNB_offset
==
0
)
LOG_D
(
PHY
,
"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB)
\n
"
,
phy_vars_ue
->
Mod_id
,
LOG_D
(
PHY
,
"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB
, gain %d
)
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
frame
,
slot
,
10
*
log10
(
phy_vars_ue
->
PHY_measurements
.
rssi
)
-
phy_vars_ue
->
rx_total_gain_dB
,
10
*
log10
(
phy_vars_ue
->
PHY_measurements
.
rssi
));
10
*
log10
(
phy_vars_ue
->
PHY_measurements
.
rssi
),
phy_vars_ue
->
rx_total_gain_dB
);
LOG_D
(
PHY
,
"[UE %d] Frame %d, slot %d RRC Measurements (idx %d, Cell id %d) => rsrp: %3.1f (%3.1f) dBm, rsrq: %3.1f dB
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
frame
,
slot
,
eNB_offset
,
...
...
@@ -324,7 +295,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
unsigned
char
abstraction_flag
){
int
aarx
,
aatx
,
eNB_id
=
0
,
rx_power_correction
=
1
,
gain_offset
=
0
;
int
aarx
,
aatx
,
eNB_id
=
0
,
gain_offset
=
0
;
//int rx_power[NUMBER_OF_CONNECTED_eNB_MAX];
int
i
;
unsigned
int
limit
,
subband
;
...
...
@@ -334,12 +305,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue
->
PHY_measurements
.
nb_antennas_rx
=
frame_parms
->
nb_antennas_rx
;
#ifdef CBMIMO1
if
(
openair_daq_vars
.
rx_rf_mode
==
0
)
gain_offset
=
25
;
else
gain_offset
=
0
;
#endif
#ifndef __SSE3__
zeroPMI
=
_mm_xor_si128
(
zeroPMI
,
zeroPMI
);
...
...
@@ -361,21 +327,6 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue
->
PHY_measurements
.
n0_power_avg_dB
=
0
;
}
// if the fft size an odd power of 2, the output of the fft is shifted one too much, so we need to compensate for that
if
(
abstraction_flag
==
0
)
{
rx_power_correction
=
1
;
}
else
{
#ifndef NEW_FFT
if
((
frame_parms
->
ofdm_symbol_size
==
128
)
||
(
frame_parms
->
ofdm_symbol_size
==
512
))
rx_power_correction
=
2
;
else
rx_power_correction
=
1
;
#else
rx_power_correction
=
1
;
#endif
}
// noise measurements
// for abstraction we do noise measurements based on the precalculated phy_vars_ue->N0
// otherwise if there is a symbol where we can take noise measurements on, we measure there
...
...
@@ -417,7 +368,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
for
(
aatx
=
0
;
aatx
<
frame_parms
->
nb_antennas_tx_eNB
;
aatx
++
)
{
phy_vars_ue
->
PHY_measurements
.
rx_spatial_power
[
eNB_id
][
aatx
][
aarx
]
=
(
signal_energy_nodc
(
&
phy_vars_ue
->
lte_ue_common_vars
.
dl_ch_estimates
[
eNB_id
][(
aatx
<<
1
)
+
aarx
][
0
],
(
frame_parms
->
N_RB_DL
*
12
))
*
rx_power_correction
);
(
frame_parms
->
N_RB_DL
*
12
)));
//- phy_vars_ue->PHY_measurements.n0_power[aarx];
if
(
phy_vars_ue
->
PHY_measurements
.
rx_spatial_power
[
eNB_id
][
aatx
][
aarx
]
<
0
)
...
...
@@ -465,6 +416,11 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue
->
PHY_measurements
.
wideband_cqi_tot
[
eNB_id
]
=
dB_fixed2
(
phy_vars_ue
->
PHY_measurements
.
rx_power_tot
[
eNB_id
],
phy_vars_ue
->
PHY_measurements
.
n0_power_tot
);
phy_vars_ue
->
PHY_measurements
.
wideband_cqi_avg
[
eNB_id
]
=
dB_fixed2
(
phy_vars_ue
->
PHY_measurements
.
rx_power_avg
[
eNB_id
],
phy_vars_ue
->
PHY_measurements
.
n0_power_avg
);
phy_vars_ue
->
PHY_measurements
.
rx_rssi_dBm
[
eNB_id
]
=
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
eNB_id
]
-
phy_vars_ue
->
rx_total_gain_dB
+
gain_offset
;
#ifdef DEBUG_MEAS
printf
(
"[PHY][eNB %d] lte_ue_measurements: RSSI %d dBm, RSSI (digital) %d dB
\n
"
,
eNB_id
,
phy_vars_ue
->
PHY_measurements
.
rx_rssi_dBm
[
eNB_id
],
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
eNB_id
]);
#endif
}
phy_vars_ue
->
PHY_measurements
.
n0_power_avg_dB
=
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
n0_power_avg
);
...
...
@@ -488,7 +444,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
msg("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
*/
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
]
=
(
signal_energy_nodc
(
dl_ch0
,
48
)
+
signal_energy_nodc
(
dl_ch1
,
48
))
*
rx_power_correction
;
(
signal_energy_nodc
(
dl_ch0
,
48
)
+
signal_energy_nodc
(
dl_ch1
,
48
));
if
(
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
]
<
0
)
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
]
=
0
;
/*
...
...
@@ -503,7 +459,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
else
{
// for (i=0;i<12;i++)
// printf("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
]
=
(
signal_energy_nodc
(
dl_ch0
,
12
)
+
signal_energy_nodc
(
dl_ch1
,
12
))
*
rx_power_correction
;
// - phy_vars_ue->PHY_measurements.n0_power[aarx];
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
]
=
(
signal_energy_nodc
(
dl_ch0
,
12
)
+
signal_energy_nodc
(
dl_ch1
,
12
));
// - phy_vars_ue->PHY_measurements.n0_power[aarx];
phy_vars_ue
->
PHY_measurements
.
subband_cqi_tot
[
eNB_id
][
subband
]
+=
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
];
phy_vars_ue
->
PHY_measurements
.
subband_cqi_dB
[
eNB_id
][
aarx
][
subband
]
=
dB_fixed2
(
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
],
phy_vars_ue
->
PHY_measurements
.
n0_power
[
aarx
]);
...
...
@@ -608,7 +564,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
// for (i=0;i<48;i++)
// printf("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
]
=
(
signal_energy_nodc
(
dl_ch0
,
48
)
)
*
rx_power_correction
-
phy_vars_ue
->
PHY_measurements
.
n0_power
[
aarx
];
(
signal_energy_nodc
(
dl_ch0
,
48
)
)
-
phy_vars_ue
->
PHY_measurements
.
n0_power
[
aarx
];
phy_vars_ue
->
PHY_measurements
.
subband_cqi_tot
[
eNB_id
][
subband
]
+=
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
];
phy_vars_ue
->
PHY_measurements
.
subband_cqi_dB
[
eNB_id
][
aarx
][
subband
]
=
dB_fixed2
(
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
],
...
...
@@ -617,7 +573,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
else
{
// for (i=0;i<12;i++)
// printf("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
]
=
(
signal_energy_nodc
(
dl_ch0
,
12
)
)
*
rx_power_correction
-
phy_vars_ue
->
PHY_measurements
.
n0_power
[
aarx
];
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
]
=
(
signal_energy_nodc
(
dl_ch0
,
12
)
)
-
phy_vars_ue
->
PHY_measurements
.
n0_power
[
aarx
];
phy_vars_ue
->
PHY_measurements
.
subband_cqi_tot
[
eNB_id
][
subband
]
+=
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
];
phy_vars_ue
->
PHY_measurements
.
subband_cqi_dB
[
eNB_id
][
aarx
][
subband
]
=
dB_fixed2
(
phy_vars_ue
->
PHY_measurements
.
subband_cqi
[
eNB_id
][
aarx
][
subband
],
phy_vars_ue
->
PHY_measurements
.
n0_power
[
aarx
]);
...
...
openair1/PHY/LTE_TRANSPORT/dci.c
View file @
d2bf4ddc
...
...
@@ -1832,13 +1832,13 @@ int32_t rx_pdcch(LTE_UE_COMMON *lte_ue_common_vars,
lte_ue_pdcch_vars
[
eNB_id
]
->
llr16
,
//subsequent function require 16 bit llr, but output must be 8 bit (actually clipped to 4, because of the Viterbi decoder)
lte_ue_pdcch_vars
[
eNB_id
]
->
llr
,
s
);
/*
#ifdef DEBUG_PHY
if (subframe==5) {
write_output("llr8_seq.m","llr8",<e_ue_pdcch_vars[eNB_id]->llr[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4);
write_output("llr16_seq.m","llr16",<e_ue_pdcch_vars[eNB_id]->llr16[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4);
}
#endif
#endif*/
}
else
{
#endif //MU_RECEIVER
...
...
@@ -1846,9 +1846,9 @@ int32_t rx_pdcch(LTE_UE_COMMON *lte_ue_common_vars,
lte_ue_pdcch_vars
[
eNB_id
]
->
rxdataF_comp
,
(
char
*
)
lte_ue_pdcch_vars
[
eNB_id
]
->
llr
,
s
);
#ifdef DEBUG_PHY
/*
#ifdef DEBUG_PHY
write_output("llr8_seq.m","llr8",<e_ue_pdcch_vars[eNB_id]->llr[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4);
#endif
#endif*/
#ifdef MU_RECEIVER
}
#endif //MU_RECEIVER
...
...
openair1/PHY/LTE_TRANSPORT/dci_tools.c
View file @
d2bf4ddc
...
...
@@ -4031,11 +4031,6 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
harq_pid
=
subframe2harq_pid
(
frame_parms
,
pdcch_alloc2ul_frame
(
frame_parms
,
phy_vars_ue
->
frame
,
subframe
),
pdcch_alloc2ul_subframe
(
frame_parms
,
subframe
));
/*
msg("Scheduling UE transmission for frame %d, subframe %d harq_pid = %d\n",
pdcch_alloc2ul_frame(frame_parms,phy_vars_ue->frame,subframe),
pdcch_alloc2ul_subframe(frame_parms,subframe),harq_pid);
*/
if
(
harq_pid
==
255
)
{
LOG_E
(
PHY
,
"frame %d, subframe %d, rnti %x, format %d: illegal harq_pid!
\n
"
,
...
...
openair1/PHY/LTE_TRANSPORT/initial_sync.c
View file @
d2bf4ddc
...
...
@@ -276,6 +276,8 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
(
mode
!=
rx_calib_ue
)
&&
(
mode
!=
rx_calib_ue_med
)
&&
(
mode
!=
rx_calib_ue_byp
)
)
//phy_adjust_gain(phy_vars_ue,0);
gain_control_all
(
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
0
],
0
);
#else
phy_adjust_gain
(
phy_vars_ue
,
0
);
#endif
// SSS detection
...
...
openair1/PHY/LTE_TRANSPORT/pbch.c
View file @
d2bf4ddc
...
...
@@ -762,7 +762,7 @@ uint16_t rx_pbch(LTE_UE_COMMON *lte_ue_common_vars,
pbch_E
=
(
frame_parms
->
Ncp
==
0
)
?
1920
:
1728
;
//RE/RB * #RB * bits/RB (QPSK)
pbch_e_rx
=
&
lte_ue_pbch_vars
->
llr
[
frame_mod4
*
(
pbch_E
>>
2
)];
#ifdef DEBUG_PBCH
msg
(
"[PBCH] starting symbol loop
\n
"
);
msg
(
"[PBCH] starting symbol loop
(Ncp %d, frame_mod4 %d,mimo_mode %d
\n
"
,
frame_parms
->
Ncp
,
frame_mod4
,
mimo_mode
);
#endif
// clear LLR buffer
...
...
openair1/PHY/LTE_TRANSPORT/pcfich.c
View file @
d2bf4ddc
...
...
@@ -142,10 +142,6 @@ void generate_pcfich(uint8_t num_pdcch_symbols,
uint8_t
i
;
uint32_t
symbol_offset
,
m
,
re_offset
,
reg_offset
;
int16_t
gain_lin_QPSK
;
#ifdef IFFT_FPGA
uint8_t
qpsk_table_offset
=
0
;
uint8_t
qpsk_table_offset2
=
0
;
#endif
uint16_t
*
pcfich_reg
=
frame_parms
->
pcfich_reg
;
int
nushiftmod3
=
frame_parms
->
nushift
%
3
;
...
...
@@ -164,28 +160,15 @@ void generate_pcfich(uint8_t num_pdcch_symbols,
gain_lin_QPSK
=
amp
/
2
;
if
(
frame_parms
->
mode1_flag
)
{
// SISO
#ifndef IFFT_FPGA
for
(
i
=
0
;
i
<
16
;
i
++
)
{
((
int16_t
*
)(
&
(
pcfich_d
[
0
][
i
])))[
0
]
=
((
pcfich_bt
[
2
*
i
]
==
1
)
?
-
gain_lin_QPSK
:
gain_lin_QPSK
);
((
int16_t
*
)(
&
(
pcfich_d
[
1
][
i
])))[
0
]
=
((
pcfich_bt
[
2
*
i
]
==
1
)
?
-
gain_lin_QPSK
:
gain_lin_QPSK
);
((
int16_t
*
)(
&
(
pcfich_d
[
0
][
i
])))[
1
]
=
((
pcfich_bt
[
2
*
i
+
1
]
==
1
)
?
-
gain_lin_QPSK
:
gain_lin_QPSK
);
((
int16_t
*
)(
&
(
pcfich_d
[
1
][
i
])))[
1
]
=
((
pcfich_bt
[
2
*
i
+
1
]
==
1
)
?
-
gain_lin_QPSK
:
gain_lin_QPSK
);
}
#else
for
(
i
=
0
;
i
<
16
;
i
++
)
{
qpsk_table_offset
=
MOD_TABLE_QPSK_OFFSET
;
if
(
pcfich_bt
[
2
*
i
]
==
1
)
qpsk_table_offset
+=
2
;
if
(
pcfich_bt
[
2
*
i
+
1
]
==
1
)
qpsk_table_offset
+=
1
;
pcfich_d
[
0
][
i
]
=
(
mod_sym_t
)
qpsk_table_offset
;
pcfich_d
[
1
][
i
]
=
(
mod_sym_t
)
qpsk_table_offset
;
}
#endif
}
else
{
// ALAMOUTI
#ifndef IFFT_FPGA
for
(
i
=
0
;
i
<
16
;
i
+=
2
)
{
// first antenna position n -> x0
((
int16_t
*
)(
&
(
pcfich_d
[
0
][
i
])))[
0
]
=
((
pcfich_bt
[
2
*
i
]
==
1
)
?
-
gain_lin_QPSK
:
gain_lin_QPSK
);
...
...
@@ -201,83 +184,25 @@ void generate_pcfich(uint8_t num_pdcch_symbols,
}
#else
for
(
i
=
0
;
i
<
16
;
i
+=
2
)
{
qpsk_table_offset
=
MOD_TABLE_QPSK_OFFSET
;
//x0
qpsk_table_offset2
=
MOD_TABLE_QPSK_OFFSET
;
//x0*
// flipping bit for imag part of symbol means taking x0*
if
(
pcfich_bt
[
2
*
i
]
==
1
)
{
//real
qpsk_table_offset
+=
2
;
qpsk_table_offset2
+=
2
;
}
if
(
pcfich_bt
[
2
*
i
+
1
]
==
1
)
//imag
qpsk_table_offset
+=
1
;
else
qpsk_table_offset2
+=
1
;
pcfich_d
[
0
][
i
]
=
(
mod_sym_t
)
qpsk_table_offset
;
// x0
pcfich_d
[
1
][
i
+
1
]
=
(
mod_sym_t
)
qpsk_table_offset2
;
// x0*
qpsk_table_offset
=
MOD_TABLE_QPSK_OFFSET
;
//-x1*
qpsk_table_offset2
=
MOD_TABLE_QPSK_OFFSET
;
//x1
// flipping bit for real part of symbol means taking -x1*
if
(
pcfich_bt
[
2
*
i
+
2
]
==
1
)
//real
qpsk_table_offset2
+=
2
;
else
qpsk_table_offset
+=
2
;
if
(
pcfich_bt
[
2
*
i
+
3
]
==
1
)
{
//imag
qpsk_table_offset
+=
1
;
qpsk_table_offset2
+=
1
;
}
pcfich_d
[
1
][
i
]
=
(
mod_sym_t
)
qpsk_table_offset
;
// -x1*
pcfich_d
[
0
][
i
+
1
]
=
(
mod_sym_t
)
qpsk_table_offset2
;
// x1
}
#endif
}
// mapping
nsymb
=
(
frame_parms
->
Ncp
==
0
)
?
14
:
12
;
#ifdef IFFT_FPGA
symbol_offset
=
(
uint32_t
)
frame_parms
->
N_RB_DL
*
12
*
((
subframe
*
nsymb
));
re_offset
=
frame_parms
->
N_RB_DL
*
12
/
2
;
#else
symbol_offset
=
(
uint32_t
)
frame_parms
->
ofdm_symbol_size
*
((
subframe
*
nsymb
));
re_offset
=
frame_parms
->
first_carrier_offset
;
#endif
// loop over 4 quadruplets and lookup REGs
m
=
0
;
for
(
pcfich_quad
=
0
;
pcfich_quad
<
4
;
pcfich_quad
++
)
{
reg_offset
=
re_offset
+
((
uint16_t
)
pcfich_reg
[
pcfich_quad
]
*
6
);
#ifdef IFFT_FPGA
if
(
reg_offset
>=
(
frame_parms
->
N_RB_DL
*
12
))
reg_offset
-=
(
frame_parms
->
N_RB_DL
*
12
);
#else
if
(
reg_offset
>=
frame_parms
->
ofdm_symbol_size
)
reg_offset
=
1
+
reg_offset
-
frame_parms
->
ofdm_symbol_size
;
#endif
// printf("mapping pcfich reg_offset %d\n",reg_offset);
for
(
i
=
0
;
i
<
6
;
i
++
)
{
if
((
i
!=
nushiftmod3
)
&&
(
i
!=
(
nushiftmod3
+
3
)))
{
txdataF
[
0
][
symbol_offset
+
reg_offset
+
i
]
=
pcfich_d
[
0
][
m
];
/*
#ifndef IFFT_FPGA
printf("pcfich: quad %d, i %d, offset %d => m%d (%d,%d)\n",pcfich_quad,i,reg_offset+i,m,
((int16_t*)&txdataF[0][symbol_offset+reg_offset+i])[0],
((int16_t*)&txdataF[0][symbol_offset+reg_offset+i])[1]);
#else
printf("pcfich: quad %d, i %d, offset %d => m%d (%d)\n",pcfich_quad,i,reg_offset+i,m,
txdataF[0][symbol_offset+reg_offset+i]);
#endif
*/
if
(
frame_parms
->
nb_antennas_tx_eNB
>
1
)
txdataF
[
1
][
symbol_offset
+
reg_offset
+
i
]
=
pcfich_d
[
1
][
m
];
m
++
;
...
...
openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
View file @
d2bf4ddc
...
...
@@ -1158,6 +1158,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
#endif
start_meas
(
&
phy_vars_eNB
->
ulsch_rate_unmatching_stats
);
if
(
lte_rate_matching_turbo_rx
(
ulsch
->
harq_processes
[
harq_pid
]
->
RTC
[
r
],
G
,
ulsch
->
harq_processes
[
harq_pid
]
->
w
[
r
],
...
...
@@ -1188,14 +1189,14 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
&
ulsch
->
harq_processes
[
harq_pid
]
->
d
[
r
][
96
],
ulsch
->
harq_processes
[
harq_pid
]
->
w
[
r
]);
stop_meas
(
&
phy_vars_eNB
->
ulsch_deinterleaving_stats
);
/*
#ifdef DEBUG_ULSCH_DECODING
/*
#ifdef DEBUG_ULSCH_DECODING
msg("decoder input(segment %d) :",r);
for (i=0;i<(3*8*Kr_bytes)+12;i++)
msg("%d : %d\n",i,ulsch->harq_processes[harq_pid]->d[r][96+i]);
msg("\n");
#endif*/
#endif
*/
}
#ifdef OMP
...
...
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
View file @
d2bf4ddc
...
...
@@ -1565,7 +1565,7 @@ void dump_ulsch(PHY_VARS_eNB *PHY_vars_eNB,uint8_t sched_subframe, uint8_t UE_id
harq_pid
=
subframe2harq_pid
(
&
PHY_vars_eNB
->
lte_frame_parms
,
PHY_vars_eNB
->
proc
[
sched_subframe
].
frame_rx
,
subframe
);
printf
(
"Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, mcs %d, Qm %d, N_symb %d
\n
"
,
subframe
,
harq_pid
,
PHY_vars_eNB
->
ulsch_eNB
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
,
PHY_vars_eNB
->
ulsch_eNB
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
mcs
,
get_Qm_ul
(
PHY_vars_eNB
->
ulsch_eNB
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
mcs
),
PHY_vars_eNB
->
ulsch_eNB
[
UE_id
]
->
Nsymb_pusch
);
#ifndef OAI_EMU
//
#ifndef OAI_EMU
write_output
(
"/tmp/ulsch_d.m"
,
"ulsch_dseq"
,
&
PHY_vars_eNB
->
ulsch_eNB
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
d
[
0
][
96
],
PHY_vars_eNB
->
ulsch_eNB
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
Kplus
*
3
,
1
,
0
);
write_output
(
"/tmp/rxsig0.m"
,
"rxs0"
,
&
PHY_vars_eNB
->
lte_eNB_common_vars
.
rxdata
[
0
][
0
][
0
],
PHY_vars_eNB
->
lte_frame_parms
.
samples_per_tti
*
10
,
1
,
1
);
...
...
@@ -1590,6 +1590,6 @@ void dump_ulsch(PHY_VARS_eNB *PHY_vars_eNB,uint8_t sched_subframe, uint8_t UE_id
write_output
(
"/tmp/ulsch_rxF_llr.m"
,
"ulsch_llr"
,
PHY_vars_eNB
->
lte_eNB_pusch_vars
[
UE_id
]
->
llr
,
PHY_vars_eNB
->
ulsch_eNB
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
*
get_Qm_ul
(
PHY_vars_eNB
->
ulsch_eNB
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
mcs
)
*
PHY_vars_eNB
->
ulsch_eNB
[
UE_id
]
->
Nsymb_pusch
,
1
,
0
);
write_output
(
"/tmp/ulsch_ch_mag.m"
,
"ulsch_ch_mag"
,
&
PHY_vars_eNB
->
lte_eNB_pusch_vars
[
UE_id
]
->
ul_ch_mag
[
0
][
0
][
0
],
PHY_vars_eNB
->
lte_frame_parms
.
N_RB_UL
*
12
*
nsymb
,
1
,
1
);
// write_output("ulsch_ch_mag1.m","ulsch_ch_mag1",&PHY_vars_eNB->lte_eNB_pusch_vars[UE_id]->ul_ch_mag[0][1][0],PHY_vars_eNB->lte_frame_parms.N_RB_UL*12*nsymb,1,1);
#endif
//
#endif
}
openair1/PHY/MODULATION/defs.h
View file @
d2bf4ddc
...
...
@@ -89,6 +89,8 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
void
normal_prefix_mod
(
int32_t
*
txdataF
,
int32_t
*
txdata
,
uint8_t
nsymb
,
LTE_DL_FRAME_PARMS
*
frame_parms
);
void
do_OFDM_mod
(
mod_sym_t
**
txdataF
,
int32_t
**
txdata
,
uint32_t
frame
,
uint16_t
next_slot
,
LTE_DL_FRAME_PARMS
*
frame_parms
);
void
remove_7_5_kHz
(
PHY_VARS_eNB
*
phy_vars_eNB
,
uint8_t
subframe
);
void
apply_7_5_kHz
(
PHY_VARS_UE
*
phy_vars_ue
,
int32_t
*
txdata
,
uint8_t
subframe
);
...
...
openair1/PHY/MODULATION/ofdm_mod.c
View file @
d2bf4ddc
...
...
@@ -37,7 +37,7 @@ This section deals with basic functions for OFDM Modulation.
*/
#include "PHY/defs.h"
#include "UTIL/LOG/log.h"
//static short temp2[2048*4] __attribute__((aligned(16)));
...
...
@@ -244,4 +244,64 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
*/
}
void
do_OFDM_mod
(
mod_sym_t
**
txdataF
,
int32_t
**
txdata
,
uint32_t
frame
,
uint16_t
next_slot
,
LTE_DL_FRAME_PARMS
*
frame_parms
)
{
int
aa
,
slot_offset
,
slot_offset_F
;
slot_offset_F
=
(
next_slot
)
*
(
frame_parms
->
ofdm_symbol_size
)
*
((
frame_parms
->
Ncp
==
1
)
?
6
:
7
);
slot_offset
=
(
next_slot
)
*
(
frame_parms
->
samples_per_tti
>>
1
);
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_tx
;
aa
++
)
{
if
(
is_pmch_subframe
(
frame
,
next_slot
>>
1
,
frame_parms
))
{
if
((
next_slot
%
2
)
==
0
)
{
LOG_D
(
PHY
,
"Frame %d, subframe %d: Doing MBSFN modulation (slot_offset %d)
\n
"
,
frame
,
next_slot
>>
1
,
slot_offset
);
PHY_ofdm_mod
(
&
txdataF
[
aa
][
slot_offset_F
],
// input
&
txdata
[
aa
][
slot_offset
],
// output
frame_parms
->
log2_symbol_size
,
// log2_fft_size
12
,
// number of symbols
frame_parms
->
ofdm_symbol_size
>>
2
,
// number of prefix samples
frame_parms
->
twiddle_ifft
,
// IFFT twiddle factors
frame_parms
->
rev
,
// bit-reversal permutation
CYCLIC_PREFIX
);
if
(
frame_parms
->
Ncp
==
EXTENDED
)
PHY_ofdm_mod
(
&
txdataF
[
aa
][
slot_offset_F
],
// input
&
txdata
[
aa
][
slot_offset
],
// output
frame_parms
->
log2_symbol_size
,
// log2_fft_size
2
,
// number of symbols
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
frame_parms
->
twiddle_ifft
,
// IFFT twiddle factors
frame_parms
->
rev
,
// bit-reversal permutation
CYCLIC_PREFIX
);
else
{
LOG_D
(
PHY
,
"Frame %d, subframe %d: Doing PDCCH modulation
\n
"
,
frame
,
next_slot
>>
1
);
normal_prefix_mod
(
&
txdataF
[
aa
][
slot_offset_F
],
&
txdata
[
aa
][
slot_offset
],
2
,
frame_parms
);
}
}
}
else
{
if
(
frame_parms
->
Ncp
==
EXTENDED
)
PHY_ofdm_mod
(
&
txdataF
[
aa
][
slot_offset_F
],
// input
&
txdata
[
aa
][
slot_offset
],
// output
frame_parms
->
log2_symbol_size
,
// log2_fft_size
6
,
// number of symbols
frame_parms
->
nb_prefix_samples
,
// number of prefix samples
frame_parms
->
twiddle_ifft
,
// IFFT twiddle factors
frame_parms
->
rev
,
// bit-reversal permutation
CYCLIC_PREFIX
);
else
{
normal_prefix_mod
(
&
txdataF
[
aa
][
slot_offset_F
],
&
txdata
[
aa
][
slot_offset
],
7
,
frame_parms
);
}
}
}
}
/** @} */
openair1/PHY/MODULATION/slot_fep.c
View file @
d2bf4ddc
...
...
@@ -102,11 +102,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_rx
;
aa
++
)
{
#ifdef NEW_FFT
memset
(
&
ue_common_vars
->
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
0
,
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
#else
memset
(
&
ue_common_vars
->
rxdataF
[
aa
][
2
*
frame_parms
->
ofdm_symbol_size
*
symbol
],
0
,
2
*
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
#endif
if
(
l
==
0
)
{
rx_offset
=
sample_offset
+
slot_offset
+
nb_prefix_samples0
+
subframe_offset
-
SOFFSET
;
...
...
@@ -116,24 +112,10 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
memcpy
((
short
*
)
&
ue_common_vars
->
rxdata
[
aa
][
frame_length_samples
],
(
short
*
)
&
ue_common_vars
->
rxdata
[
aa
][
0
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
#ifndef NEW_FFT
fft
((
short
*
)
&
ue_common_vars
->
rxdata
[
aa
][(
sample_offset
+
slot_offset
+
nb_prefix_samples0
+
subframe_offset
-
SOFFSET
)
%
frame_length_samples
],
(
short
*
)
&
ue_common_vars
->
rxdataF
[
aa
][
2
*
frame_parms
->
ofdm_symbol_size
*
symbol
],
frame_parms
->
twiddle_fft
,
frame_parms
->
rev
,
frame_parms
->
log2_symbol_size
,
frame_parms
->
log2_symbol_size
>>
1
,
0
);
#else
start_meas
(
&
phy_vars_ue
->
rx_dft_stats
);
dft
((
int16_t
*
)
&
ue_common_vars
->
rxdata
[
aa
][(
rx_offset
)
%
frame_length_samples
],
(
int16_t
*
)
&
ue_common_vars
->
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
stop_meas
(
&
phy_vars_ue
->
rx_dft_stats
);
#endif
}
else
{
...
...
@@ -148,38 +130,11 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
(
short
*
)
&
ue_common_vars
->
rxdata
[
aa
][
0
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
#ifndef NEW_FFT
fft
((
short
*
)
&
ue_common_vars
->
rxdata
[
aa
][(
sample_offset
+
slot_offset
+
(
frame_parms
->
ofdm_symbol_size
+
nb_prefix_samples0
+
nb_prefix_samples
)
+
(
frame_parms
->
ofdm_symbol_size
+
nb_prefix_samples
)
*
(
l
-
1
)
+
subframe_offset
-
SOFFSET
)
%
frame_length_samples
],
(
short
*
)
&
ue_common_vars
->
rxdataF
[
aa
][
2
*
frame_parms
->
ofdm_symbol_size
*
symbol
],
frame_parms
->
twiddle_fft
,
frame_parms
->
rev
,
frame_parms
->
log2_symbol_size
,
frame_parms
->
log2_symbol_size
>>
1
,
0
);
#else
start_meas
(
&
phy_vars_ue
->
rx_dft_stats
);
dft
((
int16_t
*
)
&
ue_common_vars
->
rxdata
[
aa
][(
rx_offset
)
%
frame_length_samples
],
(
int16_t
*
)
&
ue_common_vars
->
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
stop_meas
(
&
phy_vars_ue
->
rx_dft_stats
);
#endif
}
/*
#ifndef NEW_FFT
memcpy(&ue_common_vars->rxdataF2[aa][2*subframe_offset_F+2*frame_parms->ofdm_symbol_size*symbol],
&ue_common_vars->rxdataF[aa][2*frame_parms->ofdm_symbol_size*symbol],
2*frame_parms->ofdm_symbol_size*sizeof(int));
#else
memcpy(&ue_common_vars->rxdataF2[aa][subframe_offset_F+frame_parms->ofdm_symbol_size*symbol],
&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
frame_parms->ofdm_symbol_size*sizeof(int));
#endif
*/
}
#ifndef PERFECT_CE
if
((
l
==
0
)
||
(
l
==
(
4
-
frame_parms
->
Ncp
)))
{
...
...
openair1/PHY/defs.h
View file @
d2bf4ddc
...
...
@@ -362,6 +362,7 @@ typedef struct
uint32_t
rx_gain_med
[
4
];
uint32_t
rx_gain_byp
[
4
];
int8_t
tx_power_dBm
;
int
tx_total_RE
;
int8_t
tx_power_max_dBm
;
uint32_t
frame
;
uint8_t
n_connected_eNB
;
...
...
openair1/PHY/impl_defs_top.h
View file @
d2bf4ddc
...
...
@@ -183,7 +183,7 @@
//the min and max gains have to match the calibrated gain table
//#define MAX_RF_GAIN 160
//#define MIN_RF_GAIN 96
#define MAX_RF_GAIN
16
0
#define MAX_RF_GAIN
20
0
#define MIN_RF_GAIN 80
#define PHY_SYNCH_OFFSET ((OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES)-1) // OFFSET of BEACON SYNCH
...
...
openair1/SCHED/defs.h
View file @
d2bf4ddc
...
...
@@ -527,7 +527,7 @@ LTE_DL_FRAME_PARMS *get_lte_frame_parms(module_id_t Mod_id, uint8_t CC_id);
MU_MIMO_mode
*
get_mu_mimo_mode
(
module_id_t
Mod_id
,
uint8_t
CC_id
);
int
get_ue_active_harq_pid
(
uint8_t
Mod_id
,
uint8_t
CC_id
,
uint16_t
rnti
,
uint8_t
subframe
,
uint8_t
*
harq_pid
,
uint8_t
*
round
,
uint8_t
ul_flag
);
int
get_ue_active_harq_pid
(
uint8_t
Mod_id
,
uint8_t
CC_id
,
uint16_t
rnti
,
int
frame
,
uint8_t
subframe
,
uint8_t
*
harq_pid
,
uint8_t
*
round
,
uint8_t
ul_flag
);
void
ulsch_decoding_procedures
(
unsigned
char
last_slot
,
unsigned
int
i
,
PHY_VARS_eNB
*
phy_vars_eNB
,
unsigned
char
abstraction_flag
);
...
...
openair1/SCHED/phy_procedures_lte_eNb.c
View file @
d2bf4ddc
...
...
@@ -77,7 +77,6 @@
#define NS_PER_SLOT 500000
#define PUCCH 1
#define PUCCH1_THRES 15
#define PUCCH1a_THRES 15
...
...
@@ -211,7 +210,7 @@ int8_t find_next_ue_index(PHY_VARS_eNB *phy_vars_eNB) {
return
(
-
1
);
}
int
get_ue_active_harq_pid
(
uint8_t
Mod_id
,
uint8_t
CC_id
,
uint16_t
rnti
,
uint8_t
sched_
subframe
,
uint8_t
*
harq_pid
,
uint8_t
*
round
,
uint8_t
ul_flag
)
{
int
get_ue_active_harq_pid
(
uint8_t
Mod_id
,
uint8_t
CC_id
,
uint16_t
rnti
,
int
frame
,
uint8_t
subframe
,
uint8_t
*
harq_pid
,
uint8_t
*
round
,
uint8_t
ul_flag
)
{
LTE_eNB_DLSCH_t
*
DLSCH_ptr
;
LTE_eNB_ULSCH_t
*
ULSCH_ptr
;
...
...
@@ -219,8 +218,8 @@ int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,uint8_t sc
uint8_t
ulsch_subframe
,
ulsch_frame
;
uint8_t
i
;
int8_t
UE_id
=
find_ue
(
rnti
,
PHY_vars_eNB_g
[
Mod_id
][
CC_id
]);
int
frame
=
PHY_vars_eNB_g
[
Mod_id
][
CC_id
]
->
proc
[
sched_subframe
].
frame_tx
;
int
subframe
=
PHY_vars_eNB_g
[
Mod_id
][
CC_id
]
->
proc
[
sched_subframe
].
subframe_tx
;
//
int frame = PHY_vars_eNB_g[Mod_id][CC_id]->proc[sched_subframe].frame_tx;
//
int subframe = PHY_vars_eNB_g[Mod_id][CC_id]->proc[sched_subframe].subframe_tx;
if
(
UE_id
==-
1
)
{
LOG_E
(
PHY
,
"Cannot find UE with rnti %x
\n
"
,
rnti
);
...
...
@@ -2096,6 +2095,23 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_procedures_emos_eNB_TX
(
next_slot
,
phy_vars_eNB
);
#endif
#ifndef EXMIMO
#ifndef USRP
if
(
abstraction_flag
==
0
)
{
start_meas
(
&
phy_vars_eNB
->
ofdm_mod_stats
);
do_OFDM_mod
(
phy_vars_eNB
->
lte_eNB_common_vars
.
txdataF
[
0
],
phy_vars_eNB
->
lte_eNB_common_vars
.
txdata
[
0
],
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
subframe
<<
1
,
&
phy_vars_eNB
->
lte_frame_parms
);
do_OFDM_mod
(
phy_vars_eNB
->
lte_eNB_common_vars
.
txdataF
[
0
],
phy_vars_eNB
->
lte_eNB_common_vars
.
txdata
[
0
],
phy_vars_eNB
->
proc
[
sched_subframe
].
frame_tx
,
1
+
(
subframe
<<
1
),
&
phy_vars_eNB
->
lte_frame_parms
);
stop_meas
(
&
phy_vars_eNB
->
ofdm_mod_stats
);
}
#endif
#endif
vcd_signal_dumper_dump_function_by_name
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX
,
0
);
stop_meas
(
&
phy_vars_eNB
->
phy_proc_tx
);
...
...
@@ -2991,11 +3007,12 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++)
printf("%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]);
printf("\n");
dump_ulsch(phy_vars_eNB,sched_subframe,i);*/
*/
// dump_ulsch(phy_vars_eNB,sched_subframe,i);
//#ifndef EXMIMO_IOT
LOG_W
(
PHY
,
"[eNB] Frame %d, Subframe %d: Msg3 in error
\n
"
,
frame
,
subframe
);
//#else
//
mac_exit_wrapper("Msg3 error");
//mac_exit_wrapper("Msg3 error");
//#endif
}
// This is Msg3 error
else
{
//normal ULSCH
...
...
@@ -3017,6 +3034,7 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
// dump_ulsch(phy_vars_eNB,sched_subframe,i);
//mac_exit_wrapper("ULSCH error");
if
(
phy_vars_eNB
->
ulsch_eNB
[
i
]
->
harq_processes
[
harq_pid
]
->
round
==
phy_vars_eNB
->
ulsch_eNB
[
i
]
->
Mdlharq
)
{
LOG_I
(
PHY
,
"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mdlharq %d reached
\n
"
,
...
...
openair1/SCHED/phy_procedures_lte_ue.c
View file @
d2bf4ddc
...
...
@@ -367,7 +367,7 @@ void process_timing_advance(uint8_t Mod_id,uint8_t CC_id,int16_t timing_advance)
uint8_t
is_SR_TXOp
(
PHY_VARS_UE
*
phy_vars_ue
,
uint8_t
eNB_id
,
uint8_t
subframe
)
{
LOG_D
(
PHY
,
"[UE %d][SR %x] Frame %d subframe %d Checking for SR TXOp (sr_ConfigIndex %d)
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
lte_ue_pdcch_vars
[
eNB_id
]
->
crnti
,
phy_vars_ue
->
frame
,
subframe
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
lte_ue_pdcch_vars
[
eNB_id
]
->
crnti
,
phy_vars_ue
->
frame
+
(
subframe
==
0
)
?
1
:
0
,
subframe
,
phy_vars_ue
->
scheduling_request_config
[
eNB_id
].
sr_ConfigIndex
);
if
(
phy_vars_ue
->
scheduling_request_config
[
eNB_id
].
sr_ConfigIndex
<=
4
)
{
// 5 ms SR period
...
...
@@ -717,6 +717,8 @@ void phy_procedures_UE_TX(uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB
#else
phy_vars_ue
->
tx_power_dBm
=
UE_TX_POWER
;
#endif
phy_vars_ue
->
tx_total_RE
=
phy_vars_ue
->
ulsch_ue
[
eNB_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
;
LOG_D
(
PHY
,
"[UE %d][PUSCH %d] Frame %d subframe %d harq pid %d, Po_PUSCH : %d dBm
\n
"
,
phy_vars_ue
->
Mod_id
,
harq_pid
,(((
next_slot
>>
1
)
==
0
)
?
1
:
0
)
+
phy_vars_ue
->
frame
,
next_slot
>>
1
,
harq_pid
,
phy_vars_ue
->
tx_power_dBm
);
...
...
@@ -919,6 +921,8 @@ void phy_procedures_UE_TX(uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB
#else
phy_vars_ue
->
tx_power_dBm
=
UE_TX_POWER
;
#endif
phy_vars_ue
->
tx_total_RE
=
phy_vars_ue
->
ulsch_ue
[
eNB_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
;
LOG_I
(
PHY
,
"[UE %d][PUSCH %d] Frame %d subframe %d, generating PUSCH, Po_PUSCH: %d dBm, amp %d
\n
"
,
phy_vars_ue
->
Mod_id
,
harq_pid
,(((
next_slot
>>
1
)
==
0
)
?
1
:
0
)
+
phy_vars_ue
->
frame
,
next_slot
>>
1
,
phy_vars_ue
->
tx_power_dBm
,
#ifdef EXMIMO
...
...
@@ -1030,7 +1034,7 @@ void phy_procedures_UE_TX(uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB
// Check for SR and do ACK/NACK accordingly
if
(
is_SR_TXOp
(
phy_vars_ue
,
eNB_id
,
next_slot
>>
1
)
==
1
)
{
LOG_D
(
PHY
,
"[UE %d][SR %x] Frame %d subframe %d: got SR_TXOp, Checking for SR for PUSCH from MAC
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
lte_ue_pdcch_vars
[
eNB_id
]
->
crnti
,
phy_vars_ue
->
frame
,
next_slot
>>
1
);
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
lte_ue_pdcch_vars
[
eNB_id
]
->
crnti
,
phy_vars_ue
->
frame
+
(
next_slot
==
0
)
?
1
:
0
,
next_slot
>>
1
);
#ifdef OPENAIR2
SR_payload
=
mac_xface
->
ue_get_SR
(
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
CC_id
,
...
...
@@ -1045,7 +1049,7 @@ void phy_procedures_UE_TX(uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB
if
(
SR_payload
>
0
)
{
generate_ul_signal
=
1
;
LOG_D
(
PHY
,
"[UE %d][SR %x] Frame %d subframe %d got the SR for PUSCH is %d
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
lte_ue_pdcch_vars
[
eNB_id
]
->
crnti
,
phy_vars_ue
->
frame
,
next_slot
>>
1
,
SR_payload
);
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
lte_ue_pdcch_vars
[
eNB_id
]
->
crnti
,
phy_vars_ue
->
frame
+
(
next_slot
==
0
)
?
1
:
0
,
next_slot
>>
1
,
SR_payload
);
}
else
{
phy_vars_ue
->
sr
[
next_slot
>>
1
]
=
0
;
...
...
@@ -1073,12 +1077,13 @@ void phy_procedures_UE_TX(uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB
#else
phy_vars_ue
->
tx_power_dBm
=
UE_TX_POWER
;
#endif
phy_vars_ue
->
tx_total_RE
=
12
;
if
(
SR_payload
>
0
)
{
LOG_I
(
PHY
,
"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1a/1b (with SR for PUSCH), n1_pucch %d, Po_PUCCH, amp %d
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
dlsch_ue
[
eNB_id
][
0
]
->
rnti
,
phy_vars_ue
->
frame
,
next_slot
>>
1
,
phy_vars_ue
->
frame
+
(
next_slot
==
0
)
?
1
:
0
,
next_slot
>>
1
,
phy_vars_ue
->
scheduling_request_config
[
eNB_id
].
sr_PUCCH_ResourceIndex
,
Po_PUCCH
,
#ifdef EXMIMO
...
...
@@ -1142,11 +1147,12 @@ void phy_procedures_UE_TX(uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB
#else
phy_vars_ue
->
tx_power_dBm
=
UE_TX_POWER
;
#endif
phy_vars_ue
->
tx_total_RE
=
12
;
LOG_I
(
PHY
,
"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1 (SR for PUSCH), n1_pucch %d, Po_PUCCH %d
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
dlsch_ue
[
eNB_id
][
0
]
->
rnti
,
phy_vars_ue
->
frame
,
next_slot
>>
1
,
phy_vars_ue
->
frame
+
(
next_slot
==
0
)
?
1
:
0
,
next_slot
>>
1
,
phy_vars_ue
->
scheduling_request_config
[
eNB_id
].
sr_PUCCH_ResourceIndex
,
Po_PUCCH
);
...
...
@@ -1316,6 +1322,8 @@ void phy_procedures_UE_TX(uint8_t next_slot,PHY_VARS_UE *phy_vars_ue,uint8_t eNB
phy_vars_ue
->
tx_power_dBm
=
UE_TX_POWER
;
#endif
phy_vars_ue
->
tx_total_RE
=
96
;
#ifdef EXMIMO
phy_vars_ue
->
lte_ue_prach_vars
[
eNB_id
]
->
amp
=
get_tx_amp
(
phy_vars_ue
->
tx_power_dBm
,
phy_vars_ue
->
tx_power_max_dBm
);
#else
...
...
@@ -1491,10 +1499,15 @@ void lte_ue_measurement_procedures(uint8_t last_slot, uint16_t l, PHY_VARS_UE *p
// AGC
#ifdef EXMIMO
if
((
openair_daq_vars
.
rx_gain_mode
==
DAQ_AGC_ON
)
&&
(
mode
!=
rx_calib_ue
)
&&
(
mode
!=
rx_calib_ue_med
)
&&
(
mode
!=
rx_calib_ue_byp
)
)
//phy_adjust_gain (phy_vars_ue,0);
gain_control_all
(
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
eNB_id
],
0
);
#else
phy_adjust_gain
(
phy_vars_ue
,
0
);
#endif
eNB_id
=
0
;
...
...
openair1/SIMULATION/RF/dac.c
View file @
d2bf4ddc
...
...
@@ -87,17 +87,18 @@ double dac_fixed_gain(double **s_re,
uint32_t
input_offset_meas
,
uint32_t
length_meas
,
uint8_t
B
,
double
txpwr_dBm
)
{
double
txpwr_dBm
,
int
NB_RE
)
{
int
i
;
int
aa
;
double
amp
,
amp1
;
amp
=
pow
(
10
.
0
,.
05
*
txpwr_dBm
)
/
sqrt
(
nb_tx_antennas
);
//this is amp per tx antenna
amp
=
sqrt
(
NB_RE
)
*
pow
(
10
.
0
,.
05
*
txpwr_dBm
)
/
sqrt
(
nb_tx_antennas
);
//this is amp per tx antenna
amp1
=
0
;
for
(
aa
=
0
;
aa
<
nb_tx_antennas
;
aa
++
)
{
amp1
+=
sqrt
((
double
)
signal_energy
((
int32_t
*
)
&
input
[
aa
][
input_offset_meas
],
length_meas
)
*
(
512
.
0
/
300
.
0
)
);
amp1
+=
sqrt
((
double
)
signal_energy
((
int32_t
*
)
&
input
[
aa
][
input_offset_meas
],
length_meas
));
}
amp1
/=
nb_tx_antennas
;
...
...
@@ -118,11 +119,10 @@ double dac_fixed_gain(double **s_re,
for
(
aa
=
0
;
aa
<
nb_tx_antennas
;
aa
++
)
{
s_re
[
aa
][
i
]
=
amp
*
((
double
)(((
short
*
)
input
[
aa
]))[((
i
+
input_offset
)
<<
1
)])
/
amp1
;
///(1<<(B-1));
s_im
[
aa
][
i
]
=
amp
*
((
double
)(((
short
*
)
input
[
aa
]))[((
i
+
input_offset
)
<<
1
)
+
1
])
/
amp1
;
///(1<<(B-1));
}
}
// printf("ener %e\n",signal_energy_fp(s_re,s_im,nb_tx_antennas,length,0));
return
(
signal_energy_fp
(
s_re
,
s_im
,
nb_tx_antennas
,
512
,
0
));
return
(
signal_energy_fp
(
s_re
,
s_im
,
nb_tx_antennas
,
length_meas
,
0
));
}
openair1/SIMULATION/RF/defs.h
View file @
d2bf4ddc
...
...
@@ -101,4 +101,5 @@ double dac_fixed_gain(double **s_re,
unsigned
int
input_offset_meas
,
unsigned
int
length_meas
,
unsigned
char
B
,
double
gain
);
double
gain
,
int
NB_RE
);
openair1/SIMULATION/RF/rf.c
View file @
d2bf4ddc
...
...
@@ -46,7 +46,7 @@ extern int write_output(const char *,const char *,void *,int,int,char);
//double pn[1024];
//
#define DEBUG_RF 1
#define DEBUG_RF 1
//free(input_data);
void
rf_rx
(
double
**
r_re
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment