当前位置: 首页 > news >正文

phy_simulators之nr_pbchsim之PBCH-DMRS

phy_simulators之nr_pbchsim之PBCH-DMRS

Posted on 2026-04-29 17:49  普罗大众  阅读(0)  评论(0)    收藏  举报

1)nr_pbch_detection,检测PBCH

1.1)不同序列假设下的 PBCH DMRS相关, PBCH DMRS携带8种序列假设

for (int hf = 0; hf < N_hf; hf++) {

    for (int l = 0; l < N_L; l++) {

      // computing correlation between received DMRS symbols and transmitted sequence for current i_ssb and n_hf

      cd_t cumul = {0};

      for (int i = pbch_initial_symbol; i < pbch_initial_symbol + 3; i++) {

        c32_t meas = nr_pbch_dmrs_correlation(frame_parms,

                                              proc,

                                              i,

                                              i - pbch_initial_symbol,

                                              Nid_cell,

                                              ssb_start_subcarrier,

                                              nr_gold_pbch(frame_parms->Lmax, Nid_cell, hf, l),

                                              rxdataF);

1.2)=> 调用nr_pbch_dmrs_correlation

一个OFDM符号上的PBCH DMRS相关 

生成本地的DMRS为:

nr_pbch_dmrs_rx(dmrss, (uint32_t *)nr_gold_pbch, pilot, false);

第dmrss个符号,PBCH序列为nr_gold_pbch,输出为pilot

逐个RX天线进行相关:

for (int aarx = 0; aarx < fp->nb_antennas_rx; aarx++) {

    int re_offset = ssb_offset;

    c16_t *pil = pilot;

    const c16_t *rxF = &rxdataF[aarx][symbol_offset + k];

本地信号(采样点)为pil,接收信号(采样点)为rxF

symbol_offset=4096

k = Nid_cell % 4

不同的cell ID,DMRS会有不同的偏移,共4种偏移

复数相加并累计起来:

computed_val = c32x16maddShift(*pil, rxF[re_offset], computed_val, 15);

__attribute__((always_inline)) inline c32_t c32x16maddShift(const c16_t a, const c16_t b, const c32_t c, const int Shift) {

    return (c32_t) {

      .r = ((a.r * b.r - a.i * b.i) >> Shift) + c.r,

      .i = ((a.r * b.i + a.i * b.r) >> Shift) + c.i

    };

}

computed_val既是输入也是输出

其中:re_offset应该是子载波位置,也是采样点位置,re_offset = ssb_offset,ssb_offset = fp->first_carrier_offset + ssb_start_subcarrier,比如re_offset=1928

具体来说,接收信号逐次加4,即每4个子载波有一个DMRS,re_offset = (re_offset + 4) % fp->ofdm_symbol_size

本地信号逐次加1,pil++

2.3)PBCH DMRS信道估计:nr_pbch_channel_estimation