亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fs_lib.c

?? MELPe 1200 bps, fixed point
?? C
字號:
/*

2.4 kbps MELP Proposed Federal Standard speech coder

Fixed-point C code, version 1.0

Copyright (c) 1998, Texas Instruments, Inc.

Texas Instruments has intellectual property rights on the MELP
algorithm.	The Texas Instruments contact for licensing issues for
commercial and non-government use is William Gordon, Director,
Government Contracts, Texas Instruments Incorporated, Semiconductor
Group (phone 972 480 7442).

The fixed-point version of the voice codec Mixed Excitation Linear
Prediction (MELP) is based on specifications on the C-language software
simulation contained in GSM 06.06 which is protected by copyright and
is the property of the European Telecommunications Standards Institute
(ETSI). This standard is available from the ETSI publication office
tel. +33 (0)4 92 94 42 58. ETSI has granted a license to United States
Department of Defense to use the C-language software simulation contained
in GSM 06.06 for the purposes of the development of a fixed-point
version of the voice codec Mixed Excitation Linear Prediction (MELP).
Requests for authorization to make other use of the GSM 06.06 or
otherwise distribute or modify them need to be addressed to the ETSI
Secretariat fax: +33 493 65 47 16.

*/

/* ==================================== */
/* fs_lib.c: Fourier series subroutines */
/* ==================================== */

/*	compiler include files	*/

#include <assert.h>

#include "sc1200.h"
#include "mathhalf.h"
#include "mat_lib.h"
#include "math_lib.h"
#include "fs_lib.h"
#include "constant.h"
#include "global.h"
#include "dsp_sub.h"
#include "macro.h"
#include "fft_lib.h"

#define FFTLENGTH		512
#define DFTMAX			160



/*      Subroutine FIND_HARM: find Fourier coefficients using   */
/*      FFT of input signal divided into pitch dependent bins.  */
/*                                                              */
/*  Q values:                                                   */
/*  input - Q0                                                  */
/*  fsmag - Q13                                                 */
/*  pitch - Q7                                                  */

void find_harm(Shortword input[], Shortword fsmag[], Shortword pitch,
			   Shortword num_harm, Shortword length)
{
	register Shortword	i, j, k;
	Shortword	find_hbuf[2*FFTLENGTH];
	Shortword	iwidth, i2;
	Shortword	fwidth, mult_fwidth, shift, max;
	Longword	*L_fsmag;
	Longword	L_temp, L_max;
	Word40		avg;
	Shortword	temp1, temp2;

	L_fsmag = L_v_get(num_harm);

	/* Find normalization factor of frame and scale input to maximum          */
	/* precision. */
	max = 0;
	for (i = 0; i < length; i++){
		temp1 = abs_s(input[i]);
		if (temp1 > max)
			max = temp1;
	}
	shift = norm_s(max);

	/* initialize fsmag */
	fill(fsmag, ONE_Q13, num_harm);

	/* Perform peak-picking on FFT of input signal */
	/* Calculate FFT of complex signal in scratch buffer */
	v_zap(find_hbuf, 2*FFTLENGTH);
	for (i = 0; i < length; i++){
		find_hbuf[i] = shl(input[i], shift);
	}
	rfft(find_hbuf, FFTLENGTH);

	/* Implement pitch dependent staircase function */
	/* Harmonic bin width fwidth = Q6 */

	fwidth = shr(divide_s(FFTLENGTH, pitch), 2);
	/* iwidth = (int) fwidth */
	iwidth = shr(fwidth, 6);

	/* Originally here we have a check for setting iwidth to be at least 2.   */
	/* This is not necessary because FFTLENGTH (== 512) divided by PITCHMAX   */
	/* (== 160) will be at least 3.                                           */

	i2 = shr(iwidth, 1);

	/* if (num_harm > 0.25*pitch) num_harm = 0.25*pitch */
	/* temp1 = 0.25*pitch in Q0 */

	temp1 = shr(pitch, 9);
	if (num_harm > temp1)
		num_harm = temp1;

	/* initialize avg to make sure that it is non-zero */
	mult_fwidth = fwidth;                               /* (k + 1)*fwidth, Q6 */
	for (k = 0; k < num_harm; k++){
		/*	i = ((k + 1) * fwidth) - i2 + 0.5 */          /* Start at peak-i2 */
		i = sub(shr(add(mult_fwidth, X05_Q6), 6), i2);

		/* Calculate magnitude squared of coefficients */
		L_max = 0;
		for (j = 0; j < iwidth; j++){
			/*	temp1 = find_hbuf[2*(j + i)]; */
			/*	temp2 = find_hbuf[2*(j + i) + 1]; */
			temp2 = add(i, j);
			temp1 = find_hbuf[2*temp2];
			temp2 = find_hbuf[2*temp2 + 1];
			L_temp = L_add(L_mult(temp1, temp1), L_mult(temp2, temp2));
			L_max = Max(L_max, L_temp);
		}

		L_fsmag[k] = L_max;
		mult_fwidth = add(mult_fwidth, fwidth);
	}

	/* Normalize Fourier series values to average magnitude */
	avg = 1;
	for(k = 0; k < num_harm; k++)
		avg = L40_add(avg, L_fsmag[k]);
	temp1 = norm32(avg);
	L_temp = (Longword) L40_shl(avg, temp1);	/* man. of avg */
	temp1 = sub(31, temp1);						/* exp. of avg */
	/* now compute num_harm/avg. avg = L_temp(Q31) x 2^temp1 */
	temp2 = shl(num_harm, 10);
	/* num_harm = temp2(Q15) x 2^5 */
	temp2 = divide_s(temp2, extract_h(L_temp));
	/* now think fs as Q15 x 2^31. The constant below should be 31 */
	/* but consider Q5 for num_harm and fsmag before sqrt Q11, and */
	/* add two guard bits  30 = 31 + 5 - 4 - 2                     */
	shift = sub(30, temp1);
	/* the sentence above is just for clarity. temp1 = sub(31, temp1) */
	/* and shift = sub(30, temp1) can be shift = sub(temp1, 1)        */

	for (i = 0; i < num_harm; i++){
		/*	temp1 = num_harm/(avg + 0.0001) */
		/*	fsmag[i] = sqrt(temp1*fsmag[i]) */
		temp1 = extract_h(L_shl(L_fsmag[i], shift));
		temp1 = extract_h(L_shl(L_mult(temp1, temp2),2));		/* Q11 */
 		fsmag[i] = sqrt_Q15(temp1);
	}

	v_free(L_fsmag);
}


/* Subroutine IDFT_REAL: take inverse discrete Fourier transform of real      */
/*                       input coefficients.  Assume real time signal, so     */
/*                       reduce computation using symmetry between lower and  */
/*                       upper DFT coefficients.                              */
/*                                                                            */
/* Q values:                                                                  */
/*      real - Q13, signal - Q15                                              */

void idft_real(Shortword real[], Shortword signal[], Shortword length)
{
	register Shortword	i, j, k;
	static Shortword	idftc[DFTMAX];
	Shortword	k_inc, length2;
	Shortword	w, w2;
	Shortword	temp;
	Longword	L_temp;


	assert(length <= DFTMAX);
	length2 = add(shr(length, 1), 1);
	/*	w = TWOPI / length; */
	w = divide_s(TWO_Q3, length);                      /* w = 2/length in Q18 */

	for (i = 0; i < length; i++ ){
		L_temp = L_mult(w, i);                               /* L_temp in Q19 */

		/* make sure argument for cos function is less than 1 */
		if (L_temp > (Longword) ONE_Q19){
			/*	cos(pi+x) = cos(pi-x) */
			L_temp = L_sub((Longword) TWO_Q19, L_temp);
		} else if (L_temp == (Longword) ONE_Q19)
			L_temp = L_sub(L_temp, 1);

		L_temp = L_shr(L_temp, 4);                           /* L_temp in Q15 */
		temp = extract_l(L_temp);
		idftc[i] = cos_fxp(temp);                             /* idftc in Q15 */
	}

	w = shr(w, 1);                                     /* w = 2/length in Q17 */
	w2 = shr(w, 1);                                   /* w2 = 1/length in Q17 */
	real[0] = mult(real[0], w2);                               /* real in Q15 */
	temp = sub(length2, 1);
	for (i = 1; i < temp; i++){
		/*	real[i] *= (2.0/length); */
		real[i] = mult(real[i], w);
	}
	temp = shl(i, 1);
	if (temp == length)                           /* real[i] *= (1.0/length); */
		real[i] = mult(real[i], w2);
	else                                           /* real[i] *= (2.0/length);*/
		real[i] = mult(real[i], w);

	for (i = 0; i < length; i++){
		L_temp = L_deposit_h(real[0]);                       /* L_temp in Q31 */
		k_inc = i;
		k = k_inc;
		for (j = 1; j < length2; j++){
			L_temp = L_mac(L_temp, real[j], idftc[k]);
			k = add(k, k_inc);
			if (k >= length)
				k = sub(k, length);
		}
		signal[i] = round(L_temp);
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲自拍偷拍网站| 精品无人码麻豆乱码1区2区| 欧美电影免费观看高清完整版| 国产99久久久久久免费看农村| 午夜精品久久久久久久久久久| 国产女人18水真多18精品一级做| 欧美日韩色一区| 色综合天天综合网国产成人综合天| 美女mm1313爽爽久久久蜜臀| 洋洋av久久久久久久一区| 国产欧美一区二区精品秋霞影院| 日韩欧美卡一卡二| 欧美午夜精品久久久久久超碰| 国产a区久久久| 黑人精品欧美一区二区蜜桃| 午夜精品123| 亚洲欧美日韩一区二区| 国产人久久人人人人爽| 欧美大度的电影原声| 精品1区2区3区| 91精品91久久久中77777| 国产成a人亚洲精品| 国产在线一区二区| 久久99精品国产麻豆婷婷| 日韩在线一二三区| 亚洲已满18点击进入久久| 亚洲免费观看高清| 自拍偷在线精品自拍偷无码专区 | 成人高清免费在线播放| 九一九一国产精品| 韩国av一区二区三区四区| 免费看日韩精品| 人禽交欧美网站| 蜜桃一区二区三区四区| 免费成人在线影院| 国产精品18久久久久久久久久久久| 日本成人在线不卡视频| 日韩国产一二三区| 日韩av电影天堂| 麻豆精品精品国产自在97香蕉| 蜜臀va亚洲va欧美va天堂 | 免费欧美日韩国产三级电影| 日韩在线卡一卡二| 美女mm1313爽爽久久久蜜臀| 韩国av一区二区三区| 国产综合色视频| 国产成人av影院| 不卡一区二区三区四区| 99视频国产精品| 在线精品视频免费播放| 欧美精品免费视频| 欧美大片在线观看一区二区| 国产视频一区在线播放| 国产精品久久一卡二卡| 一区二区三区在线观看动漫| 亚洲一区二区欧美| 麻豆免费精品视频| 国产精品1区二区.| 色婷婷一区二区| 欧美美女一区二区| 精品少妇一区二区三区日产乱码| 国产欧美日韩一区二区三区在线观看| 中文幕一区二区三区久久蜜桃| 中文字幕日韩一区| 亚洲国产精品一区二区久久恐怖片| 婷婷成人激情在线网| 韩国精品主播一区二区在线观看 | 午夜国产精品影院在线观看| 麻豆91精品视频| av综合在线播放| 欧美男生操女生| 久久婷婷国产综合精品青草| 综合久久一区二区三区| 日韩av在线免费观看不卡| 国产精品91xxx| 91精品91久久久中77777| 日韩精品影音先锋| 亚洲婷婷综合久久一本伊一区| 亚洲成av人片| 风间由美一区二区av101| 欧亚一区二区三区| 久久婷婷国产综合精品青草| 亚洲一区欧美一区| 国产一区不卡在线| 欧美三区免费完整视频在线观看| 久久精品欧美日韩精品| 亚洲v中文字幕| 成人综合婷婷国产精品久久蜜臀| 欧美视频一区二区三区在线观看 | 91精品在线观看入口| 国产精品婷婷午夜在线观看| 亚洲6080在线| 97se亚洲国产综合自在线| 日韩美一区二区三区| 亚洲激情在线播放| 国产精品一区二区在线播放| 欧美日韩国产高清一区| 亚洲欧洲日本在线| 国产美女一区二区三区| 欧美区在线观看| 亚洲精品免费视频| 欧美自拍偷拍一区| 欧美激情一二三区| 毛片av一区二区| 欧美猛男超大videosgay| 中文字幕av不卡| 国产一区二区视频在线| 5566中文字幕一区二区电影 | 国产剧情一区在线| 7777精品伊人久久久大香线蕉经典版下载 | 国产精品久久久一本精品| 看电影不卡的网站| 欧美精品日韩精品| 亚洲已满18点击进入久久| 99久久久久久| 欧美极品美女视频| 国产毛片精品视频| 精品入口麻豆88视频| 欧美a级一区二区| 欧美电影一区二区| 亚洲国产综合人成综合网站| 色哟哟欧美精品| 亚洲免费av高清| 9l国产精品久久久久麻豆| 国产色产综合产在线视频| 韩国av一区二区三区| 欧美xxxx老人做受| 精一区二区三区| 精品粉嫩超白一线天av| 久久国产乱子精品免费女| 欧美一区二区三区人| 日韩av不卡一区二区| 91精品国产免费| 日韩不卡一二三区| 日韩一区二区三区免费观看| 日韩福利电影在线观看| 777色狠狠一区二区三区| 青青草国产精品97视觉盛宴| 日韩一二在线观看| 免费在线一区观看| 精品免费视频.| 国产成人免费视频一区| 国产日韩欧美亚洲| 波多野结衣视频一区| 成人欧美一区二区三区1314| 色综合久久中文综合久久97| 亚洲一区二区视频在线观看| 欧美日韩免费高清一区色橹橹| 午夜影院在线观看欧美| 欧美一区国产二区| 国产在线精品一区二区| 中文字幕欧美国产| 日韩欧美区一区二| 国产一区二区三区电影在线观看| 国产亚洲美州欧州综合国| 丰满白嫩尤物一区二区| 日韩毛片在线免费观看| 欧美日韩国产影片| 久久69国产一区二区蜜臀| 国产三级三级三级精品8ⅰ区| 91美女精品福利| 日韩激情一二三区| 久久久久久亚洲综合影院红桃| 成人免费视频一区| 一区二区三区高清| 欧美放荡的少妇| 国产精品中文欧美| 亚洲精品写真福利| 欧美日韩极品在线观看一区| 国内精品国产三级国产a久久| 日韩理论在线观看| 日韩一区二区三区av| 国产成人免费视频网站| 亚洲一区二区三区四区中文字幕| 日韩欧美中文字幕精品| 顶级嫩模精品视频在线看| 亚洲高清视频在线| 久久久久久久久久久黄色| 91蝌蚪国产九色| 久草这里只有精品视频| 国产精品激情偷乱一区二区∴| 欧美日韩dvd在线观看| 国产麻豆精品95视频| 一区二区三区精密机械公司| 久久欧美一区二区| 欧美日韩一级片在线观看| 大陆成人av片| 日韩中文字幕不卡| 亚洲视频你懂的| 久久午夜色播影院免费高清| 欧美日韩一区三区| 成人激情免费视频| 精品一区二区三区久久久| 亚洲综合男人的天堂| 国产日本一区二区| 日韩女优毛片在线| 欧美日韩一区二区在线观看| 成人18视频日本| 国产乱人伦偷精品视频不卡 | 国产亚洲精品bt天堂精选|