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>
44 typedef boost::shared_ptr<constellation> constellation_sptr;
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();
190 std::vector< std::vector<float> > soft_dec_lut();
203 std::vector<float> soft_decision_maker(
gr_complex sample);
222 float get_distance(
unsigned int index,
const gr_complex *sample);
223 unsigned int get_closest_point(
const gr_complex *sample);
246 typedef boost::shared_ptr<constellation_calcdist>
sptr;
257 static sptr make(std::vector<gr_complex> constell,
258 std::vector<int> pre_diff_code,
259 unsigned int rotational_symmetry,
260 unsigned int dimensionality);
262 unsigned int decision_maker(
const gr_complex *sample);
269 std::vector<int> pre_diff_code,
270 unsigned int rotational_symmetry,
271 unsigned int dimensionality);
302 std::vector<int> pre_diff_code,
303 unsigned int rotational_symmetry,
304 unsigned int dimensionality,
305 unsigned int n_sectors);
309 unsigned int decision_maker(
const gr_complex *sample);
312 virtual unsigned int get_sector(
const gr_complex *sample) = 0;
313 virtual unsigned int calc_sector_value(
unsigned int sector) = 0;
314 void find_sector_values();
319 std::vector<int> sector_values;
344 typedef boost::shared_ptr<constellation_rect>
sptr;
359 std::vector<int> pre_diff_code,
360 unsigned int rotational_symmetry,
361 unsigned int real_sectors,
362 unsigned int imag_sectors,
363 float width_real_sectors,
364 float width_imag_sectors);
370 std::vector<int> pre_diff_code,
371 unsigned int rotational_symmetry,
372 unsigned int real_sectors,
373 unsigned int imag_sectors,
374 float width_real_sectors,
375 float width_imag_sectors);
377 unsigned int get_sector(
const gr_complex *sample);
378 gr_complex calc_sector_center(
unsigned int sector);
379 unsigned int calc_sector_value(
unsigned int sector);
382 unsigned int n_real_sectors;
383 unsigned int n_imag_sectors;
384 float d_width_real_sectors;
385 float d_width_imag_sectors;
414 typedef boost::shared_ptr<constellation_expl_rect>
sptr;
417 std::vector<int> pre_diff_code,
418 unsigned int rotational_symmetry,
419 unsigned int real_sectors,
420 unsigned int imag_sectors,
421 float width_real_sectors,
422 float width_imag_sectors,
423 std::vector<unsigned int> sector_values);
428 std::vector<int> pre_diff_code,
429 unsigned int rotational_symmetry,
430 unsigned int real_sectors,
431 unsigned int imag_sectors,
432 float width_real_sectors,
433 float width_imag_sectors,
434 std::vector<unsigned int> sector_values);
437 return d_sector_values[sector];
441 std::vector<unsigned int> d_sector_values;
463 typedef boost::shared_ptr<constellation_psk>
sptr;
466 static sptr make(std::vector<gr_complex> constell,
467 std::vector<int> pre_diff_code,
468 unsigned int n_sectors);
473 unsigned int get_sector(
const gr_complex *sample);
475 unsigned int calc_sector_value(
unsigned int sector);
478 std::vector<int> pre_diff_code,
479 unsigned int n_sectors);
502 typedef boost::shared_ptr<constellation_bpsk>
sptr;
509 unsigned int decision_maker(
const gr_complex *sample);
537 typedef boost::shared_ptr<constellation_qpsk>
sptr;
544 unsigned int decision_maker(
const gr_complex *sample);
572 typedef boost::shared_ptr<constellation_dqpsk>
sptr;
579 unsigned int decision_maker(
const gr_complex *sample);
609 typedef boost::shared_ptr<constellation_8psk>
sptr;
616 unsigned int decision_maker(
const gr_complex *sample);
645 typedef boost::shared_ptr<constellation_8psk_natural>
sptr;
652 unsigned int decision_maker(
const gr_complex *sample);
683 typedef boost::shared_ptr<constellation_16qam>
sptr;
690 unsigned int decision_maker(
const gr_complex *sample);
int d_lut_precision
Definition: constellation.h:219
boost::shared_ptr< constellation_psk > sptr
Definition: constellation.h:463
boost::shared_ptr< constellation_dqpsk > sptr
Definition: constellation.h:572
Digital constellation for 16qam.
Definition: constellation.h:680
float d_scalefactor
The factor by which the user given constellation points were scaled by to achieve an average amplitud...
Definition: constellation.h:215
unsigned int bits_per_symbol()
Definition: constellation.h:110
constellation_pskConstellation space is divided into pie slices sectors.
Definition: constellation.h:460
Digital constellation for DQPSK.
Definition: constellation.h:569
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:502
Rectangular digital constellation.
Definition: constellation.h:410
Digital constellation for BPSK .
Definition: constellation.h:499
std::vector< std::vector< float > > d_soft_dec_lut
Definition: constellation.h:218
Digital constellation for natually mapped 8PSK.
Definition: constellation.h:642
unsigned int dimensionality()
Returns the number of complex numbers in a single symbol.
Definition: constellation.h:108
boost::shared_ptr< constellation_16qam > sptr
Definition: constellation.h:683
std::complex< float > gr_complex
Definition: gr_complex.h:27
std::vector< gr_complex > d_constellation
Definition: constellation.h:207
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:287
Include this header to use the message passing features.
Definition: logger.h:131
std::vector< int > d_pre_diff_code
Definition: constellation.h:208
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:220
Digital constellation for QPSK.
Definition: constellation.h:534
boost::shared_ptr< constellation_expl_rect > sptr
Definition: constellation.h:414
unsigned int d_arity
Definition: constellation.h:212
boost::shared_ptr< constellation_8psk > sptr
Definition: constellation.h:609
unsigned int calc_sector_value(unsigned int sector)
Definition: constellation.h:436
float d_re_min
Definition: constellation.h:216
boost::shared_ptr< constellation_8psk_natural > sptr
Definition: constellation.h:645
unsigned int arity()
Definition: constellation.h:115
Calculate Euclidian distance for any constellation.
Definition: constellation.h:242
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:344
unsigned int n_sectors
Definition: constellation.h:316
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:246
Rectangular digital constellationOnly implemented for 1-(complex)dimensional constellation.
Definition: constellation.h:340
bool d_apply_pre_diff_code
Definition: constellation.h:209
Digital constellation for 8PSK.
Definition: constellation.h:606
unsigned int d_dimensionality
Definition: constellation.h:211
unsigned int d_rotational_symmetry
Definition: constellation.h:210
unsigned int rotational_symmetry()
Returns the order of rotational symmetry.
Definition: constellation.h:106
boost::shared_ptr< constellation_qpsk > sptr
Definition: constellation.h:537