Commit 275e5b3a authored by Cedric Roux's avatar Cedric Roux

PHY: add parameter end_of_burst_delay for TDD

end_of_burst_delay is used to stop TX only "after a while".
If we stop right after effective signal, with USRP B210 and
B200mini, we observe a high EVM on the S subframe (on the
PSS).
A value of 400 (for 30.72MHz) solves this issue. This is
the default.

This default value can be changed in the configuration file.
For example:

RUs = (
    {
       local_rf       = "yes"
         nb_tx          = 1
         nb_rx          = 1
         att_tx         = 20
         att_rx         = 0;
         bands          = [7];
         max_pdschReferenceSignalPower = -27;
         max_rxgain                    = 105;
         eNB_instances  = [0];
         sf_extension = 312;
         end_of_burst_delay = 200;
    }
);

Here we would set a value of 200.

The value to put in the configuration file is for
30.72MHz. The value is scaled accordingly at runtime
(thus only one value to set for every RB configuration,
25, 50 or 100, leading to less problems when adapting
configuration files).

This option is for experts and should not be changed
randomly.
parent a05753df
...@@ -314,6 +314,8 @@ typedef struct RU_t_s{ ...@@ -314,6 +314,8 @@ typedef struct RU_t_s{
int N_TA_offset; int N_TA_offset;
/// SF extension used in TDD (unit: number of samples at 30.72MHz) (this is an expert option) /// SF extension used in TDD (unit: number of samples at 30.72MHz) (this is an expert option)
int sf_extension; int sf_extension;
/// "end of burst delay" used in TDD (unit: number of samples at 30.72MHz) (this is an expert option)
int end_of_burst_delay;
/// RF device descriptor /// RF device descriptor
openair0_device rfdevice; openair0_device rfdevice;
/// HW configuration /// HW configuration
......
...@@ -102,6 +102,7 @@ typedef enum { ...@@ -102,6 +102,7 @@ typedef enum {
#define CONFIG_STRING_RU_SDR_ADDRS "sdr_addrs" #define CONFIG_STRING_RU_SDR_ADDRS "sdr_addrs"
#define CONFIG_STRING_RU_SDR_CLK_SRC "clock_src" #define CONFIG_STRING_RU_SDR_CLK_SRC "clock_src"
#define CONFIG_STRING_RU_SF_EXTENSION "sf_extension" #define CONFIG_STRING_RU_SF_EXTENSION "sf_extension"
#define CONFIG_STRING_RU_END_OF_BURST_DELAY "end_of_burst_delay"
#define RU_LOCAL_IF_NAME_IDX 0 #define RU_LOCAL_IF_NAME_IDX 0
#define RU_LOCAL_ADDRESS_IDX 1 #define RU_LOCAL_ADDRESS_IDX 1
...@@ -124,6 +125,7 @@ typedef enum { ...@@ -124,6 +125,7 @@ typedef enum {
#define RU_SDR_ADDRS 18 #define RU_SDR_ADDRS 18
#define RU_SDR_CLK_SRC 19 #define RU_SDR_CLK_SRC 19
#define RU_SF_EXTENSION_IDX 20 #define RU_SF_EXTENSION_IDX 20
#define RU_END_OF_BURST_DELAY_IDX 21
...@@ -153,6 +155,7 @@ typedef enum { ...@@ -153,6 +155,7 @@ typedef enum {
{CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \ {CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \ {CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \ {CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, uptr:NULL, defuintval:400, TYPE_UINT, 0}, \
} }
/*---------------------------------------------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------------------------------------------*/
......
...@@ -825,8 +825,16 @@ void tx_rf(RU_t *ru) { ...@@ -825,8 +825,16 @@ void tx_rf(RU_t *ru) {
int siglen=fp->samples_per_tti,flags=1; int siglen=fp->samples_per_tti,flags=1;
if (SF_type == SF_S) { if (SF_type == SF_S) {
/* end_of_burst_delay is used to stop TX only "after a while".
* If we stop right after effective signal, with USRP B210 and
* B200mini, we observe a high EVM on the S subframe (on the
* PSS).
* A value of 400 (for 30.72MHz) solves this issue. This is
* the default.
*/
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0)
+ (fp->dl_symbols_in_S_subframe - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples); + (fp->dl_symbols_in_S_subframe - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples)
+ ru->end_of_burst_delay;
flags=3; // end of burst flags=3; // end of burst
} }
...@@ -1379,12 +1387,20 @@ int setup_RU_buffers(RU_t *ru) { ...@@ -1379,12 +1387,20 @@ int setup_RU_buffers(RU_t *ru) {
ru->N_TA_offset = 0; ru->N_TA_offset = 0;
if (frame_parms->N_RB_DL == 100) /* no scaling to do */; if (frame_parms->N_RB_DL == 100) /* no scaling to do */;
else if (frame_parms->N_RB_DL == 50) ru->sf_extension /= 2; else if (frame_parms->N_RB_DL == 50) {
else if (frame_parms->N_RB_DL == 25) ru->sf_extension /= 4; ru->sf_extension /= 2;
else { printf("not handled, todo\n"); exit(1); } ru->end_of_burst_delay /= 2;
} else if (frame_parms->N_RB_DL == 25) {
ru->sf_extension /= 4;
ru->end_of_burst_delay /= 4;
} else {
printf("not handled, todo\n");
exit(1);
}
} else { } else {
ru->N_TA_offset = 0; ru->N_TA_offset = 0;
ru->sf_extension = 0; ru->sf_extension = 0;
ru->end_of_burst_delay = 0;
} }
if (ru->openair0_cfg.mmapped_dma == 1) { if (ru->openair0_cfg.mmapped_dma == 1) {
...@@ -2884,6 +2900,7 @@ void RCconfig_RU(void) { ...@@ -2884,6 +2900,7 @@ void RCconfig_RU(void) {
RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt;
/* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */ /* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr); RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr);
RC.ru[j]->end_of_burst_delay = *(RUParamList.paramarray[j][RU_END_OF_BURST_DELAY_IDX].uptr);
for (i=0; i<RC.ru[j]->num_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; for (i=0; i<RC.ru[j]->num_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
} //strcmp(local_rf, "yes") == 0 } //strcmp(local_rf, "yes") == 0
......
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