Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commpy/tests/test_wifi80211.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_wifi80211_siso_channel():
seed(17121996)
wifi80211 = Wifi80211(1)
BERs = wifi80211.link_performance(SISOFlatChannel(fading_param=(1 + 0j, 0)), range(0, 9, 2), 10 ** 4, 600)[0]
desired = (0.489, 0.503, 0.446, 0.31, 0.015) # From previous tests
desired = (0.548, 0.508, 0.59, 0.81, 0.18) # From previous tests
# for i, val in enumerate(desired):
# print((BERs[i] - val) / val)
assert_allclose(BERs, desired, rtol=0.3,
Expand Down
13 changes: 7 additions & 6 deletions commpy/wifi80211.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_modem(self) -> mod.Modem:
"""
Gets the modem that is going to be used for this particular WiFi simulation according to the MCS
"""
qpsks = [
bits_per_symbol = [
2,
4,
4,
Expand All @@ -63,12 +63,13 @@ def get_modem(self) -> mod.Modem:
256,
256
]
if self.mcs == 0:
# BPSK
return mod.PSKModem(2)
if self.mcs <= 2:
# BPSK for mcs 0
# QPSK for mcs 1 a 2
return mod.PSKModem(bits_per_symbol[self.mcs])
else:
# Modem : QPSK
return mod.QAMModem(qpsks[self.mcs])
# Modem : QAMModem
return mod.QAMModem(bits_per_symbol[self.mcs])

@staticmethod
def _get_puncture_matrix(numerator: int, denominator: int) -> List:
Expand Down