Version 0.1.11 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@407 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
523a0bda29
commit
4fafe751bf
11
callerid.c
11
callerid.c
|
@ -43,7 +43,8 @@ struct callerid_state {
|
|||
int len;
|
||||
};
|
||||
|
||||
float dr[4], di[4];
|
||||
|
||||
float cid_dr[4], cid_di[4];
|
||||
float clidsb = 8000.0 / 1200.0;
|
||||
|
||||
#define CALLERID_SPACE 2200.0 /* 2200 hz for "0" */
|
||||
|
@ -52,10 +53,10 @@ float clidsb = 8000.0 / 1200.0;
|
|||
void callerid_init(void)
|
||||
{
|
||||
/* Initialize stuff for inverse FFT */
|
||||
dr[0] = cos(CALLERID_SPACE * 2.0 * M_PI / 8000.0);
|
||||
di[0] = sin(CALLERID_SPACE * 2.0 * M_PI / 8000.0);
|
||||
dr[1] = cos(CALLERID_MARK * 2.0 * M_PI / 8000.0);
|
||||
di[1] = sin(CALLERID_MARK * 2.0 * M_PI / 8000.0);
|
||||
cid_dr[0] = cos(CALLERID_SPACE * 2.0 * M_PI / 8000.0);
|
||||
cid_di[0] = sin(CALLERID_SPACE * 2.0 * M_PI / 8000.0);
|
||||
cid_dr[1] = cos(CALLERID_MARK * 2.0 * M_PI / 8000.0);
|
||||
cid_di[1] = sin(CALLERID_MARK * 2.0 * M_PI / 8000.0);
|
||||
}
|
||||
|
||||
struct callerid_state *callerid_new(void)
|
||||
|
|
|
@ -139,16 +139,16 @@ extern int ast_isphonenumber(char *n);
|
|||
* routines (used by ADSI for example)
|
||||
*/
|
||||
|
||||
extern float dr[4];
|
||||
extern float di[4];
|
||||
extern float cid_dr[4];
|
||||
extern float cid_di[4];
|
||||
extern float clidsb;
|
||||
|
||||
static inline float callerid_getcarrier(float *cr, float *ci, int bit)
|
||||
{
|
||||
/* Move along. There's nothing to see here... */
|
||||
float t;
|
||||
t = *cr * dr[bit] - *ci * di[bit];
|
||||
*ci = *cr * di[bit] + *ci * dr[bit];
|
||||
t = *cr * cid_dr[bit] - *ci * cid_di[bit];
|
||||
*ci = *cr * cid_di[bit] + *ci * cid_dr[bit];
|
||||
*cr = t;
|
||||
|
||||
t = 2.0 - (*cr * *cr + *ci * *ci);
|
||||
|
|
Reference in New Issue