chaotic_pfc.dynamics.signals

signals.py

Generators for the information-bearing messages used throughout the chaotic communication pipeline.

Two waveforms are provided:

  • binary_message() — a square-wave BPSK-style message taking values in {-1, +1} with a fixed bit period.

  • sinusoidal_message() — a pure cosine/sine probe useful for spectral-response measurements.

Both functions return NumPy arrays of length N so they can be fed directly to chaotic_pfc.comms.transmitter.transmit().

Functions

binary_message(N[, period])

Generate a periodic square-wave binary message.

sinusoidal_message(N[, normalised_freq])

Generate a single-tone sinusoidal probe signal.

chaotic_pfc.dynamics.signals.binary_message(N, period=20)[source]

Generate a periodic square-wave binary message.

The output takes values in {+1, -1}, with the first half of each period at +1 and the second half at -1. This is the standard BPSK-style message used by chaotic_pfc.comms.transmitter.transmit().

Parameters:
  • N (int) – Total number of samples to produce.

  • period (int) – Length of one full +1 / -1 cycle. Must be a positive even integer; each half-cycle holds period // 2 samples.

Returns:

The message samples, each +1.0 or -1.0.

Return type:

ndarray, shape (N,)

Raises:

ValueError – If period is not a positive even integer.

Examples

>>> binary_message(8, period=4)
array([ 1.,  1., -1., -1.,  1.,  1., -1., -1.])
chaotic_pfc.dynamics.signals.sinusoidal_message(N, normalised_freq=0.1)[source]

Generate a single-tone sinusoidal probe signal.

Useful for frequency-response characterisation: feeding the output of this function through the transmitter/channel/receiver chain shows the system’s gain and phase at one specific frequency.

Parameters:
  • N (int) – Number of samples to produce.

  • normalised_freq (float) – Frequency in cycles per sample. Must satisfy 0 < f < 0.5 to avoid aliasing (Nyquist at f = 0.5). The default of 0.1 gives ten samples per cycle.

Returns:

The samples sin(2π · normalised_freq · n) for n = 0, 1, …, N 1.

Return type:

ndarray, shape (N,)

Raises:

ValueError – If normalised_freq is not strictly between 0 and 0.5.