Commit ae8319db authored by Sakthivel Velumani's avatar Sakthivel Velumani Committed by Jaroslava Fiedlerova

phy: add warning when choosing higher 3/4 sampling

parent 1e861ac0
......@@ -874,6 +874,7 @@ void get_samplerate_and_bw(int mu,
switch(n_rb) {
case 270:
if (threequarter_fs) {
warn_higher_threequarter_fs(n_rb, mu);
*sample_rate=92.16e6;
*samples_per_frame = 921600;
*tx_bw = 50e6;
......@@ -973,6 +974,7 @@ void get_samplerate_and_bw(int mu,
case 273:
if (threequarter_fs) {
warn_higher_threequarter_fs(n_rb, mu);
*sample_rate=184.32e6;
*samples_per_frame = 1843200;
*tx_bw = 100e6;
......
......@@ -37,6 +37,7 @@
#include <stdlib.h>
#include "assertions.h"
#include "common/utils/utils.h"
#include "common/utils/LOG/log.h"
#define MAX_SI_GROUPS 3
#define NR_MAX_PDSCH_TBS 3824
......@@ -272,6 +273,19 @@ static __attribute__((always_inline)) inline int count_bits64_with_mask(uint64_t
return count_bits64(v & mask);
}
static inline void warn_higher_threequarter_fs(const int n_rb, const int mu)
{
LOG_W(PHY,
"3/4 sampling is not possible for current PRB size: %d and numerology: %d.\n "
"So 6/4 sampling is chosen to support x3xx type USRPs.\n "
"Note that this sampling rate increases fronthaul traffic, FFT buffer size and processing time by a factor of two compared "
"to 3/4 sampling rate.\n "
"Some PRACH configuration might not be supported with 6/4 FFT size.\n "
"Consider reducing the PRB size that would fit within the FFT size of 3/4 sampling\n",
n_rb,
mu);
}
uint64_t reverse_bits(uint64_t in, int n_bits);
void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out);
......
......@@ -199,14 +199,26 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL)
AssertFatal(1==0,"Invalid numerology index %d", mu);
}
if(fp->threequarter_fs)
fp->ofdm_symbol_size = 3 * 128;
else
fp->ofdm_symbol_size = 4 * 128;
// Start with FFT size 512
fp->ofdm_symbol_size = 512;
while(fp->ofdm_symbol_size < N_RB_DL * 12)
// Choose the right FFT size for the BW
while(fp->ofdm_symbol_size < N_RB_DL * NR_NB_SC_PER_RB)
fp->ofdm_symbol_size <<= 1;
// Do 3/4 sampling
if (fp->threequarter_fs) {
const uint16_t threeq_fft_size = fp->ofdm_symbol_size * 3 / 4;
if (threeq_fft_size < (N_RB_DL * NR_NB_SC_PER_RB)) {
// 3/4 sampling FFT size not enough
warn_higher_threequarter_fs(N_RB_DL, fp->numerology_index);
// Choose 2 times 3/4 sampling
fp->ofdm_symbol_size = threeq_fft_size << 1;
} else {
fp->ofdm_symbol_size = threeq_fft_size;
}
}
fp->first_carrier_offset = fp->ofdm_symbol_size - (N_RB_DL * 12 / 2);
fp->nb_prefix_samples = fp->ofdm_symbol_size / 128 * 9;
fp->nb_prefix_samples0 = fp->ofdm_symbol_size / 128 * (9 + (1 << mu));
......
Markdown is supported
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