diff options
Diffstat (limited to 'gnuradio-core/src/lib/general/gr_constellation.h')
-rw-r--r-- | gnuradio-core/src/lib/general/gr_constellation.h | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/gnuradio-core/src/lib/general/gr_constellation.h b/gnuradio-core/src/lib/general/gr_constellation.h index 6908f43f19..440e32e571 100644 --- a/gnuradio-core/src/lib/general/gr_constellation.h +++ b/gnuradio-core/src/lib/general/gr_constellation.h @@ -40,17 +40,21 @@ typedef boost::shared_ptr<gr_constellation> gr_constellation_sptr; // public constructor gr_constellation_sptr - gr_make_constellation (std::vector<gr_complex> constellation); +gr_make_constellation (std::vector<gr_complex> constellation, std::vector<unsigned int> pre_diff_code); class gr_constellation : public boost::enable_shared_from_this<gr_constellation> { public: - gr_constellation (std::vector<gr_complex> constellation); + gr_constellation (std::vector<gr_complex> constellation, std::vector<unsigned int> pre_diff_code); gr_constellation (); //! Returns the set of points in this constellation. std::vector<gr_complex> points() { return d_constellation;} + //! Whether to apply an encoding before doing differential encoding. (e.g. gray coding) + bool apply_pre_diff_code() { return d_apply_pre_diff_code;} + //! Returns the encoding to apply before differential encoding. + std::vector<unsigned int> pre_diff_code() { return d_pre_diff_code;} //! Returns the constellation point that matches best. //! Also calculates the phase error. @@ -77,6 +81,8 @@ class gr_constellation : public boost::enable_shared_from_this<gr_constellation> protected: std::vector<gr_complex> d_constellation; + std::vector<unsigned int> d_pre_diff_code; + bool d_apply_pre_diff_code; private: friend gr_constellation_sptr @@ -97,6 +103,7 @@ class gr_constellation_sector : public gr_constellation public: gr_constellation_sector (std::vector<gr_complex> constellation, + std::vector<unsigned int> pre_diff_code, unsigned int n_sectors); unsigned int decision_maker (gr_complex sample); @@ -133,15 +140,17 @@ typedef boost::shared_ptr<gr_constellation_rect> gr_constellation_rect_sptr; // public constructor gr_constellation_rect_sptr -gr_make_constellation_rect (std::vector<gr_complex> constellation, unsigned int real_sectors, unsigned int imag_sectors, +gr_make_constellation_rect (std::vector<gr_complex> constellation, std::vector<unsigned int> pre_diff_code, + unsigned int real_sectors, unsigned int imag_sectors, float width_real_sectors, float width_imag_sectors); class gr_constellation_rect : public gr_constellation_sector { public: - gr_constellation_rect (std::vector<gr_complex> constellation, unsigned int real_sectors, unsigned int imag_sectors, - float width_real_sectors, float width_imag_sectors); + gr_constellation_rect (std::vector<gr_complex> constellation, std::vector<unsigned int> pre_diff_code, + unsigned int real_sectors, unsigned int imag_sectors, + float width_real_sectors, float width_imag_sectors); protected: @@ -157,8 +166,9 @@ class gr_constellation_rect : public gr_constellation_sector float d_width_imag_sectors; friend gr_constellation_rect_sptr - gr_make_constellation_rect (std::vector<gr_complex> constellation, unsigned int real_sectors, unsigned int imag_sectors, - float width_real_sectors, float width_imag_sectors); + gr_make_constellation_rect (std::vector<gr_complex> constellation, std::vector<unsigned int> pre_diff_code, + unsigned int real_sectors, unsigned int imag_sectors, + float width_real_sectors, float width_imag_sectors); }; @@ -177,13 +187,15 @@ typedef boost::shared_ptr<gr_constellation_psk> gr_constellation_psk_sptr; // public constructor gr_constellation_psk_sptr -gr_make_constellation_psk (std::vector<gr_complex> constellation, unsigned int n_sectors); +gr_make_constellation_psk (std::vector<gr_complex> constellation, std::vector<unsigned int> pre_diff_code, + unsigned int n_sectors); class gr_constellation_psk : public gr_constellation_sector { public: - gr_constellation_psk (std::vector<gr_complex> constellation, unsigned int n_sectors); + gr_constellation_psk (std::vector<gr_complex> constellation, std::vector<unsigned int> pre_diff_code, + unsigned int n_sectors); protected: @@ -194,7 +206,8 @@ class gr_constellation_psk : public gr_constellation_sector private: friend gr_constellation_psk_sptr - gr_make_constellation_psk (std::vector<gr_complex> constellation, unsigned int n_sectors); + gr_make_constellation_psk (std::vector<gr_complex> constellation, std::vector<unsigned int> pre_diff_code, + unsigned int n_sectors); }; |