Abfrage des Radar-Mikrodoppler-ExtraktionsbereichsPython

Python-Programme
Anonymous
 Abfrage des Radar-Mikrodoppler-Extraktionsbereichs

Post by Anonymous »

Ich habe einen Code zum Extrahieren eines Radar-Mikrodoppler-Spektrogramms, aber selbst bei einer Entfernung von 1 m erhalte ich ein schwaches Spektrogramm zurück. Aus nächster Nähe bekomme ich ein ordentliches Spektrogramm. Das Radar, das ich verwende, ist bgt60TR13C. Ich bin gespannt, ob es sich hierbei um ein Hardware-/Algorithmus- oder Konfigurationsproblem handelt. Ich habe bereits viele verschiedene Konfigurationen ausprobiert. Ich füge den Code und das Spektrogramm der menschlichen Bewegung bei 1 m bei.

Code: Select all

import numpy as np
from scipy.signal import stft, medfilt2d
from scipy.signal.windows import hamming
import time
from ifxAvian.Avian import Device, DeviceConfig
import matplotlib.pyplot as plt

def microdoppler_processing(data_cube,
start_freq_Hz=58_000_000_000,
end_freq_Hz=62_080_000_000,
chirp_repetition_time_s=35e-5,
nperseg=64,
noverlap=32):

c = 3e8
frames, rx, chirps, samples = data_cube.shape

range_fft_mean = np.zeros((frames, chirps, samples), dtype=np.complex64)
for i in range(frames):
clutter_removed = data_cube[i] - np.mean(data_cube[i], axis=1, keepdims=True)
rfft = np.fft.fft(clutter_removed, axis=2)
range_fft_mean[i] = np.mean(rfft, axis=0)

power = np.abs(range_fft_mean)**2
mean_power_over_time = power.mean(axis=(0,1))
range_bin_idx = int(np.argmax(mean_power_over_time))
print(range_bin_idx)

slow_time_matrix = range_fft_mean[:, :, range_bin_idx]
slow_time = slow_time_matrix.reshape(-1)
slow_time = slow_time.astype(np.complex64)
slow_time = slow_time - np.mean(slow_time)

fs = 1.0 / chirp_repetition_time_s
f, t, Zxx = stft(slow_time, fs=fs, window='hann', nperseg=nperseg, noverlap=noverlap, return_onesided=False, boundary=None)

fc = 0.5 * (start_freq_Hz + end_freq_Hz)
velocities = f * c / (2.0 * fc)

spectrogram_db = 10.0 * np.log10(np.abs(Zxx)**2 + 1e-12)
noise_floor_db = np.median(spectrogram_db, axis=0, keepdims=True)
denoised = spectrogram_db - noise_floor_db
denoised[denoised < 0] = 0
filtered = medfilt2d(denoised, kernel_size=3)

y = np.fft.fftshift(velocities)
S = np.fft.fftshift(filtered, axes=0)
plt.pcolormesh(t, y, S, shading="auto")
plt.axis("off")
plt.savefig("test_dop.png", bbox_inches="tight", pad_inches=0)
plt.close()

def record(nframes, frate):
ndata = 1
print("recording")

t1 = time.time()
chirp_rep_time = 25e-5
freq1 = 58000000000
freq2 = 62080000000

for data in range(ndata):
with Device() as dev:
dev_conf = DeviceConfig(
sample_rate_Hz=1500000,
frame_repetition_time_s=1/frate,
start_frequency_Hz=freq1,
end_frequency_Hz=freq2,
num_samples_per_chirp=200,
num_chirps_per_frame=32,
chirp_repetition_time_s=chirp_rep_time,
rx_mask=7,
tx_mask=1,
tx_power_level=31,
if_gain_dB=60
)
dev.set_config(dev_conf)

frames = []

for frame_number in range(nframes):
rx_data = []
frame_contents = dev.get_next_frame()

rx_data.append(frame_contents[0])
rx_data.append(frame_contents[1])
rx_data.append(frame_contents[2])

frames.append(rx_data)

microdoppler_processing(np.array(frames, dtype=np.float32), start_freq_Hz=freq1, end_freq_Hz=freq2, chirp_repetition_time_s=chirp_rep_time)

t2 = time.time()
print("Time Taken : ", t2-t1)

record(nframes=100, frate=70)
Vielen Dank

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post