23 #ifndef INCLUDED_DIGITAL_CONSTELLATION_H
24 #define INCLUDED_DIGITAL_CONSTELLATION_H
28 #include <boost/enable_shared_from_this.hpp>
61 :
public boost::enable_shared_from_this<constellation>
65 std::vector<int> pre_diff_code,
66 unsigned int rotational_symmetry,
67 unsigned int dimensionality);
72 void map_to_points(
unsigned int value,
gr_complex *points);
73 std::vector<gr_complex> map_to_points_v(
unsigned int value);
76 virtual unsigned int decision_maker(
const gr_complex *sample) = 0;
78 unsigned int decision_maker_v(std::vector<gr_complex> sample);
80 unsigned int decision_maker_pe(
const gr_complex *sample,
float *phase_error);
87 virtual void calc_euclidean_metric(
const gr_complex *sample,
float *metric);
88 virtual void calc_hard_symbol_metric(
const gr_complex *sample,
float *metric);
91 std::vector<gr_complex>
points() {
return d_constellation;}
94 std::vector<gr_complex> s_points();
96 std::vector<std::vector<gr_complex> > v_points();
110 return floor(log(
double(d_constellation.size()))/d_dimensionality/log(2.0));
120 return shared_from_this();
134 float get_distance(
unsigned int index,
const gr_complex *sample);
135 unsigned int get_closest_point(
const gr_complex *sample);
166 static sptr make(std::vector<gr_complex> constell,
167 std::vector<int> pre_diff_code,
168 unsigned int rotational_symmetry,
169 unsigned int dimensionality);
171 unsigned int decision_maker(
const gr_complex *sample);
178 std::vector<int> pre_diff_code,
179 unsigned int rotational_symmetry,
180 unsigned int dimensionality);
201 std::vector<int> pre_diff_code,
202 unsigned int rotational_symmetry,
203 unsigned int dimensionality,
204 unsigned int n_sectors);
208 unsigned int decision_maker(
const gr_complex *sample);
211 virtual unsigned int get_sector(
const gr_complex *sample) = 0;
212 virtual unsigned int calc_sector_value(
unsigned int sector) = 0;
213 void find_sector_values();
218 std::vector<int> sector_values;
260 std::vector<int> pre_diff_code,
261 unsigned int rotational_symmetry,
262 unsigned int real_sectors,
263 unsigned int imag_sectors,
264 float width_real_sectors,
265 float width_imag_sectors);
271 std::vector<int> pre_diff_code,
272 unsigned int rotational_symmetry,
273 unsigned int real_sectors,
274 unsigned int imag_sectors,
275 float width_real_sectors,
276 float width_imag_sectors);
278 unsigned int get_sector(
const gr_complex *sample);
280 unsigned int calc_sector_value(
unsigned int sector);
283 unsigned int n_real_sectors;
284 unsigned int n_imag_sectors;
285 float d_width_real_sectors;
286 float d_width_imag_sectors;
317 std::vector<int> pre_diff_code,
318 unsigned int rotational_symmetry,
319 unsigned int real_sectors,
320 unsigned int imag_sectors,
321 float width_real_sectors,
322 float width_imag_sectors,
323 std::vector<unsigned int> sector_values);
328 std::vector<int> pre_diff_code,
329 unsigned int rotational_symmetry,
330 unsigned int real_sectors,
331 unsigned int imag_sectors,
332 float width_real_sectors,
333 float width_imag_sectors,
334 std::vector<unsigned int> sector_values);
337 return d_sector_values[sector];
341 std::vector<unsigned int> d_sector_values;
366 static sptr make(std::vector<gr_complex> constell,
367 std::vector<int> pre_diff_code,
368 unsigned int n_sectors);
373 unsigned int get_sector(
const gr_complex *sample);
375 unsigned int calc_sector_value(
unsigned int sector);
378 std::vector<int> pre_diff_code,
379 unsigned int n_sectors);
404 unsigned int decision_maker(
const gr_complex *sample);
432 unsigned int decision_maker(
const gr_complex *sample);
460 unsigned int decision_maker(
const gr_complex *sample);
488 unsigned int decision_maker(
const gr_complex *sample);
boost::shared_ptr< constellation_psk > sptr
Definition: constellation.h:363
boost::shared_ptr< constellation_dqpsk > sptr
Definition: constellation.h:453
float d_scalefactor
The factor by which the user given constellation points were scaled by to achieve an average amplitud...
Definition: constellation.h:132
unsigned int bits_per_symbol()
Definition: constellation.h:108
constellation_pskConstellation space is divided into pie slices sectors.
Definition: constellation.h:360
Digital constellation for DQPSK.
Definition: constellation.h:450
constellation_sptr base()
Definition: constellation.h:118
trellis_metric_type_t
Definition: metric_type.h:29
An abstracted constellation object.
Definition: constellation.h:60
#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:91
boost::shared_ptr< constellation_bpsk > sptr
Definition: constellation.h:397
Rectangular digital constellationOnly implemented for 1-(complex)dimensional constellation.
Definition: constellation.h:310
Digital constellation for BPSK.
Definition: constellation.h:394
unsigned int dimensionality()
Returns the number of complex numbers in a single symbol.
Definition: constellation.h:106
std::complex< float > gr_complex
Definition: gr_complex.h:27
std::vector< gr_complex > d_constellation
Definition: constellation.h:124
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:196
std::vector< int > d_pre_diff_code
Definition: constellation.h:125
void set_pre_diff_code(bool a)
Whether to apply an encoding before doing differential encoding. (e.g. gray coding) ...
Definition: constellation.h:100
Digital constellation for QPSK.
Definition: constellation.h:422
boost::shared_ptr< constellation_expl_rect > sptr
Definition: constellation.h:314
unsigned int d_arity
Definition: constellation.h:129
boost::shared_ptr< constellation_8psk > sptr
Definition: constellation.h:481
unsigned int calc_sector_value(unsigned int sector)
Definition: constellation.h:336
unsigned int arity()
Definition: constellation.h:113
Calculate Euclidian distance for any constellationConstellation which calculates the distance to each...
Definition: constellation.h:151
std::vector< int > pre_diff_code()
Returns the encoding to apply before differential encoding.
Definition: constellation.h:102
bool apply_pre_diff_code()
Whether to apply an encoding before doing differential encoding. (e.g. gray coding) ...
Definition: constellation.h:98
boost::shared_ptr< constellation_rect > sptr
Definition: constellation.h:245
unsigned int n_sectors
Definition: constellation.h:215
boost::shared_ptr< constellation_calcdist > sptr
Definition: constellation.h:155
Rectangular digital constellationOnly implemented for 1-(complex)dimensional constellation.
Definition: constellation.h:241
bool d_apply_pre_diff_code
Definition: constellation.h:126
Digital constellation for 8PSK.
Definition: constellation.h:478
unsigned int d_dimensionality
Definition: constellation.h:128
unsigned int d_rotational_symmetry
Definition: constellation.h:127
unsigned int rotational_symmetry()
Returns the order of rotational symmetry.
Definition: constellation.h:104
boost::shared_ptr< constellation_qpsk > sptr
Definition: constellation.h:425