Пример #1
0
void PLC_dofe(G711_PLC_state *PLC, short *out)
{
  if (erasecnt == 0) {
    ippsCopy_16s(history, pitchbuf, HISTORYLEN); /* get history */
    pitch = findpitch(PLC);                     /* find pitch */
    poverlap = pitch >> 2;                     /* OLA 1/4 wavelength */
    /* save original last poverlap samples */
    ippsCopy_16s(pitchbufend - poverlap, lastq, poverlap);
    poffset = 0;                     /* create pitch buffer with 1 period */
    pitchblen = pitch;
    pitchbufstart = pitchbufend - pitchblen;
    overlapadd(lastq, pitchbufstart - poverlap,
      pitchbufend - poverlap, poverlap);
    /* update last 1/4 wavelength in history buffer */
    ippsCopy_16s(pitchbufend - poverlap, &history[HISTORYLEN-poverlap],
      poverlap);
    getfespeech(PLC, out, FRAMESZ);               /* get synthesized speech */
  } else if (erasecnt == 1 || erasecnt == 2) {
Пример #2
0
/*
 * Generate the synthetic signal.
 * At the beginning of an erasure determine the pitch, and extract
 * one pitch period from the tail of the signal. Do an OLA for 1/4
 * of the pitch to smooth the signal. Then repeat the extracted signal
 * for the length of the erasure. If the erasure continues for more than
 * 10 ms, increase the number of periods in the pitchbuffer. At the end
 * of an erasure, do an OLA with the start of the first good frame.
 * The gain decays as the erasure gets longer.
 */
void LowcFE::dofe(short *out)
{
    pitchbufend = &pitchbuf[HISTORYLEN];

    if (erasecnt == 0) {
 	convertsf(history, pitchbuf, HISTORYLEN); /* get history */
	pitch = findpitch(); /* find pitch */
	poverlap = pitch >> 2; /* OLA 1/4 wavelength */
	/* save original last poverlap samples */
	copyf(pitchbufend - poverlap, lastq, poverlap);
	poffset = 0; /* create pitch buffer with 1 period */
	pitchblen = pitch;
	pitchbufstart = pitchbufend - pitchblen;
	overlapadd(lastq, pitchbufstart - poverlap,
		   pitchbufend - poverlap, poverlap);
	/* update last 1/4 wavelength in history buffer */
	convertfs(pitchbufend - poverlap, &history[HISTORYLEN-poverlap],
		  poverlap);
	getfespeech(out, FRAMESZ); /* get synthesized speech */
    } else if (erasecnt == 1 || erasecnt == 2) {