信道
信道#
信道部分的信号处理主要包括发端收端的DAC、ADC、信道传输、波分复用及解复用过程。在运行主函数中通过调用信道模块中的函数实现信道仿真:
if ch_para.infor_print:
print('---------------- Channel start ----------------')
rx_sig = channel_main.channel_transmission(tx_seq, ch_para, plot_para = plot_para)
接下来对信道模块中的代码执行进行简单介绍。首先使用者可通过设置配置文件中的随机数种子以控制随机信道效应的仿真。此处也可以通过配置输出设置,选择是否显示相应提示信息,提示信息输出如下所示。
def channel_transmission(x, para, plot_para=None):
print_flag = para.infor_print
plot_flag = para.fig_plot
save_flag = para.save_data
data_mode, device = para.ch_data_mode, para.device
plot_para.sam_rate = para.sam_rate
if para.ch_random or para.rand_seed <= 0:
rand_seed = -501
if print_flag:
print(' Channel random effects are non-determinstic')
else:
rand_seed = para.rand_seed
if print_flag:
print(' Channel random effects are determinstic')
start_time = time.time()
---------------- Channel start ----------------
Channel random effects are determinstic
Resample to channel sample rate
下面进入信道部分的信号处理流程。输入的经过发端滤波成形后的信号,首先经DAC处理,将进行信道重采样。
if para.dac:
"""
Resample to the channel sample rate
"""
if para.infor_print:
print(' Resample to channel sample rate')
for i_c in range(para.channel_num):
for i_p in range(para.nPol):
x[i_c][i_p] = resample(x[i_c][i_p], rate = para.upsam)
Resample to channel sample rate
随后进行波分复用处理,此处可以通过配置文件中的输出设置来选择是否展示WDM处理进度及生成WDM信号功率谱密度图,示意图如下图所示。另外可以设置是否保存发送的合波信号数据,保存格式为npz,数据文件名为’after_wdm_x.npz’ ‘after_wdm_y.npz’。
x = para.wdm_obj.wdm_multiplexing(x)
if plot_flag:
f_light = para.optical_carrier*10**-3
lim = (1.1*para.channel_space * para.channel_num/2)*10**-3
xlim = [-lim+f_light, lim+f_light]
plot_para.psd(x[0], name = 'WDM_PSD', \
fc = f_light, hz = 'THz', xlim=xlim)
if save_flag:
pol_name = ['x', 'y']
for i_p in range(para.nPol):
name = 'after_wdm_'+ pol_name[i_p]
para.save_data_func(x[i_p], name, data_mode = para.wdm_data_mode)
check_power(x, para.sig_power_dbm, para.channel_num)
WDM Start!
WDM: 100%|█████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 6.91it/s]
WDM end with the running time 0.4358 s
随后开始信号在仿真信道中的传输。可选择的信道类型包括光纤信道及AWGN信道,其中光纤信道的仿真传输可选择分布式傅里叶方法(SSFM)或AI信道模型。将会显示信道的基本参数设置及仿真传输的进度。可以设置是否保存光纤信道各跨段输出信号,保存格式为npz,文件名为’after_span….npz’ ;信道最终输出信号数据保存为’after_fiber_x.npz’,’after_fiber_y.npz’。
if para.channel_type == 1:
if para.fiber_mode == 'SSFM':
if print_flag:
print(' Input into the SSFM channel with {} spans and {}km'.format(para.span_num, para.total_len))
x = fiber_ssfm_trans(x, rand_seed+25, para)
elif para.fiber_mode == 'NN':
if print_flag:
print(' Input into the NN channel with {} spans and {}km'.format(para.span_num, para.total_len))
x = fiber_nn_trans(x, rand_seed+25, para)
elif para.channel == 2:
x = awgn.awgn(x)
check_power(x, para.sig_power_dbm, para.channel_num)
if save_flag:
pol_name = ['x', 'y']
for i_p in range(para.nPol):
name = 'after_fiber_'+ pol_name[i_p]
para.save_data_func(x[i_p], name, data_mode = para.ch_data_mode)
使用SSFM进行光纤信道仿真:
Input into the SSFM channel with 10 spans and 800km
Fiber SSFM Start!
Fiber SSFM: 100%|██████████████████████████████████████████████████████████████████████| 10/10 [00:11<00:00, 1.18s/it]
Fiber SSFM end with the running time 11.7603 s
使用AI模型进行光纤信道仿真:
Fiber NN Start!
Fiber NN: 100%|████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.22s/it]
Fiber NN end with the running time 1.2236 s
信道传输完成后,进入收端,进行波分解复用、相干接收、ADC重采样处理,将输出相应提示信息,最后输出整个信道仿真过程的时长。
x = para.wdm_obj.wdm_demultiplexing(x, para_update=0)
if para.receiver:
if print_flag:
print(' Input to the ICR ...')
x = para.icr_obj(x, rand_seed = rand_seed+85)
if para.adc:
for i_p in range(para.nPol):
x[i_p] = resample(x[i_p], rate = para.rx_sam_rate/para.ch_sam_rate)
if print_flag:
print(' ADC: Downsampling to {:.0f} Gsam/s'.format(para.rx_sam_rate))
end_time = time.time()
if print_flag:
print(' Channel simulation time: %.4f s' % (end_time - start_time))
Input to the ICR ...
ADC: Downsampling to 100 Gsam/s
Channel simulation time: 6.1767 s
---------------- Channel finished ----------------
作为本平台AI信道建模效果的演示,下面两幅图分别为单通道,80km,入纤功率10.0dBm的条件下,采用SSFM与AI信道模型与进行传输仿真得到的收端经色散补偿后的信号星座图。