Example #1
0
def get_ir(ir_params):
    """
        Computes the impulse reponse (ir) associated with a the Green function at x=0
        of the wave equation in a manifold M defined by its eigen-values.
        
        Return an instance of the class Signal containing the Green function at given
        sampling rate.

        ir_params : [dict] dictionary containing params

                    {  'ev_params'      : {'space':'e3', 'F': [0.1,0.1,0.1], 'j_max':1},
                       'duration'       : 0.1,
                       'nu'             : 1.7e-5,
                       'sampling_rate'  : 8000,
                    }
    """

    ir_params = _check_params(ir_params)
    eigen_vals, ev_params = get_eigenvalues(ir_params['ev_params'])
    ir_params_ = copy.deepcopy(ir_params)
    ir_params_.update({'eigen_vals':eigen_vals, 'c':ev_params['c']})
    del ir_params_['ev_params']

    green_fn_0 = compute_green_fn(**ir_params_)

    sig_gf = Signal(green_fn_0,fs=ir_params_['sampling_rate'],mono=True,normalize=True)

    return sig_gf, eigen_vals
Example #2
0
def test_eigenvalues():
    get_eigenvalues({'space':'e3'  , 'F':[0.1,0.1,0.1], 'j_max':2})
    get_eigenvalues({'space':'s3'  , 'F':[0.1], 'c':3.4e2})
    get_eigenvalues({'space':'h2e1', 'F':[0.1], 'kind':3})
    get_eigenvalues({'space':'s2e1', 'F':[0.1,0.1], 'unused_kwarg':'unused_kwarg'})