veeresht / CommPy

Digital Communication with Python
http://veeresht.github.com/CommPy
BSD 3-Clause "New" or "Revised" License
538 stars 176 forks source link

Add Gray code to modems : close both veeresht/CommPy#100 and veeresht/CommPy#60. #102

Closed BastienTr closed 3 years ago

BastienTr commented 3 years ago

Implementation based on the code from @edsonportosilva in #100. I refactored the code and simplified it a bit.

The Gray code is the new default for both QAM and PSK modems. I have no time to add tests based on performances but modem.plot_constellation show a proper Gray code.

I'll merge this PR as soon as @veeresht, @kirlf and/or @edsonportosilva validate my code.

Close both veeresht/CommPy#100 and veeresht/CommPy#60.

edsonportosilva commented 3 years ago

@BastienTr, here is a notebook to run a quick BER vs EbN0 test to see if everything is ok with the Gray mapping, i.e. if the Monte Carlo simulation agrees with the theory curves.

CommpyTest_BERvsEbN0.zip

BastienTr commented 3 years ago

ToDo list for this PR

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-3.02%) to 79.777% when pulling c373d797adf282d0a561bbbadfd5f4eca56582a8 on BastienTr:master into 46512b9d7a48b366e5a0725699b8abdc0d061cde on veeresht:master.

BastienTr commented 3 years ago

I removed the test_wifi80211 file since the references values seems to come from previous CommPy test. I feel like it is too risky to check a code based on result of the same code and we have an example here. Can someone double check the PR so that I can merge it?