cpp data recorder

This commit is contained in:
2025-05-23 06:18:23 -05:00
parent fcb291590b
commit 7f2dd0103e
12 changed files with 788 additions and 203 deletions

View File

@@ -3,12 +3,8 @@ import os.path
import time
import numpy as np
from matplotlib import pyplot as plt
import socket
import data_structures
import radar_manager
from data_recorder import DataRecorder
def db20(x):
return 20*np.log10(np.abs(x))
@@ -48,7 +44,6 @@ def main():
header = data_structures.CpiHeader.from_buffer_copy(header)
fid.seek(-ctypes.sizeof(data_structures.CpiHeader), 1)
# CPI Parameters (timing values are in clk ticks)
num_pulses = header.num_pulses
num_samples = header.num_samples
@@ -93,18 +88,19 @@ def main():
plt.figure()
plt.plot(np.diff(cpi_times))
plt.ylim([0, .02])
plt.plot(np.diff(pps_frac))
# plt.ylim([0, .04])
plt.figure()
plt.plot(iq.T.real, '.-')
plt.plot(iq.T.imag, '--.')
plt.grid()
plt.figure()
plt.imshow(db20n(iq), aspect='auto', interpolation='nearest', vmin=vmin, vmax=vmax)
plt.ylabel('Pulse Count')
plt.xlabel('Sample Count')
plt.colorbar()
# plt.figure()
# plt.plot(iq.T.real, '.-')
# plt.plot(iq.T.imag, '--.')
# plt.grid()
#
# plt.figure()
# plt.imshow(db20n(iq), aspect='auto', interpolation='nearest', vmin=vmin, vmax=vmax)
# plt.ylabel('Pulse Count')
# plt.xlabel('Sample Count')
# plt.colorbar()
plt.show()