📄 randnase.txt
字号:
// Debug the sigma through the spectrum
sprintf(filename4, "SP_ch%d_1.dat", index_ch[j]);
output_spectrum(filename4, field_ch2, f[j], sp_res, wl, lambda, 2.0);
double u=0, z=0;
for (i=0;i<mnb;i++)
{
u += field_ch2.noise[i].re*field_ch2.noise[i].re;
u += field_ch2.noise[i].im*field_ch2.noise[i].im;
}
printf("\n noise power = %g", u);
osnr_cal2_n(osnr_1, P_n, field_ch2, f, nch, fsp_n);
double sigma1;
sigma1 = pow(10.0, 0.1*P_n[j])/12.5; // ASE power density with two polarization
sigma1 *= bwsim/mnb*(mnb-1.0); // total ASE power in mW
for (i=0;i<mnb;i++)
{
u = xrandom();
z = sqrt(-0.5*sigma1*2.0*log(1.0-u));
u = xrandom();
field_ch2.noise[i].re = z*cos(TWOPI*u);
field_ch2.noise[i].im = z*sin(TWOPI*u);
}
u=0;
for (i=0;i<mnb;i++)
{
u += field_ch2.noise[i].re*field_ch2.noise[i].re;
u += field_ch2.noise[i].im*field_ch2.noise[i].im;
}
printf("\n noise power = %g, bw_step = %g", u, bw_step);
sprintf(filename4, "SP_ch%d_2.dat", index_ch[j]);
output_spectrum(filename4, field_ch2, f[j], sp_res, wl, lambda, 2.0);
sprintf(filename4, "ber_osnr_bb_ch%d_PMD%g.dat", index_ch[j], para_bb);
// Debug the sigma through the spectrum
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -