aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-12-15 00:50:49 -0500
committersotech117 <michael_foiani@brown.edu>2023-12-15 00:50:49 -0500
commitdb626076acc73fbcd499b3235bf4503c22b47e2b (patch)
treee9d3c4e8ff64b099ef619824d1c14b71da0d51f0
parent11167eff189b0d23d8f88ada09f975dc7f2d80fc (diff)
remove print statement
-rw-r--r--Recv.py7
-rw-r--r--Sender.py4
-rw-r--r--__pycache__/utils.cpython-38.pycbin2503 -> 2403 bytes
-rw-r--r--utils.py2
4 files changed, 7 insertions, 6 deletions
diff --git a/Recv.py b/Recv.py
index b5cfcfd..b1708a4 100644
--- a/Recv.py
+++ b/Recv.py
@@ -9,9 +9,9 @@ from utils import *
class Recv:
- def __init__(self, start_freq=18000):
+ def __init__(self, start_freq=19000):
self.start_freq = start_freq
- self.freq_range = 2000
+ self.freq_range = 500
self.sampling_rate = 44100
self.p = pyaudio.PyAudio()
self.bytes_per_transmit = 1
@@ -82,6 +82,7 @@ class Recv:
# just started receiving data
bytes_seen = []
recv_buffer = []
+ print("started receiving data!")
is_data_flag = bits[-1]
if prev_is_data_flag == '0' and is_data_flag == '0':
@@ -99,7 +100,7 @@ class Recv:
# FIXME: what to do with buffer?
# for now print buffer as string
buffer_as_string = ''.join([utils.receive_string(byte) for byte in recv_buffer])
- print("received data: ", buffer_as_string)
+ print("data received: ", buffer_as_string)
# clear data structure & buffer
continue
diff --git a/Sender.py b/Sender.py
index dcbbf56..d1463d7 100644
--- a/Sender.py
+++ b/Sender.py
@@ -131,9 +131,9 @@ def receive_string(data, start_freq=18000, freq_step=250):
class LinkLayer:
- def __init__(self, start_freq=18000):
+ def __init__(self, start_freq=19000):
self.start_freq = start_freq
- self.freq_range = 2000
+ self.freq_range = 500
self.sampling_rate = 44100
self.p = pyaudio.PyAudio()
self.isReceiving = False
diff --git a/__pycache__/utils.cpython-38.pyc b/__pycache__/utils.cpython-38.pyc
index 972bdec..690b063 100644
--- a/__pycache__/utils.cpython-38.pyc
+++ b/__pycache__/utils.cpython-38.pyc
Binary files differ
diff --git a/utils.py b/utils.py
index 9706e35..253bad6 100644
--- a/utils.py
+++ b/utils.py
@@ -63,7 +63,7 @@ def frequencies_to_bits(frequencies, expected_freqs):
def play_data(data, start_freq, freq_step, bytes_per_transmit, stream):
freq_list = calculate_send_frequencies(start_freq, freq_step, bytes_per_transmit)
- send_duration = 1.0
+ send_duration = .35
flip_flag = 0 # TODO: make this global between plays
for byte in data: