@ -119,14 +119,14 @@ public:
* @ remark See TS 36.213 Section 5.1 .1
* @ remark See TS 36.213 Section 5.1 .1
* @ return accumulated TPC value { - 1 , 0 , 1 , 3 }
* @ return accumulated TPC value { - 1 , 0 , 1 , 3 }
*/
*/
uint8_t encode_pusch_tpc ( ) { return enco n de_tpc( PUSCH_CODE ) ; }
uint8_t encode_pusch_tpc ( ) { return enco de_tpc( PUSCH_CODE ) ; }
/**
/**
* Called during DCI format1 / 2 A / A encoding to set PUCCH TPC command
* Called during DCI format1 / 2 A / A encoding to set PUCCH TPC command
* @ remark See TS 36.213 Section 5.1 .2
* @ remark See TS 36.213 Section 5.1 .2
* @ return accumulated TPC value { - 1 , 0 , 1 , 3 }
* @ return accumulated TPC value { - 1 , 0 , 1 , 3 }
*/
*/
uint8_t encode_pucch_tpc ( ) { return enco n de_tpc( PUCCH_CODE ) ; }
uint8_t encode_pucch_tpc ( ) { return enco de_tpc( PUCCH_CODE ) ; }
uint32_t max_ul_prbs ( ) const { return max_prbs_cached ; }
uint32_t max_ul_prbs ( ) const { return max_prbs_cached ; }
@ -147,18 +147,14 @@ private:
return 1 ;
return 1 ;
}
}
}
}
uint8_t enco n de_tpc( uint32_t cc )
uint8_t enco de_tpc( uint32_t cc )
{
{
float target_snr_dB = cc = = PUSCH_CODE ? target_pusch_snr_dB : target_pucch_snr_dB ;
float target_snr_dB = cc = = PUSCH_CODE ? target_pusch_snr_dB : target_pucch_snr_dB ;
auto & ch_snr = snr_estim_list [ cc ] ;
auto & ch_snr = snr_estim_list [ cc ] ;
assert ( ch_snr . pending_delta = = 0 ) ; // ensure called once per {cc,tti}
assert ( ch_snr . pending_delta = = 0 ) ; // ensure called once per {cc,tti}
if ( target_snr_dB < 0 ) {
if ( target_snr_dB < 0 ) {
// undefined target SINR case. Increase Tx power once per PHR, considering the number of allocable PRBs remains
// undefined target sinr case.
// unchanged
ch_snr . pending_delta = 0 ;
if ( not ch_snr . phr_flag ) {
ch_snr . pending_delta = ( max_prbs_cached = = nof_prb ) ? 1 : ( last_phr < 0 ? - 1 : 0 ) ;
ch_snr . phr_flag = true ;
}
} else {
} else {
// target SINR is finite and there is power headroom
// target SINR is finite and there is power headroom
float diff = target_snr_dB - ch_snr . snr_avg . value ( ) ;
float diff = target_snr_dB - ch_snr . snr_avg . value ( ) ;