diff --git a/src/visualise/__init__.py b/src/visualise/__init__.py index c58ab85..75d4447 100644 --- a/src/visualise/__init__.py +++ b/src/visualise/__init__.py @@ -45,7 +45,27 @@ def get_data(sock: Subscriber): subscriber_settings[sock] = (subcarrier, rx, tx) -def add_data(new_data: npt.NDArray[np.complex128]): +def add_data( + raw_data: npt.NDArray[np.complex128], new_data: npt.NDArray[np.complex128] +): + # magn = np.abs(raw_data) + # phase = np.angle(raw_data) + + # new_mag = np.abs(new_data) + # new_phase = np.angle(new_data) + + # fig, axs = plt.subplots(2, 2) + # axs[0, 0].plot(magn[:, 0, 0], c="b") + # axs[0, 0].plot(magn[:, 1, 0], c="orange") + # axs[1, 0].plot(new_mag[:, 0, 0], c="b") + # axs[1, 0].plot(new_mag[:, 1, 0], c="orange") + # axs[0, 1].plot(phase[:, 0, 0], c="b") + # axs[0, 1].plot(phase[:, 1, 0], c="orange") + # axs[1, 1].plot(new_phase[:, 0, 0], c="b") + # axs[1, 1].plot(new_phase[:, 1, 0], c="orange") + # fig.savefig("/tmp/plot.png") + # plt.close(fig) + global data if data.size == 0: data = np.expand_dims(new_data, axis=0) diff --git a/src/visualise/static/plot.js b/src/visualise/static/plot.js index a481928..63fb583 100644 --- a/src/visualise/static/plot.js +++ b/src/visualise/static/plot.js @@ -32,7 +32,7 @@ socket.addEventListener("message", function (msg) { y: [[msg.data]], }, [0], - 100, + 300, ); });