GNU Radio C++ API Reference: gr::digital::constellation_rect Class Reference

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
gr::digital::constellation_rect Class Reference

Rectangular digital constellation. More...

`#include <gnuradio/digital/constellation.h>`

## Public Types
typedef std::shared_ptr< constellation_rect > | sptr
Public Types inherited from gr::digital::constellation
enum | normalization_t { NO_NORMALIZATION , POWER_NORMALIZATION , AMPLITUDE_NORMALIZATION }

## Public Member Functions
| ~constellation_rect () override
Public Member Functions inherited from gr::digital::constellation_sector
| constellation_sector (std::vector< gr_complex > constell, std::vector< int > pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality, unsigned int n_sectors, normalization_t normalization=AMPLITUDE_NORMALIZATION)
| ~constellation_sector () override
unsigned int | decision_maker (const gr_complex *sample) override
| Returns the constellation point that matches best.
Public Member Functions inherited from gr::digital::constellation
| constellation (std::vector< gr_complex > constell, std::vector< int > pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality, normalization_t normalization=AMPLITUDE_NORMALIZATION, float npwr=1.0)
| constellation ()
virtual | ~constellation ()
void | normalize (normalization_t normalization)
| Normalizes the 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)
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 ()
pmt::pmt_t | as_pmt ()
void | gen_soft_dec_lut (int precision, float npwr=-1)
| Generates the soft decision LUT based on constellation and symbol map.
virtual std::vector< float > | calc_soft_dec (gr_complex sample, float npwr=-1)
| Calculate soft decisions for the given `sample`.
void | set_soft_dec_lut (const std::vector< std::vector< float > > &soft_dec_lut, int precision)
| Define a soft decision look-up table.
void | set_npwr (float npwr)
| Sets the constellation noise power and recalculates LUT given `npwr`.
bool | has_soft_dec_lut ()
| Returns True if the soft decision LUT has been defined, False otherwise.
std::vector< std::vector< float > > | soft_dec_lut ()
std::vector< float > | soft_decision_maker (gr_complex sample)
| Returns the soft decisions for the given `sample`.

## Static Public Member Functions
static constellation_rect::sptr | make (std::vector< gr_complex > constell, std::vector< int > pre_diff_code, unsigned int rotational_symmetry, unsigned int real_sectors, unsigned int imag_sectors, float width_real_sectors, float width_imag_sectors, normalization_t normalization=AMPLITUDE_NORMALIZATION)

## Protected Member Functions
| constellation_rect (std::vector< gr_complex > constell, std::vector< int > pre_diff_code, unsigned int rotational_symmetry, unsigned int real_sectors, unsigned int imag_sectors, float width_real_sectors, float width_imag_sectors, normalization_t normalization=AMPLITUDE_NORMALIZATION)
unsigned int | get_sector (const gr_complex *sample) override
gr_complex | calc_sector_center (unsigned int sector)
unsigned int | calc_sector_value (unsigned int sector) override
Protected Member Functions inherited from gr::digital::constellation_sector
void | find_sector_values ()
Protected Member Functions inherited from gr::digital::constellation
float | get_distance (unsigned int index, const gr_complex *sample)
unsigned int | get_closest_point (const gr_complex *sample)
void | calc_arity ()
void | max_min_axes ()

## Additional Inherited Members
Protected Attributes inherited from gr::digital::constellation_sector
unsigned int | n_sectors
Protected Attributes inherited from gr::digital::constellation
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.
float | d_maxamp
float | d_re_min
float | d_re_max
float | d_im_min
float | d_im_max
std::vector< std::vector< float > > | d_soft_dec_lut
int | d_lut_precision
float | d_lut_scale
float | d_npwr
float | d_padding
bool | d_use_external_lut

## Detailed Description

Rectangular digital constellation.

Only implemented for 1-(complex)dimensional constellation.

Constellation space is divided into rectangular sectors. Each sector is associated with the nearest constellation point.

Works well for square QAM.

Works for any generic constellation provided sectors are not too large.

## Member Typedef Documentation

## ◆ sptr

typedef std::shared_ptr<constellation_rect> gr::digital::constellation_rect::sptr

## Constructor & Destructor Documentation

## ◆ ~constellation_rect()

gr::digital::constellation_rect::~constellation_rect | ( |  | ) |
| override

## ◆ constellation_rect()

gr::digital::constellation_rect::constellation_rect | ( | std::vector< gr_complex > | constell,
|  | std::vector< int > | pre_diff_code,
|  | unsigned int | rotational_symmetry,
|  | unsigned int | real_sectors,
|  | unsigned int | imag_sectors,
|  | float | width_real_sectors,
|  | float | width_imag_sectors,
|  | normalization_t | normalization = AMPLITUDE_NORMALIZATION )
| protected

References gr::digital::constellation::AMPLITUDE_NORMALIZATION, gr::digital::constellation::pre_diff_code(), and gr::digital::constellation::rotational_symmetry().

## Member Function Documentation

## ◆ calc_sector_center()

gr_complex gr::digital::constellation_rect::calc_sector_center | ( | unsigned int | sector | ) |
| protected

## ◆ calc_sector_value()

unsigned int gr::digital::constellation_rect::calc_sector_value | ( | unsigned int | sector | ) |
| overrideprotectedvirtual

Implements gr::digital::constellation_sector.

## ◆ get_sector()

unsigned int gr::digital::constellation_rect::get_sector | ( | const gr_complex * | sample | ) |
| overrideprotectedvirtual

Implements gr::digital::constellation_sector.

## ◆ make()

constellation_rect::sptr gr::digital::constellation_rect::make | ( | std::vector< gr_complex > | constell,
|  | std::vector< int > | pre_diff_code,
|  | unsigned int | rotational_symmetry,
|  | unsigned int | real_sectors,
|  | unsigned int | imag_sectors,
|  | float | width_real_sectors,
|  | float | width_imag_sectors,
|  | normalization_t | normalization = AMPLITUDE_NORMALIZATION )
| static

Make a rectangular constellation object.

Parameters

  constell | List of constellation points (order of list matches pre_diff_code)
  pre_diff_code | List of alphabet symbols (before applying any differential coding) (order of list matches constell)
  rotational_symmetry | Number of rotations around unit circle that have the same representation.
  real_sectors | Number of sectors the real axis is split in to.
  imag_sectors | Number of sectors the imag axis is split in to.
  width_real_sectors | width of each real sector to calculate decision boundaries.
  width_imag_sectors | width of each imag sector to calculate decision boundaries.
  normalization | Use AMPLITUDE_NORMALIZATION to normalize points to mean(abs(points))=1 (default), POWER_NORMALIZATION to normalize points to mean(abs(points)^2)=1 or NO_NORMALIZATION to keep the original amplitude.

References gr::digital::constellation::AMPLITUDE_NORMALIZATION, gr::digital::constellation::pre_diff_code(), and gr::digital::constellation::rotational_symmetry().

The documentation for this class was generated from the following file:

- constellation.h