aboutsummaryrefslogtreecommitdiffstats
path: root/src/tcp_sync.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/tcp_sync.py')
-rw-r--r--src/tcp_sync.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tcp_sync.py b/src/tcp_sync.py
index 6a2e619..4a5a5b8 100644
--- a/src/tcp_sync.py
+++ b/src/tcp_sync.py
@@ -5,6 +5,7 @@ import Queue
import time
import socket
import struct
+import numpy as np
class _TcpSyncClient(threading.Thread):
"""Thead for message polling"""
@@ -54,7 +55,7 @@ class _TcpSyncClient(threading.Thread):
if (len(s)) == self.packet_size:
break
if (len(s)) > self.packet_size:
- print("received wrong size of length " + str(len(s)))
+ print("received wrong size of length " + str(len(s)) + " instead of " + str(self.packet_size))
time.sleep(0.01)
return -1
@@ -96,6 +97,16 @@ class UhdSyncMsg(object):
out.append(self.tcpa.queue.get())
return out
+ def get_msgs_fft(self, num):
+ """
+ get received messages as string of integer
+ apply fftshift to message
+ """
+ out = []
+ while len(out) < num:
+ out.append(self.tcpa.queue.get())
+ return [np.fft.fftshift(np.array(o)) for o in out]
+
def get_res(self):
"""get received messages as string of integer"""
out = []