GNU Radio 3.7.1 C++ API
|
An abstracted constellation object. More...
#include <constellation.h>
Public Member Functions | |
constellation (std::vector< gr_complex > constell, std::vector< int > pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality) | |
constellation () | |
virtual | ~constellation () |
void | map_to_points (unsigned int value, gr_complex *points) |
Returns the constellation points for a symbol value. | |
std::vector< gr_complex > | map_to_points_v (unsigned int value) |
virtual unsigned int | decision_maker (const gr_complex *sample)=0 |
Returns the constellation point that matches best. | |
unsigned int | decision_maker_v (std::vector< gr_complex > sample) |
Takes a vector rather than a pointer. Better for SWIG wrapping. | |
unsigned int | decision_maker_pe (const gr_complex *sample, float *phase_error) |
Also calculates the phase error. | |
virtual void | calc_metric (const gr_complex *sample, float *metric, gr::digital::trellis_metric_type_t type) |
Calculates distance. | |
virtual void | calc_euclidean_metric (const gr_complex *sample, float *metric) |
virtual void | calc_hard_symbol_metric (const gr_complex *sample, float *metric) |
std::vector< gr_complex > | points () |
Returns the set of points in this constellation. | |
std::vector< gr_complex > | s_points () |
Returns the vector of points in this constellation. Raise error if dimensionality is not one. | |
std::vector< std::vector < gr_complex > > | v_points () |
Returns a vector of vectors of points. | |
bool | apply_pre_diff_code () |
Whether to apply an encoding before doing differential encoding. (e.g. gray coding) | |
void | set_pre_diff_code (bool a) |
Whether to apply an encoding before doing differential encoding. (e.g. gray coding) | |
std::vector< int > | pre_diff_code () |
Returns the encoding to apply before differential encoding. | |
unsigned int | rotational_symmetry () |
Returns the order of rotational symmetry. | |
unsigned int | dimensionality () |
Returns the number of complex numbers in a single symbol. | |
unsigned int | bits_per_symbol () |
unsigned int | arity () |
constellation_sptr | base () |
Protected Member Functions | |
float | get_distance (unsigned int index, const gr_complex *sample) |
unsigned int | get_closest_point (const gr_complex *sample) |
void | calc_arity () |
Protected Attributes | |
std::vector< gr_complex > | d_constellation |
std::vector< int > | d_pre_diff_code |
bool | d_apply_pre_diff_code |
unsigned int | d_rotational_symmetry |
unsigned int | d_dimensionality |
unsigned int | d_arity |
float | d_scalefactor |
The factor by which the user given constellation points were scaled by to achieve an average amplitude of 1. |
An abstracted constellation object.
The constellation objects hold the necessary information to pass around constellation information for modulators and demodulators. These objects contain the mapping between the bits and the constellation points used to represent them as well as methods for slicing the symbol space. Various implementations are possible for efficiency and ease of use.
Standard constellations (BPSK, QPSK, QAM, etc) can be inherited from this class and overloaded to perform optimized slicing and constellation mappings.
gr::digital::constellation::constellation | ( | std::vector< gr_complex > | constell, |
std::vector< int > | pre_diff_code, | ||
unsigned int | rotational_symmetry, | ||
unsigned int | dimensionality | ||
) |
virtual gr::digital::constellation::~constellation | ( | ) | [virtual] |
bool gr::digital::constellation::apply_pre_diff_code | ( | ) | [inline] |
Whether to apply an encoding before doing differential encoding. (e.g. gray coding)
unsigned int gr::digital::constellation::arity | ( | ) | [inline] |
constellation_sptr gr::digital::constellation::base | ( | ) | [inline] |
unsigned int gr::digital::constellation::bits_per_symbol | ( | ) | [inline] |
void gr::digital::constellation::calc_arity | ( | ) | [protected] |
virtual void gr::digital::constellation::calc_euclidean_metric | ( | const gr_complex * | sample, |
float * | metric | ||
) | [virtual] |
virtual void gr::digital::constellation::calc_hard_symbol_metric | ( | const gr_complex * | sample, |
float * | metric | ||
) | [virtual] |
virtual void gr::digital::constellation::calc_metric | ( | const gr_complex * | sample, |
float * | metric, | ||
gr::digital::trellis_metric_type_t | type | ||
) | [virtual] |
Calculates distance.
Calculates metrics for all points in the constellation. For use with the viterbi algorithm.
virtual unsigned int gr::digital::constellation::decision_maker | ( | const gr_complex * | sample | ) | [pure virtual] |
Returns the constellation point that matches best.
Implemented in gr::digital::constellation_8psk, gr::digital::constellation_dqpsk, gr::digital::constellation_qpsk, gr::digital::constellation_bpsk, gr::digital::constellation_sector, and gr::digital::constellation_calcdist.
unsigned int gr::digital::constellation::decision_maker_pe | ( | const gr_complex * | sample, |
float * | phase_error | ||
) |
Also calculates the phase error.
unsigned int gr::digital::constellation::decision_maker_v | ( | std::vector< gr_complex > | sample | ) |
Takes a vector rather than a pointer. Better for SWIG wrapping.
unsigned int gr::digital::constellation::dimensionality | ( | ) | [inline] |
Returns the number of complex numbers in a single symbol.
unsigned int gr::digital::constellation::get_closest_point | ( | const gr_complex * | sample | ) | [protected] |
float gr::digital::constellation::get_distance | ( | unsigned int | index, |
const gr_complex * | sample | ||
) | [protected] |
void gr::digital::constellation::map_to_points | ( | unsigned int | value, |
gr_complex * | points | ||
) |
Returns the constellation points for a symbol value.
std::vector<gr_complex> gr::digital::constellation::map_to_points_v | ( | unsigned int | value | ) |
std::vector<gr_complex> gr::digital::constellation::points | ( | ) | [inline] |
Returns the set of points in this constellation.
std::vector<int> gr::digital::constellation::pre_diff_code | ( | ) | [inline] |
Returns the encoding to apply before differential encoding.
unsigned int gr::digital::constellation::rotational_symmetry | ( | ) | [inline] |
Returns the order of rotational symmetry.
std::vector<gr_complex> gr::digital::constellation::s_points | ( | ) |
Returns the vector of points in this constellation. Raise error if dimensionality is not one.
void gr::digital::constellation::set_pre_diff_code | ( | bool | a | ) | [inline] |
Whether to apply an encoding before doing differential encoding. (e.g. gray coding)
std::vector<std::vector<gr_complex> > gr::digital::constellation::v_points | ( | ) |
Returns a vector of vectors of points.
unsigned int gr::digital::constellation::d_arity [protected] |
std::vector<gr_complex> gr::digital::constellation::d_constellation [protected] |
unsigned int gr::digital::constellation::d_dimensionality [protected] |
std::vector<int> gr::digital::constellation::d_pre_diff_code [protected] |
unsigned int gr::digital::constellation::d_rotational_symmetry [protected] |
float gr::digital::constellation::d_scalefactor [protected] |
The factor by which the user given constellation points were scaled by to achieve an average amplitude of 1.