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
canghaiwuhen
OpenXG-RAN
Commits
3c56a7ed
Commit
3c56a7ed
authored
Jun 07, 2017
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a new proposal for the dlsch_channel_level function
parent
804a9a06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
+20
-14
No files found.
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
View file @
3c56a7ed
...
@@ -3377,7 +3377,7 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
...
@@ -3377,7 +3377,7 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
short
rb
;
short
rb
;
unsigned
char
aatx
,
aarx
,
nre
=
12
,
symbol_mod
;
unsigned
char
aatx
,
aarx
,
nre
=
12
,
symbol_mod
;
__m128i
*
dl_ch128
,
avg128D
,
coeff128
;
__m128i
*
dl_ch128
,
avg128D
;
symbol_mod
=
(
symbol
>=
(
7
-
frame_parms
->
Ncp
))
?
symbol
-
(
7
-
frame_parms
->
Ncp
)
:
symbol
;
symbol_mod
=
(
symbol
>=
(
7
-
frame_parms
->
Ncp
))
?
symbol
-
(
7
-
frame_parms
->
Ncp
)
:
symbol
;
...
@@ -3388,11 +3388,12 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
...
@@ -3388,11 +3388,12 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
else
else
nre
=
12
;
nre
=
12
;
double
one_over_nb_re
=
0
.
0
;
//nb_rb*nre = y * 2^x
one_over_nb_re
=
1
/
((
double
)(
nb_rb
*
nre
));
int16_t
x
=
log2_approx
(
nb_rb
*
nre
)
-
1
;
int16_t
one_over_nb_re_q1_15
=
(
int16_t
)(
one_over_nb_re
*
(
double
)(
1
<<
15
)
);
//int16_t one_over_y_q15 = (int16_t)((1<<((int32_t)x+15))/((int32_t)nb_rb*(int32_t)nre));
coeff128
=
_mm_set_epi16
(
one_over_nb_re_q1_15
,
one_over_nb_re_q1_15
,
one_over_nb_re_q1_15
,
one_over_nb_re_q1_15
,
float
y
=
(
float
)(
nb_rb
*
nre
)
/
(
float
)(
1
<<
x
);
one_over_nb_re_q1_15
,
one_over_nb_re_q1_15
,
one_over_nb_re_q1_15
,
one_over_nb_re_q1_15
);
//printf("1/(nb_rb*nre) = 1/%d = %d*2^(-15) * 2^(-%d)\n",nb_rb*nre,one_over_y_q15,x);
printf
(
"nb_rb*nre = %d = %f * 2^(%d)
\n
"
,
nb_rb
*
nre
,
y
,
x
);
for
(
aatx
=
0
;
aatx
<
frame_parms
->
nb_antenna_ports_eNB
;
aatx
++
)
for
(
aatx
=
0
;
aatx
<
frame_parms
->
nb_antenna_ports_eNB
;
aatx
++
)
for
(
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
for
(
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
...
@@ -3405,14 +3406,18 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
...
@@ -3405,14 +3406,18 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
for
(
rb
=
0
;
rb
<
nb_rb
;
rb
++
)
{
for
(
rb
=
0
;
rb
<
nb_rb
;
rb
++
)
{
// printf("rb %d : ",rb);
// printf("rb %d : ",rb);
// print_shorts("ch",&dl_ch128[0]);
// print_shorts("ch",&dl_ch128[0]);
avg128D
=
_mm_add_epi32
(
avg128D
,
_mm_madd_epi16
(
dl_ch128
[
0
],
_mm_srai_epi16
(
_mm_mulhi_epi16
(
dl_ch128
[
0
],
coeff128
),
15
)));
avg128D
=
_mm_add_epi32
(
avg128D
,
_mm_srai_epi16
(
_mm_madd_epi16
(
dl_ch128
[
0
],
dl_ch128
[
0
]),
x
));
avg128D
=
_mm_add_epi32
(
avg128D
,
_mm_madd_epi16
(
dl_ch128
[
1
],
_mm_srai_epi16
(
_mm_mulhi_epi16
(
dl_ch128
[
1
],
coeff128
),
15
)));
avg128D
=
_mm_add_epi32
(
avg128D
,
_mm_srai_epi16
(
_mm_madd_epi16
(
dl_ch128
[
1
],
dl_ch128
[
1
]),
x
));
//avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[0],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[0], coeff128),15)));
//avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[1],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[1], coeff128),15)));
if
(((
symbol_mod
==
0
)
||
(
symbol_mod
==
(
frame_parms
->
Ncp
-
1
)))
&&
(
frame_parms
->
mode1_flag
==
0
))
{
if
(((
symbol_mod
==
0
)
||
(
symbol_mod
==
(
frame_parms
->
Ncp
-
1
)))
&&
(
frame_parms
->
mode1_flag
==
0
))
{
dl_ch128
+=
2
;
dl_ch128
+=
2
;
}
}
else
{
else
{
avg128D
=
_mm_add_epi32
(
avg128D
,
_mm_madd_epi16
(
dl_ch128
[
2
],
_mm_srai_epi16
(
_mm_mulhi_epi16
(
dl_ch128
[
2
],
coeff128
),
15
)));
avg128D
=
_mm_add_epi32
(
avg128D
,
_mm_srai_epi16
(
_mm_madd_epi16
(
dl_ch128
[
2
],
dl_ch128
[
2
]),
x
));
//avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[2],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[2], coeff128),15)));
dl_ch128
+=
3
;
dl_ch128
+=
3
;
}
}
/*
/*
...
@@ -3424,11 +3429,12 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
...
@@ -3424,11 +3429,12 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
*/
*/
}
}
avg
[(
aatx
<<
1
)
+
aarx
]
=
(((
int32_t
*
)
&
avg128D
)[
0
]
+
avg
[(
aatx
<<
1
)
+
aarx
]
=
(((
int32_t
*
)
&
avg128D
)[
0
]
+
((
int32_t
*
)
&
avg128D
)[
1
]
+
((
int32_t
*
)
&
avg128D
)[
1
]
+
((
int32_t
*
)
&
avg128D
)[
2
]
+
((
int32_t
*
)
&
avg128D
)[
2
]
+
((
int32_t
*
)
&
avg128D
)[
3
]);
((
int32_t
*
)
&
avg128D
)[
3
]);
// printf("Channel level : %d\n",avg[(aatx<<1)+aarx]);
avg
[(
aatx
<<
1
)
+
aarx
]
=
(
int32_t
)
((
float
)
avg
[(
aatx
<<
1
)
+
aarx
]
/
y
);
printf
(
"Channel level : %d
\n
"
,
avg
[(
aatx
<<
1
)
+
aarx
]);
}
}
_mm_empty
();
_mm_empty
();
...
...
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