From 3a40e33704c643005bea23c55aba5168ddb15fbc Mon Sep 17 00:00:00 2001 From: David Date: Sun, 12 Apr 2020 06:54:05 +0930 Subject: [PATCH] 200412a with pitch embedding - better than without pitch embedding --- src/700c_train.sh | 6 +++--- src/lpcnet.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/700c_train.sh b/src/700c_train.sh index a861185..46d111b 100755 --- a/src/700c_train.sh +++ b/src/700c_train.sh @@ -24,14 +24,14 @@ train=${datestamp}_train synth_10ms() { test=$3 c2sim ~/Downloads/${test}.sw --rateKWov ${test}.f32 ${1} - test_lpcnet --mag 2 --frame_size 80 --pre 0 --no_pitch_embedding ${test}.f32 ${datestamp}_${test}_${2}.sw + test_lpcnet --mag 2 --frame_size 80 --pre 0 ${test}.f32 ${datestamp}_${test}_${2}.sw } # synth_40ms "filename" synth_40ms() { # no prediction, Codec 2 700C at 40ms frame rate (700 bits/s) from c2dec c2enc 700C ~/Downloads/${1}.sw - --eq --var | c2dec 700C - /dev/null --mlfeat ${1}_dec4.f32 - test_lpcnet --mag 2 --frame_size 80 --pre 0 --no_pitch_embedding ${1}_dec4.f32 ${datestamp}_${1}_40.sw + test_lpcnet --mag 2 --frame_size 80 --pre 0 ${1}_dec4.f32 ${datestamp}_${1}_40.sw } # experient "c2sim arg for experiment" "experiment label" @@ -43,7 +43,7 @@ experiment() { c2sim ${train}.sw --ten_ms_centre ${train}_10ms.sw --rateKWov ${train}.f32 ${1} sw2packedulaw --frame_size 80 ${train}_10ms.sw ${train}.f32 ${train}_10ms.pulaw - train_lpcnet.py ${train}.f32 ${train}_10ms.pulaw ${datestamp}_${2} --epochs ${epochs} --frame_size 80 --no_pitch_embedding + train_lpcnet.py ${train}.f32 ${train}_10ms.pulaw ${datestamp}_${2} --epochs ${epochs} --frame_size 80 dump_lpcnet.py ${datestamp}_${2}_${epochs}.h5 cp nnet_data.c src make test_lpcnet diff --git a/src/lpcnet.c b/src/lpcnet.c index a407ede..adf7627 100644 --- a/src/lpcnet.c +++ b/src/lpcnet.c @@ -162,8 +162,8 @@ void lpcnet_synthesize(LPCNetState *lpcnet, short *output, float *features, int /* FIXME: Do proper rounding once the Python code rounds properly. */ if (lpcnet->pitch_embedding) { - fprintf(stderr, "embedding\n"); pitch = (int)floor(.1 + 50*features[36]+100); + //fprintf(stderr, "pitch: %d\n", pitch); assert(pitch >=0); assert(pitch <= 255); /* latest networks (using the codec 2 pitch estimator) are trained with pitch estimates between 40 and 255, but due to the pitch