当前位置:网站首页>oai 采样频率计算

oai 采样频率计算

2022-08-10 23:22:00 洪大宇

N_RB_DL_TABLE = {
    }

N_RB_DL_TABLE["61.44mhz"] = 106
N_RB_DL_TABLE["122.88mhz"] = 106 << 1
N_RB_DL_TABLE["245.76mhz"] = 106 << 2 #Max sampples


def samples_rate_nr_soft_modem(CONFIG_N_RB_DL: str):
    """ 5G NR Soft Caculaters samples rate nr soft modem Args: CONFIG_N_RB_DL (str): _description_ """
    try:
        N_RB_DL = N_RB_DL_TABLE[CONFIG_N_RB_DL]
        ofdm_symbol_size = 512
        mu = 1  # scs30khz caculte ofdm_symbol_size
        symbols_per_slot = 14
        solts_per_subframe = 2

        solts_per_frame = 10*solts_per_subframe

        while ofdm_symbol_size < N_RB_DL * 12:
            ofdm_symbol_size <<= 1

        first_carrier_offset = ofdm_symbol_size - (N_RB_DL*12/2)
        nb_prefix_samples = ofdm_symbol_size/128*9
        nb_prefix_samples0 = ofdm_symbol_size/128*(9+(1 << mu))

        samples_per_subframe = (nb_prefix_samples0 + ofdm_symbol_size)*2 + \
            (nb_prefix_samples+ofdm_symbol_size) * \
            (symbols_per_slot*solts_per_subframe - 2)

        print(
            f"ofdm_symbol: {
      ofdm_symbol_size} nb_prefix_samples: {
      nb_prefix_samples} nb_prefix_samples0: {
      nb_prefix_samples0}")
        print(f"samples_per_frame: {
      10*samples_per_subframe}")
        print(f"2framers_samples: {
      2*10*samples_per_subframe}")
        print(f"Normal samples is {
      (10*samples_per_subframe/1e-2)/1e6} Mhz")
    except LookupError as e:  # querry out of ranges
        print(f"{
      e.args[0]} out range of table")


if __name__ == '__main__':
    samples_rate_nr_soft_modem("61.44mhz")
原网站

版权声明
本文为[洪大宇]所创,转载请带上原文链接,感谢
https://hongdayu.blog.csdn.net/article/details/126269190