Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
227216f0
Commit
227216f0
authored
7 years ago
by
hongzhi wang
Browse files
Options
Downloads
Patches
Plain Diff
ue add pbch demodulation
parent
269e2182
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
openair1/PHY/INIT/nr_init_ue.c
+4
-4
4 additions, 4 deletions
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+40
-13
40 additions, 13 deletions
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
with
44 additions
and
17 deletions
openair1/PHY/INIT/nr_init_ue.c
+
4
−
4
View file @
227216f0
...
...
@@ -842,17 +842,17 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
pbch_vars
[
eNB_id
]
->
rxdataF_ext
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
eNB_id
]
->
rxdataF_comp
=
(
int32_t
**
)
malloc16_clear
(
8
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
eNB_id
]
->
dl_ch_estimates_ext
=
(
int32_t
**
)
malloc16_clear
(
8
*
sizeof
(
int32_t
*
)
);
pbch_vars
[
eNB_id
]
->
llr
=
(
int8_t
*
)
malloc16_clear
(
1920
);
pbch_vars
[
eNB_id
]
->
llr
=
(
int8_t
*
)
malloc16_clear
(
1920
);
//
prach_vars
[
eNB_id
]
->
prachF
=
(
int16_t
*
)
malloc16_clear
(
sizeof
(
int
)
*
(
7
*
2
*
sizeof
(
int
)
*
(
fp
->
ofdm_symbol_size
*
12
))
);
prach_vars
[
eNB_id
]
->
prach
=
(
int16_t
*
)
malloc16_clear
(
sizeof
(
int
)
*
(
7
*
2
*
sizeof
(
int
)
*
(
fp
->
ofdm_symbol_size
*
12
))
);
for
(
i
=
0
;
i
<
fp
->
nb_antennas_rx
;
i
++
)
{
pbch_vars
[
eNB_id
]
->
rxdataF_ext
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
6
*
12
*
4
);
pbch_vars
[
eNB_id
]
->
rxdataF_ext
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
20
*
12
*
4
);
for
(
j
=
0
;
j
<
4
;
j
++
)
{
//fp->nb_antennas_tx;j++) {
int
idx
=
(
j
<<
1
)
+
i
;
pbch_vars
[
eNB_id
]
->
rxdataF_comp
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
6
*
12
*
4
);
pbch_vars
[
eNB_id
]
->
dl_ch_estimates_ext
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
6
*
12
*
4
);
pbch_vars
[
eNB_id
]
->
rxdataF_comp
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
20
*
12
*
4
);
pbch_vars
[
eNB_id
]
->
dl_ch_estimates_ext
[
idx
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
20
*
12
*
4
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+
40
−
13
View file @
227216f0
...
...
@@ -33,6 +33,7 @@
#include
"PHY/CODING/coding_extern.h"
#include
"PHY/phy_extern_nr_ue.h"
#include
"PHY/sse_intrin.h"
#include
"SIMULATION/TOOLS/sim.h"
//#define DEBUG_PBCH 1
//#define DEBUG_PBCH_ENCODING
...
...
@@ -246,7 +247,7 @@ void nr_pbch_channel_compensation(int **rxdataF_ext,
uint8_t
output_shift
)
{
uint16_t
rb
,
nb_rb
=
15
;
uint16_t
rb
,
nb_rb
=
20
;
uint8_t
aatx
,
aarx
;
#if defined(__x86_64__) || defined(__i386__)
__m128i
*
dl_ch128
,
*
rxdataF128
,
*
rxdataF_comp128
;
...
...
@@ -466,6 +467,10 @@ void nr_pbch_quantize(int16_t *pbch_llr16,
}
}
unsigned
short
sign
(
short
x
)
{
return
(
unsigned
short
)
x
>>
15
;
}
uint16_t
nr_rx_pbch
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
NR_UE_PBCH
*
nr_ue_pbch_vars
,
...
...
@@ -482,14 +487,24 @@ uint16_t nr_rx_pbch( PHY_VARS_NR_UE *ue,
int
max_h
=
0
;
int
symbol
,
i
;
uint8_t
pbch_a
[
8
];
uint8_t
pbch_a
[
64
];
int16_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};
double
nr_demod_table
[
8
]
=
{
0
.
707
,
0
.
707
,
0
.
707
,
-
0
.
707
,
-
0
.
707
,
0
.
707
,
-
0
.
707
,
-
0
.
707
};
double
*
demod_pbch_e
=
malloc
(
sizeof
(
double
)
*
864
);
unsigned
short
idx_demod
=
0
;
int8_t
decoderState
=
0
;
uint8_t
decoderListSize
=
8
,
pathMetricAppr
=
0
;
double
aPrioriArray
[
frame_parms
->
pbch_polar_params
.
payloadBits
];
// assume no a priori knowledge available about the payload.
double
*
channelOutput
=
malloc
(
sizeof
(
double
)
*
864
);
//add noise
uint8_t
*
estimatedOutput
=
malloc
(
sizeof
(
uint8_t
)
*
32
);
//decoder output
memset
(
&
channelOutput
[
0
],
0
,
sizeof
(
double
)
*
864
);
memset
(
&
estimatedOutput
[
0
],
0
,
sizeof
(
uint8_t
)
*
32
);
for
(
int
i
=
0
;
i
<
frame_parms
->
pbch_polar_params
.
payloadBits
;
i
++
)
aPrioriArray
[
i
]
=
NAN
;
int
subframe_rx
=
proc
->
subframe_rx
;
...
...
@@ -573,25 +588,37 @@ uint16_t nr_rx_pbch( PHY_VARS_NR_UE *ue,
printf
(
"pbch rx llr %d rxdata_comp %d addr %p
\n
"
,
*
(
pbch_e_rx
+
cnt
),
p
[
cnt
],
&
p
[
0
]);
//#endif
for
(
int
i
=
0
;
i
<
NR_POLAR_PBCH_E
/
2
;
i
++
){
idx_demod
=
(
sign
(
pbch_e_rx
[
i
<<
1
])
&
1
)
^
((
sign
(
pbch_e_rx
[(
i
<<
1
)
+
1
])
&
1
)
<<
1
);
demod_pbch_e
[
i
<<
1
]
=
nr_demod_table
[(
idx_demod
)
<<
1
];
demod_pbch_e
[(
i
<<
1
)
+
1
]
=
nr_demod_table
[((
idx_demod
)
<<
1
)
+
1
];
if
(
i
<
16
){
printf
(
"idx[%d]= %d
\n
"
,
i
,
idx_demod
);
printf
(
"sign[%d]= %d sign[%d]= %d
\n
"
,
i
<<
1
,
sign
(
pbch_e_rx
[
i
<<
1
]),
(
i
<<
1
)
+
1
,
sign
(
pbch_e_rx
[(
i
<<
1
)
+
1
]));
printf
(
"demod_pbch_e2[%d] r = %2.3f i = %2.3f
\n
"
,
i
<<
1
,
demod_pbch_e
[
i
<<
1
],
demod_pbch_e
[(
i
<<
1
)
+
1
]);}
}
//polar decoding de-rate matching
decoderState
=
polar_decoder
(
(
double
*
)
pbch_e_rx
,
pbch_a
,
&
frame_parms
->
pbch_polar_params
,
decoderListSize
,
aPrioriArray
,
pathMetricAppr
);
decoderState
=
polar_decoder
(
demod_pbch_e
,
estimatedOutput
,
&
frame_parms
->
pbch_polar_params
,
decoderListSize
,
aPrioriArray
,
pathMetricAppr
);
memset
(
pbch_a
,
0
,((
16
+
NR_POLAR_PBCH_PAYLOAD_BITS
)
>>
3
));
//
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
<
(
NR_POLAR_PBCH_PAYLOAD_BITS
>>
3
);
i
++
)
decoded_output
[(
NR_POLAR_PBCH_PAYLOAD_BITS
>>
3
)
-
i
-
1
]
=
pbch_a
[
i
];
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
//
#ifdef DEBUG_PBCH
for
(
i
=
0
;
i
<
(
NR_POLAR_PBCH_PAYLOAD_BITS
>>
3
)
;
i
++
)
msg
(
"[PBCH] pbch_a[%d] = %x
\n
"
,
i
,
decoded_output
[
i
]);
//
for (i=0; i<
2
; i++)
// printf
("[PBCH] pbch_a[%d] = %x\n",i,decoded_output[i]);
#endif
//
#endif
#ifdef DEBUG_PBCH
msg
(
"PBCH CRC %x : %x
\n
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment