nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
channel.hpp File Reference
#include <memory_resource>
#include <nk/value/value.hpp>
#include <string>
#include <tuple>

Go to the source code of this file.

Functions

Value nk::comm::awgn (::nk::ops::RngContext &rng, const Value &x, double snr_db, double sigpower_db, std::pmr::memory_resource *mr=nullptr)
 Add white Gaussian noise so the resulting SNR is snr_db dB (y = awgn(x, snr_db, sigpower_db)).
Value nk::comm::wgn (::nk::ops::RngContext &rng, int m, int n, double p, const std::string &type, bool complex_out, std::pmr::memory_resource *mr=nullptr)
 Generate an m×n matrix of white Gaussian noise samples (y = wgn(m, n, p, type, complex)).
Value nk::comm::bsc (::nk::ops::RngContext &rng, const Value &x, double p, std::pmr::memory_resource *mr=nullptr)
 Binary symmetric channel — flip each bit with probability p (y = bsc(x, p)).
Value nk::comm::qfunc (const Value &x, std::pmr::memory_resource *mr=nullptr)
 Gaussian Q-function: Q(x) = 0.5·erfc(x/√2).
Value nk::comm::qfuncinv (const Value &p, std::pmr::memory_resource *mr=nullptr)
 Inverse Q-function: Q⁻¹(p) = √2·erfc⁻¹(2p).
Value nk::comm::marcumq (const Value &a, const Value &b, int m, std::pmr::memory_resource *mr=nullptr)
 Generalised Marcum Q-function (q = marcumq(a, b, m)).
Value nk::comm::berawgn (const Value &EbNo_dB, const std::string &mod, int M, std::pmr::memory_resource *mr=nullptr)
 Analytical bit-error rate over AWGN (ber = berawgn(EbNo_dB, mod, M)).
Value nk::comm::noisebw (const Value &num, const Value &den, int Nsamp, double fs, std::pmr::memory_resource *mr=nullptr)
 Equivalent noise bandwidth of an LTI filter (bw = noisebw(num, den, Nsamp, fs)).
std::tuple< Value, Value > nk::comm::berconfint (double numErrs, double numBits, double level, std::pmr::memory_resource *mr=nullptr)
 Clopper–Pearson exact binomial confidence interval for a measured BER ([ber, ci] = berconfint(numErrs, numBits, level)).
Value nk::comm::convertSNR (const Value &snr_in, const std::string &in_type, const std::string &out_type, int bits_per_symbol, std::pmr::memory_resource *mr=nullptr)
 Convert between Eb/No, Es/No, and SNR (snr_out = convertSNR(snr_in, in_type, out_type, k)).