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
zzha zzha
OpenXG-RAN
Commits
ee91f661
Commit
ee91f661
authored
Jun 04, 2018
by
Sebastian Wagner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing file lte_gold_generic.c
parent
6742d6f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c
openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c
+75
-0
No files found.
openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c
0 → 100644
View file @
ee91f661
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "PHY/types.h"
/**
\brief Gold Sequence Generation defined in 3x.211
\param x1 x1 shift register
\param x2 x2 shift register / cinit if reset is set
\param reset Reset flag / reinitialize the generator
\return c 32 bits of gold output
*/
extern
inline
uint32_t
lte_gold_generic
(
uint32_t
*
x1
,
uint32_t
*
x2
,
uint8_t
reset
)
{
int32_t
n
;
// 3GPP 3x.211
// Nc = 1600
// c(n) = [x1(n+Nc) + x2(n+Nc)]mod2
// x1(n+31) = [x1(n+3) + x1(n)]mod2
// x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2
if
(
reset
)
{
// Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30
// x1(31) = [x1(3) + x1(0)]mod2 = 1
*
x1
=
1
+
(
1
<<
31
);
// Init value for x2: cinit = sum_{i=0}^30 x2*2^i
// x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2
// = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2
*
x2
=
*
x2
^
((
*
x2
^
(
*
x2
>>
1
)
^
(
*
x2
>>
2
)
^
(
*
x2
>>
3
))
<<
31
);
// x1 and x2 contain bits n = 0,1,...,31
// Nc = 1600 bits are skipped at the beginning
// i.e., 1600 / 32 = 50 32bit words
for
(
n
=
1
;
n
<
50
;
n
++
)
{
// Compute x1(0),...,x1(27)
*
x1
=
(
*
x1
>>
1
)
^
(
*
x1
>>
4
);
// Compute x1(28),..,x1(31) and xor
*
x1
=
*
x1
^
(
*
x1
<<
31
)
^
(
*
x1
<<
28
);
// Compute x2(0),...,x2(27)
*
x2
=
(
*
x2
>>
1
)
^
(
*
x2
>>
2
)
^
(
*
x2
>>
3
)
^
(
*
x2
>>
4
);
// Compute x2(28),..,x2(31) and xor
*
x2
=
*
x2
^
(
*
x2
<<
31
)
^
(
*
x2
<<
30
)
^
(
*
x2
<<
29
)
^
(
*
x2
<<
28
);
}
}
*
x1
=
(
*
x1
>>
1
)
^
(
*
x1
>>
4
);
*
x1
=
*
x1
^
(
*
x1
<<
31
)
^
(
*
x1
<<
28
);
*
x2
=
(
*
x2
>>
1
)
^
(
*
x2
>>
2
)
^
(
*
x2
>>
3
)
^
(
*
x2
>>
4
);
*
x2
=
*
x2
^
(
*
x2
<<
31
)
^
(
*
x2
<<
30
)
^
(
*
x2
<<
29
)
^
(
*
x2
<<
28
);
// c(n) = [x1(n+Nc) + x2(n+Nc)]mod2
return
(
*
x1
^*
x2
);
}
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