temfield_mpylab.waveform_validation

Model-based validation of an in-loop amplitude-modulated field waveform.

class temfield_mpylab.waveform_validation.AMWaveformLimits(maximum_peak_compression_db: float = 1.0, minimum_modulation_depth_percent: float = 75.0, maximum_modulation_depth_percent: float = 85.0, minimum_modulation_frequency_khz: float = 0.95, maximum_modulation_frequency_khz: float = 1.05, minimum_r_squared: float = 0.995, maximum_normalized_rmse: float = 0.03, carrier_relative_tolerance: float = 0.02, maximum_peak_relative_tolerance: float = 0.02, maximum_stability_relative_spread: float = 0.02, required_stable_waveforms: int = 3)[source]

Bases: object

Engineering limits for TEMField’s in-loop AM validation.

The 2 dB difference between the ideal 5.1 dB AM peak ratio and the historical 3.1 dB saturation boundary motivates an outer compression limit. TEMField uses the more conservative 1 dB default because the EUT is already present during this validation.

maximum_peak_compression_db: float = 1.0
minimum_modulation_depth_percent: float = 75.0
maximum_modulation_depth_percent: float = 85.0
minimum_modulation_frequency_khz: float = 0.95
maximum_modulation_frequency_khz: float = 1.05
minimum_r_squared: float = 0.995
maximum_normalized_rmse: float = 0.03
carrier_relative_tolerance: float = 0.02
maximum_peak_relative_tolerance: float = 0.02
maximum_stability_relative_spread: float = 0.02
required_stable_waveforms: int = 3
as_dict()[source]

Return a serialization-friendly mapping.

__init__(maximum_peak_compression_db: float = 1.0, minimum_modulation_depth_percent: float = 75.0, maximum_modulation_depth_percent: float = 85.0, minimum_modulation_frequency_khz: float = 0.95, maximum_modulation_frequency_khz: float = 1.05, minimum_r_squared: float = 0.995, maximum_normalized_rmse: float = 0.03, carrier_relative_tolerance: float = 0.02, maximum_peak_relative_tolerance: float = 0.02, maximum_stability_relative_spread: float = 0.02, required_stable_waveforms: int = 3) None
class temfield_mpylab.waveform_validation.InLoopAMValidationResult(status: str, passed: bool, reason: str, factor: float, target_field_v_per_m: float, start_field_v_per_m: float, limits: AMWaveformLimits, ramp_points: tuple, stable_waveforms: tuple, carrier_correction_attempts: int = 0, carrier_correction_waveforms: tuple = (), method: str = 'in_loop_waveform_rapp', normative: bool = False, ramp_strategy: str = 'adaptive_square_law')[source]

Bases: object

Result of TEMField’s non-normative waveform validation.

Parameters:
  • status (str) – Machine-readable decision status.

  • passed (bool) – Whether the final waveform set satisfies all configured limits.

  • reason (str) – Human-readable decision reason.

  • factor (float) – Positive AM peak factor 1 + m.

  • target_field_v_per_m (float) – Requested fitted carrier field in volts per metre.

  • start_field_v_per_m (float) – Safe CW starting field in volts per metre.

  • limits (AMWaveformLimits) – Engineering limits used for the decision.

  • ramp_points (tuple) – Fitted waveform diagnostics acquired during the upward ramp.

  • stable_waveforms (tuple) – Final waveform fits used for the reported decision.

  • carrier_correction_attempts (int, optional) – Number of downward final-carrier corrections applied.

  • carrier_correction_waveforms (tuple, optional) – Otherwise valid final fits superseded by the downward correction.

  • method (str, optional) – Validation method identifier.

  • normative (bool, optional) – Whether the method claims normative IEC status.

  • ramp_strategy (str, optional) – Actor-level ramp strategy identifier.

status: str
passed: bool
reason: str
factor: float
target_field_v_per_m: float
start_field_v_per_m: float
limits: AMWaveformLimits
ramp_points: tuple
stable_waveforms: tuple
carrier_correction_attempts: int = 0
carrier_correction_waveforms: tuple = ()
method: str = 'in_loop_waveform_rapp'
normative: bool = False
ramp_strategy: str = 'adaptive_square_law'
as_dict()[source]

Return a serialization-friendly mapping.

__init__(status: str, passed: bool, reason: str, factor: float, target_field_v_per_m: float, start_field_v_per_m: float, limits: AMWaveformLimits, ramp_points: tuple, stable_waveforms: tuple, carrier_correction_attempts: int = 0, carrier_correction_waveforms: tuple = (), method: str = 'in_loop_waveform_rapp', normative: bool = False, ramp_strategy: str = 'adaptive_square_law') None
temfield_mpylab.waveform_validation.analyse_am_waveform(times_ms, values, modulation_depth_percent)[source]

Fit sinusoidal and Rapp models to one measured field waveform.

peak_compression_db is the differential AM/AM gain loss between the carrier input and the positive AM peak. It is independent of the fitted absolute field scale and is therefore directly comparable across frequencies and target field strengths.

temfield_mpylab.waveform_validation.validate_am_fit(fit, target_field_v_per_m, modulation_depth_percent, limits, *, check_carrier=True)[source]

Return (passed, reason) for one final-target waveform fit.

check_carrier=False is used when several stable final waveforms are available and their mean carrier level is evaluated separately with validate_carrier_level(). All per-waveform signal-quality, modulation, compression, and peak-safety limits remain active.

temfield_mpylab.waveform_validation.validate_carrier_level(fits, target_field_v_per_m, limits)[source]

Validate the mean carrier field of stable final-target waveforms.

temfield_mpylab.waveform_validation.validate_waveform_stability(fits, limits)[source]

Return whether consecutive final-target waveforms are sufficiently stable.