sigkit.impairments package

Submodules

sigkit.impairments.awgn module

AWGN Method for the Impairments Module.

class sigkit.impairments.awgn.AWGN(snr_db: float)[source]

Bases: Impairment

Apply Additive White Gaussian Noise to a Signal.

apply(signal: Signal) Signal[source]

Applies AWGN to the samples of input Signal and returns a new Signal.

Expects a Signal object with an np.ndarray of np.complex64 samples. Returns the Signal with AWGN applied to the target snr_db.

sigkit.impairments.base module

ABC Module for the Impairment package.

class sigkit.impairments.base.Impairment[source]

Bases: ABC

Base for all numpy signal impairments.

abstractmethod apply(signal: Signal) Signal[source]

ABC Method for applying an impairment to an input Signal.

Given a Signal object with np.complex64 samples, return a new Signal with the impairment applied.

sigkit.impairments.frequency_shift module

Frequency Shift Module utilized for impairments.

class sigkit.impairments.frequency_shift.FrequencyShift(freq_offset: float)[source]

Bases: Impairment

Shift a baseband Signal in frequency by a constant offset.

Parameters:

freq_offset – Frequency offset in Hz. Positive shifts up, negative shifts down.

Example

>>> imp = FrequencyShift(freq_offset=1e3)
>>> shifted = imp.apply(signal)
apply(signal: Signal) Signal[source]

ABC Method for applying an impairment to an input Signal.

Given a Signal object with np.complex64 samples, return a new Signal with the impairment applied.

sigkit.impairments.phase_shift module

Phase Shift Module utilized for impairments.

class sigkit.impairments.phase_shift.PhaseShift(phase_offset: float | Tuple[float, float] = (-3.141592653589793, 3.141592653589793))[source]

Bases: Impairment

Apply a constant or random phase offset to a baseband Signal.

Parameters:

phase_offset

  • If float: apply a fixed phase (radians).

  • If tuple of two numbers (min_phase, max_phase): pick a random phase (per call) uniformly in [min_phase, max_phase].

apply(signal: Signal) Signal[source]

ABC Method for applying an impairment to an input Signal.

Given a Signal object with np.complex64 samples, return a new Signal with the impairment applied.