ElectricalAmplifierTimeStepper¶
- class photonforge.ElectricalAmplifierTimeStepper(*, gain=0, f_3dB=None, saturation_power=None, compression_power=None, ip3=None, noise_figure=None, r0=0, r1=0, ports=None, seed=None)[source]¶
Time-stepper for a broadband amplifier or modulator dirver.
This model implements an electrical amplifier with linear gain, noise, bandwidth limiting, port reflections, and common nonlinear effects: 1 dB compression, third-order intercept point (IP3), and saturation.
- Parameters:
gain (Annotated[float, units='dB']) – The amplifier’s power gain.
f_3dB (Annotated[Annotated[float, minimum=0, units='Hz'] | None, _]) – -3 dB frequency cutoff for bandwidth limiting.
saturation_power (Annotated[float, units='dBm'] | None) – Output saturation power.
compression_power (Annotated[float, units='dBm'] | None) – 1 dB compression power.
ip3 (Annotated[Annotated[float, units='dBm'] | None, _]) – Third order intercept point.
noise_figure (Annotated[float, units='dB'] | None) – The amplifier’s noise figure (NF). If
None, noise is disabled.r0 (Annotated[float, maximum=1, minimum=-1]) – Reflection coefficient for the input port.
r1 (Annotated[float, maximum=1, minimum=-1]) – Reflection coefficient for the output port.
ports (Annotated[Sequence[str], maxItems=2, minItems=2] | None) – Input and output port names. If not set, the sorted list of port names from the component is used.
seed (Annotated[int, minimum=0] | None) – Random number generator seed to ensure reproducibility.
Notes
The forward path signal is processed through the following stages at each time step:
Low-pass filter for bandwidth limiting:
\[ \begin{align}\begin{aligned}y_0\![n] &= \alpha y_0\![n-1] + (1-\alpha) G_a a_\text{in}\\\alpha &= e^{-2\pi f_\text{3dB} \Delta t}\\G_a &= 10^\frac{G_\text{dB}}{20}\end{aligned}\end{align} \]Soft-knee compression:
\[ \begin{align}\begin{aligned}y_1 &= y_0 \left( 1 + \frac{c_s}{P_\text{1dB}} y_0^2 \right)^{-\frac{1}{2}}\\c_s &= 10^\frac{1}{10} - 1\end{aligned}\end{align} \]Cubic IP3 nonlinearity:
\[y_2 = y_1 \left(1 - \frac{1}{P_\text{IP3}} y_1^2\right)\]Smooth saturation: A tanh function smoothly clamps the output amplitude to approach \(\sqrt{P_\text{sat}}\).
Additive noise: if enabled, white Gaussian noise is added to the output. The noise power spectral density is derived from the noise figure \(F\) as \(S_P = k_B T_0 G_\text{dB} F\).
Methods
reset()Reset internal state.
setup(component, time_step, *[, ...])Initialize the time stepper.
setup_state(*, component, time_step, **kwargs)Initialize internal state.
step([inputs, steps, time_step, show_progress])Compute the outputs of this time stepper, given inputs.
step_single(inputs, outputs, time_index, ...)Take a single time step on the given inputs.
update(*args, **kwargs)Update this time stepper.
Attributes
parametric_functionFunction used to update the time stepper.
parametric_kwargsKeyword arguments used to update the time stepper.
propertiesObject properties.
random_variablesRandom variables associated to the time stepper's parameters.
- setup_state(*, component, time_step, **kwargs)[source]¶
Initialize internal state.
- Parameters:
component (Component) – Component representing the amplifier.
time_step (Annotated[float, minimum=0, units='s']) – The interval between time steps (in seconds).
kwargs – Unused.
- step_single(inputs, outputs, time_index, update_state, shutdown)[source]¶
Take a single time step on the given inputs.
- Parameters:
inputs (ndarray) – Input values at the current time step. Must be a 1D array of complex values ordered according to
keys.outputs (ndarray) – Pre-allocated output array where results will be stored. Same size and type as
inputs.time_index (int) – Time series index for the current input.
update_state (bool) – Whether to update the internal stepper state.
shutdown (bool) – Whether this is the last call to the single stepping function for the provided
TimeSeries.
- Return type:
None