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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
lizhongxiao
OpenXG-RAN
Commits
d9d5a9fd
Commit
d9d5a9fd
authored
Jan 11, 2024
by
Thomas Schlichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gNB: small optimization in gNB_I0_measurements()
parent
5effd60a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
+25
-16
No files found.
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
View file @
d9d5a9fd
...
...
@@ -144,7 +144,8 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
NR_DL_FRAME_PARMS
*
frame_parms
=
&
gNB
->
frame_parms
;
NR_gNB_COMMON
*
common_vars
=
&
gNB
->
common_vars
;
PHY_MEASUREMENTS_gNB
*
measurements
=
&
gNB
->
measurements
;
int
rb
,
nb_symb
[
275
]
=
{
0
};
int
rb
,
nb_symb
[
frame_parms
->
N_RB_UL
];
bzero
(
nb_symb
,
sizeof
(
nb_symb
));
allocCast2D
(
n0_subband_power
,
unsigned
int
,
...
...
@@ -162,27 +163,35 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
for
(
int
s
=
first_symb
;
s
<
(
first_symb
+
num_symb
);
s
++
)
{
int
offset0
=
((
slot
&
3
)
*
frame_parms
->
symbols_per_slot
+
s
)
*
frame_parms
->
ofdm_symbol_size
;
for
(
rb
=
0
;
rb
<
frame_parms
->
N_RB_UL
;
rb
++
)
{
if
((
gNB
->
rb_mask_ul
[
s
][
rb
>>
5
]
&
(
1U
<<
(
rb
&
31
)))
==
0
&&
// check that rb was not used in this subframe
!
(
I0_SKIP_DC
&&
rb
==
frame_parms
->
N_RB_UL
>>
1
))
{
// skip middle PRB because of artificial noise possibly created by FFT
int
offset
=
offset0
+
(
frame_parms
->
first_carrier_offset
+
(
rb
*
12
))
%
frame_parms
->
ofdm_symbol_size
;
nb_symb
[
rb
]
++
;
for
(
int
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
int32_t
*
ul_ch
=
(
int32_t
*
)
&
common_vars
->
rxdataF
[
aarx
][
offset
];
for
(
int
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
int32_t
*
ul_ch
=
(
int32_t
*
)
&
common_vars
->
rxdataF
[
aarx
][
offset0
+
frame_parms
->
first_carrier_offset
];
for
(
rb
=
0
;
rb
<
frame_parms
->
N_RB_UL
;
rb
++
)
{
if
((
gNB
->
rb_mask_ul
[
s
][
rb
>>
5
]
&
(
1U
<<
(
rb
&
31
)))
==
0
&&
// check that rb was not used in this subframe
!
(
I0_SKIP_DC
&&
rb
==
frame_parms
->
N_RB_UL
>>
1
))
{
// skip middle PRB because of artificial noise possibly created by FFT
if
(
aarx
==
0
)
nb_symb
[
rb
]
++
;
int32_t
signal_energy
;
if
(((
frame_parms
->
N_RB_UL
&
1
)
==
1
)
&&
(
rb
==
(
frame_parms
->
N_RB_UL
>>
1
)))
{
signal_energy
=
signal_energy_nodc
(
ul_ch
,
6
);
ul_ch
=
(
int32_t
*
)
&
common_vars
->
rxdataF
[
aarx
][
offset0
];
signal_energy
+=
signal_energy_nodc
(
ul_ch
,
6
);
if
(
rb
==
(
frame_parms
->
N_RB_UL
>>
1
))
{
if
((
frame_parms
->
N_RB_UL
&
1
)
==
1
)
{
signal_energy
=
signal_energy_nodc
(
ul_ch
,
6
);
ul_ch
=
(
int32_t
*
)
&
common_vars
->
rxdataF
[
aarx
][
offset0
];
signal_energy
+=
signal_energy_nodc
(
ul_ch
,
6
);
ul_ch
+=
6
;
}
else
{
ul_ch
=
(
int32_t
*
)
&
common_vars
->
rxdataF
[
aarx
][
offset0
];
signal_energy
=
signal_energy_nodc
(
ul_ch
,
12
);
ul_ch
+=
12
;
}
}
else
{
signal_energy
=
signal_energy_nodc
(
ul_ch
,
12
);
ul_ch
+=
12
;
}
n0_subband_power
[
aarx
][
rb
]
+=
signal_energy
;
LOG_D
(
PHY
,
"slot %d symbol %d RB %d aarx %d n0_subband_power %d
\n
"
,
slot
,
s
,
rb
,
aarx
,
signal_energy
);
}
//antenna
}
}
//
rb
}
}
// rb
}
//
antenna
}
// symb
int
nb_rb
=
0
;
int32_t
n0_subband_tot
=
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