Commit 36fb0aae authored by Florian Kaltenberger's avatar Florian Kaltenberger
Browse files

initial synch gain control measurement when unsynchronized reverted to take measurement around PSS

parent 41e3429e
......@@ -483,13 +483,10 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
*eNB_id = sync_source;
#ifdef DEBUG_PHY
msg("[PHY][UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d\n",
LOG_D(PHY,"[UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d (%d dB)\n",sync_source,peak_pos,peak_val,dB_fixed(peak_val)/2);
#ifdef DEBUG_PHY
if (debug_cnt == 0) {
......@@ -571,12 +571,20 @@ 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
if (ret!=0) { //we are not synched, so we cannot use rssi measurement (which is based on channel estimates)
rx_power = 0;
// do a measurement on the best guess of the PSS
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],
// do a measurement on the full frame
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
rx_power += signal_energy(&phy_vars_ue->lte_ue_common_vars.rxdata[aarx][0],
// 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;
......@@ -617,7 +625,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
// exit_fun("debug exit");
return ret;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment