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
lizhongxiao
OpenXG-RAN
Commits
b830090a
Commit
b830090a
authored
Dec 22, 2021
by
luis_pereira87
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perform frequency offset correction in two consecutive frames for SA
parent
ad37d8ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
15 deletions
+27
-15
openair1/PHY/NR_REFSIG/ss_pbch_nr.h
openair1/PHY/NR_REFSIG/ss_pbch_nr.h
+1
-0
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+26
-15
No files found.
openair1/PHY/NR_REFSIG/ss_pbch_nr.h
View file @
b830090a
...
...
@@ -65,6 +65,7 @@
/* SS/PBCH parameters */
#define N_RB_SS_PBCH_BLOCK (20)
#define NB_SYMBOLS_PBCH (3)
#define NR_N_SYMBOLS_SSB (4)
#define IQ_SIZE (sizeof(int16_t) * 2)
/* I and Q are alternatively stored into buffers */
#define N_SYMB_SLOT (14)
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
View file @
b830090a
...
...
@@ -42,6 +42,7 @@
#include "common_lib.h"
#include <math.h>
#include <nr-uesoftmodem.h>
#include "PHY/NR_REFSIG/pss_nr.h"
#include "PHY/NR_REFSIG/sss_nr.h"
...
...
@@ -250,21 +251,31 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
#endif
// digital compensation of FFO for SSB symbols
if
(
ue
->
UE_fo_compensation
){
double
s_time
=
1
/
(
1.0e3
*
fp
->
samples_per_subframe
);
// sampling time
double
off_angle
=
-
2
*
M_PI
*
s_time
*
(
ue
->
common_vars
.
freq_offset
);
// offset rotation angle compensation per sample
int
start
=
is
*
fp
->
samples_per_frame
+
ue
->
ssb_offset
;
// start for offset correction is at ssb_offset (pss time position)
int
end
=
start
+
4
*
(
fp
->
ofdm_symbol_size
+
fp
->
nb_prefix_samples
);
// loop over samples in 4 symbols (ssb size), including prefix
for
(
int
n
=
start
;
n
<
end
;
n
++
){
for
(
int
ar
=
0
;
ar
<
fp
->
nb_antennas_rx
;
ar
++
)
{
re
=
((
double
)(((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
]))[
2
*
n
]);
im
=
((
double
)(((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
]))[
2
*
n
+
1
]);
((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
])[
2
*
n
]
=
(
short
)(
round
(
re
*
cos
(
n
*
off_angle
)
-
im
*
sin
(
n
*
off_angle
)));
((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
])[
2
*
n
+
1
]
=
(
short
)(
round
(
re
*
sin
(
n
*
off_angle
)
+
im
*
cos
(
n
*
off_angle
)));
}
}
if
(
ue
->
UE_fo_compensation
){
double
s_time
=
1
/
(
1.0e3
*
fp
->
samples_per_subframe
);
// sampling time
double
off_angle
=
-
2
*
M_PI
*
s_time
*
(
ue
->
common_vars
.
freq_offset
);
// offset rotation angle compensation per sample
// In SA we need to perform frequency offset correction in two consecutive frames because we need to decode SIB1
// and we do not know yet in which slot it goes.
// start for offset correction
int
start
=
get_softmodem_params
()
->
sa
?
is
*
fp
->
samples_per_frame
:
is
*
fp
->
samples_per_frame
+
ue
->
ssb_offset
;
// loop over samples
int
end
=
get_softmodem_params
()
->
sa
?
start
+
(
fp
->
samples_per_frame
<<
1
)
:
start
+
NR_N_SYMBOLS_SSB
*
(
fp
->
ofdm_symbol_size
+
fp
->
nb_prefix_samples
);
for
(
int
n
=
start
;
n
<
end
;
n
++
){
for
(
int
ar
=
0
;
ar
<
fp
->
nb_antennas_rx
;
ar
++
)
{
re
=
((
double
)(((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
]))[
2
*
n
]);
im
=
((
double
)(((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
]))[
2
*
n
+
1
]);
((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
])[
2
*
n
]
=
(
short
)(
round
(
re
*
cos
(
n
*
off_angle
)
-
im
*
sin
(
n
*
off_angle
)));
((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
])[
2
*
n
+
1
]
=
(
short
)(
round
(
re
*
sin
(
n
*
off_angle
)
+
im
*
cos
(
n
*
off_angle
)));
}
}
}
/* check that SSS/PBCH block is continuous inside the received buffer */
...
...
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