diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index 4a12452a96..ed144886ee 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -156,12 +156,18 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch, } // Scrambling is now done with offset (nushift*M)%32 offset = (nushift*M)&0x1f; +#ifdef DEBUG_PBCH_ENCODING + printf("Scrambling params: nushift %d M %d length %d bitwise %d offset %d\n", nushift, M, length, bitwise, offset); +#endif for (int i=0; i>i)&1)? (((*pbch_a_interleaved)>>i)&1)<>i)&1) ^ ((s>>((i+offset)&0x1f))&1))<>2)&1)<<1) ^ ((sfn>>1)&1); nr_pbch_scrambling(pbch, (uint32_t)config->sch_config.physical_cell_id.value, nushift, M, NR_POLAR_PBCH_PAYLOAD_BITS, 1); #ifdef DEBUG_PBCH_ENCODING - + printf("Payload scrambling:\n"); + for (int i=0; i<4; i++) + printf("pbch_a_prime[%d]: 0x%04x\n", i, pbch->pbch_a_prime[i]); #endif /// CRC, coding and rate matching polar_encoder (pbch->pbch_a_prime, pbch->pbch_e, &frame_parms->pbch_polar_params); #ifdef DEBUG_PBCH_ENCODING - + printf("Channel coding:\n"); + for (int i=0; i>3; i++) + printf("pbch_e[%d]: 0x%04x", i, pbch->pbch_e[i]); + printf("\n"); #endif /// Scrambling M = NR_POLAR_PBCH_E; nushift = config->sch_config.physical_cell_id.value &3;; nr_pbch_scrambling(pbch, (uint32_t)config->sch_config.physical_cell_id.value, nushift, M, NR_POLAR_PBCH_E, 0); +#ifdef DEBUG_PBCH_ENCODING + printf("Scrambling:\n"); + for (int i=0; i>3; i++) + printf("pbch_e[%d]: 0x%04x", i, pbch->pbch_e[i]); + printf("\n"); +#endif /// QPSK modulation for (int i=0; i>1; i++){