Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
6e2a8385
Commit
6e2a8385
authored
Aug 04, 2022
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common function to get sample rate and BW
parent
7f910a2e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
280 additions
and
338 deletions
+280
-338
common/utils/nr/nr_common.c
common/utils/nr/nr_common.c
+230
-0
common/utils/nr/nr_common.h
common/utils/nr/nr_common.h
+7
-0
executables/nr-ru.c
executables/nr-ru.c
+8
-220
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+10
-43
openair1/SIMULATION/NR_PHY/pucchsim.c
openair1/SIMULATION/NR_PHY/pucchsim.c
+13
-42
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+12
-33
No files found.
common/utils/nr/nr_common.c
View file @
6e2a8385
...
@@ -472,6 +472,236 @@ int get_subband_size(int NPRB,int size) {
...
@@ -472,6 +472,236 @@ int get_subband_size(int NPRB,int size) {
}
}
void
get_samplerate_and_bw
(
int
mu
,
int
n_rb
,
int8_t
threequarter_fs
,
double
*
sample_rate
,
unsigned
int
*
samples_per_frame
,
double
*
tx_bw
,
double
*
rx_bw
)
{
if
(
mu
==
0
)
{
switch
(
n_rb
)
{
case
270
:
if
(
threequarter_fs
)
{
*
sample_rate
=
92.16e6
;
*
samples_per_frame
=
921600
;
*
tx_bw
=
50e6
;
*
rx_bw
=
50e6
;
}
else
{
*
sample_rate
=
61.44e6
;
*
samples_per_frame
=
614400
;
*
tx_bw
=
50e6
;
*
rx_bw
=
50e6
;
}
case
216
:
if
(
threequarter_fs
)
{
*
sample_rate
=
46.08e6
;
*
samples_per_frame
=
460800
;
*
tx_bw
=
40e6
;
*
rx_bw
=
40e6
;
}
else
{
*
sample_rate
=
61.44e6
;
*
samples_per_frame
=
614400
;
*
tx_bw
=
40e6
;
*
rx_bw
=
40e6
;
}
break
;
case
160
:
//30 MHz
case
133
:
//25 MHz
if
(
threequarter_fs
)
{
AssertFatal
(
1
==
0
,
"N_RB %d cannot use 3/4 sampling
\n
"
,
n_rb
);
}
else
{
*
sample_rate
=
30.72e6
;
*
samples_per_frame
=
307200
;
*
tx_bw
=
20e6
;
*
rx_bw
=
20e6
;
}
case
106
:
if
(
threequarter_fs
)
{
*
sample_rate
=
23.04e6
;
*
samples_per_frame
=
230400
;
*
tx_bw
=
20e6
;
*
rx_bw
=
20e6
;
}
else
{
*
sample_rate
=
30.72e6
;
*
samples_per_frame
=
307200
;
*
tx_bw
=
20e6
;
*
rx_bw
=
20e6
;
}
break
;
case
52
:
if
(
threequarter_fs
)
{
*
sample_rate
=
11.52e6
;
*
samples_per_frame
=
115200
;
*
tx_bw
=
10e6
;
*
rx_bw
=
10e6
;
}
else
{
*
sample_rate
=
15.36e6
;
*
samples_per_frame
=
153600
;
*
tx_bw
=
10e6
;
*
rx_bw
=
10e6
;
}
case
25
:
if
(
threequarter_fs
)
{
*
sample_rate
=
5.76e6
;
*
samples_per_frame
=
57600
;
*
tx_bw
=
5e6
;
*
rx_bw
=
5e6
;
}
else
{
*
sample_rate
=
7.68e6
;
*
samples_per_frame
=
76800
;
*
tx_bw
=
5e6
;
*
rx_bw
=
5e6
;
}
break
;
default:
AssertFatal
(
0
==
1
,
"N_RB %d not yet supported for numerology %d
\n
"
,
n_rb
,
mu
);
}
}
else
if
(
mu
==
1
)
{
switch
(
n_rb
)
{
case
273
:
if
(
threequarter_fs
)
{
*
sample_rate
=
184.32e6
;
*
samples_per_frame
=
1843200
;
*
tx_bw
=
100e6
;
*
rx_bw
=
100e6
;
}
else
{
*
sample_rate
=
122.88e6
;
*
samples_per_frame
=
1228800
;
*
tx_bw
=
100e6
;
*
rx_bw
=
100e6
;
}
break
;
case
217
:
if
(
threequarter_fs
)
{
*
sample_rate
=
92.16e6
;
*
samples_per_frame
=
921600
;
*
tx_bw
=
80e6
;
*
rx_bw
=
80e6
;
}
else
{
*
sample_rate
=
122.88e6
;
*
samples_per_frame
=
1228800
;
*
tx_bw
=
80e6
;
*
rx_bw
=
80e6
;
}
break
;
case
162
:
if
(
threequarter_fs
)
{
AssertFatal
(
1
==
0
,
"N_RB %d cannot use 3/4 sampling
\n
"
,
n_rb
);
}
else
{
*
sample_rate
=
61.44e6
;
*
samples_per_frame
=
614400
;
*
tx_bw
=
60e6
;
*
rx_bw
=
60e6
;
}
break
;
case
133
:
if
(
threequarter_fs
)
{
AssertFatal
(
1
==
0
,
"N_RB %d cannot use 3/4 sampling
\n
"
,
n_rb
);
}
else
{
*
sample_rate
=
61.44e6
;
*
samples_per_frame
=
614400
;
*
tx_bw
=
50e6
;
*
rx_bw
=
50e6
;
}
break
;
case
106
:
if
(
threequarter_fs
)
{
*
sample_rate
=
46.08e6
;
*
samples_per_frame
=
460800
;
*
tx_bw
=
40e6
;
*
rx_bw
=
40e6
;
}
else
{
*
sample_rate
=
61.44e6
;
*
samples_per_frame
=
614400
;
*
tx_bw
=
40e6
;
*
rx_bw
=
40e6
;
}
break
;
case
51
:
if
(
threequarter_fs
)
{
*
sample_rate
=
23.04e6
;
*
samples_per_frame
=
230400
;
*
tx_bw
=
20e6
;
*
rx_bw
=
20e6
;
}
else
{
*
sample_rate
=
30.72e6
;
*
samples_per_frame
=
307200
;
*
tx_bw
=
20e6
;
*
rx_bw
=
20e6
;
}
break
;
case
24
:
if
(
threequarter_fs
)
{
*
sample_rate
=
11.52e6
;
*
samples_per_frame
=
115200
;
*
tx_bw
=
10e6
;
*
rx_bw
=
10e6
;
}
else
{
*
sample_rate
=
15.36e6
;
*
samples_per_frame
=
153600
;
*
tx_bw
=
10e6
;
*
rx_bw
=
10e6
;
}
break
;
default:
AssertFatal
(
0
==
1
,
"N_RB %d not yet supported for numerology %d
\n
"
,
n_rb
,
mu
);
}
}
else
if
(
mu
==
3
)
{
switch
(
n_rb
)
{
case
66
:
if
(
threequarter_fs
)
{
*
sample_rate
=
184.32e6
;
*
samples_per_frame
=
1843200
;
*
tx_bw
=
100e6
;
*
rx_bw
=
100e6
;
}
else
{
*
sample_rate
=
122.88e6
;
*
samples_per_frame
=
1228800
;
*
tx_bw
=
100e6
;
*
rx_bw
=
100e6
;
}
break
;
case
32
:
if
(
threequarter_fs
)
{
*
sample_rate
=
92.16e6
;
*
samples_per_frame
=
921600
;
*
tx_bw
=
50e6
;
*
rx_bw
=
50e6
;
}
else
{
*
sample_rate
=
61.44e6
;
*
samples_per_frame
=
614400
;
*
tx_bw
=
50e6
;
*
rx_bw
=
50e6
;
}
break
;
default:
AssertFatal
(
0
==
1
,
"N_RB %d not yet supported for numerology %d
\n
"
,
n_rb
,
mu
);
}
}
else
{
AssertFatal
(
0
==
1
,
"Numerology %d not supported for the moment
\n
"
,
mu
);
}
}
// from start symbol index and nb or symbols to symbol occupation bitmap in a slot
// from start symbol index and nb or symbols to symbol occupation bitmap in a slot
uint16_t
SL_to_bitmap
(
int
startSymbolIndex
,
int
nrOfSymbols
)
{
uint16_t
SL_to_bitmap
(
int
startSymbolIndex
,
int
nrOfSymbols
)
{
return
((
1
<<
nrOfSymbols
)
-
1
)
<<
startSymbolIndex
;
return
((
1
<<
nrOfSymbols
)
-
1
)
<<
startSymbolIndex
;
...
...
common/utils/nr/nr_common.h
View file @
6e2a8385
...
@@ -76,6 +76,13 @@ uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols);
...
@@ -76,6 +76,13 @@ uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols);
int
get_nb_periods_per_frame
(
uint8_t
tdd_period
);
int
get_nb_periods_per_frame
(
uint8_t
tdd_period
);
int
get_supported_band_index
(
int
scs
,
int
band
,
int
n_rbs
);
int
get_supported_band_index
(
int
scs
,
int
band
,
int
n_rbs
);
long
rrc_get_max_nr_csrs
(
uint8_t
max_rbs
,
long
b_SRS
);
long
rrc_get_max_nr_csrs
(
uint8_t
max_rbs
,
long
b_SRS
);
void
get_samplerate_and_bw
(
int
mu
,
int
n_rb
,
int8_t
threequarter_fs
,
double
*
sample_rate
,
unsigned
int
*
samples_per_frame
,
double
*
tx_bw
,
double
*
rx_bw
);
#define CEILIDIV(a,b) ((a+b-1)/b)
#define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
...
...
executables/nr-ru.c
View file @
6e2a8385
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
#include "common/utils/nr/nr_common.h"
#include "common/utils/assertions.h"
#include "common/utils/assertions.h"
#include "common/utils/system.h"
#include "common/utils/system.h"
#include "common/ran_context.h"
#include "common/ran_context.h"
...
@@ -809,226 +810,13 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
...
@@ -809,226 +810,13 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
int
mu
=
config
->
ssb_config
.
scs_common
.
value
;
int
mu
=
config
->
ssb_config
.
scs_common
.
value
;
int
N_RB
=
config
->
carrier_config
.
dl_grid_size
[
config
->
ssb_config
.
scs_common
.
value
].
value
;
int
N_RB
=
config
->
carrier_config
.
dl_grid_size
[
config
->
ssb_config
.
scs_common
.
value
].
value
;
if
(
mu
==
NR_MU_0
)
{
get_samplerate_and_bw
(
mu
,
switch
(
N_RB
)
{
N_RB
,
case
270
:
fp
->
threequarter_fs
,
if
(
fp
->
threequarter_fs
)
{
&
cfg
->
sample_rate
,
cfg
->
sample_rate
=
92.16e6
;
&
cfg
->
samples_per_frame
,
cfg
->
samples_per_frame
=
921600
;
&
cfg
->
tx_bw
,
cfg
->
tx_bw
=
50e6
;
&
cfg
->
rx_bw
);
cfg
->
rx_bw
=
50e6
;
}
else
{
cfg
->
sample_rate
=
61.44e6
;
cfg
->
samples_per_frame
=
614400
;
cfg
->
tx_bw
=
50e6
;
cfg
->
rx_bw
=
50e6
;
}
case
216
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
46.08e6
;
cfg
->
samples_per_frame
=
460800
;
cfg
->
tx_bw
=
40e6
;
cfg
->
rx_bw
=
40e6
;
}
else
{
cfg
->
sample_rate
=
61.44e6
;
cfg
->
samples_per_frame
=
614400
;
cfg
->
tx_bw
=
40e6
;
cfg
->
rx_bw
=
40e6
;
}
break
;
case
160
:
//30 MHz
case
133
:
//25 MHz
if
(
fp
->
threequarter_fs
)
{
AssertFatal
(
1
==
0
,
"N_RB %d cannot use 3/4 sampling
\n
"
,
N_RB
);
}
else
{
cfg
->
sample_rate
=
30.72e6
;
cfg
->
samples_per_frame
=
307200
;
cfg
->
tx_bw
=
20e6
;
cfg
->
rx_bw
=
20e6
;
}
case
106
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
23.04e6
;
cfg
->
samples_per_frame
=
230400
;
cfg
->
tx_bw
=
20e6
;
cfg
->
rx_bw
=
20e6
;
}
else
{
cfg
->
sample_rate
=
30.72e6
;
cfg
->
samples_per_frame
=
307200
;
cfg
->
tx_bw
=
20e6
;
cfg
->
rx_bw
=
20e6
;
}
break
;
case
52
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
11.52e6
;
cfg
->
samples_per_frame
=
115200
;
cfg
->
tx_bw
=
10e6
;
cfg
->
rx_bw
=
10e6
;
}
else
{
cfg
->
sample_rate
=
15.36e6
;
cfg
->
samples_per_frame
=
153600
;
cfg
->
tx_bw
=
10e6
;
cfg
->
rx_bw
=
10e6
;
}
case
25
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
5.76e6
;
cfg
->
samples_per_frame
=
57600
;
cfg
->
tx_bw
=
5e6
;
cfg
->
rx_bw
=
5e6
;
}
else
{
cfg
->
sample_rate
=
7.68e6
;
cfg
->
samples_per_frame
=
76800
;
cfg
->
tx_bw
=
5e6
;
cfg
->
rx_bw
=
5e6
;
}
break
;
default:
AssertFatal
(
0
==
1
,
"N_RB %d not yet supported for numerology %d
\n
"
,
N_RB
,
mu
);
}
}
else
if
(
mu
==
NR_MU_1
)
{
switch
(
N_RB
)
{
case
273
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
184.32e6
;
cfg
->
samples_per_frame
=
1843200
;
cfg
->
tx_bw
=
100e6
;
cfg
->
rx_bw
=
100e6
;
}
else
{
cfg
->
sample_rate
=
122.88e6
;
cfg
->
samples_per_frame
=
1228800
;
cfg
->
tx_bw
=
100e6
;
cfg
->
rx_bw
=
100e6
;
}
break
;
case
217
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
92.16e6
;
cfg
->
samples_per_frame
=
921600
;
cfg
->
tx_bw
=
80e6
;
cfg
->
rx_bw
=
80e6
;
}
else
{
cfg
->
sample_rate
=
122.88e6
;
cfg
->
samples_per_frame
=
1228800
;
cfg
->
tx_bw
=
80e6
;
cfg
->
rx_bw
=
80e6
;
}
break
;
case
162
:
if
(
fp
->
threequarter_fs
)
{
AssertFatal
(
1
==
0
,
"N_RB %d cannot use 3/4 sampling
\n
"
,
N_RB
);
}
else
{
cfg
->
sample_rate
=
61.44e6
;
cfg
->
samples_per_frame
=
614400
;
cfg
->
tx_bw
=
60e6
;
cfg
->
rx_bw
=
60e6
;
}
break
;
case
133
:
if
(
fp
->
threequarter_fs
)
{
AssertFatal
(
1
==
0
,
"N_RB %d cannot use 3/4 sampling
\n
"
,
N_RB
);
}
else
{
cfg
->
sample_rate
=
61.44e6
;
cfg
->
samples_per_frame
=
614400
;
cfg
->
tx_bw
=
50e6
;
cfg
->
rx_bw
=
50e6
;
}
break
;
case
106
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
46.08e6
;
cfg
->
samples_per_frame
=
460800
;
cfg
->
tx_bw
=
40e6
;
cfg
->
rx_bw
=
40e6
;
}
else
{
cfg
->
sample_rate
=
61.44e6
;
cfg
->
samples_per_frame
=
614400
;
cfg
->
tx_bw
=
40e6
;
cfg
->
rx_bw
=
40e6
;
}
break
;
case
51
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
23.04e6
;
cfg
->
samples_per_frame
=
230400
;
cfg
->
tx_bw
=
20e6
;
cfg
->
rx_bw
=
20e6
;
}
else
{
cfg
->
sample_rate
=
30.72e6
;
cfg
->
samples_per_frame
=
307200
;
cfg
->
tx_bw
=
20e6
;
cfg
->
rx_bw
=
20e6
;
}
break
;
case
24
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
11.52e6
;
cfg
->
samples_per_frame
=
115200
;
cfg
->
tx_bw
=
10e6
;
cfg
->
rx_bw
=
10e6
;
}
else
{
cfg
->
sample_rate
=
15.36e6
;
cfg
->
samples_per_frame
=
153600
;
cfg
->
tx_bw
=
10e6
;
cfg
->
rx_bw
=
10e6
;
}
break
;
default:
AssertFatal
(
0
==
1
,
"N_RB %d not yet supported for numerology %d
\n
"
,
N_RB
,
mu
);
}
}
else
if
(
mu
==
NR_MU_3
)
{
switch
(
N_RB
)
{
case
66
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
184.32e6
;
cfg
->
samples_per_frame
=
1843200
;
cfg
->
tx_bw
=
100e6
;
cfg
->
rx_bw
=
100e6
;
}
else
{
cfg
->
sample_rate
=
122.88e6
;
cfg
->
samples_per_frame
=
1228800
;
cfg
->
tx_bw
=
100e6
;
cfg
->
rx_bw
=
100e6
;
}
break
;
case
32
:
if
(
fp
->
threequarter_fs
)
{
cfg
->
sample_rate
=
92.16e6
;
cfg
->
samples_per_frame
=
921600
;
cfg
->
tx_bw
=
50e6
;
cfg
->
rx_bw
=
50e6
;
}
else
{
cfg
->
sample_rate
=
61.44e6
;
cfg
->
samples_per_frame
=
614400
;
cfg
->
tx_bw
=
50e6
;
cfg
->
rx_bw
=
50e6
;
}
break
;
default:
AssertFatal
(
0
==
1
,
"N_RB %d not yet supported for numerology %d
\n
"
,
N_RB
,
mu
);
}
}
else
{
AssertFatal
(
0
==
1
,
"Numerology %d not supported for the moment
\n
"
,
mu
);
}
if
(
config
->
cell_config
.
frame_duplex_type
.
value
==
TDD
)
if
(
config
->
cell_config
.
frame_duplex_type
.
value
==
TDD
)
cfg
->
duplex_mode
=
duplex_mode_TDD
;
cfg
->
duplex_mode
=
duplex_mode_TDD
;
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
6e2a8385
...
@@ -887,55 +887,22 @@ int main(int argc, char **argv)
...
@@ -887,55 +887,22 @@ int main(int argc, char **argv)
if
(
g_rbStart
<
0
)
g_rbStart
=
0
;
if
(
g_rbStart
<
0
)
g_rbStart
=
0
;
if
(
g_rbSize
<
0
)
g_rbSize
=
N_RB_DL
-
g_rbStart
;
if
(
g_rbSize
<
0
)
g_rbSize
=
N_RB_DL
-
g_rbStart
;
double
fs
,
bw
;
double
fs
,
txbw
,
rxbw
;
uint32_t
samples
;
if
(
mu
==
0
&&
N_RB_DL
==
25
)
{
get_samplerate_and_bw
(
mu
,
fs
=
7.68e6
;
N_RB_DL
,
bw
=
5e6
;
frame_parms
->
threequarter_fs
,
}
&
fs
,
else
if
(
mu
==
1
&&
N_RB_DL
==
217
)
{
&
samples
,
fs
=
122.88e6
;
&
txbw
,
bw
=
80e6
;
&
rxbw
);
}
else
if
(
mu
==
1
&&
N_RB_DL
==
245
)
{
fs
=
122.88e6
;
bw
=
90e6
;
}
else
if
(
mu
==
1
&&
N_RB_DL
==
273
)
{
fs
=
122.88e6
;
bw
=
100e6
;
}
else
if
(
mu
==
1
&&
N_RB_DL
==
106
)
{
fs
=
61.44e6
;
bw
=
40e6
;
}
else
if
(
mu
==
1
&&
N_RB_DL
==
133
)
{
fs
=
61.44e6
;
bw
=
50e6
;
}
else
if
(
mu
==
1
&&
N_RB_DL
==
162
)
{
fs
=
61.44e6
;
bw
=
60e6
;
}
else
if
(
mu
==
1
&&
N_RB_DL
==
24
)
{
fs
=
15.36e6
;
bw
=
10e6
;
}
else
if
(
mu
==
3
&&
N_RB_DL
==
66
)
{
fs
=
122.88e6
;
bw
=
100e6
;
}
else
if
(
mu
==
3
&&
N_RB_DL
==
32
)
{
fs
=
61.44e6
;
bw
=
50e6
;
}
else
AssertFatal
(
1
==
0
,
"Unsupported numerology for mu %d, N_RB %d
\n
"
,
mu
,
N_RB_DL
);
gNB2UE
=
new_channel_desc_scm
(
n_tx
,
gNB2UE
=
new_channel_desc_scm
(
n_tx
,
n_rx
,
n_rx
,
channel_model
,
channel_model
,
fs
/
1e6
,
//sampling frequency in MHz
fs
/
1e6
,
//sampling frequency in MHz
bw
,
tx
bw
,
30e-9
,
30e-9
,
0
,
0
,
0
,
0
,
...
...
openair1/SIMULATION/NR_PHY/pucchsim.c
View file @
6e2a8385
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include <sys/mman.h>
#include <sys/mman.h>
#include "common/config/config_userapi.h"
#include "common/config/config_userapi.h"
#include "common/utils/load_module_shlib.h"
#include "common/utils/load_module_shlib.h"
#include "common/utils/nr/nr_common.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
#include "common/ran_context.h"
#include "PHY/types.h"
#include "PHY/types.h"
...
@@ -390,45 +391,18 @@ int main(int argc, char **argv)
...
@@ -390,45 +391,18 @@ int main(int argc, char **argv)
nr_phy_config_request_sim
(
gNB
,
N_RB_DL
,
N_RB_DL
,
mu
,
Nid_cell
,
SSB_positions
);
nr_phy_config_request_sim
(
gNB
,
N_RB_DL
,
N_RB_DL
,
mu
,
Nid_cell
,
SSB_positions
);
phy_init_nr_gNB
(
gNB
,
0
,
0
);
phy_init_nr_gNB
(
gNB
,
0
,
0
);
double
fs
,
bw
,
scs
,
eps
;
double
fs
,
txbw
,
rxbw
;
uint32_t
samples
;
if
(
mu
==
1
&&
N_RB_DL
==
217
)
{
fs
=
122.88e6
;
get_samplerate_and_bw
(
mu
,
bw
=
80e6
;
N_RB_DL
,
scs
=
30000
;
frame_parms
->
threequarter_fs
,
}
&
fs
,
else
if
(
mu
==
1
&&
N_RB_DL
==
245
)
{
&
samples
,
fs
=
122.88e6
;
&
txbw
,
bw
=
90e6
;
&
rxbw
);
scs
=
30000
;
}
else
if
(
mu
==
1
&&
N_RB_DL
==
273
)
{
fs
=
122.88e6
;
bw
=
100e6
;
scs
=
30000
;
}
else
if
(
mu
==
1
&&
N_RB_DL
==
106
)
{
fs
=
61.44e6
;
bw
=
40e6
;
scs
=
30000
;
}
else
AssertFatal
(
1
==
0
,
"Unsupported numerology for mu %d, N_RB %d
\n
"
,
mu
,
N_RB_DL
);
// cfo with respect to sub-carrier spacing
eps
=
cfo
/
scs
;
// computation of integer and fractional FO to compare with estimation results
int
IFO
;
if
(
eps
!=
0
.
0
){
printf
(
"Introducing a CFO of %lf relative to SCS of %d kHz
\n
"
,
eps
,(
int
)(
scs
/
1000
));
if
(
eps
>
0
)
IFO
=
(
int
)(
eps
+
0
.
5
);
else
IFO
=
(
int
)(
eps
-
0
.
5
);
printf
(
"FFO = %lf; IFO = %d
\n
"
,
eps
-
IFO
,
IFO
);
}
UE2gNB
=
new_channel_desc_scm
(
n_tx
,
n_rx
,
channel_model
,
fs
,
bw
,
DS_TDL
,
0
,
0
,
0
,
0
);
UE2gNB
=
new_channel_desc_scm
(
n_tx
,
n_rx
,
channel_model
,
fs
,
tx
bw
,
DS_TDL
,
0
,
0
,
0
,
0
);
if
(
UE2gNB
==
NULL
)
{
if
(
UE2gNB
==
NULL
)
{
printf
(
"Problem generating channel model. Exiting.
\n
"
);
printf
(
"Problem generating channel model. Exiting.
\n
"
);
...
@@ -477,9 +451,6 @@ int main(int argc, char **argv)
...
@@ -477,9 +451,6 @@ int main(int argc, char **argv)
memcpy
(
&
UE
->
frame_parms
,
frame_parms
,
sizeof
(
NR_DL_FRAME_PARMS
));
memcpy
(
&
UE
->
frame_parms
,
frame_parms
,
sizeof
(
NR_DL_FRAME_PARMS
));
UE
->
frame_parms
.
nb_antennas_rx
=
1
;
UE
->
frame_parms
.
nb_antennas_rx
=
1
;
if
(
eps
!=
0
.
0
)
UE
->
UE_fo_compensation
=
1
;
// if a frequency offset is set then perform fo estimation and compensation
if
(
init_nr_ue_signal
(
UE
,
1
)
!=
0
)
if
(
init_nr_ue_signal
(
UE
,
1
)
!=
0
)
{
{
printf
(
"Error at UE NR initialisation
\n
"
);
printf
(
"Error at UE NR initialisation
\n
"
);
...
@@ -568,7 +539,7 @@ int main(int argc, char **argv)
...
@@ -568,7 +539,7 @@ int main(int argc, char **argv)
}
}
random_channel
(
UE2gNB
,
0
);
random_channel
(
UE2gNB
,
0
);
freq_channel
(
UE2gNB
,
N_RB_DL
,
2
*
N_RB_DL
+
1
,
scs
/
1000
);
freq_channel
(
UE2gNB
,
N_RB_DL
,
2
*
N_RB_DL
+
1
,
15
<<
mu
);
for
(
int
symb
=
0
;
symb
<
nrofSymbols
;
symb
++
)
{
for
(
int
symb
=
0
;
symb
<
nrofSymbols
;
symb
++
)
{
int
i0
=
(
startingSymbolIndex
+
symb
)
*
gNB
->
frame_parms
.
ofdm_symbol_size
;
int
i0
=
(
startingSymbolIndex
+
symb
)
*
gNB
->
frame_parms
.
ofdm_symbol_size
;
for
(
int
re
=
0
;
re
<
N_RB_DL
*
12
;
re
++
)
{
for
(
int
re
=
0
;
re
<
N_RB_DL
*
12
;
re
++
)
{
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
6e2a8385
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "common/ran_context.h"
#include "common/ran_context.h"
#include "common/config/config_userapi.h"
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/log.h"
#include "common/utils/nr/nr_common.h"
#include "PHY/defs_gNB.h"
#include "PHY/defs_gNB.h"
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/defs_nr_UE.h"
...
@@ -668,45 +669,23 @@ int main(int argc, char **argv)
...
@@ -668,45 +669,23 @@ int main(int argc, char **argv)
if
(
snr1set
==
0
)
if
(
snr1set
==
0
)
snr1
=
snr0
+
10
;
snr1
=
snr0
+
10
;
double
sampling_frequency
;
double
bandwidth
;
if
(
mu
==
0
&&
N_RB_UL
==
25
)
{
double
sampling_frequency
,
tx_bandwidth
,
rx_bandwidth
;
sampling_frequency
=
7
.
68
;
uint32_t
samples
;
bandwidth
=
5
;
get_samplerate_and_bw
(
mu
,
}
N_RB_DL
,
else
if
(
mu
==
1
&&
N_RB_UL
==
273
)
{
openair0_cfg
[
0
].
threequarter_fs
,
sampling_frequency
=
122
.
88
;
&
sampling_frequency
,
bandwidth
=
100
;
&
samples
,
}
&
tx_bandwidth
,
else
if
(
mu
==
1
&&
N_RB_UL
==
217
)
{
&
rx_bandwidth
);
sampling_frequency
=
122
.
88
;
bandwidth
=
80
;
}
else
if
(
mu
==
1
&&
N_RB_UL
==
106
)
{
sampling_frequency
=
61
.
44
;
bandwidth
=
40
;
}
else
if
(
mu
==
1
&&
N_RB_UL
==
24
)
{
sampling_frequency
=
15
.
36
;
bandwidth
=
10
;
}
else
if
(
mu
==
3
&&
N_RB_UL
==
32
)
{
sampling_frequency
=
61
.
44
;
bandwidth
=
50
;
}
else
{
printf
(
"Add N_RB_UL %d
\n
"
,
N_RB_UL
);
exit
(
-
1
);
}
LOG_I
(
PHY
,
"++++++++++++++++++++++++++++++++++++++++++++++%i+++++++++++++++++++++++++++++++++++++++++"
,
loglvl
);
LOG_I
(
PHY
,
"++++++++++++++++++++++++++++++++++++++++++++++%i+++++++++++++++++++++++++++++++++++++++++"
,
loglvl
);
if
(
openair0_cfg
[
0
].
threequarter_fs
==
1
)
sampling_frequency
*=
.
75
;
UE2gNB
=
new_channel_desc_scm
(
n_tx
,
n_rx
,
channel_model
,
UE2gNB
=
new_channel_desc_scm
(
n_tx
,
n_rx
,
channel_model
,
sampling_frequency
,
sampling_frequency
/
1e6
,
bandwidth
,
tx_
bandwidth
,
DS_TDL
,
DS_TDL
,
0
,
0
,
0
,
0
);
0
,
0
,
0
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment