Skip to content

Commit b549586

Browse files
drowe67claude
andcommitted
rade_c_v1/v2_wav: replace SNR check with loss-based ctest
Uses rade_tx_wav/rade_rx_wav -f feature file output to measure loss end-to-end (no noise, nominal gain). Threshold set at 5% above software-only baseline (rade_c#989770e, AGC on, wav/all.wav): V2: 0.088 (baseline 0.084), V1: 0.119 (baseline 0.113). Tighter than the 10% integrator criterion -- no HW in the loop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 85179f9 commit b549586

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -939,16 +939,24 @@ add_test(NAME rade_c_v2_text
939939
COMMAND ${RADE_C_BUILD_DIR}/src/rade_v2_text_test)
940940
set_tests_properties(rade_c_v2_text PROPERTIES PASS_REGULAR_EXPRESSION "PASS")
941941

942-
# WAV pipeline sanity check: encode speech WAV → RADE WAV → decoded WAV, confirm sync+SNR
942+
# WAV pipeline loss test: speech WAV -> RADE WAV -> decoded WAV, measure loss (no noise, nominal gain).
943+
# Models the verification procedure for third-party integrators of the RADE library.
944+
# Threshold: 5% above software-only (rade_c#989770e) baseline (V2: 0.084, V1: 0.113, AGC on, wav/all.wav).
945+
# Tighter than the 10% integrator criterion -- these are reference tools with no HW in the loop.
946+
# Baseline is a moving target if the model is retrained -- update threshold and hash accordingly.
943947
add_test(NAME rade_c_v1_wav
944-
COMMAND sh -c "${RADE_C_BUILD_DIR}/src/rade_tx_wav ${CMAKE_SOURCE_DIR}/wav/brian_g8sez.wav /tmp/rade_nopy_v1_wav_tx.wav && \
945-
${RADE_C_BUILD_DIR}/src/rade_rx_wav /tmp/rade_nopy_v1_wav_tx.wav /tmp/rade_nopy_v1_wav_rx.wav")
946-
set_tests_properties(rade_c_v1_wav PROPERTIES PASS_REGULAR_EXPRESSION "SNR: [0-9]")
948+
COMMAND sh -c "cd ${CMAKE_SOURCE_DIR}; \
949+
${RADE_C_BUILD_DIR}/src/rade_tx_wav ${CMAKE_SOURCE_DIR}/wav/all.wav /tmp/rade_c_v1_wav_tx.wav -f /tmp/rade_c_v1_wav_features_tx.f32; \
950+
${RADE_C_BUILD_DIR}/src/rade_rx_wav /tmp/rade_c_v1_wav_tx.wav /tmp/rade_c_v1_wav_rx.wav -f /tmp/rade_c_v1_wav_features_rx.f32; \
951+
python3 loss.py /tmp/rade_c_v1_wav_features_tx.f32 /tmp/rade_c_v1_wav_features_rx.f32 --loss_test 0.119 --clip_start 100 --clip_end 300")
952+
set_tests_properties(rade_c_v1_wav PROPERTIES PASS_REGULAR_EXPRESSION "PASS")
947953

948954
add_test(NAME rade_c_v2_wav
949-
COMMAND sh -c "${RADE_C_BUILD_DIR}/src/rade_tx_wav --v2 ${CMAKE_SOURCE_DIR}/wav/brian_g8sez.wav /tmp/rade_nopy_v2_wav_tx.wav && \
950-
${RADE_C_BUILD_DIR}/src/rade_rx_wav --v2 /tmp/rade_nopy_v2_wav_tx.wav /tmp/rade_nopy_v2_wav_rx.wav")
951-
set_tests_properties(rade_c_v2_wav PROPERTIES PASS_REGULAR_EXPRESSION "SNR: [0-9]")
955+
COMMAND sh -c "cd ${CMAKE_SOURCE_DIR}; \
956+
${RADE_C_BUILD_DIR}/src/rade_tx_wav --v2 ${CMAKE_SOURCE_DIR}/wav/all.wav /tmp/rade_c_v2_wav_tx.wav -f /tmp/rade_c_v2_wav_features_tx.f32; \
957+
${RADE_C_BUILD_DIR}/src/rade_rx_wav --v2 /tmp/rade_c_v2_wav_tx.wav /tmp/rade_c_v2_wav_rx.wav -f /tmp/rade_c_v2_wav_features_rx.f32; \
958+
python3 loss.py /tmp/rade_c_v2_wav_features_tx.f32 /tmp/rade_c_v2_wav_features_rx.f32 --loss_test 0.088 --clip_start 100 --clip_end 300")
959+
set_tests_properties(rade_c_v2_wav PROPERTIES PASS_REGULAR_EXPRESSION "PASS")
952960

953961
endif() # RADE_C_BUILD_DIR
954962

0 commit comments

Comments
 (0)