def test_pol_rot(self, method1, method2, phi):
     phi = np.pi / phi
     fb = 40.e9
     os = 2
     fs = os * fb
     N = 2**16
     beta = 0.9
     mu1 = 0.1e-2
     mu2 = 0.1e-2
     M = 32
     s = signals.SignalQAMGrayCoded(M, N, nmodes=2, fb=fb)
     s = s.resample(fs, beta=beta, renormalise=True)
     s = impairments.rotate_field(s, phi)
     sout, wxy, err = equalisation.dual_mode_equalisation(
         s, (mu1, mu2),
         Ntaps=5,
         Niter=(3, 3),
         methods=(method1, method2),
         adaptive_stepsize=(True, True))
     sout = helpers.normalise_and_center(sout)
     ser = sout.cal_ser()
     #plt.plot(sout[0].real, sout[0].imag, 'r.')
     #plt.plot(sout[1].real, sout[1].imag, 'b.')
     #plt.show()
     if ser.mean() > 0.5:
         ser = sout[::-1].cal_ser()
     npt.assert_allclose(ser, 0)
 def test_pol_rot(self, method, phi):
     phi = np.pi / phi
     fb = 40.e9
     os = 2
     fs = os * fb
     N = 2**16
     beta = 0.1
     mu = 0.1e-2
     M = 4
     ntaps = 5
     s = signals.SignalQAMGrayCoded(M, N, nmodes=2, fb=fb)
     s = s.resample(fs, beta=beta, renormalise=True)
     s = impairments.rotate_field(s, phi)
     wxy, err = equalisation.equalise_signal(s,
                                             mu,
                                             Niter=3,
                                             Ntaps=ntaps,
                                             method=method,
                                             adaptive_stepsize=True,
                                             avoid_cma_sing=False)
     sout = equalisation.apply_filter(s, wxy)
     #plt.plot(sout[0].real, sout[0].imag, '.r')
     #plt.show()
     ser = sout.cal_ser()
     #if ser.mean() > 0.5:
     #ser = sout[::-1].cal_ser
     npt.assert_allclose(ser, 0)
Ejemplo n.º 3
0
 def test_rotate_field(self):
     s2 = impairments.rotate_field(self.s, np.pi / 3)
     assert type(self.s) is type(s2)
Ejemplo n.º 4
0
 def test_rotate_field_attr(self, attr):
     s2 = impairments.rotate_field(self.s, np.pi / 3)
     assert getattr(self.s, attr) is getattr(s2, attr)
Ejemplo n.º 5
0
 def test_rotate_field(self, dtype):
     s = signals.ResampledQAM(16, 2**14, fs=2, nmodes=2, dtype=dtype)
     s2 = impairments.rotate_field(s, np.pi / 3)
     assert np.dtype(dtype) is s2.dtype