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( |
modemcf | modemcf_create_arbitrary( |
modemcf | modemcf_recreate( |
modemcf | modemcf_copy( |
int | modemcf_destroy( |
int | modemcf_print( |
int | modemcf_reset( |
unsigned int | modemcf_gen_rand_sym( |
unsigned int | modemcf_get_bps( |
modulation_scheme | modemcf_get_scheme( |
int | modemcf_modulate( |
int | modemcf_demodulate( |
int | modemcf_demodulate_soft( |
int | modemcf_get_demodulator_sample( |
float | modemcf_get_demodulator_phase_error( |
float | modemcf_get_demodulator_evm( |
Interfaces
modemcf modemcf_create(
Create digital modem object with a particular scheme
- _scheme : linear modulation scheme (e.g. LIQUID_MODEM_QPSK)
modemcf modemcf_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
modemcf modemcf_recreate(
Recreate modulation scheme, re-allocating memory as necessary
- _q : modem object
- _scheme : linear modulation scheme (e.g. LIQUID_MODEM_QPSK)
modemcf modemcf_copy(
Copy object including all internal objects and state
int modemcf_destroy(
Destroy modem object, freeing all allocated memory
int modemcf_print(
Print modem status to stdout
int modemcf_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 modemcf_gen_rand_sym(
Generate random symbol for modulation
unsigned int modemcf_get_bps(
Get number of bits per symbol (bps) of modem object
modulation_scheme modemcf_get_scheme(
Get modulation scheme of modem object
int modemcf_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 modemcf_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 modemcf_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 modemcf_get_demodulator_sample(
Get demodulator's estimated transmit sample
- _q :
- _x_hat :
float modemcf_get_demodulator_phase_error(
Get demodulator phase error
float modemcf_get_demodulator_evm(
Get demodulator error vector magnitude