add training data, y-pol phase shifted by 90 deg, x/y different powers

This commit is contained in:
Joseph Hopfmüller
2024-12-11 10:56:30 +01:00
parent 98d0b5ba8d
commit 638b62ee03
3 changed files with 15 additions and 4 deletions

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ac7eb8830fa7bb91e18ae87ab7b55d463738dbfd1f5662957c06c69ac98a214f
size 599

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:43b78cdded1b5acd9d569920357d45c9433348a955b794524ee705845828825c
size 134217856

View File

@@ -116,7 +116,7 @@ class pam_generator:
raise ValueError(f"Unknown pulse shape: {self.pulse_shape}") raise ValueError(f"Unknown pulse shape: {self.pulse_shape}")
# prepare symbols # prepare symbols
symbols_x = symbols[0] / (self.mod_order or np.max(symbols[0])) symbols_x = symbols[0] / (self.mod_order)
diffs_x = np.diff(symbols_x, prepend=symbols_x[0]) diffs_x = np.diff(symbols_x, prepend=symbols_x[0])
digital_x = self.generate_digital_signal(diffs_x, max_jitter) digital_x = self.generate_digital_signal(diffs_x, max_jitter)
digital_x = np.pad( digital_x = np.pad(
@@ -127,7 +127,7 @@ class pam_generator:
E_x = np.convolve(digital_x, wavelet) E_x = np.convolve(digital_x, wavelet)
# convert to pam and set modulation depth (scale and move up such that 1 stays at 1) # convert to pam and set modulation depth (scale and move up such that 1 stays at 1)
E_x = np.cumsum(E_x) * self.modulation_depth + (1 - self.modulation_depth) E_x = np.cumsum(E_x) * self.modulation_depth + 2*(1 - self.modulation_depth)
# cut off the wavelet tails # cut off the wavelet tails
E_x = E_x[self.glova.sps // 2 + len(wavelet) // 2 - 1 : -len(wavelet) // 2] E_x = E_x[self.glova.sps // 2 + len(wavelet) // 2 - 1 : -len(wavelet) // 2]
@@ -136,7 +136,7 @@ class pam_generator:
E[0]["E"][0] = np.sqrt(np.multiply(np.square(E[0]["E"][0]), E_x)) E[0]["E"][0] = np.sqrt(np.multiply(np.square(E[0]["E"][0]), E_x))
if not self.single_channel: if not self.single_channel:
symbols_y = symbols[1] / (self.mod_order or np.max(symbols[1])) symbols_y = symbols[1] / (self.mod_order)
diffs_y = np.diff(symbols_y, prepend=symbols_y[0]) diffs_y = np.diff(symbols_y, prepend=symbols_y[0])
digital_y = self.generate_digital_signal(diffs_y, max_jitter) digital_y = self.generate_digital_signal(diffs_y, max_jitter)
digital_y = np.pad( digital_y = np.pad(
@@ -224,18 +224,23 @@ def initialize_fiber_and_data(config, input_data_override=None):
pulse_shape=config["signal"]["pulse_shape"], pulse_shape=config["signal"]["pulse_shape"],
fwhm=config["signal"]["fwhm"], fwhm=config["signal"]["fwhm"],
seed=config["signal"]["jitter_seed"], seed=config["signal"]["jitter_seed"],
single_channel=False single_channel=False,
mod_order=config["signal"]["mod_order"],
) )
symbols_x = symbolsrc(pattern="random") symbols_x = symbolsrc(pattern="random")
symbols_y = symbolsrc(pattern="random") symbols_y = symbolsrc(pattern="random")
symbols_x[:3] = 0 symbols_x[:3] = 0
symbols_y[:3] = 0 symbols_y[:3] = 0
# symbols_x += 1
cw = laser() cw = laser()
source_signal = modulator(E=cw, symbols=(symbols_x, symbols_y)) source_signal = modulator(E=cw, symbols=(symbols_x, symbols_y))
# source_signal[0]['E'][1] += source_signal[0]['E'][1][np.argmin(np.abs(source_signal[0]['E'][1]))]
source_signal = py_edfa(E=source_signal) source_signal = py_edfa(E=source_signal)
c_data.E_in = source_signal[0]["E"] c_data.E_in = source_signal[0]["E"]