Fix quantization bug where pitch can get too low
Would cause unused pitch embedding vectors to be used
This commit is contained in:
parent
f0df3e82ec
commit
56d9f13efd
3 changed files with 4 additions and 2 deletions
|
@ -130,6 +130,7 @@ LPCNET_EXPORT void lpcnet_synthesize(LPCNetState *lpcnet, const float *features,
|
|||
float pitch_gain;
|
||||
/* Matches the Python code -- the 0.1 avoids rounding issues. */
|
||||
pitch = (int)floor(.1 + 50*features[36]+100);
|
||||
pitch = IMIN(255, IMAX(33, pitch));
|
||||
pitch_gain = lpcnet->old_gain[FEATURES_DELAY-1];
|
||||
memmove(&lpcnet->old_gain[1], &lpcnet->old_gain[0], (FEATURES_DELAY-1)*sizeof(lpcnet->old_gain[0]));
|
||||
lpcnet->old_gain[0] = features[PITCH_GAIN_FEATURE];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue