23 #ifndef INCLUDED_DIGITAL_CONSTELLATION_H
24 #define INCLUDED_DIGITAL_CONSTELLATION_H
28 #include <boost/enable_shared_from_this.hpp>
29 #include <boost/any.hpp>
63 :
public boost::enable_shared_from_this<constellation>
67 std::vector<int> pre_diff_code,
68 unsigned int rotational_symmetry,
69 unsigned int dimensionality);
74 void map_to_points(
unsigned int value,
gr_complex *points);
75 std::vector<gr_complex> map_to_points_v(
unsigned int value);
78 virtual unsigned int decision_maker(
const gr_complex *sample) = 0;
80 unsigned int decision_maker_v(std::vector<gr_complex> sample);
82 unsigned int decision_maker_pe(
const gr_complex *sample,
float *phase_error);
89 virtual void calc_euclidean_metric(
const gr_complex *sample,
float *metric);
90 virtual void calc_hard_symbol_metric(
const gr_complex *sample,
float *metric);
93 std::vector<gr_complex>
points() {
return d_constellation;}
96 std::vector<gr_complex> s_points();
98 std::vector<std::vector<gr_complex> > v_points();
112 return floor(log(
double(d_constellation.size()))/d_dimensionality/log(2.0));
122 return shared_from_this();
142 void gen_soft_dec_lut(
int precision,
float npwr=1.0);
163 virtual std::vector<float> calc_soft_dec(
gr_complex sample,
float npwr=1.0);
183 void set_soft_dec_lut(
const std::vector< std::vector<float> > &soft_dec_lut,
187 bool has_soft_dec_lut();
198 std::vector<float> soft_decision_maker(
gr_complex sample);
217 float get_distance(
unsigned int index,
const gr_complex *sample);
218 unsigned int get_closest_point(
const gr_complex *sample);
251 static sptr make(std::vector<gr_complex> constell,
252 std::vector<int> pre_diff_code,
253 unsigned int rotational_symmetry,
254 unsigned int dimensionality);
256 unsigned int decision_maker(
const gr_complex *sample);
263 std::vector<int> pre_diff_code,
264 unsigned int rotational_symmetry,
265 unsigned int dimensionality);
286 std::vector<int> pre_diff_code,
287 unsigned int rotational_symmetry,
288 unsigned int dimensionality,
289 unsigned int n_sectors);
293 unsigned int decision_maker(
const gr_complex *sample);
296 virtual unsigned int get_sector(
const gr_complex *sample) = 0;
297 virtual unsigned int calc_sector_value(
unsigned int sector) = 0;
298 void find_sector_values();
303 std::vector<int> sector_values;
345 std::vector<int> pre_diff_code,
346 unsigned int rotational_symmetry,
347 unsigned int real_sectors,
348 unsigned int imag_sectors,
349 float width_real_sectors,
350 float width_imag_sectors);
356 std::vector<int> pre_diff_code,
357 unsigned int rotational_symmetry,
358 unsigned int real_sectors,
359 unsigned int imag_sectors,
360 float width_real_sectors,
361 float width_imag_sectors);
363 unsigned int get_sector(
const gr_complex *sample);
364 gr_complex calc_sector_center(
unsigned int sector);
365 unsigned int calc_sector_value(
unsigned int sector);
368 unsigned int n_real_sectors;
369 unsigned int n_imag_sectors;
370 float d_width_real_sectors;
371 float d_width_imag_sectors;
402 std::vector<int> pre_diff_code,
403 unsigned int rotational_symmetry,
404 unsigned int real_sectors,
405 unsigned int imag_sectors,
406 float width_real_sectors,
407 float width_imag_sectors,
408 std::vector<unsigned int> sector_values);
413 std::vector<int> pre_diff_code,
414 unsigned int rotational_symmetry,
415 unsigned int real_sectors,
416 unsigned int imag_sectors,
417 float width_real_sectors,
418 float width_imag_sectors,
419 std::vector<unsigned int> sector_values);
422 return d_sector_values[sector];
426 std::vector<unsigned int> d_sector_values;
451 static sptr make(std::vector<gr_complex> constell,
452 std::vector<int> pre_diff_code,
453 unsigned int n_sectors);
458 unsigned int get_sector(
const gr_complex *sample);
460 unsigned int calc_sector_value(
unsigned int sector);
463 std::vector<int> pre_diff_code,
464 unsigned int n_sectors);
489 unsigned int decision_maker(
const gr_complex *sample);
521 unsigned int decision_maker(
const gr_complex *sample);
553 unsigned int decision_maker(
const gr_complex *sample);
587 unsigned int decision_maker(
const gr_complex *sample);
int d_lut_precision
Definition: constellation.h:214
boost::shared_ptr< constellation_psk > sptr
Definition: constellation.h:448
boost::shared_ptr< constellation_dqpsk > sptr
Definition: constellation.h:546
float d_scalefactor
The factor by which the user given constellation points were scaled by to achieve an average amplitud...
Definition: constellation.h:210
unsigned int bits_per_symbol()
Definition: constellation.h:110
constellation_pskConstellation space is divided into pie slices sectors.
Definition: constellation.h:445
Digital constellation for DQPSK01 | 00 11 | 10.
Definition: constellation.h:543
constellation_sptr base()
Definition: constellation.h:120
trellis_metric_type_t
Definition: metric_type.h:29
An abstracted constellation object.
Definition: constellation.h:62
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
std::vector< gr_complex > points()
Returns the set of points in this constellation.
Definition: constellation.h:93
boost::shared_ptr< constellation_bpsk > sptr
Definition: constellation.h:482
Rectangular digital constellationOnly implemented for 1-(complex)dimensional constellation.
Definition: constellation.h:395
Digital constellation for BPSK.
Definition: constellation.h:479
std::vector< std::vector< float > > d_soft_dec_lut
Definition: constellation.h:213
unsigned int dimensionality()
Returns the number of complex numbers in a single symbol.
Definition: constellation.h:108
std::complex< float > gr_complex
Definition: gr_complex.h:27
std::vector< gr_complex > d_constellation
Definition: constellation.h:202
void calc_metric(int O, int D, const std::vector< T > &TABLE, const T *input, float *metric, digital::trellis_metric_type_t type)
Sectorized digital constellationConstellation space is divided into sectors. Each sector is associate...
Definition: constellation.h:281
std::vector< int > d_pre_diff_code
Definition: constellation.h:203
void set_pre_diff_code(bool a)
Whether to apply an encoding before doing differential encoding. (e.g. gray coding) ...
Definition: constellation.h:102
float d_lut_scale
Definition: constellation.h:215
Digital constellation for QPSK01 | 11 00 | 10.
Definition: constellation.h:511
boost::shared_ptr< constellation_expl_rect > sptr
Definition: constellation.h:399
unsigned int d_arity
Definition: constellation.h:207
boost::shared_ptr< constellation_8psk > sptr
Definition: constellation.h:580
unsigned int calc_sector_value(unsigned int sector)
Definition: constellation.h:421
float d_re_min
Definition: constellation.h:211
unsigned int arity()
Definition: constellation.h:115
Calculate Euclidian distance for any constellationConstellation which calculates the distance to each...
Definition: constellation.h:236
std::vector< int > pre_diff_code()
Returns the encoding to apply before differential encoding.
Definition: constellation.h:104
pmt::pmt_t as_pmt()
Definition: constellation.h:125
PMT_API pmt_t make_any(const boost::any &any)
make an any
bool apply_pre_diff_code()
Whether to apply an encoding before doing differential encoding. (e.g. gray coding) ...
Definition: constellation.h:100
boost::shared_ptr< constellation_rect > sptr
Definition: constellation.h:330
unsigned int n_sectors
Definition: constellation.h:300
boost::intrusive_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
Definition: pmt.h:56
boost::shared_ptr< constellation_calcdist > sptr
Definition: constellation.h:240
Rectangular digital constellationOnly implemented for 1-(complex)dimensional constellation.
Definition: constellation.h:326
bool d_apply_pre_diff_code
Definition: constellation.h:204
Digital constellation for 8PSK101 | 100 001 | 000 011 | 010 111 | 110.
Definition: constellation.h:577
unsigned int d_dimensionality
Definition: constellation.h:206
unsigned int d_rotational_symmetry
Definition: constellation.h:205
unsigned int rotational_symmetry()
Returns the order of rotational symmetry.
Definition: constellation.h:106
boost::shared_ptr< constellation_qpsk > sptr
Definition: constellation.h:514