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
Michael Black
OpenXG-RAN
Commits
8ae993ae
Commit
8ae993ae
authored
Jun 22, 2018
by
hongzhi wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ue add nr pbch unscrambling
parent
227216f0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
15 deletions
+32
-15
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+3
-0
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+26
-14
targets/RT/USER/nr-ue.c
targets/RT/USER/nr-ue.c
+3
-1
No files found.
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
View file @
8ae993ae
...
...
@@ -95,6 +95,8 @@ int pbch_detection(PHY_VARS_NR_UE *ue, runmode_t mode)
pbch_decoded
=
0
;
printf
(
"pbch_detection nid_cell %d
\n
"
,
frame_parms
->
Nid_cell
);
//for (frame_mod4=0; frame_mod4<4; frame_mod4++) {
pbch_tx_ant
=
nr_rx_pbch
(
ue
,
&
ue
->
proc
.
proc_rxtx
[
0
],
...
...
@@ -265,6 +267,7 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
nr_gold_pbch
(
ue
);
ret
=
pbch_detection
(
ue
,
mode
);
ret
=
-
1
;
// write_output("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
#ifdef DEBUG_INITIAL_SYNCH
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
View file @
8ae993ae
...
...
@@ -394,6 +394,8 @@ void nr_pbch_unscrambling(NR_DL_FRAME_PARMS *frame_parms,
uint8_t
reset
;
uint32_t
x1
,
x2
,
s
=
0
;
printf
(
"unscramb nid_cell %d
\n
"
,
frame_parms
->
Nid_cell
);
reset
=
1
;
// x1 is set in first call to lte_gold_generic
x2
=
frame_parms
->
Nid_cell
;
//this is c_init in 36.211 Sec 6.6.1
...
...
@@ -402,12 +404,13 @@ void nr_pbch_unscrambling(NR_DL_FRAME_PARMS *frame_parms,
for
(
i
=
0
;
i
<
length
;
i
++
)
{
if
(
i
%
32
==
0
)
{
s
=
lte_gold_generic
(
&
x1
,
&
x2
,
reset
);
//
printf("lte_gold[%d]=%x\n",i,s);
printf
(
"lte_gold[%d]=%x
\n
"
,
i
,
s
);
reset
=
0
;
}
if
(((
s
>>
(
i
%
32
))
&
1
)
==
0
)
pbch_a
[
i
]
=
-
pbch_a
[
i
];
printf
(
"s = %d
\n
"
,((
s
>>
(
i
%
32
))
&
1
)
);
if
(((
s
>>
(
i
%
32
))
&
1
)
==
1
)
pbch_a
[
i
]
=
1
-
pbch_a
[
i
];
}
}
...
...
@@ -449,7 +452,7 @@ void nr_pbch_alamouti(NR_DL_FRAME_PARMS *frame_parms,
}
void
nr_pbch_quantize
(
int
16_t
*
pbch_llr16
,
void
nr_pbch_quantize
(
int
8_t
*
pbch_llr8
,
int16_t
*
pbch_llr
,
uint16_t
len
)
{
...
...
@@ -462,7 +465,7 @@ void nr_pbch_quantize(int16_t *pbch_llr16,
else if (pbch_llr[i]<-8)
pbch_llr8[i]=-8;
else*/
pbch_llr
16
[
i
]
=
(
char
)(
pbch_llr
[
i
]);
pbch_llr
8
[
i
]
=
(
char
)(
pbch_llr
[
i
]);
}
}
...
...
@@ -487,9 +490,10 @@ uint16_t nr_rx_pbch( PHY_VARS_NR_UE *ue,
int
max_h
=
0
;
int
symbol
,
i
;
uint8_t
pbch_a
[
64
];
//uint8_t pbch_a[64];
uint8_t
*
pbch_a
=
malloc
(
sizeof
(
uint8_t
)
*
32
);
;
int
16
_t
*
pbch_e_rx
;
int
8
_t
*
pbch_e_rx
;
uint8_t
*
decoded_output
=
nr_ue_pbch_vars
->
decoded_output
;
uint16_t
crc
;
//short nr_demod_table[8] = {0,0,0,1,1,0,1,1};
...
...
@@ -504,6 +508,11 @@ uint16_t nr_rx_pbch( PHY_VARS_NR_UE *ue,
memset
(
&
channelOutput
[
0
],
0
,
sizeof
(
double
)
*
864
);
memset
(
&
estimatedOutput
[
0
],
0
,
sizeof
(
uint8_t
)
*
32
);
memset
(
&
pbch_a
[
0
],
0
,
sizeof
(
uint8_t
)
*
32
);
frame_parms
->
Nid_cell
=
100
;
printf
(
"nr_pbch_ue nid_cell %d
\n
"
,
frame_parms
->
Nid_cell
);
for
(
int
i
=
0
;
i
<
frame_parms
->
pbch_polar_params
.
payloadBits
;
i
++
)
aPrioriArray
[
i
]
=
NAN
;
int
subframe_rx
=
proc
->
subframe_rx
;
...
...
@@ -600,17 +609,20 @@ uint16_t nr_rx_pbch( PHY_VARS_NR_UE *ue,
//polar decoding de-rate matching
decoderState
=
polar_decoder
(
demod_pbch_e
,
estimatedOutput
,
&
frame_parms
->
pbch_polar_params
,
decoderListSize
,
aPrioriArray
,
pathMetricAppr
);
decoderState
=
polar_decoder
(
demod_pbch_e
,
pbch_a
,
&
frame_parms
->
pbch_polar_params
,
decoderListSize
,
aPrioriArray
,
pathMetricAppr
);
for
(
i
=
0
;
i
<
32
/*(NR_POLAR_PBCH_PAYLOAD_BITS>>3)*/
;
i
++
)
printf
(
"pbch_a[%d] = %d
\n
"
,
i
,
pbch_a
[
i
]);
//memset(pbch_a,0,((16+NR_POLAR_PBCH_PAYLOAD_BITS)>>3));
//un-scrambling
// nr_pbch_unscrambling(frame_parms,
// pbch_a,
// NR_POLAR_PBCH_PAYLOAD_BITS);
nr_pbch_unscrambling
(
frame_parms
,
pbch_a
,
NR_POLAR_PBCH_PAYLOAD_BITS
);
// Fix byte endian
for
(
i
=
0
;
i
<
32
/*(NR_POLAR_PBCH_PAYLOAD_BITS>>3)*/
;
i
++
)
printf
(
"estimated output[%d] = %d
\n
"
,
i
,
estimatedOutput
[
i
]);
printf
(
"after unscrambling pbch_a[%d] = %d
\n
"
,
i
,
pbch_a
[
i
]);
// Fix byte endian
//for (i=0; i<32 /*(NR_POLAR_PBCH_PAYLOAD_BITS>>3)*/; i++)
// printf("estimated output[%d] = %d \n", i,estimatedOutput[i]);
//decoded_output[(NR_POLAR_PBCH_PAYLOAD_BITS>>3)-i-1] = pbch_a[i];
//#ifdef DEBUG_PBCH
...
...
targets/RT/USER/nr-ue.c
View file @
8ae993ae
...
...
@@ -61,6 +61,8 @@
#include "T.h"
extern
double
cpuf
;
static
nfapi_config_request_t
config_t
;
static
nfapi_config_request_t
*
config
=&
config_t
;
#define FRAME_PERIOD 100000000ULL
#define DAQ_PERIOD 66667ULL
...
...
@@ -413,7 +415,7 @@ static void *UE_thread_synch(void *arg) {
//UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]);
//UE->rfdevice.trx_stop_func(&UE->rfdevice);
// sleep(1);
nr_init_frame_parms_ue
(
&
UE
->
frame_parms
);
nr_init_frame_parms_ue
(
config
,
&
UE
->
frame_parms
);
/*if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) {
LOG_E(HW,"Could not start the device\n");
oai_exit=1;
...
...
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