Meritve na terenu

This commit is contained in:
2026-01-25 11:57:17 +01:00
parent 97728bd829
commit b01565628e
4 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -12,7 +12,7 @@ FFT_SIZE = 1024
BIN_COUNT = FFT_SIZE // 2 # 512 Bins
DISPLAY_BINS = 100 # Only display first 100 bins
SWEEP_SIZE = 2
BYTES_PER_FRAME = BIN_COUNT * 4 + SWEEP_SIZE
BYTES_PER_FRAME = BIN_COUNT * 4
WATERFALL_HISTORY = 100 # Number of frames to display in waterfall
try:
@@ -50,15 +50,15 @@ def update(frame):
raw_data = ser.read(BYTES_PER_FRAME)
try:
fm_sweep = struct.unpack(f'H', raw_data[:2])
fm_sweep = [2]
x_dist = np.linspace(0, 1024*3e8/100e6/fm_sweep[0], BIN_COUNT)
x_dist = np.linspace(0, 1024*3e8/100e6/2, BIN_COUNT)
x_dist_display = x_dist[:DISPLAY_BINS] # Only first 100 bins
ax1.set_title(f'FFT prikaz radarskega signala FM={fm_sweep[0]}')
ax1.set_title(f'FFT prikaz radarskega signala FM={2}')
bar_plot.set_xdata(x_dist_display)
ax1.set_xlim(x_dist_display[2], x_dist_display[-1]) # Skip DC
fft_data = struct.unpack(f'{BIN_COUNT}f', raw_data[2:])
fft_data = struct.unpack(f'{BIN_COUNT}f', raw_data[:])
fft_data_display = fft_data[:DISPLAY_BINS] # Only use first 100 bins
# Update FFT plot