From 05f9d181e1ea86cd4bd875e4e6aaaea76b840f90 Mon Sep 17 00:00:00 2001 From: rakadu1 Date: Tue, 5 May 2026 14:16:17 +0530 Subject: [PATCH] feat(radar): recalibrate visualization engine for high-fidelity diagnostics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restores sharp target peaks and improves signal clarity in Shenron radar outputs by optimizing windowing functions and disabling smoothing-heavy interpolation. - radar_processor.py: Switched windowing from Hann to Blackman-Harris for range and velocity processing to achieve deeper sidelobe rejection (-92 dB) and suppress horizontal artifacts. - test_shenron.py: Replaced 'bicubic' interpolation with 'nearest' for Range-Doppler (RD) and CFAR maps to restore diagnostic clarity and prevent target blurring. - config.yaml: Removed hardcoded RD plot limits (xRange/yRange) to ensure the renderer utilizes the true physical axis (e.g., ±26.8 m/s) derived from hardware specs. - Added technical comments explaining the trade-off between main-lobe width and dynamic range in the new DSP windowing. --- scripts/ISOLATE/sim_radar_utils/config.yaml | 5 +++-- scripts/ISOLATE/sim_radar_utils/radar_processor.py | 7 +++++-- scripts/test_shenron.py | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/ISOLATE/sim_radar_utils/config.yaml b/scripts/ISOLATE/sim_radar_utils/config.yaml index d5bf4d4..da90ecc 100644 --- a/scripts/ISOLATE/sim_radar_utils/config.yaml +++ b/scripts/ISOLATE/sim_radar_utils/config.yaml @@ -69,8 +69,9 @@ Visualize: xUnit: "m" yLabel: "Velocity" yUnit: "m/s" - xRange: [-8, 8] # Doppler Velocity limits [m/s] - yRange: [0, 120] # Range limits [m] + # xRange and yRange deliberately NOT set here — the renderer uses the true + # physical Doppler axis (±26.8 m/s for AWRL1432) computed from chirp_rep. + # DO NOT add xRange overrides without resetting the axis in test_shenron.py. winSize: [500, 400] pos: [600, 50] radarPCD: diff --git a/scripts/ISOLATE/sim_radar_utils/radar_processor.py b/scripts/ISOLATE/sim_radar_utils/radar_processor.py index 258c516..02e3991 100644 --- a/scripts/ISOLATE/sim_radar_utils/radar_processor.py +++ b/scripts/ISOLATE/sim_radar_utils/radar_processor.py @@ -22,10 +22,13 @@ cfarCfg = config['CFAR'] class RadarProcessor: def __init__(self): # radar data will be shaped as (# of chirp, # of sample, # of antenna) - self.rangeWin = np.tile(signal.windows.hann(radarCfg['N']), (radarCfg['Np'], radarCfg['NrChn'], 1)) + # Blackman-Harris window: Deepest sidelobe rejection (-92 dB). + # Used to suppress the horizontal "astigmatism" sidelobe lines at the + # cost of a broader main-lobe (slightly less range resolution). + self.rangeWin = np.tile(signal.windows.blackmanharris(radarCfg['N']), (radarCfg['Np'], radarCfg['NrChn'], 1)) self.rangeWin = np.transpose(self.rangeWin, (2, 0, 1)) - self.velWin = np.tile(signal.windows.hann(radarCfg['Np']), (radarCfg['N'], radarCfg['NrChn'], 1)) + self.velWin = np.tile(signal.windows.blackmanharris(radarCfg['Np']), (radarCfg['N'], radarCfg['NrChn'], 1)) self.velWin = np.transpose(self.velWin, (0, 2, 1)) rangeRes = fftCfg['c0'] / (2*(radarCfg['fStop'] - radarCfg['fStrt'])) diff --git a/scripts/test_shenron.py b/scripts/test_shenron.py index 8b282a7..18a9120 100644 --- a/scripts/test_shenron.py +++ b/scripts/test_shenron.py @@ -307,8 +307,8 @@ def run_testbench(iter_name): display_limit_cfg = 120.0 render_engines[r_type] = { - 'rd': FastHeatmapEngine(extent=[-max_vel_cfg, max_vel_cfg, 0, max_r_cfg], cmap='viridis', title=f'{r_type.upper()} Range-Doppler', xlabel='Doppler Velocity [m/s]', ylabel='Range [m]', ylim=[0, 120], interpolation='bicubic'), - 'cfar': FastHeatmapEngine(extent=[-max_vel_cfg, max_vel_cfg, 0, max_r_cfg], cmap='plasma', title=f'{r_type.upper()} CFAR Noise Threshold', xlabel='Doppler Velocity [m/s]', ylabel='Range [m]', ylim=[0, 120], interpolation='bicubic'), + 'rd': FastHeatmapEngine(extent=[-max_vel_cfg, max_vel_cfg, 0, max_r_cfg], cmap='viridis', title=f'{r_type.upper()} Range-Doppler', xlabel='Doppler Velocity [m/s]', ylabel='Range [m]', ylim=[0, 120], interpolation='nearest'), + 'cfar': FastHeatmapEngine(extent=[-max_vel_cfg, max_vel_cfg, 0, max_r_cfg], cmap='plasma', title=f'{r_type.upper()} CFAR Noise Threshold', xlabel='Doppler Velocity [m/s]', ylabel='Range [m]', ylim=[0, 120], interpolation='nearest'), 'ra_static': FastHeatmapEngine(extent=[-display_limit_cfg, display_limit_cfg, 0, display_limit_cfg], cmap='jet', vmin=-5, vmax=55, title=f'{r_type.upper()} Range-Azimuth (Absolute)', xlabel='Lateral distance [m]', ylabel='Longitudinal distance [m]', aspect='equal'), 'ra_dyn': FastHeatmapEngine(extent=[-display_limit_cfg, display_limit_cfg, 0, display_limit_cfg], cmap='jet', title=f'{r_type.upper()} Range-Azimuth (Dynamic)', xlabel='Lateral distance [m]', ylabel='Longitudinal distance [m]', aspect='equal') }