void OSM_cSizeDist::setRR( double s1, double s2, double p1, double p2 ) { filterS( s1 ); filterS( s2 ); filterP( p1 ); filterP( p2 ); s0 = s1; x0 = log(s1); dx = log(s2) - x0; p0 = p1; y0 = log( -log(p1/100) ); dy = log( -log(p2/100) ) - y0; }
double OSM_cSizeDist::percentRR( double size ) { double x, y, retVal = 0; if( dx==0 ) { retVal = p0; } else { filterS( size ); x = log( size ); y = y0 + dy * (x-x0)/dx; retVal = 100 * exp( -exp(y) ); } return retVal; }
static inline int demodulator(fsk_data *fskd, float *retval, float x) { float xS,xM; fskd->cola_in[fskd->pcola] = x; xS = filterS(fskd,x); xM = filterM(fskd,x); fskd->cola_filter[fskd->pcola] = xM-xS; x = filterL(fskd,xM*xM - xS*xS); fskd->cola_demod[fskd->pcola++] = x; fskd->pcola &= (NCOLA-1); *retval = x; return 0; }