con_stch.c

来自「手机加密通话软件」· C语言 代码 · 共 57 行

C
57
字号
/* Copyright 2001,2002,2003 NAH6
 * All Rights Reserved
 *
 * Parts Copyright DoD, Parts Copyright Starium
 *
 */

#include "main.h"
#include "con_stch.h"
#include <stdio.h>

extern float StochCB[1082];	/* This is defined in stoch.c */

/**************************************************************************
*                                                                         *
* ROUTINE
*		CalcStoch
*
* FUNCTION
*		Calculate Stochastic codebook contribution to synthesis
*		from code book index and gain
*
* SYNOPSIS
*		CalcStoch(s_index, s_gain, vector)
*
*   formal
*
*                       data    I/O
*       name            type    type    function
*       -------------------------------------------------------------------
*	s_index		int	 i	stochastic codebook index
*	s_gain		int	 i	stochastic codebook gain
*	vector		int	 o	vector from stochastic codebook
*
**************************************************************************/
void ConstructStochCW(
int	s_index,
float	s_gain,
float	vector[SF_LEN])
{

int	codeword;
int 	i;

/*  Copy selected vector to excitation array */
	codeword = 2 * (MAX_STOCH_CB_SIZE - s_index);
	if (codeword < 0)
	{
	  printf("ConstructStochCW: Error in codeword calculation\n");
	  codeword = 0;
	}
	for (i = 0; i < SF_LEN; i++)
	  vector[i] = StochCB[i + codeword] * s_gain;


}

⌨️ 快捷键说明

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