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
379fc455
Commit
379fc455
authored
Dec 12, 2019
by
Haruki NAOI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: freq_offset_estimation overflow.
(cherry picked from commit 5e7eb7c94857f5765bb7f18afc7f4c748acb048b)
parent
ad7dd954
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
+18
-17
No files found.
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
View file @
379fc455
...
@@ -880,37 +880,38 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms,
...
@@ -880,37 +880,38 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms,
Ravg
[
0
]
=
0
;
Ravg
[
0
]
=
0
;
Ravg
[
1
]
=
0
;
Ravg
[
1
]
=
0
;
int16_t
iv
,
rv
,
phase_idx
;
int16_t
iv
,
rv
,
phase_idx
;
__m128i
avg128U1
,
avg128U2
,
R
[
3
],
mmtmpD0
,
mmtmpD1
,
mmtmpD2
,
mmtmpD3
;
__m128i
R
[
3
],
mmtmpD0
,
mmtmpD1
,
mmtmpD2
,
mmtmpD3
;
__m128
avg128U1
,
avg128U2
;
// round(tan((pi/4)*[1:1:N]/N)*pow2(15))
// round(tan((pi/4)*[1:1:N]/N)*pow2(15))
int16_t
alpha
[
128
]
=
{
201
,
402
,
603
,
804
,
1006
,
1207
,
1408
,
1610
,
1811
,
2013
,
2215
,
2417
,
2619
,
2822
,
3024
,
3227
,
3431
,
3634
,
3838
,
4042
,
4246
,
4450
,
4655
,
4861
,
5066
,
5272
,
5479
,
5686
,
5893
,
6101
,
6309
,
6518
,
6727
,
6937
,
7147
,
7358
,
7570
,
7782
,
7995
,
8208
,
8422
,
8637
,
8852
,
9068
,
9285
,
9503
,
9721
,
9940
,
10160
,
10381
,
10603
,
10825
,
11049
,
11273
,
11498
,
11725
,
11952
,
12180
,
12410
,
12640
,
12872
,
13104
,
13338
,
13573
,
13809
,
14046
,
14285
,
14525
,
14766
,
15009
,
15253
,
15498
,
15745
,
15993
,
16243
,
16494
,
16747
,
17001
,
17257
,
17515
,
17774
,
18035
,
18298
,
18563
,
18829
,
19098
,
19368
,
19640
,
19915
,
20191
,
20470
,
20750
,
21033
,
21318
,
21605
,
21895
,
22187
,
22481
,
22778
,
23078
,
23380
,
23685
,
23992
,
24302
,
24615
,
24931
,
25250
,
25572
,
25897
,
26226
,
26557
,
26892
,
27230
,
27572
,
27917
,
28266
,
28618
,
28975
,
29335
,
29699
,
30067
,
30440
,
30817
,
31198
,
31583
,
31973
,
32368
,
32767
};
int16_t
alpha
[
128
]
=
{
201
,
402
,
603
,
804
,
1006
,
1207
,
1408
,
1610
,
1811
,
2013
,
2215
,
2417
,
2619
,
2822
,
3024
,
3227
,
3431
,
3634
,
3838
,
4042
,
4246
,
4450
,
4655
,
4861
,
5066
,
5272
,
5479
,
5686
,
5893
,
6101
,
6309
,
6518
,
6727
,
6937
,
7147
,
7358
,
7570
,
7782
,
7995
,
8208
,
8422
,
8637
,
8852
,
9068
,
9285
,
9503
,
9721
,
9940
,
10160
,
10381
,
10603
,
10825
,
11049
,
11273
,
11498
,
11725
,
11952
,
12180
,
12410
,
12640
,
12872
,
13104
,
13338
,
13573
,
13809
,
14046
,
14285
,
14525
,
14766
,
15009
,
15253
,
15498
,
15745
,
15993
,
16243
,
16494
,
16747
,
17001
,
17257
,
17515
,
17774
,
18035
,
18298
,
18563
,
18829
,
19098
,
19368
,
19640
,
19915
,
20191
,
20470
,
20750
,
21033
,
21318
,
21605
,
21895
,
22187
,
22481
,
22778
,
23078
,
23380
,
23685
,
23992
,
24302
,
24615
,
24931
,
25250
,
25572
,
25897
,
26226
,
26557
,
26892
,
27230
,
27572
,
27917
,
28266
,
28618
,
28975
,
29335
,
29699
,
30067
,
30440
,
30817
,
31198
,
31583
,
31973
,
32368
,
32767
};
// compute log2_maxh (output_shift)
// compute log2_maxh (output_shift)
avg128U1
=
_mm_setzero_
si128
();
avg128U1
=
_mm_setzero_
ps
();
avg128U2
=
_mm_setzero_
si128
();
avg128U2
=
_mm_setzero_
ps
();
for
(
rb
=
0
;
rb
<
nb_rb
;
rb
++
)
{
for
(
rb
=
0
;
rb
<
nb_rb
;
rb
++
)
{
avg128U1
=
_mm_add_
epi32
(
avg128U1
,
_mm_madd_epi16
(
ul_ch1
[
0
],
ul_ch1
[
0
]
));
avg128U1
=
_mm_add_
ps
(
avg128U1
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch1
[
0
],
ul_ch1
[
0
])
));
avg128U1
=
_mm_add_
epi32
(
avg128U1
,
_mm_madd_epi16
(
ul_ch1
[
1
],
ul_ch1
[
1
]
));
avg128U1
=
_mm_add_
ps
(
avg128U1
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch1
[
1
],
ul_ch1
[
1
])
));
avg128U1
=
_mm_add_
epi32
(
avg128U1
,
_mm_madd_epi16
(
ul_ch1
[
2
],
ul_ch1
[
2
]
));
avg128U1
=
_mm_add_
ps
(
avg128U1
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch1
[
2
],
ul_ch1
[
2
])
));
avg128U2
=
_mm_add_
epi32
(
avg128U2
,
_mm_madd_epi16
(
ul_ch2
[
0
],
ul_ch2
[
0
]
));
avg128U2
=
_mm_add_
ps
(
avg128U2
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch2
[
0
],
ul_ch2
[
0
])
));
avg128U2
=
_mm_add_
epi32
(
avg128U2
,
_mm_madd_epi16
(
ul_ch2
[
1
],
ul_ch2
[
1
]
));
avg128U2
=
_mm_add_
ps
(
avg128U2
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch2
[
1
],
ul_ch2
[
1
])
));
avg128U2
=
_mm_add_
epi32
(
avg128U2
,
_mm_madd_epi16
(
ul_ch2
[
2
],
ul_ch2
[
2
]
));
avg128U2
=
_mm_add_
ps
(
avg128U2
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch2
[
2
],
ul_ch2
[
2
])
));
ul_ch1
+=
3
;
ul_ch1
+=
3
;
ul_ch2
+=
3
;
ul_ch2
+=
3
;
}
}
avg
[
0
]
=
(
((
in
t
*
)
&
avg128U1
)[
0
]
+
avg
[
0
]
=
(
int
)(
(((
floa
t
*
)
&
avg128U1
)[
0
]
+
((
in
t
*
)
&
avg128U1
)[
1
]
+
((
floa
t
*
)
&
avg128U1
)[
1
]
+
((
in
t
*
)
&
avg128U1
)[
2
]
+
((
floa
t
*
)
&
avg128U1
)[
2
]
+
((
int
*
)
&
avg128U1
)[
3
])
/
(
nb_rb
*
12
);
((
float
*
)
&
avg128U1
)[
3
])
/
(
float
)(
nb_rb
*
12
)
);
avg
[
1
]
=
(
((
in
t
*
)
&
avg128U2
)[
0
]
+
avg
[
1
]
=
(
int
)(
(((
floa
t
*
)
&
avg128U2
)[
0
]
+
((
in
t
*
)
&
avg128U2
)[
1
]
+
((
floa
t
*
)
&
avg128U2
)[
1
]
+
((
in
t
*
)
&
avg128U2
)[
2
]
+
((
floa
t
*
)
&
avg128U2
)[
2
]
+
((
int
*
)
&
avg128U2
)[
3
])
/
(
nb_rb
*
12
);
((
float
*
)
&
avg128U2
)[
3
])
/
(
float
)(
nb_rb
*
12
)
);
// msg("avg0 = %d, avg1 = %d\n",avg[0],avg[1]);
// msg("avg0 = %d, avg1 = %d\n",avg[0],avg[1]);
avg
[
0
]
=
cmax
(
avg
[
0
],
avg
[
1
]);
avg
[
0
]
=
cmax
(
avg
[
0
],
avg
[
1
]);
...
...
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