mirror of https://github.com/drowe67/LPCNet.git
Merge branch 'dr-vec-compare' of github.com:drowe67/LPCNet into dr-vec-compare
commit
64c066c409
|
@ -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")
|
COMMAND sh -c "cd ${CMAKE_CURRENT_SOURCE_DIR}/unittest; SYNTH_mag=1 ./test_core_nn.sh")
|
||||||
add_test(NAME nnet2f32
|
add_test(NAME nnet2f32
|
||||||
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}; ./src/nnet2f32 t.f32")
|
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")
|
||||||
|
|
|
@ -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
|
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
|
# Reading Further
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,9 @@ target_link_libraries(quant2c m)
|
||||||
add_executable(diff32 diff32.c)
|
add_executable(diff32 diff32.c)
|
||||||
target_link_libraries(diff32 m)
|
target_link_libraries(diff32 m)
|
||||||
|
|
||||||
|
add_executable(ramp ramp.c)
|
||||||
|
target_link_libraries(ramp m)
|
||||||
|
|
||||||
add_executable(quant_enc quant_enc.c)
|
add_executable(quant_enc quant_enc.c)
|
||||||
target_link_libraries(quant_enc lpcnetfreedv m codec2)
|
target_link_libraries(quant_enc lpcnetfreedv m codec2)
|
||||||
|
|
||||||
|
|
|
@ -424,9 +424,6 @@ int main(int argc, char *argv[]) {
|
||||||
for(i=0; i<NB_BANDS; i++) features_out[i] = tmp[i];
|
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++) {
|
for(i=0; i<NB_FEATURES; i++) {
|
||||||
if (isnan(features_out[i])) {
|
if (isnan(features_out[i])) {
|
||||||
fprintf(stderr, "f: %d i: %d\n", f, i);
|
fprintf(stderr, "f: %d i: %d\n", f, i);
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
|
@ -74,7 +74,7 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
if ((argc - dx) < 2) {
|
if ((argc - dx) < 2) {
|
||||||
helpmsg:
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue