コード例 #1
0
ファイル: Path.cpp プロジェクト: Yuhulabs/wsgc
wsgc_complex Path::MakeGaussianDelaySample()
{
    wsgc_float u1;
    wsgc_float u2;
    wsgc_float r;
    wsgc_complex val;

    if (m_noSpread) //if not using any spread
    {
        val = (m_LPGain, 0);
    }
    else
    {
        // Generate two uniform random numbers between -1 and +1
        // that are inside the unit circle

        do {
            //u1 = 1.0 - 2.0 * (wsgc_float)rand()/(wsgc_float)RAND_MAX ;
            //u2 = 1.0 - 2.0 * (wsgc_float)rand()/(wsgc_float)RAND_MAX ;
            u1 = m_unif(m_randomEngine);
            u2 = m_unif(m_randomEngine);
            r = u1*u1 + u2*u2;
        } while(r >= 1.0 || r == 0.0);

        val.real() = m_LPGain*u1*sqrt(-2.0*log(r)/r);
        val.imag() = m_LPGain*u2*sqrt(-2.0*log(r)/r);

        //SweepGenCpx(  &val, 320, 0.0, 30*5, 30*5/200.0);

        // Now LP filter the Gaussian samples
        val = m_pLPFIR->CalcFilter(val);
    }

    //gDebug1 = CalcCpxRMS( val, 288000);
    //CalcCpxSweepRMS( val, 500);

    return val;
}
コード例 #2
0
    bool mk_interp_tail_simplifier::rule_substitution::unify(expr * e1, expr * e2) {
        SASSERT(m_rule);

        //we need to apply the current substitution in order to ensure the unifier 
        //works in an incremental way
        expr_ref e1_s(m);
        expr_ref e2_s(m);
        m_subst.apply(e1,e1_s);
        m_subst.apply(e2,e2_s);
        //and we need to reset the cache as we're going to modify the substitution
        m_subst.reset_cache();

        return m_unif (e1_s, e2_s, m_subst, false);
    }