diff --git a/9_Firmware/9_2_FPGA/radar_receiver_final.v b/9_Firmware/9_2_FPGA/radar_receiver_final.v index fa6f8ad..5aaa71c 100644 --- a/9_Firmware/9_2_FPGA/radar_receiver_final.v +++ b/9_Firmware/9_2_FPGA/radar_receiver_final.v @@ -17,7 +17,12 @@ module radar_receiver_final ( output wire [31:0] doppler_output, output wire doppler_valid, output wire [4:0] doppler_bin, - output wire [5:0] range_bin + output wire [5:0] range_bin, + + // Matched filter range profile output (for USB) + output wire signed [15:0] range_profile_i_out, + output wire signed [15:0] range_profile_q_out, + output wire range_profile_valid_out ); // ========== INTERNAL SIGNALS ========== @@ -216,6 +221,11 @@ wire signed [15:0] range_profile_i; wire signed [15:0] range_profile_q; wire range_valid; +// Expose matched filter output to top level for USB range profile +assign range_profile_i_out = range_profile_i; +assign range_profile_q_out = range_profile_q; +assign range_profile_valid_out = range_valid; + matched_filter_multi_segment mf_dual ( .clk(clk), .reset_n(reset_n), diff --git a/9_Firmware/9_2_FPGA/radar_system_top.v b/9_Firmware/9_2_FPGA/radar_system_top.v index 6176b17..7a5c6d5 100644 --- a/9_Firmware/9_2_FPGA/radar_system_top.v +++ b/9_Firmware/9_2_FPGA/radar_system_top.v @@ -402,7 +402,12 @@ radar_receiver_final rx_inst ( .doppler_output(rx_doppler_output), .doppler_valid(rx_doppler_valid), .doppler_bin(rx_doppler_bin), - .range_bin(rx_range_bin) + .range_bin(rx_range_bin), + + // Matched filter range profile (for USB) + .range_profile_i_out(rx_range_profile[15:0]), + .range_profile_q_out(rx_range_profile[31:16]), + .range_profile_valid_out(rx_range_valid) ); // ============================================================================ @@ -448,10 +453,9 @@ end // DATA PACKING FOR USB // ============================================================================ -// For range profile, we'll use the doppler data as a placeholder -// In a real system, this would come from the matched filter output -assign usb_range_profile = rx_doppler_output; -assign usb_range_valid = rx_doppler_valid; +// Range profile from matched filter output (wired through radar_receiver_final) +assign usb_range_profile = rx_range_profile; +assign usb_range_valid = rx_range_valid; assign usb_doppler_real = rx_doppler_real; assign usb_doppler_imag = rx_doppler_imag;