Linear modulator/demodulator (modem) object FIXME: need to point both modem and modemcf pointers to same struct typedef struct MODEM(_s) * MODEM();
Public Functions
modem | modem_create( |
modem | modem_create_arbitrary( |
modem | modem_recreate( |
modem | modem_copy( |
int | modem_destroy( |
int | modem_print( |
int | modem_reset( |
unsigned int | modem_gen_rand_sym( |
unsigned int | modem_get_bps( |
modulation_scheme | modem_get_scheme( |
int | modem_modulate( |
int | modem_demodulate( |
int | modem_demodulate_soft( |
int | modem_get_demodulator_sample( |
float | modem_get_demodulator_phase_error( |
float | modem_get_demodulator_evm( |
Interfaces
modem modem_create(
Create digital modem object with a particular scheme
- _scheme : linear modulation scheme (e.g. LIQUID_MODEM_QPSK)
modem modem_create_arbitrary(
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(
Recreate modulation scheme, re-allocating memory as necessary
- _q : modem object
- _scheme : linear modulation scheme (e.g. LIQUID_MODEM_QPSK)
modem modem_copy(
Copy object including all internal objects and state
int modem_destroy(
Destroy modem object, freeing all allocated memory
int modem_print(
Print modem status to stdout
int modem_reset(
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(
Generate random symbol for modulation
unsigned int modem_get_bps(
Get number of bits per symbol (bps) of modem object
modulation_scheme modem_get_scheme(
Get modulation scheme of modem object
int modem_modulate(
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(
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 modem_demodulate_soft(
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(
Get demodulator's estimated transmit sample
- _q :
- _x_hat :
float modem_get_demodulator_phase_error(
Get demodulator phase error
float modem_get_demodulator_evm(
Get demodulator error vector magnitude