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
spbro
OpenXG-RAN
Commits
b2e1631f
Commit
b2e1631f
authored
Feb 03, 2023
by
Roberto Louro Magueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplification of function nr_ulsch_channel_compensation()
parent
da193d1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
68 deletions
+26
-68
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
+2
-3
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
+2
-0
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
+22
-65
No files found.
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
View file @
b2e1631f
...
...
@@ -45,9 +45,8 @@ void nr_est_timing_advance_pusch(const NR_DL_FRAME_PARMS *frame_parms, const int
const
int
sync_pos
=
0
;
for
(
int
i
=
0
;
i
<
frame_parms
->
ofdm_symbol_size
;
i
++
)
{
int
Re
=
((
int16_t
*
)
ul_ch_estimates_time
)[(
i
<<
1
)];
int
Im
=
((
int16_t
*
)
ul_ch_estimates_time
)[
1
+
(
i
<<
1
)];
int
temp
=
(
Re
*
Re
/
2
)
+
(
Im
*
Im
/
2
);
c16_t
*
sample
=
(
c16_t
*
)
&
ul_ch_estimates_time
[
i
];
int
temp
=
(
sample
->
r
*
sample
->
r
/
2
)
+
(
sample
->
i
*
sample
->
i
/
2
);
if
(
temp
>
max_val
)
{
max_pos
=
i
;
max_val
=
temp
;
...
...
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
View file @
b2e1631f
...
...
@@ -102,9 +102,11 @@ __attribute__((always_inline)) inline c16_t c32x16cumulVectVectWithSteps(c16_t *
int
get_delay_idx
(
int
delay
)
{
int
delay_idx
=
MAX_UL_DELAY_COMP
+
delay
;
// If the measured delay is less than -MAX_UL_DELAY_COMP, a -MAX_UL_DELAY_COMP delay is compensated.
if
(
delay_idx
<
0
)
{
delay_idx
=
0
;
}
// If the measured delay is greater than +MAX_UL_DELAY_COMP, a +MAX_UL_DELAY_COMP delay is compensated.
if
(
delay_idx
>
MAX_UL_DELAY_COMP
<<
1
)
{
delay_idx
=
MAX_UL_DELAY_COMP
<<
1
;
}
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
View file @
b2e1631f
...
...
@@ -547,7 +547,19 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
#endif
}
__m128i
a_mult_conjb
(
__m128i
a
,
__m128i
b
,
unsigned
char
output_shift
)
{
__m128i
mmtmpD0
=
_mm_madd_epi16
(
b
,
a
);
__m128i
mmtmpD1
=
_mm_shufflelo_epi16
(
b
,
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpD1
=
_mm_shufflehi_epi16
(
mmtmpD1
,
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpD1
=
_mm_sign_epi16
(
mmtmpD1
,
*
(
__m128i
*
)
&
conjugate
[
0
]);
mmtmpD1
=
_mm_madd_epi16
(
mmtmpD1
,
a
);
mmtmpD0
=
_mm_srai_epi32
(
mmtmpD0
,
output_shift
);
mmtmpD1
=
_mm_srai_epi32
(
mmtmpD1
,
output_shift
);
__m128i
mmtmpD2
=
_mm_unpacklo_epi32
(
mmtmpD0
,
mmtmpD1
);
__m128i
mmtmpD3
=
_mm_unpackhi_epi32
(
mmtmpD0
,
mmtmpD1
);
return
_mm_packs_epi32
(
mmtmpD2
,
mmtmpD3
);
}
//==============================================================================================
// Pre-processing for LLR computation
...
...
@@ -689,71 +701,16 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
}
// multiply by conjugated channel
mmtmpD0
=
_mm_madd_epi16
(
ul_ch128
[
0
],
rxdataF128
[
0
]);
// print_ints("re",&mmtmpD0);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1
=
_mm_shufflelo_epi16
(
ul_ch128
[
0
],
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpD1
=
_mm_shufflehi_epi16
(
mmtmpD1
,
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpD1
=
_mm_sign_epi16
(
mmtmpD1
,
*
(
__m128i
*
)
&
conjugate
[
0
]);
// print_ints("im",&mmtmpD1);
mmtmpD1
=
_mm_madd_epi16
(
mmtmpD1
,
rxdataF128
[
0
]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0
=
_mm_srai_epi32
(
mmtmpD0
,
output_shift
);
// print_ints("re(shift)",&mmtmpD0);
mmtmpD1
=
_mm_srai_epi32
(
mmtmpD1
,
output_shift
);
// print_ints("im(shift)",&mmtmpD1);
mmtmpD2
=
_mm_unpacklo_epi32
(
mmtmpD0
,
mmtmpD1
);
mmtmpD3
=
_mm_unpackhi_epi32
(
mmtmpD0
,
mmtmpD1
);
// print_ints("c0",&mmtmpD2);
// print_ints("c1",&mmtmpD3);
rxdataF_comp128
[
0
]
=
_mm_packs_epi32
(
mmtmpD2
,
mmtmpD3
);
// print_shorts("rx:",rxdataF128);
// print_shorts("ch:",ul_ch128);
// print_shorts("pack:",rxdataF_comp128);
// multiply by conjugated channel
mmtmpD0
=
_mm_madd_epi16
(
ul_ch128
[
1
],
rxdataF128
[
1
]);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1
=
_mm_shufflelo_epi16
(
ul_ch128
[
1
],
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpD1
=
_mm_shufflehi_epi16
(
mmtmpD1
,
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpD1
=
_mm_sign_epi16
(
mmtmpD1
,
*
(
__m128i
*
)
conjugate
);
mmtmpD1
=
_mm_madd_epi16
(
mmtmpD1
,
rxdataF128
[
1
]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0
=
_mm_srai_epi32
(
mmtmpD0
,
output_shift
);
mmtmpD1
=
_mm_srai_epi32
(
mmtmpD1
,
output_shift
);
mmtmpD2
=
_mm_unpacklo_epi32
(
mmtmpD0
,
mmtmpD1
);
mmtmpD3
=
_mm_unpackhi_epi32
(
mmtmpD0
,
mmtmpD1
);
rxdataF_comp128
[
1
]
=
_mm_packs_epi32
(
mmtmpD2
,
mmtmpD3
);
// print_shorts("rx:",rxdataF128+1);
// print_shorts("ch:",ul_ch128+1);
// print_shorts("pack:",rxdataF_comp128+1);
// multiply by conjugated channel
mmtmpD0
=
_mm_madd_epi16
(
ul_ch128
[
2
],
rxdataF128
[
2
]);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
mmtmpD1
=
_mm_shufflelo_epi16
(
ul_ch128
[
2
],
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpD1
=
_mm_shufflehi_epi16
(
mmtmpD1
,
_MM_SHUFFLE
(
2
,
3
,
0
,
1
));
mmtmpD1
=
_mm_sign_epi16
(
mmtmpD1
,
*
(
__m128i
*
)
conjugate
);
mmtmpD1
=
_mm_madd_epi16
(
mmtmpD1
,
rxdataF128
[
2
]);
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpD0
=
_mm_srai_epi32
(
mmtmpD0
,
output_shift
);
mmtmpD1
=
_mm_srai_epi32
(
mmtmpD1
,
output_shift
);
mmtmpD2
=
_mm_unpacklo_epi32
(
mmtmpD0
,
mmtmpD1
);
mmtmpD3
=
_mm_unpackhi_epi32
(
mmtmpD0
,
mmtmpD1
);
rxdataF_comp128
[
2
]
=
_mm_packs_epi32
(
mmtmpD2
,
mmtmpD3
);
//print_shorts("rx:",rxdataF128+2);
//print_shorts("ch:",ul_ch128+2);
//print_shorts("pack:",rxdataF_comp128+2);
// Multiply received data by conjugated channel
rxdataF_comp128
[
0
]
=
a_mult_conjb
(
rxdataF128
[
0
],
ul_ch128
[
0
],
output_shift
);
rxdataF_comp128
[
1
]
=
a_mult_conjb
(
rxdataF128
[
1
],
ul_ch128
[
1
],
output_shift
);
rxdataF_comp128
[
2
]
=
a_mult_conjb
(
rxdataF128
[
2
],
ul_ch128
[
2
],
output_shift
);
ul_ch128
+=
3
;
ul_ch_mag128
+=
3
;
ul_ch_mag128b
+=
3
;
rxdataF128
+=
3
;
rxdataF_comp128
+=
3
;
ul_ch128
+=
3
;
ul_ch_mag128
+=
3
;
ul_ch_mag128b
+=
3
;
rxdataF128
+=
3
;
rxdataF_comp128
+=
3
;
}
}
}
...
...
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