⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 specdist.c

📁 语音CELP压缩解压源代码(C语音)
💻 C
字号:
/**************************************************************************** ROUTINE*               specdist** FUNCTION**               Computes spectral distorion caused by quantization of*		line spectral frequencies.** SYNOPSIS**		subroutine specdist(unqfreq, newfreq, dm, sumdm, iframedm)**   formal**                       data    I/O*       name            type    type    function*       -------------------------------------------------------------------*	unqfreq		float	i	unquantized line spectral frequencies*	newfreq		float	i	quantized line spectral frequencies*	dm		float	o	distortion array (subframe)*	sumdm		float	o	distortion array (current sum)*	iframedm	int	o	number of subframes**   external*                       data    I/O*       name            type    type    function*       -------------------------------------------------------------------*       no		int     i****************************************************************************** DESCRIPTION**	Calculate distortions/distances (log spectral error, etc.).*	See the first reference below for a complete description.  A*	"reference" system is compared against a "test" system.  Because*	of the nonsymetric nature of the Itakura-Saito measure which some*	of these distortion measures are based, poorer measures will be*	obtained if the "reference" and "test" systems are reversed.*	Because of gain uncertainties, a few measures are reported.*	(Peter Kroon generally uses the measure DM(4).)****************************************************************************** CALLED BY**	celp** CALLS**	dist   lsptopc   pctorc   rctoac****************************************************************************** REFERENCES**	"Distance Measures for Speech Processing", A.h. Gray and J.D. Markel,*	IEEE Trans. on ASSP, Vol. ASSP-24, no. 5, Oct. 1976**	"Quantization and Bit Allocation in Speech Processing",*	A.h. Gray and J.D. Markel,IEEE Trans. on ASSP, Vol. ASSP-24*	no. 6, Dec. 1976**	"A Note on Quantization and Bit Allocation in Speech Processing",*	A.h. Gray and J.D. Markel,IEEE Trans. on ASSP, Vol. ASSP-25*	no. 3, June 1977***************************************************************************/#include "ccsub.h"extern int no;specdist(unqfreq, newfreq, dm, sumdm, iframedm)float unqfreq[], newfreq[], dm[], sumdm[];int *iframedm;{  float unqpc[MAXNO + 1], newpc[MAXNO + 1], unqac[MAXNO + 1];  float newac[MAXNO + 1], unqrc[MAXNO], newrc[MAXNO];  /* Convert LSP's to autocorrelation coefficients for input to "dist" 	 */  lsptopc(unqfreq, unqpc);  lsptopc(newfreq, newpc);  pctorc(unqpc, unqrc, no);  pctorc(newpc, newrc, no);  rctoac(unqrc, unqac, no);  rctoac(newrc, newac, no);  /* find distances between the ac sequences 				 */  dist(no, 4 * no, unqac, newac, dm, sumdm, iframedm);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -