modemcf

Variants: modem, modemcf

Linear modulator/demodulator (modem) object FIXME: need to point both modem and modemcf pointers to same struct typedef struct MODEM(_s) * MODEM();

Public Functions

modemcf modemcf_create(modulation_scheme _scheme)
modemcf modemcf_create_arbitrary(float complex * _table, unsigned int _M)
modemcf modemcf_recreate(modemcf _q, modulation_scheme _scheme)
modemcf modemcf_copy(modemcf _q)
int modemcf_destroy(modemcf _q)
int modemcf_print(modemcf _q)
int modemcf_reset(modemcf _q)
unsigned int modemcf_gen_rand_sym(modemcf _q)
unsigned int modemcf_get_bps(modemcf _q)
modulation_scheme modemcf_get_scheme(modemcf _q)
int modemcf_modulate(modemcf _q, unsigned int _s, float complex * _y)
int modemcf_demodulate(modemcf _q, float complex _x, unsigned int * _s)
int modemcf_demodulate_soft(modemcf _q, float complex _x, unsigned int * _s, unsigned char * _soft_bits)
int modemcf_get_demodulator_sample(modemcf _q, float complex * _x_hat)
float modemcf_get_demodulator_phase_error(modemcf _q)
float modemcf_get_demodulator_evm(modemcf _q)

Interfaces

modemcf modemcf_create(modulation_scheme _scheme)

Create digital modem object with a particular scheme

  • _scheme : linear modulation scheme (e.g. LIQUID_MODEM_QPSK)

modemcf modemcf_create_arbitrary(float complex * _table, unsigned int _M)

Create linear digital modem object with arbitrary constellation points defined by an external table of symbols. Sample points are provided as complex float pairs and converted internally if needed.

  • _table : array of complex constellation points, shape: (_M, 1)
  • _M : modulation order and table size

modemcf modemcf_recreate(modemcf _q, modulation_scheme _scheme)

Recreate modulation scheme, re-allocating memory as necessary

  • _q : modem object
  • _scheme : linear modulation scheme (e.g. LIQUID_MODEM_QPSK)

modemcf modemcf_copy(modemcf _q)

Copy object including all internal objects and state

int modemcf_destroy(modemcf _q)

Destroy modem object, freeing all allocated memory

int modemcf_print(modemcf _q)

Print modem status to stdout

int modemcf_reset(modemcf _q)

Reset internal state of modem object; note that this is only relevant for modulation types that retain an internal state such as LIQUID_MODEM_DPSK4 as most linear modulation types are stateless

unsigned int modemcf_gen_rand_sym(modemcf _q)

Generate random symbol for modulation

unsigned int modemcf_get_bps(modemcf _q)

Get number of bits per symbol (bps) of modem object

modulation_scheme modemcf_get_scheme(modemcf _q)

Get modulation scheme of modem object

int modemcf_modulate(modemcf _q, unsigned int _s, float complex * _y)

Modulate input symbol (bits) and generate output complex sample

  • _q : modem object
  • _s : input symbol, 0 <= _s <= M-1
  • _y : output complex sample

int modemcf_demodulate(modemcf _q, float complex _x, unsigned int * _s)

Demodulate input sample and provide maximum-likelihood estimate of symbol that would have generated it. The output is a hard decision value on the input sample. This is performed efficiently by taking advantage of symmetry on most modulation types. For example, square and rectangular quadrature amplitude modulation with gray coding can use a bisection search independently on its in-phase and quadrature channels. Arbitrary modulation schemes are relatively slow, however, for large modulation types as the demodulator must compute the distance between the received sample and all possible symbols to derive the optimal symbol.

  • _q : modem object
  • _x : input sample
  • _s : output hard symbol, 0 <= _s <= M-1

int modemcf_demodulate_soft(modemcf _q, float complex _x, unsigned int * _s, unsigned char * _soft_bits)

Demodulate input sample and provide (approximate) log-likelihood ratio (LLR, soft bits) as an output. Similarly to the hard-decision demodulation method, this is computed efficiently for most modulation types.

  • _q : modem object
  • _x : input sample
  • _s : output hard symbol, 0 <= _s <= M-1
  • _soft_bits : output soft bits, shape: (log2(M), 1)

int modemcf_get_demodulator_sample(modemcf _q, float complex * _x_hat)

Get demodulator's estimated transmit sample

  • _q :
  • _x_hat :

float modemcf_get_demodulator_phase_error(modemcf _q)

Get demodulator phase error

float modemcf_get_demodulator_evm(modemcf _q)

Get demodulator error vector magnitude