|
|
|
@ -152,34 +152,40 @@ uint32_t srsran_min_symbol_sz_rb(uint32_t nof_prb)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float srsran_symbol_distance_s(uint32_t l0, uint32_t l1, srsran_subcarrier_spacing_t scs)
|
|
|
|
|
float srsran_symbol_offset_s(uint32_t l, srsran_subcarrier_spacing_t scs)
|
|
|
|
|
{
|
|
|
|
|
// l0 must be smaller than l1
|
|
|
|
|
if (l0 >= l1) {
|
|
|
|
|
return 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Count number of symbols in between
|
|
|
|
|
uint32_t count = l1 - l0;
|
|
|
|
|
|
|
|
|
|
// Compute at what symbol there is a longer CP
|
|
|
|
|
uint32_t cp_boundary = 7U << (uint32_t)scs;
|
|
|
|
|
|
|
|
|
|
// Select whether extra CP shall be added
|
|
|
|
|
uint32_t extra_cp = 0;
|
|
|
|
|
if (l0 < cp_boundary && l1 >= cp_boundary) {
|
|
|
|
|
extra_cp = 16;
|
|
|
|
|
}
|
|
|
|
|
// First symbol CP
|
|
|
|
|
uint32_t N = 160;
|
|
|
|
|
|
|
|
|
|
// Compute reference FFT size
|
|
|
|
|
uint32_t N = (2048 + 144) * count + extra_cp;
|
|
|
|
|
// Symbols in between the first and l
|
|
|
|
|
N += (2048 + 144) * l;
|
|
|
|
|
|
|
|
|
|
// Add extra samples at the longer CP boundary
|
|
|
|
|
if (l >= cp_boundary) {
|
|
|
|
|
N += 16;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Compute time using reference sampling rate
|
|
|
|
|
float TS = SRSRAN_LTE_TS / (float)(1U << (uint32_t)scs);
|
|
|
|
|
|
|
|
|
|
// Return symbol distance in microseconds
|
|
|
|
|
// Return symbol offset in seconds
|
|
|
|
|
return (float)N * TS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float srsran_symbol_distance_s(uint32_t l0, uint32_t l1, srsran_subcarrier_spacing_t scs)
|
|
|
|
|
{
|
|
|
|
|
// l0 must be smaller than l1
|
|
|
|
|
if (l0 >= l1) {
|
|
|
|
|
return 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Return symbol distance in seconds
|
|
|
|
|
return srsran_symbol_offset_s(l1, scs) - srsran_symbol_offset_s(l0, scs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool srsran_tdd_nr_is_dl(const srsran_tdd_config_nr_t* cfg, uint32_t numerology, uint32_t slot_idx)
|
|
|
|
|
{
|
|
|
|
|
// Protect NULL pointer access
|
|
|
|
|