示例#1
0
def _import_module(dtype):

    # Make sure the proper block module is loaded, too
    _import_block_module(dtype)

    mod = None
    if dtype == numpy.float32:
        _temp = __import__('vsip.signal', globals(), locals(), ['_window_f'], -1) 
        mod = _temp._window_f
    elif dtype in (float, numpy.float64):
        _temp = __import__('vsip.signal', globals(), locals(), ['_window_d'], -1) 
        mod = _temp._window_d
    if not mod:
        raise ValueError, 'Unsupported dtype %s'%(dtype)
    return mod
示例#2
0
def _import_module(dtype):

    # Make sure the proper block module is loaded, too
    _import_block_module(dtype)

    mod = None
    if dtype == numpy.float32:
        _temp = __import__('vsip.signal', globals(), locals(), ['_window_f'],
                           -1)
        mod = _temp._window_f
    elif dtype in (float, numpy.float64):
        _temp = __import__('vsip.signal', globals(), locals(), ['_window_d'],
                           -1)
        mod = _temp._window_d
    if not mod:
        raise ValueError, 'Unsupported dtype %s' % (dtype)
    return mod
示例#3
0
文件: cast.py 项目: ssbirute/openvsip
def cast(dtype, v):

    mod = _import_block_module(dtype)
    return v.__class__(block=as_type(v.block, dtype))