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
1a6610ee
Commit
1a6610ee
authored
Nov 03, 2021
by
ahadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding nr_prs.c to cmakelist and headers
parent
70889ee9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
0 deletions
+99
-0
openair1/PHY/NR_TRANSPORT/nr_prs.c
openair1/PHY/NR_TRANSPORT/nr_prs.c
+96
-0
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+3
-0
No files found.
openair1/PHY/NR_TRANSPORT/nr_prs.c
0 → 100644
View file @
1a6610ee
//int nr_generate_prs(){}
int
nr_generate_pbch_dmrs
(
uint32_t
*
gold_pbch_dmrs
,
int32_t
*
txdataF
,
int16_t
amp
,
uint8_t
ssb_start_symbol
,
nfapi_nr_config_request_scf_t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
{
int
k
,
l
;
//int16_t a;
int16_t
mod_dmrs
[
NR_PBCH_DMRS_LENGTH
<<
1
];
uint8_t
idx
=
0
;
uint8_t
nushift
=
config
->
cell_config
.
phy_cell_id
.
value
&
3
;
LOG_D
(
PHY
,
"PBCH DMRS mapping started at symbol %d shift %d
\n
"
,
ssb_start_symbol
+
1
,
nushift
);
/// QPSK modulation
for
(
int
m
=
0
;
m
<
NR_PBCH_DMRS_LENGTH
;
m
++
)
{
idx
=
(((
gold_pbch_dmrs
[(
m
<<
1
)
>>
5
])
>>
((
m
<<
1
)
&
0x1f
))
&
3
);
mod_dmrs
[
m
<<
1
]
=
nr_qpsk_mod_table
[
idx
<<
1
];
mod_dmrs
[(
m
<<
1
)
+
1
]
=
nr_qpsk_mod_table
[(
idx
<<
1
)
+
1
];
#ifdef DEBUG_PBCH_DMRS
printf
(
"m %d idx %d gold seq %d b0-b1 %d-%d mod_dmrs %d %d
\n
"
,
m
,
idx
,
gold_pbch_dmrs
[(
m
<<
1
)
>>
5
],
(((
gold_pbch_dmrs
[(
m
<<
1
)
>>
5
])
>>
((
m
<<
1
)
&
0x1f
))
&
1
),
(((
gold_pbch_dmrs
[((
m
<<
1
)
+
1
)
>>
5
])
>>
(((
m
<<
1
)
+
1
)
&
0x1f
))
&
1
),
mod_dmrs
[(
m
<<
1
)],
mod_dmrs
[(
m
<<
1
)
+
1
]);
#endif
}
/// Resource mapping
// PBCH DMRS are mapped within the SSB block on every fourth subcarrier starting from nushift of symbols 1, 2, 3
///symbol 1 [0+nushift:4:236+nushift] -- 60 mod symbols
k
=
frame_parms
->
first_carrier_offset
+
frame_parms
->
ssb_start_subcarrier
+
nushift
;
l
=
ssb_start_symbol
+
1
;
for
(
int
m
=
0
;
m
<
60
;
m
++
)
{
#ifdef DEBUG_PBCH_DMRS
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_dmrs
[
m
<<
1
])
>>
15
;
((
int16_t
*
)
txdataF
)[((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]
=
(
amp
*
mod_dmrs
[(
m
<<
1
)
+
1
])
>>
15
;
#ifdef DEBUG_PBCH_DMRS
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
+=
4
;
if
(
k
>=
frame_parms
->
ofdm_symbol_size
)
k
-=
frame_parms
->
ofdm_symbol_size
;
}
///symbol 2 [0+u:4:44+nushift ; 192+nu:4:236+nushift] -- 24 mod symbols
k
=
frame_parms
->
first_carrier_offset
+
frame_parms
->
ssb_start_subcarrier
+
nushift
;
l
++
;
for
(
int
m
=
60
;
m
<
84
;
m
++
)
{
#ifdef DEBUG_PBCH_DMRS
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_dmrs
[
m
<<
1
])
>>
15
;
((
int16_t
*
)
txdataF
)[((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]
=
(
amp
*
mod_dmrs
[(
m
<<
1
)
+
1
])
>>
15
;
#ifdef DEBUG_PBCH_DMRS
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
==
71
)
?
148
:
4
;
// Jump from 44+nu to 192+nu
if
(
k
>=
frame_parms
->
ofdm_symbol_size
)
k
-=
frame_parms
->
ofdm_symbol_size
;
}
///symbol 3 [0+nushift:4:236+nushift] -- 60 mod symbols
k
=
frame_parms
->
first_carrier_offset
+
frame_parms
->
ssb_start_subcarrier
+
nushift
;
l
++
;
for
(
int
m
=
84
;
m
<
NR_PBCH_DMRS_LENGTH
;
m
++
)
{
#ifdef DEBUG_PBCH_DMRS
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_dmrs
[
m
<<
1
])
>>
15
;
((
int16_t
*
)
txdataF
)[((
l
*
frame_parms
->
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]
=
(
amp
*
mod_dmrs
[(
m
<<
1
)
+
1
])
>>
15
;
#ifdef DEBUG_PBCH_DMRS
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
+=
4
;
if
(
k
>=
frame_parms
->
ofdm_symbol_size
)
k
-=
frame_parms
->
ofdm_symbol_size
;
}
#ifdef DEBUG_PBCH_DMRS
write_output
(
"txdataF_pbch_dmrs.m"
,
"txdataF_pbch_dmrs"
,
txdataF
[
0
],
frame_parms
->
samples_per_frame_wCP
>>
1
,
1
,
1
);
#endif
return
0
;
}
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
View file @
1a6610ee
...
...
@@ -45,6 +45,9 @@
@param
@returns 0 on success
*/
int
nr_generate_prs
();
int
nr_generate_pss
(
int16_t
*
d_pss
,
int32_t
*
txdataF
,
int16_t
amp
,
...
...
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