?? csub.c
字號:
/**************************************************************************
*
* ROUTINE
* csub
*
* FUNCTION
* control routine to find optimal excitation
* (adaptive and stochastic code book searches)
*
* SYNOPSIS
* subroutine csub(s, v, l, lp)
*
* formal
*
* data I/O
* name type type function
* -------------------------------------------------------------------
* s[l] float i speech or residual segment
* v[l] float o optimum excitation vector
* l int i stochastic analysis frame size
* lp int i adaptive (pitch) analysis frame size
*
* external
* data I/O
* name type type function
* -------------------------------------------------------------------
* idb int i
* no int i
* nseg int i
* sg int i
* e0[] float i/o
* fndex_e0_vid int i
* fndpp_e0_vid int i
* mxsw int i modified excitation switch
*
***************************************************************************
*
* Global
*
* SPECTRUM VARIABLES:
* d2a real memory 1/A(z)
* d2b real memory 1/A(z)
* d3a real memory A(z)
* d3b real memory A(z)
* d4a real memory 1/A(z/gamma)
* d4b real memory 1/A(z/gamma)
*
* PITCH VARIABLES:
* d1a real memory 1/P(z)
* d1b real memory 1/P(z)
***************************************************************************
*
* CALLED BY
*
* celp
*
* CALLS
*
* confg cbsearch psearch movefr save_sg setr
*
* mescite1 mexcite2
*
**************************************************************************/
#include "ccsub.h"
float d1a[MAXPA], d1b[MAXPA], d2a[MAXNO+1], d2b[MAXNO+1], d3a[MAXNO+1], d3b[MAXNO+1];
float d4a[MAXNO+1], d4b[MAXNO+1];
float selec_ad[MAXLP]; /* selected pitch ex. from ad codebook by psearch*/
extern int idb, no, nseg, sg, mxsw;
extern float e0[MAXLP];
csub(s, v, l, lp)
int l, lp;
float s[], v[];
{
register int i;
/* *find the intial error without pitch VQ */
setr(l, 0.0, e0);
confg(s, l, d2a, d3a, d4a);
/*
movefr(no + 1, d2b, d2a);
movefr(no + 1, d3b, d3a);
movefr(no + 1, d4b, d4a);
*/
for (i = 0; i <= no; i++)
{
d2a[i] = d2b[i];
d3a[i] = d3b[i];
d4a[i] = d4b[i];
}
/* *find impulse response (h) of perceptual weighting filter */
impulse(l);
/* *pitch (adaptive code book) search */
psearch(l);
/* *find initial error with pitch VQ */
confg_ad(s, l, d1a, d2a, d3a, d4a);
/* *stochastic code book search */
cbsearch(l, v);
/* *update filter states */
movefr(l, v, e0);
confg_cb(s, l, d1a, d2b, d3b, d4b);
/*
movefr(no + 1, d2b, d2a);
movefr(no + 1, d3b, d3a);
movefr(no + 1, d4b, d4a);
*/
for (i = 0; i <= no; i++)
{
d2a[i] = d2b[i];
d3a[i] = d3b[i];
d4a[i] = d4b[i];
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -