Commit 331918a2 authored by hm-striegle's avatar hm-striegle

Debug BERcalc

parent 84462518
......@@ -74,7 +74,7 @@ E = amp(E = E, Pmean = P0)
E = osnr( E = E, OSNR = 15.0 ) # Set initial OSNR to bad 20 dB
for c in range(0, 10):
for c in range(0, 0):
print('Span: ', c)
fibres = pypho_fiber_birefringence.create_pmd_fibre(SSMF.l, 1e3, 0.00)
E = SSMF(E = E, birefarray = fibres)
......@@ -103,5 +103,5 @@ plt.subplot(2, 1, 2); h = plt.contourf(Esy_re_ax, Esy_im_ax, Dec_y, 32, cmap=plt
# Calculate BER
############################
BER = calc_BER (gp, E, [constpts_x, constpts_y], osnr( E = E), Dec_x, Dec_y, Esx_re_ax, Esx_im_ax, Esy_re_ax, Esy_im_ax, 5, LO, filter_f0, sigsampler)
BER = calc_BER (gp, E, [constpts_x, constpts_y], osnr( E = E), Dec_x, Dec_y, Esx_re_ax, Esx_im_ax, Esy_re_ax, Esy_im_ax, 10, LO, filter_f0, sigsampler,[bits_x, bits_y])
print(BER)
\ No newline at end of file
File added
File added
......@@ -342,7 +342,7 @@ def create_optnoise (glova, E, OSNR):
return E_N
########################################################################
def calc_BER (gp, E, constpts, OSNR, Dec_x, Dec_y, Esx_re_ax, Esx_im_ax, Esy_re_ax, Esy_im_ax, M, LO, ofil, sigsampler):
def calc_BER (gp, E, constpts, OSNR, Dec_x, Dec_y, Esx_re_ax, Esx_im_ax, Esy_re_ax, Esy_im_ax, M, LO, ofil, sigsampler, bits):
'Calculate BER value of given signal'
Esiggi = copy.deepcopy(E)
......@@ -373,7 +373,8 @@ def calc_BER (gp, E, constpts, OSNR, Dec_x, Dec_y, Esx_re_ax, Esx_im_ax, Esy_re_
E_tmp[0]['E'][0] = I_x_I + 1.0j*I_x_Q
E_tmp[0]['E'][1] = I_y_I + 1.0j*I_y_Q
Esx, Esy, Nsx, Nsy = sigsampler(E = E_tmp, style = 'NO')
#Esx, Esy, Nsx, Nsy = sigsampler(E = E_tmp, style = 'NO')
Esx, Esy, Nsx, Nsy = sigsampler(E = E_tmp, constpoints = constpts, bits = bits, style = 'NO')
# plt.figure(1)
#plt.subplot(2, 1, 1); plt.plot(np.real(Esx), np.imag(Esx), '.')
......
File added
File added
File added
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment