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);
252 static sptr make(std::vector<gr_complex> constell,
253 std::vector<int> pre_diff_code,
254 unsigned int rotational_symmetry,
255 unsigned int dimensionality);
257 unsigned int decision_maker(
const gr_complex *sample);
264 std::vector<int> pre_diff_code,
265 unsigned int rotational_symmetry,
266 unsigned int dimensionality);
297 std::vector<int> pre_diff_code,
298 unsigned int rotational_symmetry,
299 unsigned int dimensionality,
300 unsigned int n_sectors);
304 unsigned int decision_maker(
const gr_complex *sample);
307 virtual unsigned int get_sector(
const gr_complex *sample) = 0;
308 virtual unsigned int calc_sector_value(
unsigned int sector) = 0;
309 void find_sector_values();
314 std::vector<int> sector_values;
354 std::vector<int> pre_diff_code,
355 unsigned int rotational_symmetry,
356 unsigned int real_sectors,
357 unsigned int imag_sectors,
358 float width_real_sectors,
359 float width_imag_sectors);
365 std::vector<int> pre_diff_code,
366 unsigned int rotational_symmetry,
367 unsigned int real_sectors,
368 unsigned int imag_sectors,
369 float width_real_sectors,
370 float width_imag_sectors);
372 unsigned int get_sector(
const gr_complex *sample);
373 gr_complex calc_sector_center(
unsigned int sector);
374 unsigned int calc_sector_value(
unsigned int sector);
377 unsigned int n_real_sectors;
378 unsigned int n_imag_sectors;
379 float d_width_real_sectors;
380 float d_width_imag_sectors;
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);
432 return d_sector_values[sector];
436 std::vector<unsigned int> d_sector_values;
461 static sptr make(std::vector<gr_complex> constell,
462 std::vector<int> pre_diff_code,
463 unsigned int n_sectors);
468 unsigned int get_sector(
const gr_complex *sample);
470 unsigned int calc_sector_value(
unsigned int sector);
473 std::vector<int> pre_diff_code,
474 unsigned int n_sectors);
504 unsigned int decision_maker(
const gr_complex *sample);
539 unsigned int decision_maker(
const gr_complex *sample);
574 unsigned int decision_maker(
const gr_complex *sample);
611 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:458
boost::shared_ptr< constellation_dqpsk > sptr
Definition: constellation.h:567
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:455
Digital constellation for DQPSK.
Definition: constellation.h:564
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:497
Rectangular digital constellation.
Definition: constellation.h:405
Digital constellation for BPSK .
Definition: constellation.h:494
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 constellation.
Definition: constellation.h:282
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 QPSK.
Definition: constellation.h:529
boost::shared_ptr< constellation_expl_rect > sptr
Definition: constellation.h:409
unsigned int d_arity
Definition: constellation.h:207
boost::shared_ptr< constellation_8psk > sptr
Definition: constellation.h:604
unsigned int calc_sector_value(unsigned int sector)
Definition: constellation.h:431
float d_re_min
Definition: constellation.h:211
unsigned int arity()
Definition: constellation.h:115
Calculate Euclidian distance for any constellation.
Definition: constellation.h:237
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:339
unsigned int n_sectors
Definition: constellation.h:311
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:241
Rectangular digital constellationOnly implemented for 1-(complex)dimensional constellation.
Definition: constellation.h:335
bool d_apply_pre_diff_code
Definition: constellation.h:204
Digital constellation for 8PSK.
Definition: constellation.h:601
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:532