Modulators¶
-
class
Modulators.
BaseModulator
[source]¶ Base class for modulators. All modulator classes should be derived from it.
Modulator classes need to implement the abstract methods modulate and demodulate defined below, in which symbols are embedded in / extracted from time-domain signals. The time-domain here is normalized.
During construction, any modulator class should set the attributes
- _norm_dt
- _n_samples
- _n_symbols_per_block
Users can access these attributes (read-only) via the properties norm_dt, n_samples and n_symbols_per_block that already defined in this class.
-
demodulate
(q_rx)[source]¶ Extracts a block of symbols from a given fiber output. This includes equalization, i.e., removing the impact of fiber propagation.
Parameters: q_rx (numpy.array(complex)) – The vector q_rx is of length self.n_samples. It contains the time-domain samples q_rx(n*self.norm_dt), where n=0,1,…,self.n_samples-1. Note that the time here is normalized. Returns: - symbols_rx (numpy.array(complex)) – A vector of length self.n_symbols_per_block. Note that these values do not have to be drawn from a specific constellation. The task of assigning these values to constellation points is up to the user.
- nfspec_rx (NFSpectrum) – Nonlinear Fourier spectrum of the provided signal q_rx(t)
-
modulate
(symbols)[source]¶ Embeds a block of symbols in a nonlinear Fourier spectrum and generates the corresponding fiber input.
Parameters: symbols (numpy.array(complex)) – A vector of symbols, drawn from a constellation. The length of the vector has to be self.n_blocks_per_symbol. Returns: - q_tx (numpy.array(complex)) – The vector q_tx is of length self.n_samples. It contains the time-domain samples q_tx(n*self.norm_dt), where n=0,1,…,self.n_samples-1. Note that the time here is normalized.
- nfspec_tx (NFSpectrum) – Nonlinear Fourier spectrum of the generated signal q_tx(t).
-
n_samples
¶ Number of samples per fiber input / fiber output (read-only).
-
n_symbols_per_block
¶ Number of symbols embedded in each fiber input / output (read-only).
-
normalized_dt
¶ Time difference, in normalized units, between consecutive samples of fiber inputs / outputs (read-only).
-
Modulators.CarrierWaveforms.
flat_top
(xivec, T0)[source]¶ Flat-top carrier that is bandlimited with bandwidth 2*T0. The effective bandwidth, based on visual inspection in linear scale, is around T0.
The top of this filter has a width of approximately 20/T0. The visible bottom (in linear scale) has a width of approximately 45/T0.
-
class
Modulators.
ContSpecModulator
(carrier_waveform_fun, carrier_spacing, n_symbols_per_block, normalized_distance, T, required_normalized_dt, required_dxi, contspec_type, percent_precompensation=0.0, power_control_factor=1.0, use_power_normalization_map=False)[source]¶ This modulator embeds symbols in the continuous spectrum using a classic multi-carrier approach.
-
__init__
(carrier_waveform_fun, carrier_spacing, n_symbols_per_block, normalized_distance, T, required_normalized_dt, required_dxi, contspec_type, percent_precompensation=0.0, power_control_factor=1.0, use_power_normalization_map=False)[source]¶ Constructor.
Parameters: - carrier_waveform_fun (function) – A function that maps numpy.array(float) to numpy.array(complex). The inputs of this function are vectors with nonlinear frequencies xi. The outputs are vectors with the values of the carrier waveforms at the corresponding xi. See Helpers.CarrierWaveforms for examples.
- carrier_spacing (float) – Spacing between consequtive carriers in the nonlinear frequency domain (xi).
- n_symbols_per_block (int) – Number of carriers.
- normalized_distance (float) – Length of the fiber link in normalized units.
- T (numpy.array(float)) – Vector of length two with T[0]<T[1]. Specifies a time interval, in normalized units, used during the generation of the fiber inputs.
- required_normalized_dt (float) – The modulator will choose the number of time domain samples such that the time step, in normalized units, does not exceed this value.
- required_dxi (float) – The modulator will choose the number of samples in the nonlinear frequency domain such that the nonlinear frequency step is not larger than this value.
- contspec_type (str) – Type of continuous spectrum used for encoding data. Choose “b/a” for reflection coefficients and “b” for b-coefficients.
- percent_precompensation (float) – Value between 0.0 and 100.0. A value of 50.0 means that transmitter and receiver both compensate 50% of the phase change in the continuous spectrum induced by the channel. A value of 0.0 means that the phase changes is completely reverted at the receiver.
- power_control_factor (float) – A positive real number. The carrier waveform is effectively scaled by this number.
- use_power_normalization_map (bool) – If True, the modulator applies a power normalized map as described in Yangzhang et. al (Proc. OFC‘17) to the nonlinear Fourier spectrum it has generated before passing it on to the inverse NFT. Currently only implemented for reflection coefficients (contspec_type=”b/a”).
-
demodulate
(q)[source]¶ Extracts a block of symbols from a given fiber output. This includes equalization, i.e., removing the impact of fiber propagation.
Parameters: q_rx (numpy.array(complex)) – The vector q_rx is of length self.n_samples. It contains the time-domain samples q_rx(n*self.norm_dt), where n=0,1,…,self.n_samples-1. Note that the time here is normalized. Returns: - symbols_rx (numpy.array(complex)) – A vector of length self.n_symbols_per_block. Note that these values do not have to be drawn from a specific constellation. The task of assigning these values to constellation points is up to the user.
- nfspec_rx (NFSpectrum) – Nonlinear Fourier spectrum of the provided signal q_rx(t)
-
modulate
(symbols)[source]¶ Embeds a block of symbols in a nonlinear Fourier spectrum and generates the corresponding fiber input.
Parameters: symbols (numpy.array(complex)) – A vector of symbols, drawn from a constellation. The length of the vector has to be self.n_blocks_per_symbol. Returns: - q_tx (numpy.array(complex)) – The vector q_tx is of length self.n_samples. It contains the time-domain samples q_tx(n*self.norm_dt), where n=0,1,…,self.n_samples-1. Note that the time here is normalized.
- nfspec_tx (NFSpectrum) – Nonlinear Fourier spectrum of the generated signal q_tx(t).
-
-
class
Modulators.
DiscSpecModulator
(eigenvalues, residues_amplitude, normalized_distance, T, required_normalized_dt)[source]¶ This modulator embeds symbols in residues of a multi-soliton with fixed eigenvalue pattern.
-
__init__
(eigenvalues, residues_amplitude, normalized_distance, T, required_normalized_dt)[source]¶ Constructor.
Parameters: - eigenvalues (numpy.array(complex)) – Vector of eigenvalues used to generate fiber inputs.
- residues_amplitude (numpy.array(complex)) – Vector of scaling factors. The final residues for the eigenvalue is obtained by multiplying these factors with the symbols.
- normalized_distance (float) – Fiber length in normalized units.
- T (numpy.array(float)) – Vector of length two with T[0]<T[1]. Specifies the time interval, in normalized units, used for the generation of the fiber inputs.
- required_normalized_dt (float) – The modulator will choose the number of time domain samples such that the time step, in normalized units, does not exceed this value.
-
demodulate
(q)[source]¶ Extracts a block of symbols from a given fiber output. This includes equalization, i.e., removing the impact of fiber propagation.
Parameters: q_rx (numpy.array(complex)) – The vector q_rx is of length self.n_samples. It contains the time-domain samples q_rx(n*self.norm_dt), where n=0,1,…,self.n_samples-1. Note that the time here is normalized. Returns: - symbols_rx (numpy.array(complex)) – A vector of length self.n_symbols_per_block. Note that these values do not have to be drawn from a specific constellation. The task of assigning these values to constellation points is up to the user.
- nfspec_rx (NFSpectrum) – Nonlinear Fourier spectrum of the provided signal q_rx(t)
-
modulate
(symbols)[source]¶ Embeds a block of symbols in a nonlinear Fourier spectrum and generates the corresponding fiber input.
Parameters: symbols (numpy.array(complex)) – A vector of symbols, drawn from a constellation. The length of the vector has to be self.n_blocks_per_symbol. Returns: - q_tx (numpy.array(complex)) – The vector q_tx is of length self.n_samples. It contains the time-domain samples q_tx(n*self.norm_dt), where n=0,1,…,self.n_samples-1. Note that the time here is normalized.
- nfspec_tx (NFSpectrum) – Nonlinear Fourier spectrum of the generated signal q_tx(t).
-