comnum.awgn#
- comnum.awgn(x, snr_db, rng, *, fs=1.0, bandwidth_hz=1.0)#
Add circular complex Gaussian noise for an SNR of
snr_dbwithin the bandwidthbandwidthof a signal sampled atfs(OptiCommPyawgn):σ² = (fs/bandwidth) P_x / SNR.- Parameters:
- Returns:
the noisy signal (complex128).
- Return type:
- Raises:
ValueError – for an input that is not an array of numbers of the expected shape.
Examples
>>> import comnum, numpy as np >>> x = np.ones(100_000, dtype=complex) >>> y = comnum.awgn(x, 10.0, comnum.Rng(1)) >>> round(comnum.snr_db(y, x)) 10