mpylab.tools.characteristic module

This is mpylab.tools.characteristic.

Provide tools for device characteristics

author:

Hans Georg Krauthäuser (main author)

license:

GPLv3 or higher

mpylab.tools.characteristic.find_compression_point(Pin_dB, Pout_dB, gain_dB, start, level)

Find compression point

Pin_dB: array with input power in dB Pout_dB: array with output power in dB gain_dB: float; gain in dB start: int, start index; ignore points below level: float, compression level

mpylab.tools.characteristic.get_gain_compression(Pin, Pout, smooth=True, window=7, poly=2, fit_window=6, min_slope=0.8, max_slope=1.2, input_unit=None, output_unit=None)

Calculates small signal gain and compression points from experimental (noisy) data

Pin: Sequence of Input Power values (floats or Quantities); Pin is in linear unit, e.g. Watt Pout: Sequence of Output Power values (floats or Quantities); Pout is in linear unit, e.g. Watt smooth: bool, optional, default True; whether the curve is filtered with scipy.savgol_filter window: int, optional, default 7, window parameter of savgol_filter poly: int, optional, default 2, poly parameter of savgol_filter fit_window: int, optional, default 6, window width for search for linear fit min_slope: float, optional, default 0.8, lower bound for small signal slope on dB scale (ideal = 1 dB/dB) max_slope: float, optional, default 1.2, upper bound for small signal slope on dB scale (ideal = 1 dB/dB) input_unit: scuq unit, optional; unit used when Pin entries are numeric floats output_unit: scuq unit, optional; unit used when Pout entries are numeric floats

Complex quantities are converted to magnitude quantities before fitting. Their Cartesian covariance is projected onto the radial direction, so the returned gain and compression-point quantities remain real and uncertain.

mpylab.tools.characteristic.rapp_power(pin, gain, saturation, p)

Rapp Model of a power amplifier

pin: float, input power (linear) gain: float, linear gain saturation: float, input saturation (linear) p: float, smoothness of compression, small value -> smooth, large value -> harder