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
Michael Black
OpenXG-RAN
Commits
1769eca2
Commit
1769eca2
authored
Feb 04, 2016
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved gain control when not synched
parent
39e497b8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
40 deletions
+55
-40
openair1/PHY/LTE_ESTIMATION/adjust_gain.c
openair1/PHY/LTE_ESTIMATION/adjust_gain.c
+4
-11
openair1/PHY/LTE_ESTIMATION/defs.h
openair1/PHY/LTE_ESTIMATION/defs.h
+1
-0
openair1/PHY/LTE_TRANSPORT/initial_sync.c
openair1/PHY/LTE_TRANSPORT/initial_sync.c
+48
-27
openair1/SCHED/phy_procedures_lte_ue.c
openair1/SCHED/phy_procedures_lte_ue.c
+2
-2
No files found.
openair1/PHY/LTE_ESTIMATION/adjust_gain.c
View file @
1769eca2
...
...
@@ -38,23 +38,16 @@ extern int card;
#endif
void
phy_adjust_gain
(
PHY_VARS_UE
*
phy_vars_ue
,
uint8_t
eNB_id
)
phy_adjust_gain
(
PHY_VARS_UE
*
phy_vars_ue
,
uint
32_t
rx_power_fil_dB
,
uint
8_t
eNB_id
)
{
uint16_t
rx_power_fil_dB
;
#ifdef EXMIMO
exmimo_config_t
*
p_exmimo_config
=
openair0_exmimo_pci
[
card
].
exmimo_config_ptr
;
uint16_t
i
;
#endif
int
rssi
;
rssi
=
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
rssi
);
if
(
rssi
>
0
)
rx_power_fil_dB
=
rssi
;
else
rx_power_fil_dB
=
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
eNB_id
];
LOG_D
(
PHY
,
"Gain control: rssi %d (%d,%d)
\n
"
,
rssi
,
LOG_I
(
PHY
,
"Gain control: rssi %d (%d,%d)
\n
"
,
rx_power_fil_dB
,
phy_vars_ue
->
PHY_measurements
.
rssi
,
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
eNB_id
]
);
...
...
@@ -87,7 +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
;
}
LOG_
D
(
PHY
,
"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
);
LOG_
I
(
PHY
,
"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/defs.h
View file @
1769eca2
...
...
@@ -213,6 +213,7 @@ int8_t set_RSRQ_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,floa
//! Automatic gain control
void
phy_adjust_gain
(
PHY_VARS_UE
*
phy_vars_ue
,
uint32_t
rx_power_fil_dB
,
unsigned
char
eNB_id
);
int
lte_ul_channel_estimation
(
PHY_VARS_eNB
*
phy_vars_eNB
,
...
...
openair1/PHY/LTE_TRANSPORT/initial_sync.c
View file @
1769eca2
...
...
@@ -280,7 +280,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
uint8_t
flip_fdd_ncp
,
flip_fdd_ecp
,
flip_tdd_ncp
,
flip_tdd_ecp
;
// uint16_t Nid_cell_fdd_ncp=0,Nid_cell_fdd_ecp=0,Nid_cell_tdd_ncp=0,Nid_cell_tdd_ecp=0;
LTE_DL_FRAME_PARMS
*
frame_parms
=
&
phy_vars_ue
->
lte_frame_parms
;
int
i
;
int
ret
=-
1
;
int
aarx
,
rx_power
=
0
;
/*#ifdef OAI_USRP
...
...
@@ -316,32 +315,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
LOG_I
(
PHY
,
"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d
\n
"
,
phy_vars_ue
->
Mod_id
,
sync_pos
,
phy_vars_ue
->
lte_ue_common_vars
.
eNb_id
);
#endif
for
(
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
rx_power
+=
signal_energy
(
&
phy_vars_ue
->
lte_ue_common_vars
.
rxdata
[
aarx
][
sync_pos2
],
frame_parms
->
ofdm_symbol_size
+
frame_parms
->
nb_prefix_samples
);
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
0
]
=
dB_fixed
(
rx_power
/
frame_parms
->
nb_antennas_rx
);
#ifdef DEBUG_INITIAL_SYNCH
LOG_I
(
PHY
,
"[UE%d] Initial sync : Estimated power: %d dB
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
0
]
);
#endif
#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
[
0
],
0
);
#else
#ifndef OAI_USRP
#ifndef OAI_BLADERF
phy_adjust_gain
(
phy_vars_ue
,
0
);
#endif
#endif
#endif
// SSS detection
// PSS is hypothesized in last symbol of first slot in Frame
...
...
@@ -597,6 +570,54 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
}
// gain control
if
(
ret
!=
0
)
{
//we are not synched, so do a measurement on the full frame
rx_power
=
0
;
for
(
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
rx_power
+=
signal_energy
(
&
phy_vars_ue
->
lte_ue_common_vars
.
rxdata
[
aarx
][
0
],
frame_parms
->
samples_per_tti
*
10
);
// we might add a low-pass filter here later
phy_vars_ue
->
PHY_measurements
.
rx_power_avg
[
0
]
=
rx_power
/
frame_parms
->
nb_antennas_rx
;
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
0
]
=
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
rx_power_avg
[
0
]);
#ifdef DEBUG_INITIAL_SYNCH
LOG_I
(
PHY
,
"[UE%d] Initial sync : Estimated power: %d dB
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
0
]
);
#endif
#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
[
0
],
0
);
#else
#ifndef OAI_USRP
#ifndef OAI_BLADERF
phy_adjust_gain
(
phy_vars_ue
,
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
0
],
0
);
#endif
#endif
#endif
}
else
{
#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
(
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
rssi
),
0
);
#else
#ifndef OAI_USRP
#ifndef OAI_BLADERF
phy_adjust_gain
(
phy_vars_ue
,
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
rssi
),
0
);
#endif
#endif
#endif
}
// exit_fun("debug exit");
return
ret
;
}
...
...
openair1/SCHED/phy_procedures_lte_ue.c
View file @
1769eca2
...
...
@@ -1549,12 +1549,12 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t
if
((
openair_daq_vars
.
rx_gain_mode
==
DAQ_AGC_ON
)
&&
(
mode
!=
rx_calib_ue
)
&&
(
mode
!=
rx_calib_ue_med
)
&&
(
mode
!=
rx_calib_ue_byp
)
)
if
(
phy_vars_ue
->
frame_rx
%
100
==
0
)
gain_control_all
(
phy_vars_ue
->
PHY_measurements
.
rx_power_avg_dB
[
eNB_id
]
,
0
);
gain_control_all
(
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
rssi
)
,
0
);
#else
#ifndef OAI_USRP
#ifndef OAI_BLADERF
phy_adjust_gain
(
phy_vars_ue
,
0
);
phy_adjust_gain
(
phy_vars_ue
,
dB_fixed
(
phy_vars_ue
->
PHY_measurements
.
rssi
),
0
);
#endif
#endif
#endif
...
...
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