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
dadadb72
Commit
dadadb72
authored
Jul 05, 2022
by
Roberto Louro Magueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
To use some casts to c16_t
parent
52f6d38a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
+2
-2
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
+8
-8
No files found.
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
View file @
dadadb72
...
...
@@ -75,8 +75,8 @@ int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms,
for
(
int
i
=
0
;
i
<
frame_parms
->
ofdm_symbol_size
;
i
++
)
{
int
temp
=
0
;
for
(
int
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_rx
;
aa
++
)
{
int
Re
=
((
int16_t
*
)
srs_estimated_channel_time
[
aa
])[(
i
<<
1
)]
;
int
Im
=
((
int16_t
*
)
srs_estimated_channel_time
[
aa
])[
1
+
(
i
<<
1
)]
;
int
Re
=
((
c16_t
*
)
srs_estimated_channel_time
[
aa
])[
i
].
r
;
int
Im
=
((
c16_t
*
)
srs_estimated_channel_time
[
aa
])[
i
].
i
;
temp
+=
(
Re
*
Re
/
2
)
+
(
Im
*
Im
/
2
);
}
if
(
temp
>
max_val
)
{
...
...
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
View file @
dadadb72
...
...
@@ -999,11 +999,11 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
for
(
int
sc_idx
=
0
;
sc_idx
<
nr_srs_info
->
sc_list_length
;
sc_idx
++
)
{
int16_t
generated_real
=
srs_generated_signal
[
nr_srs_info
->
sc_list
[
sc_idx
]]
&
0xFFFF
;
int16_t
generated_imag
=
(
srs_generated_signal
[
nr_srs_info
->
sc_list
[
sc_idx
]]
>>
16
)
&
0xFFFF
;
int16_t
generated_real
=
((
c16_t
*
)
srs_generated_signal
)[
nr_srs_info
->
sc_list
[
sc_idx
]].
r
;
int16_t
generated_imag
=
(
(
c16_t
*
)
srs_generated_signal
)[
nr_srs_info
->
sc_list
[
sc_idx
]].
i
;
int16_t
received_real
=
srs_received_signal
[
ant
][
nr_srs_info
->
sc_list
[
sc_idx
]]
&
0xFFFF
;
int16_t
received_imag
=
(
srs_received_signal
[
ant
][
nr_srs_info
->
sc_list
[
sc_idx
]]
>>
16
)
&
0xFFFF
;
int16_t
received_real
=
((
c16_t
*
)
srs_received_signal
[
ant
])[
nr_srs_info
->
sc_list
[
sc_idx
]].
r
;
int16_t
received_imag
=
(
(
c16_t
*
)
srs_received_signal
[
ant
])[
nr_srs_info
->
sc_list
[
sc_idx
]].
i
;
// We know that nr_srs_info->srs_generated_signal_bits bits are enough to represent the generated_real and generated_imag.
// So we only need a nr_srs_info->srs_generated_signal_bits shift to ensure that the result fits into 16 bits.
...
...
@@ -1074,10 +1074,10 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
// Compute noise
for
(
int
sc_idx
=
0
;
sc_idx
<
nr_srs_info
->
sc_list_length
;
sc_idx
++
)
{
ch_real
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]
=
(
int16_t
)(
srs_estimated_channel_freq
[
ant
][
nr_srs_info
->
sc_list
[
sc_idx
]]
&
0xFFFF
)
;
ch_imag
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]
=
(
int16_t
)((
srs_estimated_channel_freq
[
ant
][
nr_srs_info
->
sc_list
[
sc_idx
]]
>>
16
)
&
0xFFFF
)
;
noise_real
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]
=
abs
((
int16_t
)(
srs_ls_estimated_channel
[
ant
][
nr_srs_info
->
sc_list
[
sc_idx
]]
&
0xFFFF
)
-
ch_real
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]);
noise_imag
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]
=
abs
((
int16_t
)((
srs_ls_estimated_channel
[
ant
][
nr_srs_info
->
sc_list
[
sc_idx
]]
>>
16
)
&
0xFFFF
)
-
ch_imag
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]);
ch_real
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]
=
(
(
c16_t
*
)
srs_estimated_channel_freq
[
ant
])[
nr_srs_info
->
sc_list
[
sc_idx
]].
r
;
ch_imag
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]
=
(
(
c16_t
*
)
srs_estimated_channel_freq
[
ant
])[
nr_srs_info
->
sc_list
[
sc_idx
]].
i
;
noise_real
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]
=
abs
((
(
c16_t
*
)
srs_ls_estimated_channel
[
ant
])[
nr_srs_info
->
sc_list
[
sc_idx
]].
r
-
ch_real
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]);
noise_imag
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]
=
abs
((
(
c16_t
*
)
srs_ls_estimated_channel
[
ant
])[
nr_srs_info
->
sc_list
[
sc_idx
]].
i
-
ch_imag
[
ant
*
nr_srs_info
->
sc_list_length
+
sc_idx
]);
}
// Convert to time domain
...
...
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