diff options
author | Ben Reynwar <ben@reynwar.net> | 2012-06-25 08:09:05 -0700 |
---|---|---|
committer | Ben Reynwar <ben@reynwar.net> | 2012-06-25 08:09:05 -0700 |
commit | 1f57cf3fee8ded4d58e77bef8ffd8d8ce4aca53c (patch) | |
tree | 795a34e4599a88a80040d27dcb2b342e4c705bea /gr-digital/python/qam.py | |
parent | fd3abfe06ef4f574122d2d2a08b716db8c2b776d (diff) | |
parent | 881010202a5054c430d8e5a6f72c206c1cc350ae (diff) |
Merge branch 'next' of http://gnuradio.org/git/gnuradio into next
Diffstat (limited to 'gr-digital/python/qam.py')
-rw-r--r-- | gr-digital/python/qam.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gr-digital/python/qam.py b/gr-digital/python/qam.py index 5b1f7683b8..0635fda75e 100644 --- a/gr-digital/python/qam.py +++ b/gr-digital/python/qam.py @@ -157,14 +157,20 @@ def qam_constellation(constellation_points=_def_constellation_points, else: raise ValueError("Mod code is not implemented for QAM") if differential: - points = make_differential_constellation(constellation_points, gray_coded) + points = make_differential_constellation(constellation_points, gray_coded=False) else: points = make_non_differential_constellation(constellation_points, gray_coded) side = int(sqrt(constellation_points)) width = 2.0/(side-1) - # No pre-diff code - # Should add one so that we can gray-code the quadrant bits too. - pre_diff_code = [] + # For differential and gray-coded then gray-code the first two + # bits with a pre_diff_code. + # FIXME: It would be good to have a test to make sure that gray-coded constellations + # are really gray-coded. Perhaps by checking on the correlation between bit-errors. + if differential and gray_coded: + m = constellation_points + pre_diff_code = range(0, m/2) + range(3*m/4, m) + range(m/2, 3*m/4) + else: + pre_diff_code = [] constellation = digital_swig.constellation_rect(points, pre_diff_code, 4, side, side, width, width) return constellation |