chaotic_pfc.comms.channel

channel.py

Transmission-channel models sitting between the chaotic transmitter and the receiver.

Eight channels are provided:

  • ideal_channel() — noiseless pass-through used to establish a best-case baseline for chaos synchronisation.

  • fir_channel() — a symmetric FIR low-pass filter built on top of scipy.signal.firwin(), representing a band-limited physical link.

  • awgn() — additive white Gaussian noise.

  • channel_impulsive() — AWGN with Middleton Class-A impulsive noise.

  • channel_multipath() — multipath channel with configurable tap delays and gains.

  • channel_interferers() — composite channel (AWGN + DCSK interferer + narrow-band WiFi-like interferer), lives in chaotic_pfc.comms.dcsk.

  • channel_urban() — combined urban channel with impulsive noise, multipath, and interferers, lives in chaotic_pfc.comms.dcsk.

All accept the transmitted signal s as a 1-D array and return the received signal r of the same length. The FIR channel additionally returns its filter coefficients so they can be overlaid on the PSD plots produced by chaotic_pfc.plotting.

Functions

awgn(sig, snr_db[, rng])

Add white Gaussian noise to sig for a given SNR in dB.

channel_impulsive(sig, snr_db[, ...])

AWGN channel with Middleton Class-A impulsive noise.

channel_multipath(sig, snr_db[, delays, ...])

Multipath channel with configurable tap delays and gains.

fir_channel(s[, cutoff, num_taps, window])

Transmit s through a symmetric FIR low-pass channel.

ideal_channel(s)

Transmit s through a noiseless, distortion-free channel.

chaotic_pfc.comms.channel.ideal_channel(s)[source]

Transmit s through a noiseless, distortion-free channel.

This is literally a copy of the input. It is still defined as a function (rather than aliased to numpy.ndarray.copy) so that the receiver-side code can always call ideal_channel(s) consistently regardless of the channel configuration chosen by the caller.

Parameters:

s (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – Transmitted signal, shape (N,).

Returns:

  • ndarray, shape (N,) – An independent copy of s. Mutating the output does not affect the input.

  • Implements (Channel.)

Return type:

ndarray[tuple[Any, …], dtype[_ScalarT]]

chaotic_pfc.comms.channel.fir_channel(s, cutoff=0.99, num_taps=201, window='hamming')[source]

Transmit s through a symmetric FIR low-pass channel.

The channel is built with scipy.signal.firwin() using pass_zero=True (true low-pass) and unit sampling frequency normalisation (fs=2.0). The DC gain of the resulting filter is normalised to 1.0.

Parameters:
  • s (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – Transmitted signal, shape (N,).

  • cutoff (float) – Normalised cutoff frequency ω_c / π (0, 1). Defaults to 0.99 — i.e. the channel passes almost everything, mimicking a very lightly band-limited link.

  • num_taps (int) – Length of the FIR filter in samples. Must be a positive integer.

  • window (str) – Window function passed through to firwin. Any name accepted by scipy.signal.get_window() is valid — common choices are "hamming", "hann", "blackman".

Returns:

  • r (ndarray, shape (N,)) – Received signal, s filtered through the FIR coefficients.

  • h (ndarray, shape (num_taps,)) – Filter coefficients, useful for overlaying the channel response on PSD plots.

  • Implements (Channel.)

Return type:

tuple[ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]]]

chaotic_pfc.comms.channel.awgn(sig, snr_db, rng=None)[source]

Add white Gaussian noise to sig for a given SNR in dB.

Parameters:
  • sig (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – Signal samples.

  • snr_db (float) – Signal-to-noise ratio in dB.

  • rng (Generator | None) – Random generator (uses np.random.default_rng if None).

Return type:

ndarray[tuple[Any, …], dtype[_ScalarT]]

chaotic_pfc.comms.channel.channel_impulsive(sig, snr_db, prob_impulso=0.01, amp_fator=10.0, rng=None)[source]

AWGN channel with Middleton Class-A impulsive noise.

Parameters:
  • prob_impulso (float) – Probability a sample is hit by an impulse (e.g. 0.01 = 1 %).

  • amp_fator (float) – Impulse amplitude in multiples of the signal std.

  • sig (ndarray[tuple[Any, ...], dtype[_ScalarT]])

  • snr_db (float)

  • rng (Generator | None)

Return type:

ndarray[tuple[Any, …], dtype[_ScalarT]]

chaotic_pfc.comms.channel.channel_multipath(sig, snr_db, delays=None, gains=None, rng=None)[source]

Multipath channel with configurable tap delays and gains.

Parameters:
  • delays (list[int] | None) – Delay of each path in samples (default: [0, 3, 7, 15]).

  • gains (list[float] | None) – Attenuation per path (default: [1.0, 0.6, 0.4, 0.2]).

  • sig (ndarray[tuple[Any, ...], dtype[_ScalarT]])

  • snr_db (float)

  • rng (Generator | None)

Return type:

ndarray[tuple[Any, …], dtype[_ScalarT]]