scanpitab.c
来自「speech signal process tools」· C语言 代码 · 共 71 行
C
71 行
/* This material contains proprietary software of Entropic Processing, Inc. Any reproduction, distribution, or publication without the the prior written permission of Entropic Processing, Inc. is strictly prohibited. Any public distribution of copies of this work authorized in writing by Entropic Processing, Inc. must bear the notice Copyright 1986, Entropic Proccessing, Inc (C) 1985, Entropic Processing, Inc. */#ifdef SCCSstatic char *sccsid = "@(#)scanpitab.c 1.2 4/28/86";#endif /* This routine scans the coherence function and selects the best possible pitch value from it. */#define uuvv 4#define uvvv 5#define vvv 7 scan_pit_tab (pit_tab, kount, alfmse, ikdst)int pit_tab[], kount;float alfmse[], ikdst[];{ int i, j, pitch1, pitch2, n, prev_n; float min_alfmse, t1, weight[160]; extern int ptrack_state; for (i = 0; i < kount; i++) { pitch1 = pit_tab[i]; weight[i] = 1.0; prev_n = 1; for (j = i + 1; j < kount; j++) { pitch2 = pit_tab[j]; n = pitch2 * 1.0 / pitch1 + 0.5; if (n != prev_n && n * (pitch1 - 4) < pitch2 && pitch2 < n * (pitch1 + 4)) { weight[i] *= 0.8; prev_n = n; } } }/* weighting based on pulse energies */ if (ptrack_state == vvv || ptrack_state == uvvv || ptrack_state == uuvv) for (i = 0; i < kount; i++) { pitch1 = pit_tab[i]; if (ikdst[pitch1] > 1.0) weight[i] *= ikdst[pitch1]; } pitch1 = pit_tab[0]; min_alfmse = alfmse[pitch1] * weight[0]; for (i = 1; i < kount; i++) { pitch2 = pit_tab[i]; t1 = alfmse[pitch2] * weight[i]; if (t1 < min_alfmse) { pitch1 = pitch2; min_alfmse = t1; } } return (pitch1);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?