diff --git a/CMakeLists.txt b/CMakeLists.txt index f31b1c3..4d583cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,7 +73,7 @@ endif() # grab latest NN model (or substitute your own) set(LPCNET_ROOT http://rowetel.com/downloads/deep/) -set(LPCNET_FILE lpcnet_190924a_v1.0.tgz) +set(LPCNET_FILE lpcnet_191005_v1.0.tgz) set(LPCNET_URL ${LPCNET_ROOT}${LPCNET_FILE}) # Work around not having the FetchContent module. diff --git a/src/codec2_pitch.c b/src/codec2_pitch.c index ef06909..a267785 100644 --- a/src/codec2_pitch.c +++ b/src/codec2_pitch.c @@ -102,12 +102,13 @@ int codec2_pitch_est(CODEC2_PITCH *pitch, float Sn[], float *f0, float *voicing) model.Wo = 2.0*M_PI/pitch_samples; dft_speech(&pitch->c2const, pitch->fft_fwd_cfg, Sw, Sn, pitch->w); two_stage_pitch_refinement(&pitch->c2const, &model, Sw); + pitch_samples = 2.0*M_PI/model.Wo; estimate_amplitudes(&model, Sw, pitch->W, 1); snr = est_voicing_mbe(&pitch->c2const, &model, Sw, pitch->W); *voicing = 1.0 - 2.0/pow(10.0, snr/10.0); if (*voicing < 0.0) *voicing = 0.0; - return (int)2*pitch_samples; + return round(2.0*pitch_samples); } void codec2_pitch_destroy(CODEC2_PITCH *pitch) diff --git a/src/full_train.sh b/src/full_train.sh index f38934c..7a18940 100755 --- a/src/full_train.sh +++ b/src/full_train.sh @@ -12,7 +12,7 @@ SRC2=vk5apr_recording_21_may.wav # 64s SRC3=all_speechcat.sw # 185 minutes, wide range of speakers SRC=train_src -DATE=190924a +DATE=191005 synth() { ./src/dump_data --test --c2pitch ~/Downloads/$1.sw $1.f32 diff --git a/unittest/birch_20h_states_targ.f32 b/unittest/birch_20h_states_targ.f32 index b8c981a..fccec93 100644 Binary files a/unittest/birch_20h_states_targ.f32 and b/unittest/birch_20h_states_targ.f32 differ diff --git a/unittest/birch_20h_targ.raw b/unittest/birch_20h_targ.raw index 4abdd81..5203e14 100644 Binary files a/unittest/birch_20h_targ.raw and b/unittest/birch_20h_targ.raw differ diff --git a/unittest/birch_out_targ.raw b/unittest/birch_out_targ.raw index f2021f2..8ea4bbd 100644 Binary files a/unittest/birch_out_targ.raw and b/unittest/birch_out_targ.raw differ diff --git a/unittest/birch_states_targ.f32 b/unittest/birch_states_targ.f32 index a7aa44d..41fefdb 100644 Binary files a/unittest/birch_states_targ.f32 and b/unittest/birch_states_targ.f32 differ diff --git a/unittest/birch_targ.f32 b/unittest/birch_targ.f32 index f464334..26f5b24 100644 Binary files a/unittest/birch_targ.f32 and b/unittest/birch_targ.f32 differ diff --git a/unittest/c01_01_190804a_targ.raw b/unittest/c01_01_190804a_targ.raw index 8bb9776..65a440e 100644 Binary files a/unittest/c01_01_190804a_targ.raw and b/unittest/c01_01_190804a_targ.raw differ diff --git a/unittest/c01_01_mag.f32 b/unittest/c01_01_mag.f32 index b7f1aab..466adfa 100644 Binary files a/unittest/c01_01_mag.f32 and b/unittest/c01_01_mag.f32 differ