modem

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

Variants: modem, modemcf

Public Functions

modem modem_create(modulation_scheme _scheme)
modem modem_create_arbitrary(float complex * _table, unsigned int _M)
modem modem_recreate(modem _q, modulation_scheme _scheme)
modem modem_copy(modem _q)
int modem_destroy(modem _q)
int modem_print(modem _q)
int modem_reset(modem _q)
unsigned int modem_gen_rand_sym(modem _q)
unsigned int modem_get_bps(modem _q)
modulation_scheme modem_get_scheme(modem _q)
int modem_modulate(modem _q, unsigned int _s, float complex * _y)
int modem_demodulate(modem _q, float complex _x, unsigned int * _s)
int modem_demodulate_soft(modem _q, float complex _x, unsigned int * _s, unsigned char * _soft_bits)
int modem_get_demodulator_sample(modem _q, float complex * _x_hat)
float modem_get_demodulator_phase_error(modem _q)
float modem_get_demodulator_evm(modem _q)

Interfaces

modem modem_create(modulation_scheme _scheme)

Create digital modem object with a particular scheme

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

modem modem_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

modem modem_recreate(modem _q, modulation_scheme _scheme)

Recreate modulation scheme, re-allocating memory as necessary

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

modem modem_copy(modem _q)

Copy object including all internal objects and state

int modem_destroy(modem _q)

Destroy modem object, freeing all allocated memory

int modem_print(modem _q)

Print modem status to stdout

int modem_reset(modem _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 modem_gen_rand_sym(modem _q)

Generate random symbol for modulation

unsigned int modem_get_bps(modem _q)

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

modulation_scheme modem_get_scheme(modem _q)

Get modulation scheme of modem object

int modem_modulate(modem _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 modem_demodulate(modem _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 indepdently 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 modem_demodulate_soft(modem _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 modem_get_demodulator_sample(modem _q, float complex * _x_hat)

Get demodulator's estimated transmit sample

  • _q :
  • _x_hat :

float modem_get_demodulator_phase_error(modem _q)

Get demodulator phase error

float modem_get_demodulator_evm(modem _q)

Get demodulator error vector magnitude