23 #ifndef INCLUDED_DIGITAL_CONSTELLATION_H 24 #define INCLUDED_DIGITAL_CONSTELLATION_H 30 #include <boost/any.hpp> 31 #include <boost/enable_shared_from_this.hpp> 44 typedef boost::shared_ptr<constellation> constellation_sptr;
66 std::vector<int> pre_diff_code,
67 unsigned int rotational_symmetry,
68 unsigned int dimensionality,
69 bool normalize_points =
true);
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);
91 virtual void calc_euclidean_metric(
const gr_complex* sample,
float* metric);
92 virtual void calc_hard_symbol_metric(
const gr_complex* sample,
float* metric);
95 std::vector<gr_complex>
points() {
return d_constellation; }
98 std::vector<gr_complex> s_points();
100 std::vector<std::vector<gr_complex>> v_points();
116 return floor(log(
double(d_constellation.size())) / d_dimensionality / log(2.0));
119 unsigned int arity() {
return d_arity; }
121 constellation_sptr
base() {
return shared_from_this(); }
137 void gen_soft_dec_lut(
int precision,
float npwr = 1.0);
158 virtual std::vector<float> calc_soft_dec(
gr_complex sample,
float npwr = 1.0);
178 void set_soft_dec_lut(
const std::vector<std::vector<float>>& soft_dec_lut,
182 bool has_soft_dec_lut();
185 std::vector<std::vector<float>> soft_dec_lut();
197 std::vector<float> soft_decision_maker(
gr_complex sample);
216 float get_distance(
unsigned int index,
const gr_complex* sample);
217 unsigned int get_closest_point(
const gr_complex* sample);
239 typedef boost::shared_ptr<constellation_calcdist>
sptr;
253 static sptr make(std::vector<gr_complex> constell,
254 std::vector<int> pre_diff_code,
255 unsigned int rotational_symmetry,
256 unsigned int dimensionality,
257 bool normalize_points =
true);
259 unsigned int decision_maker(
const gr_complex* sample);
266 std::vector<int> pre_diff_code,
267 unsigned int rotational_symmetry,
268 unsigned int dimensionality,
269 bool nomalize_points =
true);
299 std::vector<int> pre_diff_code,
300 unsigned int rotational_symmetry,
301 unsigned int dimensionality,
302 unsigned int n_sectors);
306 unsigned int decision_maker(
const gr_complex* sample);
309 virtual unsigned int get_sector(
const gr_complex* sample) = 0;
310 virtual unsigned int calc_sector_value(
unsigned int sector) = 0;
311 void find_sector_values();
316 std::vector<int> sector_values;
340 typedef boost::shared_ptr<constellation_rect>
sptr;
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);
366 std::vector<int> pre_diff_code,
367 unsigned int rotational_symmetry,
368 unsigned int real_sectors,
369 unsigned int imag_sectors,
370 float width_real_sectors,
371 float width_imag_sectors);
373 unsigned int get_sector(
const gr_complex* sample);
374 gr_complex calc_sector_center(
unsigned int sector);
375 unsigned int calc_sector_value(
unsigned int sector);
378 unsigned int n_real_sectors;
379 unsigned int n_imag_sectors;
380 float d_width_real_sectors;
381 float d_width_imag_sectors;
409 typedef boost::shared_ptr<constellation_expl_rect>
sptr;
412 std::vector<int> pre_diff_code,
413 unsigned int rotational_symmetry,
414 unsigned int real_sectors,
415 unsigned int imag_sectors,
416 float width_real_sectors,
417 float width_imag_sectors,
418 std::vector<unsigned int> sector_values);
423 std::vector<int> pre_diff_code,
424 unsigned int rotational_symmetry,
425 unsigned int real_sectors,
426 unsigned int imag_sectors,
427 float width_real_sectors,
428 float width_imag_sectors,
429 std::vector<unsigned int> sector_values);
433 return d_sector_values[sector];
437 std::vector<unsigned int> d_sector_values;
459 typedef boost::shared_ptr<constellation_psk>
sptr;
462 static sptr make(std::vector<gr_complex> constell,
463 std::vector<int> pre_diff_code,
464 unsigned int n_sectors);
469 unsigned int get_sector(
const gr_complex* sample);
471 unsigned int calc_sector_value(
unsigned int sector);
474 std::vector<int> pre_diff_code,
475 unsigned int n_sectors);
498 typedef boost::shared_ptr<constellation_bpsk>
sptr;
505 unsigned int decision_maker(
const gr_complex* sample);
534 typedef boost::shared_ptr<constellation_qpsk>
sptr;
541 unsigned int decision_maker(
const gr_complex* sample);
569 typedef boost::shared_ptr<constellation_dqpsk>
sptr;
576 unsigned int decision_maker(
const gr_complex* sample);
606 typedef boost::shared_ptr<constellation_8psk>
sptr;
613 unsigned int decision_maker(
const gr_complex* sample);
642 typedef boost::shared_ptr<constellation_8psk_natural>
sptr;
649 unsigned int decision_maker(
const gr_complex* sample);
680 typedef boost::shared_ptr<constellation_16qam>
sptr;
687 unsigned int decision_maker(
const gr_complex* sample);
int d_lut_precision
Definition: constellation.h:213
boost::shared_ptr< constellation_psk > sptr
Definition: constellation.h:459
boost::shared_ptr< constellation_dqpsk > sptr
Definition: constellation.h:569
Digital constellation for 16qam.
Definition: constellation.h:677
float d_scalefactor
The factor by which the user given constellation points were scaled by to achieve an average amplitud...
Definition: constellation.h:209
unsigned int bits_per_symbol()
Definition: constellation.h:114
boost::shared_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:96
constellation_pskConstellation space is divided into pie slices sectors.
Definition: constellation.h:456
Digital constellation for DQPSK.
Definition: constellation.h:566
constellation_sptr base()
Definition: constellation.h:121
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< std::vector< float > > d_soft_dec_lut
Definition: constellation.h:212
std::vector< gr_complex > points()
Returns the set of points in this constellation.
Definition: constellation.h:95
boost::shared_ptr< constellation_bpsk > sptr
Definition: constellation.h:498
Rectangular digital constellation.
Definition: constellation.h:406
Digital constellation for BPSK .
Definition: constellation.h:495
Digital constellation for natually mapped 8PSK.
Definition: constellation.h:639
unsigned int dimensionality()
Returns the number of complex numbers in a single symbol.
Definition: constellation.h:112
boost::shared_ptr< constellation_16qam > sptr
Definition: constellation.h:680
std::complex< float > gr_complex
Definition: gr_complex.h:27
std::vector< gr_complex > d_constellation
Definition: constellation.h:201
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 constellation.
Definition: constellation.h:285
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
std::vector< int > d_pre_diff_code
Definition: constellation.h:202
void set_pre_diff_code(bool a)
Whether to apply an encoding before doing differential encoding. (e.g. gray coding) ...
Definition: constellation.h:106
float d_lut_scale
Definition: constellation.h:214
Digital constellation for QPSK.
Definition: constellation.h:531
boost::shared_ptr< constellation_expl_rect > sptr
Definition: constellation.h:409
unsigned int d_arity
Definition: constellation.h:206
boost::shared_ptr< constellation_8psk > sptr
Definition: constellation.h:606
unsigned int calc_sector_value(unsigned int sector)
Definition: constellation.h:431
float d_re_min
Definition: constellation.h:210
boost::shared_ptr< constellation_8psk_natural > sptr
Definition: constellation.h:642
unsigned int arity()
Definition: constellation.h:119
Calculate Euclidian distance for any constellation.
Definition: constellation.h:236
std::vector< int > pre_diff_code()
Returns the encoding to apply before differential encoding.
Definition: constellation.h:108
pmt::pmt_t as_pmt()
Definition: constellation.h:123
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:103
boost::shared_ptr< constellation_rect > sptr
Definition: constellation.h:340
unsigned int n_sectors
Definition: constellation.h:313
boost::shared_ptr< constellation_calcdist > sptr
Definition: constellation.h:239
Rectangular digital constellationOnly implemented for 1-(complex)dimensional constellation.
Definition: constellation.h:337
bool d_apply_pre_diff_code
Definition: constellation.h:203
Digital constellation for 8PSK.
Definition: constellation.h:603
unsigned int d_dimensionality
Definition: constellation.h:205
unsigned int d_rotational_symmetry
Definition: constellation.h:204
unsigned int rotational_symmetry()
Returns the order of rotational symmetry.
Definition: constellation.h:110
boost::shared_ptr< constellation_qpsk > sptr
Definition: constellation.h:534