文章目录
GSNR与OSNR的区别
OSNR:Optical Signal-to-Noise Ratio
GSNR:Generalized Signal-to-Noise Ratio
区别在于这个“广义”:
GSNR:
G
S
N
R
=
10
l
o
g
10
(
P
s
(
E
∣
r
x
−
t
x
∣
2
)
)
=
10
l
o
g
10
(
P
s
(
P
A
S
E
+
P
N
L
)
)
GSNR=10 log_{10}(\frac{P_s}{(E|rx-tx|^2 )})=10log_{10}(\frac{P_s}{(P_{ASE}+P_{NL} )})
GSNR=10log10((E∣rx−tx∣2)Ps)=10log10((PASE+PNL)Ps)
式中,rx与tx分别为接收和传输符号,
P
s
P_s
Ps是信号功率,
P
A
S
E
P_{ASE}
PASE是来自EDFA的ASE噪声,
P
N
L
P_{NL}
PNL表示光纤引入的非线性噪声。
OSNR计算代码:
def calu_osnr(x, sam_rate):
# psd unit w
try:
sig_x = x[0].detach().cpu().numpy()
except:
sig_x = x[0]
psd, f = plt.psd(sig_x, NFFT = 8192, Fs = sam_rate)
f_real = f
# Calu sig and noise power
band_width_half = 12.5 / 2
index = np.where((f_real >= -band_width_half) & (f_real <= band_width_half))
psd_sig = psd[index]
freq_sig = f_real[index]
sig_power = integrate.trapezoid(psd_sig, freq_sig)
# Calu noise power
f1 = np.min(f_real)
f2 = f1 + 12.5
index = np.where((f_real >= f1) & (f_real <= f2))
psd_noise = psd[index]
freq_noise = f_real[index]
noise_power = integrate.trapezoid(psd_noise, freq_noise)
osnr = 10 * np.log10((sig_power - noise_power) / noise_power)
noise_power_ref = noise_power
return osnr
粗浅的理解是,OSNR计算的是光学上的噪声,可以看到代码中展示的,从光功率谱出发得到的信噪比,但是GSNR是从符号出发,符号往往是光学系统、电学系统产生的影响的总的体现,所以GSNR的信噪比更广泛。
BER(误码率)与Q因子
B
E
R
=
N
e
r
r
o
r
N
b
i
t
s
BER=\frac{N_{error}}{N_{bits}}
BER=NbitsNerror
式中,
N
e
r
r
o
r
N_{error}
Nerror表示错误比特数,
N
b
i
t
s
N_{bits}
Nbits表示比特总数