Amplifiers

Inheritance diagram of hermespy.simulation.rf.blocks.amps.PowerAmplifier, hermespy.simulation.rf.blocks.amps.ClippingPowerAmplifier, hermespy.simulation.rf.blocks.amps.RappPowerAmplifier, hermespy.simulation.rf.blocks.amps.SalehPowerAmplifier, hermespy.simulation.rf.blocks.amps.CustomPowerAmplifier

Radio-frequency (RF) amplifiers are blocks increasing the power (or equivalently the amplitude) of an input signals passing through the block. In the process, they introduce hardmonic frequency components due to their non-linear amplification characteristics, phase shifts and thermal noise. Deployed in high frequency applications they may additionally introduce memory effects due to their internal circuitry.

This module provides various numerical models of RF amplifiers implementing the basic relationship

\[s'(t) = f\lbrace s(t), t, \tau \rbrace \in \mathbb{C}\]

between an electromagnetic complex-valued input signal \(s(t) \in \mathbb{C}\) and the respective output signal \(s'(t) \in \mathbb{C}\) with respective to a past delay component \(\tau\) and time variable \(t\). Note that, for memoryless models, this function reduces to

\[s'(t) = f\lbrace s(t), t \rbrace \in \mathbb{C} \quad \text{.}\]

Ideal Amplifier

The power amplifier is usually the last stage in a transmitting device’s radio frequency chain before the antenna. This base model is HermesPy’s default power amplifier model, which is a linear amplifier with a constant gain and therfore no distortion

\[s'(t) = s(t) \text{,}\]

which may be overwritten by classes inheriting from this base.

class PowerAmplifier(gain=1.0, saturation_amplitude=inf, noise_model=None, noise_level=None, seed=None)[source]

Bases: RFBlock, Serializable

Base class of a distorionless power-amplifier model.

Parameters:
  • gain (float) – Linear voltage gain of the power amplifier.

  • saturation_amplitude (float) – Cut-off point for the linear behaviour of the amplification in Volt.

classmethod Deserialize(process)[source]

Deserialize an object’s state.

Objects cannot be deserialized directly, instead a Factory must be instructed to carry out the deserialization process.

Parameters:

process (DeserializationProcess) – The current stage of the deserialization process. This object is generated by the Factory and provides an interface to deserialization methods supporting multiple backends.

Return type:

PowerAmplifier

Returns:

The deserialized object.

model(input_signal)[source]

Model signal amplification characteristics.

Parameters:

input_signal (RFSignal) – Sample vector of the signal feeding into the power amplifier.

Return type:

RFSignal

Returns: Distorted signal after amplification modeling.

plot_characteristics(axes=None, *, title=None, samples=None)[source]

Plot the power amplifier distortion characteristics.

Generates a matplotlib plot depicting the phase/amplitude.

Parameters:
  • axes (ndarray[tuple[int, int], dtype[Any]] | None) – The axis object into which the information should be plotted. If not specified, the routine will generate and return a new figure.

  • title (str | None) – Title of the generated plot.

  • samples (ndarray | None) – Sample points at which to evaluate the characteristics. In other words, the x-axis of the resulting characteristics plot.

Return type:

Figure

Returns: Handle to the generated figure.

realize(bandwidth, oversampling_factor, carrier_frequency)[source]

Return the current state of the radio-frequency block.

Parameters:
  • bandwidth (float) – Bandwith of the proecessed signals in Hz.

  • oversampling_factor (int) – Oversampling factor of the modeling.

  • carrier_frequency (float) – Target carrier frequency of the modeled radio front-end in Hz.

Return type:

RFBlockRealization

Returns:

Current state of the radio-frequency block.

serialize(process)[source]

Serialize this object’s state.

Objects cannot be serialized directly, instead a Factory must be instructed to carry out the serialization process.

Parameters:

process (SerializationProcess) – The current stage of the serialization process. This object is generated by the Factory and provides an interface to serialization methods supporting multiple backends.

Return type:

None

property gain: float[source]

Linear voltage gain of the power amplifier.

Raises:

ValueError – If gain is smaller than zero.

property i: RFBlockPort[PowerAmplifier][source]

Input port of the power amplifier.

property num_input_ports: int[source]

Number of physical ports feeding into this radio-frequency block.

If the returned number is negative, the block can accept an arbitrary number of input ports.

property num_output_ports: int[source]

Number of physical ports emerging from this radio-frequency block.

property o: RFBlockPort[PowerAmplifier][source]

Output port of the power amplifier.

property saturation_amplitude: float[source]

Cut-off point for the linear behaviour of the amplification.

Referred to as \(s_\mathrm{sat} \ \mathbb{R}_{+}\) in equations.

Returns: Saturation amplitude in Volt.

Raises:

ValueError – If amplitude is smaller than zero.

property title: str[source]

Clipping Amplifier

Model of a power amplifier driven into saturation. Complex signal samples with amplitudes above \(s_\mathrm{sat} \in \mathbb{R}\) will be clipped to the maximum amplitude value. In case of clipping, the respective sample angles will be preserved, so that

\[s'(t) = \frac{s(t)}{|s(t)|} \cdot \min{(|s(t)|, s_\mathrm{sat})} \text{.}\]
class ClippingPowerAmplifier(gain=1.0, saturation_amplitude=inf, noise_model=None, noise_level=None, seed=None)[source]

Bases: PowerAmplifier

Model of a clipping power amplifier.

Parameters:
  • gain (float) – Linear voltage gain of the power amplifier.

  • saturation_amplitude (float) – Cut-off point for the linear behaviour of the amplification in Volt.

model(input_signal)[source]

Model signal amplification characteristics.

Parameters:

input_signal (RFSignal) – Sample vector of the signal feeding into the power amplifier.

Return type:

RFSignal

Returns: Distorted signal after amplification modeling.

Saleh Amplifier

Model of a power amplifier according to Saleh[1]. Implements a saturation characteristic according to

\[s'(t) = s(t) \cdot A\lbrace s(t) \rbrace e^{\mathrm{j} \Phi\lbrace s(t) \rbrace}\]

where

\[A\lbrace s \rbrace = \frac{ \alpha_\mathrm{a} \frac{|s|}{s_\mathrm{sat}} } { 1 + \beta_\mathrm{a} \frac{|s|^2}{s_\mathrm{sat}^2} }\]

describes the amplitude model depending on two parameters \(\alpha_\mathrm{a}, \beta_\mathrm{a} \in \mathbb{R}_{+}\) and

\[\Phi\lbrace s \rbrace = \frac{ \alpha_\Phi \frac{|s|}{s_\mathrm{sat}} } { 1 + \beta_\Phi \frac{|s|^2}{s_\mathrm{sat}^2} }\]

describes the phase model depending on \(\alpha_\Phi, \beta_\Phi \in \mathbb{R}\), respectively.

class SalehPowerAmplifier(amplitude_alpha, amplitude_beta, phase_alpha, phase_beta, **kwargs)[source]

Bases: PowerAmplifier

Model of a power amplifier according to Saleh.

See Saleh[1] for further details.

Parameters:
  • amplitude_alpha (float) – Amplitude model factor alpha.

  • amplitude_beta (float) – Amplitude model factor beta.

  • phase_alpha (float) – Phase model factor alpha.

  • phase_beta (float) – Phase model factor beta.

  • kwargs (Any) – PowerAmplifier base class initialization arguments.

classmethod Deserialize(process)[source]

Deserialize an object’s state.

Objects cannot be deserialized directly, instead a Factory must be instructed to carry out the deserialization process.

Parameters:

process (DeserializationProcess) – The current stage of the deserialization process. This object is generated by the Factory and provides an interface to deserialization methods supporting multiple backends.

Return type:

SalehPowerAmplifier

Returns:

The deserialized object.

model(input_signal)[source]

Model signal amplification characteristics.

Parameters:

input_signal (RFSignal) – Sample vector of the signal feeding into the power amplifier.

Return type:

RFSignal

Returns: Distorted signal after amplification modeling.

serialize(process)[source]

Serialize this object’s state.

Objects cannot be serialized directly, instead a Factory must be instructed to carry out the serialization process.

Parameters:

process (SerializationProcess) – The current stage of the serialization process. This object is generated by the Factory and provides an interface to serialization methods supporting multiple backends.

Return type:

None

property amplitude_alpha: float[source]

Amplitude model factor \(\alpha_\mathrm{a}\).

Returns:

Amplitude factor.

Return type:

float

Raises:

ValueError – If the factor is smaller than zero.

property amplitude_beta: float[source]

Amplitude model factor \(\beta_\mathrm{a}\).

Returns: Amplitude factor.

Raises:

ValueError – If the factor is smaller than zero.

phase_alpha: float[source]

Phase model factor \(\alpha_\Phi\).

phase_beta: float[source]

Phase model factor \(\beta_\Phi\).

Rapp Amplifier

Model of a power amplifier according to Rapp[2]. Implements a saturation characteristic according to

\[s'(t) = s(t) \cdot \left( 1 + \left( \frac{|s(t)|}{s_\mathrm{sat}} \right)^{2p_\mathrm{Rapp}} \right)^{-\frac{1}{2p_\mathrm{Rapp}}} \text{,}\]

where \(p_\mathrm{Rapp} \in \lbrace x \in \mathbb{R} | x \geq 1 \rbrace\) denotes the smoothness factor of the saturation curve.

class RappPowerAmplifier(smoothness_factor=1.0, **kwargs)[source]

Bases: PowerAmplifier

Model of a power amplifier according to Rapp’s model.

See Rapp[2] for further details.

Parameters:
  • smoothness_factor (float) – Smoothness factor of the amplification saturation characteristics.

  • kwargs (Any) – PowerAmplifier base class initialization arguments.

classmethod Deserialize(process)[source]

Deserialize an object’s state.

Objects cannot be deserialized directly, instead a Factory must be instructed to carry out the deserialization process.

Parameters:

process (DeserializationProcess) – The current stage of the deserialization process. This object is generated by the Factory and provides an interface to deserialization methods supporting multiple backends.

Return type:

RappPowerAmplifier

Returns:

The deserialized object.

model(input_signal)[source]

Model signal amplification characteristics.

Parameters:

input_signal (RFSignal) – Sample vector of the signal feeding into the power amplifier.

Return type:

RFSignal

Returns: Distorted signal after amplification modeling.

serialize(process)[source]

Serialize this object’s state.

Objects cannot be serialized directly, instead a Factory must be instructed to carry out the serialization process.

Parameters:

process (SerializationProcess) – The current stage of the serialization process. This object is generated by the Factory and provides an interface to serialization methods supporting multiple backends.

Return type:

None

property smoothness_factor: float[source]

Smoothness factor of the amplification saturation characteristics.

Also referred to as Rapp-factor \(p_\mathrm{Rapp}\).

Returns: Smoothness factor.

Raises:

ValueError – If smoothness factor is smaller than one.

Custom Amplifier

Fully customizable pwoer amplification model. The users may define their own gain and phase characteristics.

class CustomPowerAmplifier(input, gains, phases, **kwargs)[source]

Bases: PowerAmplifier

Model of a customized power amplifier.

Parameters:
  • input (ndarray)

  • gains (ndarray)

  • phases (ndarray)

  • **kwargs (Any) – PowerAmplifier base class initialization arguments.

Raises:

ValueError – If input, gain, and phase are not vectors of identical length.

classmethod Deserialize(process)[source]

Deserialize an object’s state.

Objects cannot be deserialized directly, instead a Factory must be instructed to carry out the deserialization process.

Parameters:

process (DeserializationProcess) – The current stage of the deserialization process. This object is generated by the Factory and provides an interface to deserialization methods supporting multiple backends.

Return type:

CustomPowerAmplifier

Returns:

The deserialized object.

model(input_signal)[source]

Model signal amplification characteristics.

Parameters:

input_signal (RFSignal) – Sample vector of the signal feeding into the power amplifier.

Return type:

RFSignal

Returns: Distorted signal after amplification modeling.

serialize(process)[source]

Serialize this object’s state.

Objects cannot be serialized directly, instead a Factory must be instructed to carry out the serialization process.

Parameters:

process (SerializationProcess) – The current stage of the serialization process. This object is generated by the Factory and provides an interface to serialization methods supporting multiple backends.

Return type:

None

property gains: ndarray[source]
property input: ndarray[source]
property phases: ndarray[source]