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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
a6fd4707
Commit
a6fd4707
authored
Nov 30, 2021
by
ahadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prs resource mapping
parent
f136f047
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
7 deletions
+63
-7
openair1/PHY/NR_TRANSPORT/nr_prs.c
openair1/PHY/NR_TRANSPORT/nr_prs.c
+63
-7
No files found.
openair1/PHY/NR_TRANSPORT/nr_prs.c
View file @
a6fd4707
...
...
@@ -5,7 +5,8 @@
#include "PHY/NR_REFSIG/nr_refsig.h"
#include "PHY/sse_intrin.h"
#define DEBUG_PRS
//#define DEBUG_PRS
#define DEBUG_PRS_MAP
extern
short
nr_qpsk_mod_table
[
8
];
...
...
@@ -15,14 +16,25 @@ int nr_generate_prs(uint32_t *nr_gold_prs,
uint8_t
ssb_start_symbol
,
nfapi_nr_config_request_scf_t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
{
//int k,l;
//int16_t a;
// Get K_Prime from the table for the length of PRS or LPRS
int
k_prime_table
[
4
][
12
]
=
{
{
0
,
1
,
0
,
1
,
0
,
1
,
0
,
1
,
0
,
1
,
0
,
1
},
{
0
,
2
,
1
,
3
,
0
,
2
,
1
,
3
,
0
,
2
,
1
,
3
},
{
0
,
3
,
1
,
4
,
2
,
5
,
0
,
3
,
1
,
4
,
2
,
5
},
{
0
,
6
,
3
,
9
,
1
,
7
,
4
,
10
,
2
,
8
,
5
,
11
}};
int
k_prime
=
0
;
int
k
=
0
;
int16_t
mod_prs
[
NR_MAX_PRS_LENGTH
<<
1
];
uint8_t
idx
=
0
;
uint8_t
nushift
=
config
->
cell_config
.
phy_cell_id
.
value
&
3
;
LOG_D
(
PHY
,
"PRS mapping started at symbol %d shift %d
\n
"
,
ssb_start_symbol
+
1
,
nushift
);
/// QPSK modulation
uint8_t
combSize
=
6
;
uint8_t
REOffset
=
0
;
uint8_t
symbolStart
=
5
;
uint8_t
NumPRSSymbols
=
6
;
// QPSK modulation
for
(
int
m
=
0
;
m
<
NR_MAX_PRS_LENGTH
;
m
++
)
{
idx
=
(((
nr_gold_prs
[(
m
<<
1
)
>>
5
])
>>
((
m
<<
1
)
&
0x1f
))
&
3
);
mod_prs
[
m
<<
1
]
=
nr_qpsk_mod_table
[
idx
<<
1
];
...
...
@@ -33,8 +45,52 @@ int nr_generate_prs(uint32_t *nr_gold_prs,
(((
nr_gold_prs
[((
m
<<
1
)
+
1
)
>>
5
])
>>
(((
m
<<
1
)
+
1
)
&
0x1f
))
&
1
),
mod_prs
[(
m
<<
1
)],
mod_prs
[(
m
<<
1
)
+
1
]);
#endif
}
// PRS resource mapping with combsize=k which means PRS symbols exist in every k-th subcarrier in frequency domain
// According to ts138.211 sec.7.4.1.7.2
for
(
int
l
=
symbolStart
;
l
<
symbolStart
+
NumPRSSymbols
;
l
++
)
{
int
symInd
=
l
-
5
;
if
(
combSize
==
2
)
{
k_prime
=
k_prime_table
[
0
][
symInd
];
}
else
if
(
combSize
==
4
){
k_prime
=
k_prime_table
[
1
][
symInd
];
}
else
if
(
combSize
==
6
){
k_prime
=
k_prime_table
[
2
][
symInd
];
}
else
if
(
combSize
==
12
){
k_prime
=
k_prime_table
[
3
][
symInd
];
}
for
(
int
m
=
0
;
m
<
NR_MAX_PRS_LENGTH
;
m
++
)
{
#ifdef DEBUG_PRS_MAP
printf
(
"m %d at k %d of l %d
\n
"
,
m
,
k
,
l
);
#endif
((
int16_t
*
)
txdataF
)[(
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
]
=
(
amp
*
mod_prs
[
m
<<
1
])
>>
15
;
((
int16_t
*
)
txdataF
)[((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]
=
(
amp
*
mod_prs
[(
m
<<
1
)
+
1
])
>>
15
;
#ifdef DEBUG_PRS_MAP
printf
(
"(%d,%d)
\n
"
,
((
int16_t
*
)
txdataF
)[(
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
],
((
int16_t
*
)
txdataF
)[((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]);
#endif
k
=
m
*
combSize
+
(
REOffset
+
k_prime
)
%
combSize
;
//if (k >= frame_parms->ofdm_symbol_size)
//k-=frame_parms->ofdm_symbol_size;
}
}
return
0
;
}
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