Skip to content

Commit

Permalink
Merge branch 'master' into PC_receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
rayandaod committed May 31, 2019
2 parents 5832a60 + ef3045d commit a838534
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/preambles.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ def generate_preamble_symbols(n_symbols_to_send):
else:
raise ValueError('This preamble type does not exist yet... Hehehe')

if params.MAPPING == "qam" and not params.NORMALIZE_MAPPING and params.PREAMBLE_TYPE == "barker":
# TODO: improve that
if params.M == 16:
read_write.write_preamble_symbols(preamble_symbols * 3)
elif params.M == 4:
read_write.write_preamble_symbols(preamble_symbols)
else:
raise ValueError('TODO: automate the scaling of the barker sequence')
if params.MAPPING == "qam" and not params.NORMALIZE_MAPPING:
number_of_points_on_side = np.sqrt(params.M)/2.0
test_value = np.log2(params.M)/2.0
if test_value != int(test_value):
raise ValueError('Not a valid Qam value')
read_write.write_preamble_symbols(preamble_symbols * (2.0*number_of_points_on_side - 1))

return None

Expand Down

0 comments on commit a838534

Please sign in to comment.