Skip to content

Commit

Permalink
Use codec2 ch tool to generate noise.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiw committed Dec 9, 2024
1 parent 708edbb commit fb10065
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ DefineAudioTest(1600)
add_test(NAME rade_reporting_clean COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test/test_rade_reporting.sh)
set_tests_properties(rade_reporting_clean PROPERTIES PASS_REGULAR_EXPRESSION "Adding callsign ZZ0ZZZ @ SNR")

add_test(NAME rade_reporting_awgn COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test/test_rade_reporting.sh noise)
add_test(NAME rade_reporting_awgn COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test/test_rade_reporting.sh ${CODEC2_BUILD_DIR})
set_tests_properties(rade_reporting_awgn PROPERTIES PASS_REGULAR_EXPRESSION "Adding callsign ZZ0ZZZ @ SNR")

endif(UNITTEST)
2 changes: 2 additions & 0 deletions cmake/BuildCodec2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ set_target_properties(codec2 PROPERTIES
IMPORTED_IMPLIB "${BINARY_DIR}/src/libcodec2${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)

set(CODEC2_BUILD_DIR ${BINARY_DIR})

if(BOOTSTRAP_LPCNET)
add_dependencies(build_codec2 build_lpcnetfreedv)
endif(BOOTSTRAP_LPCNET)
Expand Down
4 changes: 2 additions & 2 deletions test/test_rade_reporting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ FDV_PID=$!
# Stop recording, play back in RX mode
kill $RECORD_PID

if [ "$1" == "noise" ]; then
if [ "$1" != "" ]; then
# Add noise to recording to test performance
sox $(pwd)/test.wav -p synth whitenoise vol 0.395 | sox -m $(pwd)/test.wav - $(pwd)/testwithnoise.wav
sox $(pwd)/test.wav -t raw -r 8000 -c 1 -e signed-integer -b 16 - | $1/src/ch - - --No -18 | sox -t raw -r 8000 -c 1 -e signed-integer -b 16 - -t wav $(pwd)/testwithnoise.wav
mv $(pwd)/testwithnoise.wav $(pwd)/test.wav
fi

Expand Down

0 comments on commit fb10065

Please sign in to comment.