Merge branch 'dr-vec-compare' of github.com:drowe67/LPCNet into dr-vec-compare

pull/10/head
David 2019-10-06 07:04:53 +10:30
commit 64c066c409
6 changed files with 41 additions and 5 deletions

View File

@ -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")

View File

@ -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

View File

@ -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)

View File

@ -422,10 +422,7 @@ int main(int argc, char *argv[]) {
float tmp[NB_BANDS];
dct(tmp, features_out);
for(i=0; i<NB_BANDS; i++) features_out[i] = tmp[i];
}
/* need to recompute LPCs after every frame, as we have quantised, or interpolated */
lpc_from_cepstrum(&features_out[2*NB_BANDS+3], features_out);
}
for(i=0; i<NB_FEATURES; i++) {
if (isnan(features_out[i])) {

26
src/ramp.c 100644
View File

@ -0,0 +1,26 @@
/* generates a linear ramp to test quant_feat decimation/interpolation */
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#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<FRAMES; i++) {
for(j=0; j<NB_FEATURES; j++)
features[j] = i+j;
fwrite(features, sizeof(float), NB_FEATURES, fout);
}
fclose(fout);
return 0;
}

View File

@ -74,7 +74,7 @@ int main(int argc, char **argv) {
if ((argc - dx) < 2) {
helpmsg:
fprintf(stderr, "usage: test_lpcnet [--mag] [--logstates statesfile] <features.f32> <output.pcm>\n");
fprintf(stderr, "usage: test_lpcnet [--mag] [--logstates statesfile] [--nnet lpcnet_xxx.f32] <features.f32> <output.pcm>\n");
return 0;
}