engineeringkit.communications#

Decibel conversions; wavelength, Friis free-space propagation and decibel link budgets; Johnson-Nyquist thermal noise and the cascaded noise factor; Nyquist signalling, Hartley’s law, binary entropy and Shannon capacity; AM, DSB-SC and FM modulation with Carson’s bandwidth rule; BPSK/QPSK and their AWGN bit-error rates (scipy.special.erfc); the Hamming(7,4) code; and OFDM via numpy.fft.

engineeringkit.communications: modulation, noise, capacity, detection, coding and link budgets.

Hertz wavelengths and Friis free-space propagation with decibel link budgets; Johnson-Nyquist thermal noise and Friis’s cascaded noise factor; Nyquist signalling, Hartley’s line rate, Shannon entropy and capacity; AM, suppressed-carrier and FM modulation with Carson’s bandwidth rule; BPSK/QPSK and their AWGN error rates; Hamming(7,4) error correction; and DFT-based OFDM. Models are hand-written closed forms; NumPy’s FFT and SciPy’s erfc and trapezoidal integration are used where they are the standard tool.

class engineeringkit.communications.HammingDecodeResult(data, syndromes, corrected)[source]#

Bases: object

Output of engineeringkit.communications.hamming74_decode().

Parameters:
  • data (ndarray)

  • syndromes (ndarray)

  • corrected (ndarray)

corrected: ndarray#

Codewords after correction.

Type:

ndarray of int

data: ndarray#

Decoded data bits, four per codeword.

Type:

ndarray of int

summary()[source]#

Number of words decoded and number in which a bit was corrected.

Return type:

dict

syndromes: ndarray#

Per-word syndrome, the 1-based position of the corrected bit (0 if none).

Type:

ndarray of int

engineeringkit.communications.am_signal(message, t, fc, mu=1.0, carrier_amplitude=1.0)[source]#

Conventional (full-carrier) AM, \(s(t) = A_c[1 + \mu m(t)]\cos 2\pi f_c t\).

Parameters:
  • message (array_like) – Normalised message \(m(t)\) with \(|m| \le 1\) [-].

  • t (array_like) – Sample times [s], same shape as message.

  • fc (float) – Carrier frequency [Hz], nonnegative.

  • mu (float, optional) – Modulation index [-], nonnegative; mu > 1 overmodulates and distorts an envelope detector’s output.

  • carrier_amplitude (float, optional) – Carrier amplitude \(A_c\) [V].

Returns:

Modulated waveform [V].

Return type:

ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> am_signal([0.5], [0.0], 1.0, mu=0.5).tolist()
[1.25]
engineeringkit.communications.ber_bpsk_awgn(ebn0)[source]#

Bit-error rate of coherent BPSK in AWGN, \(Q(\sqrt{2E_b/N_0}) = \tfrac12\operatorname{erfc}\sqrt{E_b/N_0}\).

Parameters:

ebn0 (float or array_like) – Energy per bit over noise spectral density, \(E_b/N_0\) [-] (linear, not dB), nonnegative.

Returns:

Bit-error probability [-].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

References

V. A. Kotel’nikov, The Theory of Optimum Noise Immunity (1947; English translation, McGraw-Hill, 1959).

Examples

>>> f"{float(ber_bpsk_awgn(10 ** (9.6 / 10))):.1e}"
'9.7e-06'
engineeringkit.communications.ber_qpsk_awgn(ebn0)[source]#

Bit-error rate of coherent Gray-labelled QPSK in AWGN; equal to BPSK per bit.

Parameters:

ebn0 (float or array_like) – \(E_b/N_0\) [-] (linear), nonnegative.

Returns:

Bit-error probability [-].

Return type:

float or ndarray

Notes

The in-phase and quadrature rails are independent BPSK channels. See Communications: linear ratios, modulation phase and channel scope.

Examples

>>> bool(ber_qpsk_awgn(4.0) == ber_bpsk_awgn(4.0))
True
engineeringkit.communications.binary_symmetric_capacity(p)[source]#

Capacity of the binary symmetric channel, \(C = 1 - H(p)\).

Parameters:

p (float or array_like) – Crossover (bit-flip) probability [-] in [0, 1].

Returns:

Capacity [bit per channel use].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> round(binary_symmetric_capacity(0.11), 3)
0.5
engineeringkit.communications.bpsk(bits)[source]#

Binary phase-shift keying: map bits 0, 1 to antipodal symbols -1, +1.

Parameters:

bits (array_like) – Binary data (any integer or float dtype holding only 0 and 1).

Returns:

Real unit-energy symbols.

Return type:

ndarray

Notes

Inputs are converted to float before arithmetic, so unsigned zeros do not wrap; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> bpsk([0, 1, 1]).tolist()
[-1.0, 1.0, 1.0]
engineeringkit.communications.carson_bandwidth(peak_deviation, message_bandwidth)[source]#

Carson’s rule for the 98%-power bandwidth of FM, \(B \approx 2(\Delta f + W)\).

Parameters:
  • peak_deviation (float or array_like) – Peak frequency deviation \(\Delta f\) [Hz], nonnegative.

  • message_bandwidth (float or array_like) – Highest message frequency \(W\) [Hz], nonnegative.

Returns:

Transmission bandwidth [Hz].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

References

J. R. Carson, “Notes on the theory of modulation,” Proc. IRE 10 (1922) 57-64.

Examples

>>> float(carson_bandwidth(75e3, 15e3))
180000.0
engineeringkit.communications.cascaded_noise_factor(gains, noise_factors)[source]#

Friis’s formula for the noise factor of amplifiers in cascade.

\[F = F_1 + \frac{F_2 - 1}{G_1} + \frac{F_3 - 1}{G_1 G_2} + \cdots\]
Parameters:
  • gains (array_like) – Linear available power gain of each stage [-], positive. The last stage’s gain does not affect the result.

  • noise_factors (array_like) – Linear noise factor of each stage [-], at least one.

Returns:

Overall noise factor [-].

Return type:

float

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

References

H. T. Friis, “Noise figures of radio receivers,” Proc. IRE 32 (1944) 419-422.

Examples

>>> round(cascaded_noise_factor([10.0, 10.0], [2.0, 3.0]), 6)
2.2
engineeringkit.communications.db(x)[source]#

Power ratio in decibels, \(10\log_{10} x\).

Parameters:

x (float or array_like) – Linear power ratio [-], positive.

Returns:

Ratio [dB].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> float(db(100.0))
20.0
engineeringkit.communications.dbm(power_w)[source]#

Power in decibels relative to one milliwatt.

Parameters:

power_w (float or array_like) – Power [W], positive.

Returns:

Power [dBm].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> float(dbm(1.0))
30.0
engineeringkit.communications.dsb_sc(message, t, fc)[source]#

Double-sideband suppressed-carrier modulation, \(s(t) = m(t)\cos 2\pi f_c t\).

Parameters:
  • message (array_like) – Message samples [V].

  • t (array_like) – Sample times [s].

  • fc (float) – Carrier frequency [Hz], nonnegative.

Returns:

Modulated waveform [V]; demodulate by multiplying with a coherent carrier and low-pass filtering.

Return type:

ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> dsb_sc([2.0], [0.0], 5.0).tolist()
[2.0]
engineeringkit.communications.entropy_binary(p)[source]#

Binary entropy \(H(p) = -p\log_2 p - (1-p)\log_2(1-p)\).

Parameters:

p (float or array_like) – Probability [-] in [0, 1].

Returns:

Entropy [bit]; zero at p = 0 and p = 1, one at p = 0.5.

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

References

C. E. Shannon, “A mathematical theory of communication,” Bell Syst. Tech. J. 27 (1948) 379-423, 623-656.

Examples

>>> float(entropy_binary(0.5))
1.0
engineeringkit.communications.fm_signal(message, t, fc, kf)[source]#

Frequency modulation, \(\cos(2\pi f_c t + 2\pi k_f\int_0^t m\,d\tau)\).

The phase integral uses the trapezoidal rule, so nonuniform time grids are allowed; the modulation phase is zero at the first sample.

Parameters:
  • message (array_like) – Message samples \(m(t)\).

  • t (array_like) – Strictly increasing sample times [s], same shape as message.

  • fc (float) – Carrier frequency [Hz], nonnegative.

  • kf (float) – Frequency sensitivity [Hz per message unit].

Returns:

Unit-amplitude FM waveform.

Return type:

ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

References

E. H. Armstrong, “A method of reducing disturbances in radio signaling by a system of frequency modulation,” Proc. IRE 24 (1936) 689-740.

Examples

>>> fm_signal([1.0, 1.0], [0.0, 0.25], 0.0, 1.0).round(12).tolist()
[1.0, 0.0]
engineeringkit.communications.free_space_path_loss(distance, f, c=299792458.0)[source]#

Free-space path loss between isotropic antennas, \((4\pi d f / c)^2\).

Parameters:
  • distance (float or array_like) – Separation [m], positive; far field is assumed.

  • f (float or array_like) – Frequency [Hz], positive.

  • c (float, optional) – Propagation speed [m/s].

Returns:

Linear loss ratio [-], at least one in the far field.

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> round(float(free_space_path_loss_db(1000.0, 2.4e9)), 2)
100.05
engineeringkit.communications.free_space_path_loss_db(distance, f, c=299792458.0)[source]#

Free-space path loss in decibels; see free_space_path_loss().

Parameters:
  • distance (float or array_like) – Separation [m], positive.

  • f (float or array_like) – Frequency [Hz], positive.

  • c (float, optional) – Propagation speed [m/s].

Returns:

Path loss [dB].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> round(float(free_space_path_loss_db(1.0, 299792458.0 / (4 * np.pi))), 6)
0.0
engineeringkit.communications.friis_received_power(Pt, Gt, Gr, distance, f)[source]#

Friis transmission equation, \(P_r = P_t G_t G_r (\lambda/4\pi d)^2\).

Parameters:
  • Pt (float or array_like) – Transmitted power [W], nonnegative.

  • Gt (float or array_like) – Transmit and receive antenna gains [-] (linear), positive.

  • Gr (float or array_like) – Transmit and receive antenna gains [-] (linear), positive.

  • distance (float or array_like) – Separation [m], positive.

  • f (float or array_like) – Frequency [Hz], positive.

Returns:

Received power [W].

Return type:

float or ndarray

Notes

Free space, far-field antennas and matched polarization and impedance are assumed. Inputs are raw SI numbers; see Communications: linear ratios, modulation phase and channel scope.

References

H. T. Friis, “A note on a simple transmission formula,” Proc. IRE 34 (1946) 254-256.

Examples

>>> round(float(friis_received_power(1.0, 1.0, 1.0, 1000.0, 2.4e9)) * 1e10, 4)
0.9881
engineeringkit.communications.from_db(x_db)[source]#

Linear power ratio from decibels, \(10^{x/10}\).

Parameters:

x_db (float or array_like) – Ratio [dB].

Returns:

Linear power ratio [-].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> float(from_db(30.0))
1000.0
engineeringkit.communications.from_dbm(x)[source]#

Power in watts from dBm, \(10^{-3}\cdot 10^{x/10}\).

Parameters:

x (float or array_like) – Power [dBm].

Returns:

Power [W].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> float(from_dbm(30.0))
1.0
engineeringkit.communications.hamming74_decode(codewords)[source]#

Decode Hamming(7,4) codewords, correcting up to one flipped bit per word.

Parameters:

codewords (array_like) – Received binary words; length must be a multiple of seven.

Returns:

Decoded data bits, the syndrome of each word (the 1-based position of the corrected bit, or 0), and the corrected codewords.

Return type:

HammingDecodeResult

Notes

Two or more errors in one word are silently mis-corrected; the code’s minimum distance of three guarantees only single-error correction. See Communications: linear ratios, modulation phase and channel scope.

Examples

>>> received = hamming74_encode([1, 0, 1, 1])
>>> received[4] ^= 1
>>> result = hamming74_decode(received)
>>> result.data.tolist(), result.syndromes.tolist()
([1, 0, 1, 1], [5])
engineeringkit.communications.hamming74_encode(data)[source]#

Encode data bits with the Hamming(7,4) single-error-correcting code.

Parameters:

data (array_like) – Binary data; its length must be a multiple of four.

Returns:

Codewords [p1, p2, d1, p3, d2, d3, d4] concatenated, 7/4 as long as the input. Any two codewords differ in at least three positions.

Return type:

ndarray of int

Notes

See Communications: linear ratios, modulation phase and channel scope.

References

R. W. Hamming, “Error detecting and error correcting codes,” Bell Syst. Tech. J. 29 (1950) 147-160.

Examples

>>> hamming74_encode([1, 0, 1, 1]).tolist()
[0, 1, 1, 0, 0, 1, 1]
engineeringkit.communications.hamming_distance(a, b)[source]#

Number of positions at which two equal-length binary words differ.

Parameters:
  • a (array_like) – Binary words of the same shape.

  • b (array_like) – Binary words of the same shape.

Returns:

Hamming distance.

Return type:

int

Notes

See Communications: linear ratios, modulation phase and channel scope.

Examples

>>> hamming_distance([1, 0, 1, 1], [1, 1, 1, 0])
2
engineeringkit.communications.hartley_capacity(B, M)[source]#

Hartley’s line rate, \(2B\log_2 M\), for M distinguishable levels.

Parameters:
  • B (float or array_like) – Bandwidth [Hz], nonnegative.

  • M (int) – Number of distinguishable signal levels, at least 2.

Returns:

Bit rate [bit/s].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

References

R. V. L. Hartley, “Transmission of information,” Bell Syst. Tech. J. 7 (1928) 535-563.

Examples

>>> float(hartley_capacity(3000.0, 4))
12000.0

Received power from a decibel link budget, \(P_r = P_t + G_t + G_r - L_p - L\).

Parameters:
  • pt_dbm (float or array_like) – Transmitted power [dBm].

  • gt_db (float or array_like) – Antenna gains [dBi].

  • gr_db (float or array_like) – Antenna gains [dBi].

  • path_loss_db (float or array_like) – Propagation loss [dB].

  • losses_db (float or array_like, optional) – Other losses (cables, pointing, atmosphere) [dB].

Returns:

Received power [dBm].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> float(link_budget_db(30.0, 10.0, 10.0, 100.0, 2.0))
-52.0
engineeringkit.communications.noise_figure(F)[source]#

Noise figure \(NF = 10\log_{10} F\) from a linear noise factor.

Parameters:

F (float or array_like) – Noise factor [-], at least one (one for a noiseless device).

Returns:

Noise figure [dB].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> float(noise_figure(2.0)) > 3.0
True
engineeringkit.communications.nyquist_symbol_rate(B)[source]#

Maximum intersymbol-interference-free pulse rate through an ideal low-pass channel, \(2B\).

Parameters:

B (float or array_like) – Channel bandwidth [Hz], nonnegative.

Returns:

Symbol rate [baud].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

References

H. Nyquist, “Certain topics in telegraph transmission theory,” Trans. AIEE 47 (1928) 617-644.

Examples

>>> float(nyquist_symbol_rate(3000.0))
6000.0
engineeringkit.communications.ofdm_demodulate(samples, n_subcarriers, cyclic_prefix=0)[source]#

Recover subcarrier symbols from OFDM samples (inverse of ofdm_modulate()).

Parameters:
  • samples (array_like) – Received baseband samples; the length must be a multiple of n_subcarriers + cyclic_prefix.

  • n_subcarriers (int) – Number of subcarriers, at least 2.

  • cyclic_prefix (int, optional) – Cyclic-prefix length used by the transmitter.

Returns:

One complex value per subcarrier per block. After a channel shorter than the cyclic prefix, each equals the transmitted symbol times the channel’s frequency response at that subcarrier.

Return type:

ndarray of complex

Notes

See Communications: linear ratios, modulation phase and channel scope.

Examples

>>> rx = ofdm_demodulate(ofdm_modulate([1, -1, 1j, -1j], 4, 2), 4, 2)
>>> np.allclose(rx, [1, -1, 1j, -1j])
True
engineeringkit.communications.ofdm_modulate(symbols, n_subcarriers, cyclic_prefix=0)[source]#

Map complex symbols onto OFDM time-domain blocks with an inverse DFT.

Parameters:
  • symbols (array_like) – Complex constellation symbols; the length must be a multiple of n_subcarriers.

  • n_subcarriers (int) – Number of subcarriers (IDFT size), at least 2.

  • cyclic_prefix (int, optional) – Number of samples copied from the end of each block to its front, nonnegative and less than n_subcarriers.

Returns:

Baseband samples, n_subcarriers + cyclic_prefix per block, normalised so average power equals average symbol energy.

Return type:

ndarray of complex

Notes

See Communications: linear ratios, modulation phase and channel scope.

References

S. B. Weinstein and P. M. Ebert, “Data transmission by frequency-division multiplexing using the discrete Fourier transform,” IEEE Trans. Commun. Technol. 19 (1971) 628-634.

Examples

>>> x = ofdm_modulate([1, 1, 1, 1], 4, cyclic_prefix=1)
>>> np.round(x.real, 12).tolist()
[0.0, 2.0, 0.0, 0.0, 0.0]
engineeringkit.communications.q_function(x)[source]#

Gaussian tail probability \(Q(x) = \tfrac12\operatorname{erfc}(x/\sqrt2)\).

Parameters:

x (float or array_like) – Threshold in standard deviations [-].

Returns:

\(P(Z > x)\) for a standard normal \(Z\).

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> float(q_function(0.0))
0.5
engineeringkit.communications.qpsk(bit_pairs)[source]#

Quadrature phase-shift keying: two bits per unit-energy complex symbol.

The first bit of each pair sets the sign of the in-phase component and the second the quadrature component (Gray labelling), so each symbol is \((\pm 1 \pm j)/\sqrt2\).

Parameters:

bit_pairs (array_like) – An even number of binary values.

Returns:

Complex symbols, half as many as bits.

Return type:

ndarray

Notes

See Communications: linear ratios, modulation phase and channel scope.

References

C. R. Cahn, “Combined digital phase and amplitude modulation communication systems,” IRE Trans. Commun. Syst. 8 (1960) 150-155.

Examples

>>> np.round(qpsk([1, 1]) * np.sqrt(2), 12).tolist()
[(1+1j)]
engineeringkit.communications.shannon_capacity(B, snr_linear)[source]#

Shannon-Hartley capacity of a band-limited AWGN channel, \(C = B\log_2(1 + S/N)\).

Parameters:
  • B (float or array_like) – Bandwidth [Hz], nonnegative.

  • snr_linear (float or array_like) – Signal-to-noise power ratio [-] (linear), nonnegative.

Returns:

Capacity [bit/s]: the highest rate at which arbitrarily reliable communication is possible with ideal coding.

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

References

C. E. Shannon, “Communication in the presence of noise,” Proc. IRE 37 (1949) 10-21.

Examples

>>> round(float(shannon_capacity(3000.0, 1000.0)))
29902
engineeringkit.communications.spectral_efficiency(bit_rate, B)[source]#

Spectral efficiency \(R_b/B\).

Parameters:
  • bit_rate (float or array_like) – Bit rate [bit/s], nonnegative.

  • B (float or array_like) – Occupied bandwidth [Hz], positive.

Returns:

Efficiency [bit/s/Hz].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> float(spectral_efficiency(1e6, 2.5e5))
4.0
engineeringkit.communications.symbol_rate(bit_rate, M)[source]#

Symbol (baud) rate for an M-ary alphabet, \(R_b / \log_2 M\).

Parameters:
  • bit_rate (float or array_like) – Bit rate [bit/s], nonnegative.

  • M (int) – Alphabet size, at least 2.

Returns:

Symbol rate [baud].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> float(symbol_rate(9600.0, 16))
2400.0
engineeringkit.communications.thermal_noise_power(B, T=290.0, k=1.380649e-23)[source]#

Available thermal (Johnson-Nyquist) noise power \(N = kTB\).

Parameters:
  • B (float or array_like) – Noise bandwidth [Hz], nonnegative.

  • T (float or array_like, optional) – Absolute noise temperature [K], nonnegative; 290 K is the standard reference.

  • k (float, optional) – Boltzmann constant [J/K].

Returns:

Noise power [W] (-174 dBm in 1 Hz at 290 K).

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

References

J. B. Johnson, “Thermal agitation of electricity in conductors,” Phys. Rev. 32 (1928) 97-109; H. Nyquist, Phys. Rev. 32 (1928) 110-113.

Examples

>>> round(float(10 * np.log10(thermal_noise_power(1.0) / 1e-3)), 2)
-173.98
engineeringkit.communications.wavelength(f, c=299792458.0)[source]#

Free-space wavelength \(\lambda = c/f\).

Parameters:
  • f (float or array_like) – Frequency [Hz], positive.

  • c (float, optional) – Propagation speed [m/s], positive.

Returns:

Wavelength [m].

Return type:

float or ndarray

Notes

Inputs are raw SI numbers with no dimensional metadata; see Communications: linear ratios, modulation phase and channel scope.

Examples

>>> round(float(wavelength(100e6)), 4)
2.9979

Visualizers#

Matplotlib visualizers for engineeringkit.communications.

engineeringkit.communications.visualizers.plot_ber_curve(ebn0_db, ber, ax=None, label=None)[source]#

Semilog plot of bit-error rate against \(E_b/N_0\) in decibels.

Parameters:
  • ebn0_db (array_like) – \(E_b/N_0\) values [dB].

  • ber (array_like) – Matching bit-error rates [-]; zeros are omitted from the log axis.

  • ax (matplotlib.axes.Axes, optional) – Axes to draw on; a new figure is created if omitted.

  • label (str, optional) – Legend label.

Return type:

matplotlib.axes.Axes

engineeringkit.communications.visualizers.plot_constellation(symbols, ax=None, label=None)[source]#

Scatter complex symbols in the in-phase/quadrature plane.

Parameters:
  • symbols (array_like) – Complex (or real) symbols.

  • ax (matplotlib.axes.Axes, optional) – Axes to draw on; a new figure is created if omitted.

  • label (str, optional) – Legend label.

Return type:

matplotlib.axes.Axes