Exemplo n.º 1
0
 def test_add_carrier_offset(self, dtype):
     s = signals.ResampledQAM(16, 2**14, fs=2, nmodes=2, dtype=dtype)
     s2 = impairments.add_carrier_offset(s, 1e-3)
     assert np.dtype(dtype) is s2.dtype
Exemplo n.º 2
0
 def test_add_carrier_offset(self):
     s2 = impairments.add_carrier_offset(self.s, 1e-3)
     assert type(self.s) is type(s2)
Exemplo n.º 3
0
                "sig_agwn_pmd_time")

    if USE_PHASE_NOISE:
        sig = impairments.apply_phase_noise(sig, LINEWIDTH)
        if PLOT_PICTURES:
            plot_constellation(
                sig,
                "Signal constellation after pulseshaping, AGWN\n PMD and phase noise, linewidth of laser = {:d}MHz"
                .format(int(LINEWIDTH / 1e6)), "sig_agwn_pmd_phase")
            plot_time(
                sig,
                "Signal constellation after pulseshaping, AGWN\n PMD and phase noise, linewidth of laser = {:d}MHz"
                .format(int(LINEWIDTH / 1e6)), "sig_agwn_pmd_phase_time")

    if USE_FREQ_OFFSET:
        sig = impairments.add_carrier_offset(sig, FREQ_OFFSET)
        if PLOT_PICTURES:
            plot_constellation(
                sig,
                "Signal constellation at receiver, with AGWN, PMD,\n phase noise and frequency offset, $f_{offset}="
                + "{:d}MHz$".format(int(FREQ_OFFSET / 1e6)),
                "sig_agwn_pmd_phase_freq")
            plot_time(
                sig,
                "Signal constellation at receiver, with AGWN, PMD,\n phase noise and frequency offset, $f_{offset}="
                + "{:d}MHz$".format(int(FREQ_OFFSET / 1e6)),
                "sig_agwn_pmd_phase_freq_time")

    # lock the random seed to add traceability
    random.seed(420691337)