From 2c56edf2da832be44706139b9f6ac3d84ad0ef96 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 4 Oct 2019 10:59:32 +0930 Subject: [PATCH 1/2] minor changes while tracking down distortion in 190924a --- src/quant_feat.c | 5 +---- src/test_lpcnet.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/quant_feat.c b/src/quant_feat.c index cc2883c..2c74e41 100644 --- a/src/quant_feat.c +++ b/src/quant_feat.c @@ -422,10 +422,7 @@ int main(int argc, char *argv[]) { float tmp[NB_BANDS]; dct(tmp, features_out); for(i=0; i \n"); + fprintf(stderr, "usage: test_lpcnet [--mag] [--logstates statesfile] [--nnet lpcnet_xxx.f32] \n"); return 0; } From 82ef38437016d7e46bd76c710c278963f0acd10d Mon Sep 17 00:00:00 2001 From: David Date: Fri, 4 Oct 2019 14:39:23 +0930 Subject: [PATCH 2/2] ramp generator to test decimation/interpolation in quant_feat - no problems found --- CMakeLists.txt | 2 ++ README.md | 8 ++++++++ src/CMakeLists.txt | 3 +++ src/ramp.c | 26 ++++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 src/ramp.c diff --git a/CMakeLists.txt b/CMakeLists.txt index f31b1c3..6005378 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,3 +127,5 @@ add_test(NAME core_synthesis_mag COMMAND sh -c "cd ${CMAKE_CURRENT_SOURCE_DIR}/unittest; SYNTH_mag=1 ./test_core_nn.sh") add_test(NAME nnet2f32 COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}; ./src/nnet2f32 t.f32") +add_test(NAME SIMD_functions + COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}; ./src/test_vec") diff --git a/README.md b/README.md index 5bbe838..4d8ce54 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,14 @@ LPCNet at 1733 bits/s using direct-split quantiser: ``` sox ../../wav/wia.wav -t raw -r 16000 - | ./lpcnet_enc -s | ./lpcnet_dec -s | aplay -f S16_LE -r 16000 ``` +# CTests + +``` +$ cd ~/LPCNet/build_linux +$ ctest +``` + +Note, due to precision/library issues several tests (1-3) will only pass on certain machines such as Ubuntu 16 and 18, Ubuntu 17 is known to fail. # Reading Further diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cae16b5..e39b2de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -77,6 +77,9 @@ target_link_libraries(quant2c m) add_executable(diff32 diff32.c) target_link_libraries(diff32 m) +add_executable(ramp ramp.c) +target_link_libraries(ramp m) + add_executable(quant_enc quant_enc.c) target_link_libraries(quant_enc lpcnetfreedv m codec2) diff --git a/src/ramp.c b/src/ramp.c new file mode 100644 index 0000000..da6f0b7 --- /dev/null +++ b/src/ramp.c @@ -0,0 +1,26 @@ +/* generates a linear ramp to test quant_feat decimation/interpolation */ + +#include +#include +#include +#include +#include + +#define NB_FEATURES 55 +#define FRAMES 18 + +int main(void) { + FILE *fout = fopen("ramp.f32", "wb"); assert(fout != NULL); + float features[NB_FEATURES]; + int i,j; + + for(i=0; i