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
常顺宇
OpenXG-RAN
Commits
c5734aa1
Commit
c5734aa1
authored
Feb 08, 2021
by
Thomas Schlichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NR_UE: slightly cleanup PRACH generation
parent
92e654c6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
87 deletions
+66
-87
openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
+66
-87
No files found.
openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
View file @
c5734aa1
...
@@ -244,85 +244,57 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
...
@@ -244,85 +244,57 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
*********************************************************/
*********************************************************/
if
(
mu
==
1
)
{
if
(
mu
==
1
)
{
if
(
fp
->
N_RB_UL
<=
100
)
switch
(
fp
->
samples_per_subframe
)
{
AssertFatal
(
1
==
0
,
"N_RB_UL %d not support for NR PRACH yet
\n
"
,
fp
->
N_RB_UL
);
case
46080
:
else
if
(
fp
->
N_RB_UL
<
137
)
{
if
(
fp
->
threequarter_fs
==
0
)
{
//40 MHz @ 61.44 Ms/s
//50 MHz @ 61.44 Ms/s
if
(
prach_sequence_length
==
0
)
{
if
(
prach_fmt_id
==
0
||
prach_fmt_id
==
1
||
prach_fmt_id
==
2
)
dftlen
=
49152
;
if
(
prach_fmt_id
==
3
)
dftlen
=
12288
;
}
// 839 sequence
else
{
switch
(
mu
){
case
1
:
dftlen
=
2048
;
break
;
default:
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
break
;
}
}
}
else
{
// threequarter sampling
// 40 MHz @ 46.08 Ms/s
// 40 MHz @ 46.08 Ms/s
if
(
prach_sequence_length
==
0
)
{
if
(
prach_sequence_length
==
0
)
{
AssertFatal
(
fp
->
N_RB_UL
<=
107
,
"cannot do 108..136 PRBs with 3/4 sampling
\n
"
);
if
(
prach_fmt_id
==
0
||
prach_fmt_id
==
1
||
prach_fmt_id
==
2
)
if
(
prach_fmt_id
==
0
||
prach_fmt_id
==
1
||
prach_fmt_id
==
2
)
dftlen
=
36864
;
dftlen
=
36864
;
if
(
prach_fmt_id
==
3
)
if
(
prach_fmt_id
==
3
)
dftlen
=
9216
;
dftlen
=
9216
;
}
else
{
}
else
{
// 839 sequence
switch
(
mu
){
case
1
:
dftlen
=
1536
;
dftlen
=
1536
;
break
;
default:
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
break
;
}
}
}
// short format
break
;
}
// 3/4 sampling
}
// <=50 MHz BW
case
61440
:
else
if
(
fp
->
N_RB_UL
<=
273
)
{
// 40, 50, 60 MHz @ 61.44 Ms/s
if
(
fp
->
threequarter_fs
==
0
)
{
//80,90,100 MHz @ 122.88 Ms/s
if
(
prach_sequence_length
==
0
)
{
if
(
prach_sequence_length
==
0
)
{
if
(
prach_fmt_id
==
0
||
prach_fmt_id
==
1
||
prach_fmt_id
==
2
)
if
(
prach_fmt_id
==
0
||
prach_fmt_id
==
1
||
prach_fmt_id
==
2
)
dftlen
=
98304
;
dftlen
=
49152
;
if
(
prach_fmt_id
==
3
)
if
(
prach_fmt_id
==
3
)
dftlen
=
24576
;
dftlen
=
12288
;
}
else
{
// 839 sequence
dftlen
=
2048
;
}
}
}
else
{
// threequarter sampling
switch
(
mu
){
case
1
:
dftlen
=
4096
;
break
;
break
;
default:
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
case
92160
:
break
;
// 50, 60, 70, 80, 90 MHz @ 92.16 Ms/s
}
}
}
else
{
AssertFatal
(
fp
->
N_RB_UL
<=
217
,
"cannot do more than 217 PRBs with 3/4 sampling
\n
"
);
// 80 MHz @ 92.16 Ms/s
if
(
prach_sequence_length
==
0
)
{
if
(
prach_sequence_length
==
0
)
{
if
(
prach_fmt_id
==
0
||
prach_fmt_id
==
1
||
prach_fmt_id
==
2
)
if
(
prach_fmt_id
==
0
||
prach_fmt_id
==
1
||
prach_fmt_id
==
2
)
dftlen
=
73728
;
dftlen
=
73728
;
if
(
prach_fmt_id
==
3
)
if
(
prach_fmt_id
==
3
)
dftlen
=
18432
;
dftlen
=
18432
;
}
else
{
}
else
{
// 839 sequence
switch
(
mu
){
case
1
:
dftlen
=
3072
;
dftlen
=
3072
;
break
;
default:
AssertFatal
(
1
==
0
,
"Shouldn't get here
\n
"
);
break
;
}
}
break
;
case
122880
:
// 70, 80, 90, 100 MHz @ 122.88 Ms/s
if
(
prach_sequence_length
==
0
)
{
if
(
prach_fmt_id
==
0
||
prach_fmt_id
==
1
||
prach_fmt_id
==
2
)
dftlen
=
98304
;
if
(
prach_fmt_id
==
3
)
dftlen
=
24576
;
}
else
{
// 839 sequence
dftlen
=
4096
;
}
}
break
;
default:
AssertFatal
(
1
==
0
,
"sample rate %f MHz not supported for numerology %d
\n
"
,
fp
->
samples_per_subframe
/
1000
.
0
,
mu
);
}
}
}
}
else
if
(
mu
==
3
)
{
else
if
(
mu
==
3
)
{
...
@@ -432,8 +404,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
...
@@ -432,8 +404,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
use_extended_prach_prefix
=
1
;
use_extended_prach_prefix
=
1
;
}
}
if
(
fp
->
N_RB_UL
<=
34
)
{
//32 PRB case 61.44Msps
if
(
mu
==
3
)
{
if
(
fp
->
threequarter_fs
==
0
)
{
switch
(
fp
->
samples_per_subframe
)
{
case
61440
:
// 32 PRB case, 61.44 Msps
Ncp
<<=
1
;
//to account for 61.44Mbps
Ncp
<<=
1
;
//to account for 61.44Mbps
// This is after cyclic prefix
// This is after cyclic prefix
prach2
=
prach
+
(
Ncp
<<
1
);
//times 2 for complex samples
prach2
=
prach
+
(
Ncp
<<
1
);
//times 2 for complex samples
...
@@ -491,13 +464,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
...
@@ -491,13 +464,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
prach_len
=
(
512
*
12
)
+
Ncp
;
prach_len
=
(
512
*
12
)
+
Ncp
;
}
}
}
}
}
break
;
else
AssertFatal
(
1
==
0
,
"3/4 sampling not supported for this PRACH size %d
\n
"
,
fp
->
N_RB_UL
);
}
case
122880
:
// 66 PRB case, 122.88 Msps
else
if
(
fp
->
N_RB_UL
<=
68
)
{
//66 PRB case, 122.88 Msps
if
(
fp
->
threequarter_fs
==
0
)
{
Ncp
<<=
2
;
//to account for 122.88Mbps
Ncp
<<=
2
;
//to account for 122.88Mbps
// This is after cyclic prefix
// This is after cyclic prefix
prach2
=
prach
+
(
Ncp
<<
1
);
//times 2 for complex samples
prach2
=
prach
+
(
Ncp
<<
1
);
//times 2 for complex samples
...
@@ -555,13 +524,15 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
...
@@ -555,13 +524,15 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
prach_len
=
(
1024
*
12
)
+
Ncp
;
prach_len
=
(
1024
*
12
)
+
Ncp
;
}
}
}
}
break
;
default:
AssertFatal
(
1
==
0
,
"sample rate %f MHz not supported for numerology %d
\n
"
,
fp
->
samples_per_subframe
/
1000
.
0
,
mu
);
}
}
else
}
else
if
(
mu
==
1
)
{
AssertFatal
(
1
==
0
,
"3/4 sampling not supported for this PRACH size %d
\n
"
,
fp
->
N_RB_UL
);
switch
(
fp
->
samples_per_subframe
)
{
}
case
61440
:
// full sampling @ 61.44 Ms/s
else
if
(
fp
->
N_RB_UL
<
137
)
{
// 46.08 or 61.44 Ms/s
Ncp
=
Ncp
*
2
;
// to account for 61.44 Ms/s
if
(
fp
->
threequarter_fs
==
0
)
{
// full sampling @ 61.44 Ms/s
Ncp
<<=
1
;
//to account for 61.44Mbps
// This is after cyclic prefix
// This is after cyclic prefix
prach2
=
prach
+
(
Ncp
<<
1
);
//times 2 for complex samples
prach2
=
prach
+
(
Ncp
<<
1
);
//times 2 for complex samples
if
(
prach_sequence_length
==
0
){
if
(
prach_sequence_length
==
0
){
...
@@ -587,7 +558,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
...
@@ -587,7 +558,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
memmove
(
prach
,
prach
+
(
49152
<<
3
),(
Ncp
<<
2
));
memmove
(
prach
,
prach
+
(
49152
<<
3
),(
Ncp
<<
2
));
// here we have |Prefix | Prach49152 | Prach49152| Prach49152 | Prach49152
// here we have |Prefix | Prach49152 | Prach49152| Prach49152 | Prach49152
prach_len
=
(
49152
*
4
)
+
Ncp
;
prach_len
=
(
49152
*
4
)
+
Ncp
;
}
else
if
(
prach_fmt_id
==
3
)
{
//
//
6144 samples @ 30.72 Ms/s, 12288 samples @ 61.44 Ms/s
}
else
if
(
prach_fmt_id
==
3
)
{
// 6144 samples @ 30.72 Ms/s, 12288 samples @ 61.44 Ms/s
idft
(
IDFT_12288
,
prachF
,
prach2
,
1
);
idft
(
IDFT_12288
,
prachF
,
prach2
,
1
);
memmove
(
prach2
+
(
12288
<<
1
),
prach2
,(
12288
<<
2
));
memmove
(
prach2
+
(
12288
<<
1
),
prach2
,(
12288
<<
2
));
// here we have |empty | Prach12288 | Prach12288| empty12288 | empty12288
// here we have |empty | Prach12288 | Prach12288| empty12288 | empty12288
...
@@ -649,7 +620,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
...
@@ -649,7 +620,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
prach_len
=
(
2048
*
12
)
+
Ncp
;
prach_len
=
(
2048
*
12
)
+
Ncp
;
}
}
}
}
}
else
{
// threequarter sampling @ 46.08 Ms/s
break
;
case
46080
:
// threequarter sampling @ 46.08 Ms/s
Ncp
=
(
Ncp
*
3
)
/
2
;
Ncp
=
(
Ncp
*
3
)
/
2
;
prach2
=
prach
+
(
Ncp
<<
1
);
prach2
=
prach
+
(
Ncp
<<
1
);
if
(
prach_sequence_length
==
0
){
if
(
prach_sequence_length
==
0
){
...
@@ -738,9 +711,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
...
@@ -738,9 +711,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
prach_len
=
(
1536
*
12
)
+
Ncp
;
prach_len
=
(
1536
*
12
)
+
Ncp
;
}
}
}
}
}
break
;
}
else
if
(
fp
->
N_RB_UL
<=
273
)
{
// 92.16 or 122.88 Ms/s
if
(
fp
->
threequarter_fs
==
0
)
{
// full sampling @ 122.88 Ms/s
case
122880
:
// full sampling @ 122.88 Ms/s
Ncp
<<=
2
;
//to account for 122.88Mbps
Ncp
<<=
2
;
//to account for 122.88Mbps
// This is after cyclic prefix
// This is after cyclic prefix
prach2
=
prach
+
(
Ncp
<<
1
);
//times 2 for complex samples
prach2
=
prach
+
(
Ncp
<<
1
);
//times 2 for complex samples
...
@@ -828,7 +801,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
...
@@ -828,7 +801,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
prach_len
=
(
4096
*
12
)
+
Ncp
;
prach_len
=
(
4096
*
12
)
+
Ncp
;
}
}
}
}
}
else
{
// three quarter sampling @ 92.16 Ms/s
break
;
case
92160
:
// three quarter sampling @ 92.16 Ms/s
Ncp
=
(
Ncp
*
3
);
//to account for 92.16 Msps
Ncp
=
(
Ncp
*
3
);
//to account for 92.16 Msps
prach2
=
prach
+
(
Ncp
<<
1
);
//times 2 for complex samples
prach2
=
prach
+
(
Ncp
<<
1
);
//times 2 for complex samples
if
(
prach_sequence_length
==
0
){
if
(
prach_sequence_length
==
0
){
...
@@ -915,6 +890,10 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
...
@@ -915,6 +890,10 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
prach_len
=
(
3072
*
12
)
+
Ncp
;
prach_len
=
(
3072
*
12
)
+
Ncp
;
}
}
}
}
break
;
default:
AssertFatal
(
1
==
0
,
"sample rate %f MHz not supported for numerology %d
\n
"
,
fp
->
samples_per_subframe
/
1000
.
0
,
mu
);
}
}
}
}
...
...
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