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
zzha zzha
OpenXG-RAN
Commits
886b580f
Commit
886b580f
authored
Apr 05, 2022
by
rmagueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PMI computation for rank=1 case
parent
4254d59a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
8 deletions
+57
-8
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/INIT/nr_init_ue.c
+2
-1
openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
+53
-6
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+2
-1
No files found.
openair1/PHY/INIT/nr_init_ue.c
View file @
886b580f
...
...
@@ -347,7 +347,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
}
ue
->
nr_csi_rs_info
->
noise_power
=
(
uint32_t
*
)
malloc16_clear
(
sizeof
(
uint32_t
));
ue
->
nr_csi_rs_info
->
rank_indicator
=
(
uint8_t
*
)
malloc16_clear
(
sizeof
(
uint8_t
));
ue
->
nr_csi_rs_info
->
pmi
=
(
uint8_t
*
)
malloc16_clear
(
sizeof
(
uint8_t
));
ue
->
nr_csi_rs_info
->
i1
=
(
uint8_t
*
)
malloc16_clear
(
3
*
sizeof
(
uint8_t
));
ue
->
nr_csi_rs_info
->
i2
=
(
uint8_t
*
)
malloc16_clear
(
sizeof
(
uint8_t
));
ue
->
nr_csi_rs_info
->
csi_rs_generated_signal
=
(
int32_t
**
)
malloc16
(
NR_MAX_NB_PORTS
*
sizeof
(
int32_t
*
)
);
for
(
i
=
0
;
i
<
NR_MAX_NB_PORTS
;
i
++
)
{
ue
->
nr_csi_rs_info
->
csi_rs_generated_signal
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
samples_per_frame_wCP
*
sizeof
(
int32_t
));
...
...
openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
View file @
886b580f
...
...
@@ -457,8 +457,6 @@ int nr_csi_rs_ri_estimation(PHY_VARS_NR_UE *ue,
*
rank_indicator
=
1
;
}
LOG_I
(
NR_PHY
,
"RI = %i
\n
"
,
*
rank_indicator
+
1
);
return
0
;
}
...
...
@@ -467,21 +465,64 @@ int nr_csi_rs_pmi_estimation(PHY_VARS_NR_UE *ue,
nr_csi_rs_info_t
*
nr_csi_rs_info
,
int32_t
***
csi_rs_estimated_channel_freq
,
uint8_t
rank_indicator
,
uint8_t
*
pmi
)
{
uint8_t
*
i1
,
uint8_t
*
i2
)
{
NR_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
i1
[
0
]
=
1
;
i1
[
1
]
=
1
;
i1
[
2
]
=
1
;
*
i2
=
0
;
// TS 38.214: For 2 antenna ports {3000, 3001} and the UE configured with higher layer parameter codebookType set to
// 'typeISinglePanel' each PMI value corresponds to a codebook index given in Table 5.2.2.2.1-1.
// The first column is applicable if the UE is reporting a Rank = 1, whereas the second column is applicable if the
// UE is reporting a Rank = 2.
*
pmi
=
0
;
if
(
ue
->
nr_csi_rs_info
->
N_ports
==
1
)
{
return
0
;
}
if
(
rank_indicator
==
0
)
{
uint32_t
metric
[
4
]
=
{
0
};
uint16_t
shift
=
nr_csi_rs_info
->
log2_maxh
+
log2_approx
(
frame_parms
->
nb_antennas_rx
)
+
log2_approx
(
csirs_config_pdu
->
nr_of_rbs
)
-
1
;
for
(
int
rb
=
csirs_config_pdu
->
start_rb
;
rb
<
(
csirs_config_pdu
->
start_rb
+
csirs_config_pdu
->
nr_of_rbs
);
rb
++
)
{
if
(
csirs_config_pdu
->
freq_density
<=
1
&&
csirs_config_pdu
->
freq_density
!=
(
rb
%
2
))
{
continue
;
}
uint16_t
k
=
(
frame_parms
->
first_carrier_offset
+
rb
*
NR_NB_SC_PER_RB
)
%
frame_parms
->
ofdm_symbol_size
;
for
(
int
ant_rx
=
0
;
ant_rx
<
frame_parms
->
nb_antennas_rx
;
ant_rx
++
)
{
int16_t
*
csi_rs_estimated_channel_p0
=
(
int16_t
*
)
&
csi_rs_estimated_channel_freq
[
ant_rx
][
0
][
k
];
int16_t
*
csi_rs_estimated_channel_p1
=
(
int16_t
*
)
&
csi_rs_estimated_channel_freq
[
ant_rx
][
1
][
k
];
// H_p0 + 1*H_p1 = (H_p0_re + H_p1_re) + 1j*(H_p0_im + H_p1_im)
metric
[
0
]
+=
((
csi_rs_estimated_channel_p0
[
0
]
+
csi_rs_estimated_channel_p1
[
0
])
*
(
csi_rs_estimated_channel_p0
[
0
]
+
csi_rs_estimated_channel_p1
[
0
])
+
(
csi_rs_estimated_channel_p0
[
1
]
+
csi_rs_estimated_channel_p1
[
1
])
*
(
csi_rs_estimated_channel_p0
[
1
]
+
csi_rs_estimated_channel_p1
[
1
]))
>>
shift
;
// H_p0 + 1j*H_p1 = (H_p0_re - H_p1_im) + 1j*(H_p0_im + H_p1_re)
metric
[
1
]
+=
((
csi_rs_estimated_channel_p0
[
0
]
-
csi_rs_estimated_channel_p1
[
1
])
*
(
csi_rs_estimated_channel_p0
[
0
]
-
csi_rs_estimated_channel_p1
[
1
])
+
(
csi_rs_estimated_channel_p0
[
1
]
+
csi_rs_estimated_channel_p1
[
0
])
*
(
csi_rs_estimated_channel_p0
[
1
]
+
csi_rs_estimated_channel_p1
[
0
]))
>>
shift
;
// H_p0 - 1*H_p1 = (H_p0_re - H_p1_re) + 1j*(H_p0_im - H_p1_im)
metric
[
2
]
+=
((
csi_rs_estimated_channel_p0
[
0
]
-
csi_rs_estimated_channel_p1
[
0
])
*
(
csi_rs_estimated_channel_p0
[
0
]
-
csi_rs_estimated_channel_p1
[
0
])
+
(
csi_rs_estimated_channel_p0
[
1
]
-
csi_rs_estimated_channel_p1
[
1
])
*
(
csi_rs_estimated_channel_p0
[
1
]
-
csi_rs_estimated_channel_p1
[
1
]))
>>
shift
;
// H_p0 - 1j*H_p1 = (H_p0_re + H_p1_im) + 1j*(H_p0_im - H_p1_re)
metric
[
3
]
+=
((
csi_rs_estimated_channel_p0
[
0
]
+
csi_rs_estimated_channel_p1
[
1
])
*
(
csi_rs_estimated_channel_p0
[
0
]
+
csi_rs_estimated_channel_p1
[
1
])
+
(
csi_rs_estimated_channel_p0
[
1
]
-
csi_rs_estimated_channel_p1
[
0
])
*
(
csi_rs_estimated_channel_p0
[
1
]
-
csi_rs_estimated_channel_p1
[
0
]))
>>
shift
;
}
}
for
(
int
tested_i2
=
0
;
tested_i2
<
4
;
tested_i2
++
)
{
if
(
metric
[
tested_i2
]
>
metric
[
*
i2
])
{
*
i2
=
tested_i2
;
}
}
}
else
if
(
rank_indicator
==
1
)
{
}
else
{
...
...
@@ -554,7 +595,13 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
ue
->
nr_csi_rs_info
,
ue
->
nr_csi_rs_info
->
csi_rs_estimated_channel_freq
,
*
ue
->
nr_csi_rs_info
->
rank_indicator
,
ue
->
nr_csi_rs_info
->
pmi
);
ue
->
nr_csi_rs_info
->
i1
,
ue
->
nr_csi_rs_info
->
i2
);
LOG_I
(
NR_PHY
,
"RI = %i, i1 = [%i %i %i], i2 = %i
\n
"
,
*
ue
->
nr_csi_rs_info
->
rank_indicator
+
1
,
ue
->
nr_csi_rs_info
->
i1
[
0
],
ue
->
nr_csi_rs_info
->
i1
[
1
],
ue
->
nr_csi_rs_info
->
i1
[
2
],
*
ue
->
nr_csi_rs_info
->
i2
);
return
0
;
}
openair1/PHY/defs_nr_common.h
View file @
886b580f
...
...
@@ -269,7 +269,8 @@ typedef struct {
int32_t
csi_rs_estimated_numer_fin
[
NR_MAX_OFDM_SYMBOL_SIZE
]
__attribute__
((
aligned
(
32
)));
uint32_t
*
noise_power
;
uint8_t
*
rank_indicator
;
uint8_t
*
pmi
;
uint8_t
*
i1
;
uint8_t
*
i2
;
}
nr_csi_rs_info_t
;
typedef
struct
NR_DL_FRAME_PARMS
NR_DL_FRAME_PARMS
;
...
...
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