spandsp  0.0.6
private/plc.h
Go to the documentation of this file.
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/plc.h
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2004 Steve Underwood
9  *
10  * All rights reserved.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 2.1,
14  * as published by the Free Software Foundation.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 /*! \file */
27 
28 #if !defined(_SPANDSP_PRIVATE_PLC_H_)
29 #define _SPANDSP_PRIVATE_PLC_H_
30 
31 /*! Minimum allowed pitch (66 Hz) */
32 #define PLC_PITCH_MIN 120
33 /*! Maximum allowed pitch (200 Hz) */
34 #define PLC_PITCH_MAX 40
35 /*! Maximum pitch OLA window */
36 #define PLC_PITCH_OVERLAP_MAX (PLC_PITCH_MIN >> 2)
37 /*! The length over which the AMDF function looks for similarity (20 ms) */
38 #define CORRELATION_SPAN 160
39 /*! History buffer length. The buffer much also be at leat 1.25 times
40  PLC_PITCH_MIN, but that is much smaller than the buffer needs to be for
41  the pitch assessment. */
42 #define PLC_HISTORY_LEN (CORRELATION_SPAN + PLC_PITCH_MIN)
43 
44 /*!
45  The generic packet loss concealer context.
46 */
48 {
49  /*! Consecutive erased samples */
51  /*! Current offset into pitch period */
53  /*! Pitch estimate */
54  int pitch;
55  /*! Buffer for a cycle of speech */
57  /*! History buffer */
59  /*! Current pointer into the history buffer */
60  int buf_ptr;
61 };
62 
63 #endif
64 /*- End of file ------------------------------------------------------------*/
int pitch
Definition: private/plc.h:54
float pitchbuf[120]
Definition: private/plc.h:56
int16_t history[(160+120)]
Definition: private/plc.h:58
Definition: private/plc.h:47
#define PLC_HISTORY_LEN
Definition: private/plc.h:42
int pitch_offset
Definition: private/plc.h:52
#define PLC_PITCH_MIN
Definition: private/plc.h:32
int buf_ptr
Definition: private/plc.h:60
int missing_samples
Definition: private/plc.h:50