?? intanaly.c
字號:
/**************************************************************************
*
* ROUTINE
* intanaly
*
* FUNCTION
* Linearly interpolate between transmitted LSPs
* to generate nn (=4) intermediate sets of LSP
* frequencies for subframe analysis.
*
*
* SYNOPSIS
* subroutine intanaly(lspnew, nn, lsp)
*
* formal
*
* data I/O
* name type type function
* -------------------------------------------------------------------
* lspnew float i new frequency array
* nn int i number of segments/frame
* lsp float o interpolated frequency matrix
*
* external
* data I/O
* name type type function
* -------------------------------------------------------------------
* no int i
* frame int i
*
***************************************************************************
*
* DESCRIPTION
* This routine linearly interpolates lsp's for analysis in
* nn (=4) subframes. This is a combination of inter- and
* intra-frame interpolation. There are two routines, one for the
* analyzer and one for the synthesizer.
*
* The lsps are interpolated from two transmitted frames,
* old and new. The lsp interpolation is calculated as follows:
*
* superframe: old new
*
* | | |
* |---------------------|---------------------|
* | | |
*
* \ /
* \ /
*
* subframe: 1 2 3 4
* | |
* ...---|--------|--------|--------|--------|
* | |
* v v v v
*
* weighting:
* old: 7/8 5/8 3/8 1/8
* new: 1/8 3/8 5/8 7/8
*
* Note: This is dependent on nn = ll/l = 4!
*
***************************************************************************
*
* CALLED BY
*
* celp
*
* CALLS
*
*
*
**************************************************************************/
#define TRUE 1
#define FALSE 0
#include "ccsub.h"
extern int no, frame;
static float tempfreq, w[2][4] = { 0.875, 0.625, 0.375, 0.125,
0.125, 0.375, 0.625, 0.875};
intanaly(lspnew, nn, lsp)
int nn;
float lspnew[];
register float lsp[][MAXNO];
{
register int m;
static float lspold[MAXNO] = {.03, .05, .09, .13, .19, .23, .29, .33, .39, .44};
static float oldlsp[MAXNO];
#define STEP(i,j) lsp[i][j] = w[0][i]*lspold[j] + w[1][i]*lspnew[j];
STEP(0,0); STEP(0,1); STEP(0,2); STEP(0,3); STEP(0,4);
STEP(0,5); STEP(0,6); STEP(0,7); STEP(0,8); STEP(0,9);
STEP(1,0); STEP(1,1); STEP(1,2); STEP(1,3); STEP(1,4);
STEP(1,5); STEP(1,6); STEP(1,7); STEP(1,8); STEP(1,9);
STEP(2,0); STEP(2,1); STEP(2,2); STEP(2,3); STEP(2,4);
STEP(2,5); STEP(2,6); STEP(2,7); STEP(2,8); STEP(2,9);
STEP(3,0); STEP(3,1); STEP(3,2); STEP(3,3); STEP(3,4);
STEP(3,5); STEP(3,6); STEP(3,7); STEP(3,8); STEP(3,9);
/*
for (i = 0; i < nn; i++)
{
for (j = 0; j < no; j++)
lsp[i][j] = w[0][i]*lspold[j] + w[1][i]*lspnew[j];
}
*/
for (m = 0; m < no; m++)
{
lspold[m] = lspnew[m];
oldlsp[m] = lsp[nn][m];
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -