Commit 09a481d9 authored by Guy De Souza's avatar Guy De Souza

PBCH and modulation bugs

parent 109f6ef4
Pipeline #11328 failed with stage
in 0 seconds
...@@ -246,6 +246,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch, ...@@ -246,6 +246,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
uint16_t M; uint16_t M;
uint8_t nushift; uint8_t nushift;
uint32_t unscrambling_mask; uint32_t unscrambling_mask;
uint64_t a_reversed=0;
LOG_I(PHY, "PBCH generation started\n"); LOG_I(PHY, "PBCH generation started\n");
...@@ -300,8 +301,13 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch, ...@@ -300,8 +301,13 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
printf("pbch_a_prime: 0x%08x\n", pbch->pbch_a_prime); printf("pbch_a_prime: 0x%08x\n", pbch->pbch_a_prime);
#endif #endif
// Encoder reversal
for (int i=0; i<NR_POLAR_PBCH_PAYLOAD_BITS; i++)
a_reversed |= (((uint64_t)pbch->pbch_a_prime>>i)&1)<<(31-i);
/// CRC, coding and rate matching /// CRC, coding and rate matching
polar_encoder_fast (&pbch->pbch_a_prime, (uint32_t*)pbch->pbch_e, 0, polar_params); polar_encoder_fast (&a_reversed, (uint32_t*)pbch->pbch_e, 0, polar_params);
#ifdef DEBUG_PBCH_ENCODING #ifdef DEBUG_PBCH_ENCODING
printf("Channel coding:\n"); printf("Channel coding:\n");
for (int i=0; i<NR_POLAR_PBCH_E_DWORD; i++) for (int i=0; i<NR_POLAR_PBCH_E_DWORD; i++)
......
...@@ -48,7 +48,7 @@ int nr_generate_pss( int16_t *d_pss, ...@@ -48,7 +48,7 @@ int nr_generate_pss( int16_t *d_pss,
for (i=0; i < NR_PSS_LENGTH; i++) { for (i=0; i < NR_PSS_LENGTH; i++) {
m = (i + 43*Nid2)%(NR_PSS_LENGTH); m = (i + 43*Nid2)%(NR_PSS_LENGTH);
d_pss[i] = (1 - 2*x[m]) * 32767; d_pss[i] = (1 - 2*x[m]) * 23170;
} }
#ifdef NR_PSS_DEBUG #ifdef NR_PSS_DEBUG
......
...@@ -57,7 +57,7 @@ int nr_generate_sss( int16_t *d_sss, ...@@ -57,7 +57,7 @@ int nr_generate_sss( int16_t *d_sss,
m1 = Nid1 % 112; m1 = Nid1 % 112;
for (i = 0; i < NR_SSS_LENGTH ; i++) { for (i = 0; i < NR_SSS_LENGTH ; i++) {
d_sss[i] = (1 - 2*x0[(i + m0) % NR_SSS_LENGTH] ) * (1 - 2*x1[(i + m1) % NR_SSS_LENGTH] ) * 32767; d_sss[i] = (1 - 2*x0[(i + m0) % NR_SSS_LENGTH] ) * (1 - 2*x1[(i + m1) % NR_SSS_LENGTH] ) * 23170;
} }
#ifdef NR_SSS_DEBUG #ifdef NR_SSS_DEBUG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment