42 #define BWLIST {75,800} 44 #define FLIST {1400,1800,1200,2200,1300,2100} 46 #define STATE_SEARCH_STARTBIT 0 47 #define STATE_SEARCH_STARTBIT2 1 48 #define STATE_SEARCH_STARTBIT3 2 49 #define STATE_GET_BYTE 3 54 retval = (float) **buffer / 256;
60 #define GET_SAMPLE get_sample(&buffer, len) 71 { 1.8229206611e-04,-7.8997325866e-01,2.2401819940e+00,-4.6751353581e+00,5.5080745712e+00,-5.0571565772e+00,2.6215820004e+00,0.0000000000e+00, },
72 { 9.8532175289e-02,-5.6297236492e-02,3.3146713415e-01,-9.2239200436e-01,1.4844365184e+00,-2.0183258642e+00,2.0074154497e+00,0.0000000000e+00, },
75 { 1.8229206610e-04,-7.8997325866e-01,7.7191410839e-01,-2.8075643964e+00,1.6948618347e+00,-3.0367273700e+00,9.0333559408e-01,0.0000000000e+00, },
76 { 9.8531161839e-02,-5.6297236492e-02,1.1421579050e-01,-4.8122536483e-01,4.0121072432e-01,-7.4834487567e-01,6.9170822332e-01,0.0000000000e+00, },
79 { 1.8229206611e-04,-7.8997325866e-01,2.9003821430e+00,-6.1082779024e+00,7.7169345751e+00,-6.6075999680e+00,3.3941838836e+00,0.0000000000e+00, },
80 { 9.8539686961e-02,-5.6297236492e-02,4.2915323820e-01,-1.2609358633e+00,2.2399213250e+00,-2.9928879142e+00,2.5990173742e+00,0.0000000000e+00, },
83 { 1.8229206610e-04,-7.8997325866e-01,-7.7191410839e-01,-2.8075643964e+00,-1.6948618347e+00,-3.0367273700e+00,-9.0333559408e-01,0.0000000000e+00, },
84 { 9.8531161839e-02,-5.6297236492e-02,-1.1421579050e-01,-4.8122536483e-01,-4.0121072432e-01,-7.4834487567e-01,-6.9170822332e-01,0.0000000000e+00, },
87 { 1.8229206611e-04,-7.8997325866e-01,2.5782298908e+00,-5.3629717478e+00,6.5890882172e+00,-5.8012914776e+00,3.0171839130e+00,0.0000000000e+00, },
88 { 9.8534230718e-02,-5.6297236492e-02,3.8148618075e-01,-1.0848760410e+00,1.8441165168e+00,-2.4860666655e+00,2.3103384142e+00,0.0000000000e+00, },
91 { 1.8229206610e-04,-7.8997325866e-01,-3.8715051001e-01,-2.6192408538e+00,-8.3977994034e-01,-2.8329897913e+00,-4.5306444352e-01,0.0000000000e+00, },
92 { 9.8531160936e-02,-5.6297236492e-02,-5.7284484199e-02,-4.3673866734e-01,-1.9564766257e-01,-6.2028156584e-01,-3.4692356122e-01,0.0000000000e+00, },
103 { 1.3868644653e-08,-6.3283665042e-01,4.0895057217e+00,-1.1020074592e+01,1.5850766191e+01,-1.2835109292e+01,5.5477477340e+00,0.0000000000e+00, },
104 { 3.1262119724e-03,-7.8390522307e-03,8.5209627801e-02,-4.0804129163e-01,1.1157139955e+00,-1.8767603680e+00,1.8916395224e+00,0.0000000000e+00, },
116 fskd->
fmxv[(fskd->
fmp+6)&7] = in*(*pc++);
118 s = (fskd->
fmxv[(fskd->
fmp + 6) & 7] - fskd->
fmxv[fskd->
fmp]) + 3 * (fskd->
fmxv[(fskd->
fmp + 2) & 7] - fskd->
fmxv[(fskd->
fmp + 4) & 7]);
119 for (i = 0, j = fskd->
fmp; i < 6; i++, j++)
120 s += fskd->
fmyv[j&7]*(*pc++);
135 fskd->
fsxv[(fskd->
fsp+6)&7] = in*(*pc++);
137 s = (fskd->
fsxv[(fskd->
fsp + 6) & 7] - fskd->
fsxv[fskd->
fsp]) + 3 * (fskd->
fsxv[(fskd->
fsp + 2) & 7] - fskd->
fsxv[(fskd->
fsp + 4) & 7]);
138 for (i = 0, j = fskd->
fsp; i < 6; i++, j++)
139 s += fskd->
fsyv[j&7]*(*pc++);
154 fskd->
flxv[(fskd->
flp + 6) & 7] = in * (*pc++);
158 15 * (fskd->
flxv[(fskd->
flp+2)&7] + fskd->
flxv[(fskd->
flp+4)&7]) +
159 20 * fskd->
flxv[(fskd->
flp+3)&7];
161 for (i = 0,j = fskd->
flp;i<6;i++,j++)
162 s += fskd->
flyv[j&7]*(*pc++);
180 x =
filterL(fskd,xM*xM - xS*xS);
197 spb = 8000.0 / 1200.0;
204 if ((x * fskd->
x0) < 0) {
206 if (fskd->
cont<(spb2))
215 if (fskd->
cont > spb) {
220 f = (x > 0) ? 0x80 : 0;
231 switch (fskd->
state) {
234 goto search_startbit2;
236 goto search_startbit3;
271 printf(
"x2 = %5.5f ", fskd->
x2);
287 printf(
"x1 = %5.5f ", fskd->
x1);
294 }
while (fskd->
x1 > 0);
301 if (fskd->
nbit < 8) {
310 for (a = n1 = 0; j; j--) {
313 buffer += (olen - *
len);
328 buffer += (olen - *
len);
344 for (j = fskd->
nstop;j;j--) {
Asterisk main include file. File version handling, generic pbx functions.
static float filterM(fsk_data *fskd, float in)
#define STATE_SEARCH_STARTBIT3
static float filterL(fsk_data *fskd, float in)
static float get_sample(short **buffer, int *len)
#define STATE_SEARCH_STARTBIT2
int fsk_serial(fsk_data *fskd, short *buffer, int *len, int *outbyte)
static int demodulator(fsk_data *fskd, float *retval, float x)
static double coef_out[NBW][8]
Coefficients for output filter Coefficients table, generated by program "mkfilter" Format: coef[IDX_B...
static int get_bit_raw(fsk_data *fskd, short *buffer, int *len)
static double coef_in[NF][NBW][8]
Coefficients for input filters Coefficients table, generated by program "mkfilter" mkfilter is part o...
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static float filterS(fsk_data *fskd, float in)
#define STATE_SEARCH_STARTBIT