Module Import alias identifier ImportFrom alias alias alias alias ImportFrom alias alias alias alias Assign NameStore NameLoad Assign NameStore NameStore NameStore NameLoad FunctionDef arguments args defaults body Expr Str TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str If UnaryOpNot NameLoad body Expr Call NameLoad Str Assign NameStore Num orelse ImportFrom alias Assign NameStore SubscriptLoad Call NameLoad Index Num Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults NameLoad body Expr Str Global identifier identifier identifier identifier If NameLoad body Return If BoolOpAnd UnaryOpNot NameLoad CompareNotEq Call AttributeLoad Call NameLoad Str Str attr Str body Expr Call AttributeLoad NameLoad attr Str Return Assign NameStore NameLoad TryExcept body ImportFrom alias alias ImportFrom alias handlers ExceptHandler type NameLoad body Expr Call NameLoad Str Return TryExcept body Import alias handlers ExceptHandler type NameLoad body Expr Call NameLoad Str Return Assign NameStore Call NameLoad If CompareIs NameLoad NameLoad body Expr Call NameLoad Str Return Assign NameStore Call NameLoad Str Str Str Assign NameStore Call NameLoad Str Str Str Assign NameStore Call NameLoad Str Str Str TryExcept body Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler body Expr Call NameLoad Str Return Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad BinOpAdd BinOpDiv BinOpSub NameLoad BinOpMod NameLoad Num Num Num If CompareEq NameLoad Str body Assign NameStore Num Expr Call NameLoad If NameLoad body ImportFrom alias Assign NameStore Call NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr BinOpDiv Call AttributeLoad SubscriptLoad NameLoad Slice NameLoad attr Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Call NameLoad keyword NameLoad body Expr Str If UnaryOpNot SubscriptLoad NameLoad Index Str body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Call NameLoad BinOpMult NameLoad Call NameLoad NameLoad keyword NameLoad attr orelse Assign NameStore Call NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call NameLoad NameLoad SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign TupleStore NameStore NameStore TupleLoad Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad BinOpAdd BinOpFloorDiv BinOpSub NameLoad BinOpMod NameLoad Num Num Num Assign NameStore Call NameLoad BinOpAdd BinOpFloorDiv BinOpSub NameLoad BinOpMod NameLoad Num Num Num If CompareEq NameLoad Str body Assign NameStore Num Expr Call NameLoad If NameLoad body ImportFrom alias Assign NameStore Call NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr BinOpDiv Call AttributeLoad SubscriptLoad NameLoad Slice NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str orelse Expr Call AttributeLoad NameLoad attr Str Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Call NameLoad keyword NameLoad body Expr Str If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore CompareLt NameLoad NameLoad If UnaryOpNot SubscriptLoad NameLoad Index Str body Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr AugAssignMult NameStore AttributeLoad SubscriptLoad NameLoad Index BinOpFloorDiv Call AttributeLoad NameLoad attr Num BinOpAdd Call NameLoad NameLoad Num Num attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad If CompareEq BinOpMod Call NameLoad NameLoad NameLoad Num Num body If CompareGt NameLoad NameLoad body AugAssignDiv SubscriptStore NameLoad Index BinOpSub NameLoad Num Num Assign NameStore Call AttributeLoad Call NameLoad NameLoad keyword NameLoad attr orelse Assign NameStore Call NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad NameLoad attr TupleLoad NameLoad Call AttributeLoad NameLoad attr Call NameLoad BinOpSub NameLoad NameLoad Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call NameLoad NameLoad SubscriptLoad NameLoad Index Str Assign NameStore IfExp NameLoad NameLoad NameLoad Assign NameStore IfExp NameLoad NameLoad NameLoad If CompareEq BinOpMod NameLoad Num Num body Assign NameStore Call NameLoad BinOpFloorDiv BinOpSub NameLoad BinOpMod NameLoad Num Num Expr Call NameLoad SubscriptLoad NameLoad Index Str keyword Call NameLoad NameLoad BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str keyword NameLoad Assign NameStore SubscriptLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Slice IfExp NameLoad NameLoad NameLoad If Call AttributeLoad CompareGt NameLoad Num attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Str Assign SubscriptStore NameLoad Slice SubscriptLoad NameLoad Index Num NameLoad Assign SubscriptStore NameLoad Slice UnaryOpUSub SubscriptLoad NameLoad Index Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call AttributeLoad CompareEq NameLoad Num attr body Return NameLoad orelse If Call AttributeLoad CompareLt NameLoad Num attr body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd BinOpSub SubscriptLoad NameLoad Index Num Call NameLoad NameLoad Num Num keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd BinOpSub SubscriptLoad NameLoad Index Num Call NameLoad NameLoad Num Num keyword AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr ListLoad NameLoad BinOpSub BinOpMult Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Slice SubscriptLoad NameLoad Index Num Num Num NameLoad BinOpSub BinOpMult Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Slice Num BinOpSub UnaryOpUSub SubscriptLoad NameLoad Index Num Num Num NameLoad decorator_list
N/A N/A numpy np scipy.fftpack fft ifft rfft irfft utils sizeof_fmt logger get_config warn N/A _cuda_capable False N/A _multiply_inplace_c128 _halve_c128 _real_c128 None _get_cudafft N/A N/A N/A N/A N/A Helper to deal with scikit-cuda namespace change N/A N/A skcuda fft N/A N/A N/A ImportError N/A N/A N/A scikits.cuda fft N/A N/A N/A ImportError N/A N/A fft None N/A fft N/A get_cuda_memory N/A N/A N/A N/A N/A Get the amount of free memory for CUDA operations

    Returns
    -------
    memory : str
        The amount of available memory as a human-readable string.
     N/A N/A _cuda_capable N/A N/A N/A warn CUDA not enabled, returning zero for memory N/A mem 0 N/A pycuda.driver mem_get_info N/A mem N/A N/A mem_get_info N/A 0 N/A N/A sizeof_fmt mem N/A init_cuda N/A N/A ignore_config N/A False N/A N/A Initialize CUDA functionality

    This function attempts to load the necessary interfaces
    (hardware connectivity) to run CUDA-based filtering. This
    function should only need to be run once per session.

    If the config var (set via mne.set_config or in ENV)
    MNE_USE_CUDA == 'true', this function will be executed when
    the first CUDA setup is performed. If this variable is not
    set, this function can be manually executed.
     N/A _cuda_capable _multiply_inplace_c128 _halve_c128 _real_c128 N/A _cuda_capable N/A N/A N/A N/A N/A ignore_config N/A N/A N/A N/A get_config MNE_USE_CUDA false lower true N/A N/A N/A N/A logger info CUDA not enabled in config, skipping initialization N/A N/A _cuda_capable False N/A N/A pycuda gpuarray driver pycuda.elementwise ElementwiseKernel N/A N/A N/A ImportError N/A N/A N/A warn module pycuda not found, CUDA not enabled N/A N/A N/A N/A pycuda.autoinit N/A N/A N/A ImportError N/A N/A N/A warn pycuda.autoinit could not be imported, likely a hardware error, CUDA not enabled N/A N/A cudafft N/A _get_cudafft N/A N/A cudafft None N/A N/A N/A warn module scikit-cuda not found, CUDA not enabled N/A N/A _multiply_inplace_c128 N/A ElementwiseKernel pycuda::complex<double> *a, pycuda::complex<double> *b b[i] *= a[i] multiply_inplace N/A _halve_c128 N/A ElementwiseKernel pycuda::complex<double> *a a[i] /= 2.0 halve_value N/A _real_c128 N/A ElementwiseKernel pycuda::complex<double> *a a[i] = real(a[i]) real_value N/A N/A N/A N/A N/A cudafft Plan 16 N/A np float64 N/A np complex128 N/A N/A N/A N/A N/A warn Device does not support 64-bit FFTs, CUDA not enabled N/A N/A _cuda_capable True N/A N/A N/A logger info N/A Enabling CUDA with %s available memory N/A get_cuda_memory N/A setup_cuda_fft_multiply_repeated N/A N/A n_jobs h_fft N/A N/A N/A Set up repeated CUDA FFT multiplication with a given filter

    Parameters
    ----------
    n_jobs : int | str
        If n_jobs == 'cuda', the function will attempt to set up for CUDA
        FFT multiplication.
    h_fft : array
        The filtering function that will be used repeatedly.
        If n_jobs='cuda', this function will be shortened (since CUDA
        assumes FFTs of real signals are half the length of the signal)
        and turned into a gpuarray.

    Returns
    -------
    n_jobs : int
        Sets n_jobs = 1 if n_jobs == 'cuda' was passed in, otherwise
        original n_jobs is passed.
    cuda_dict : dict
        Dictionary with the following CUDA-related variables:
            use_cuda : bool
                Whether CUDA should be used.
            fft_plan : instance of FFTPlan
                FFT plan to use in calculating the FFT.
            ifft_plan : instance of FFTPlan
                FFT plan to use in calculating the IFFT.
            x_fft : instance of gpuarray
                Empty allocated GPU space for storing the result of the
                frequency-domain multiplication.
            x : instance of gpuarray
                Empty allocated GPU space for the data to filter.
    h_fft : array | instance of gpuarray
        This will either be a gpuarray (if CUDA enabled) or np.ndarray.
        If CUDA is enabled, h_fft will be modified appropriately for use
        with filter.fft_multiply().

    Notes
    -----
    This function is designed to be used with fft_multiply_repeated().
     N/A cuda_dict N/A dict use_cuda False fft_plan None ifft_plan None x_fft None x None N/A n_fft N/A len h_fft N/A cuda_fft_len N/A int N/A N/A N/A n_fft N/A n_fft 2 2 1 N/A N/A n_jobs cuda N/A N/A n_jobs 1 N/A N/A init_cuda N/A _cuda_capable N/A pycuda gpuarray N/A cudafft N/A _get_cudafft N/A N/A N/A h_fft N/A N/A gpuarray to_gpu N/A N/A N/A N/A h_fft N/A cuda_fft_len astype complex_ N/A len h_fft N/A N/A N/A cuda_dict update use_cuda True fft_plan N/A N/A cudafft Plan n_fft N/A np float64 N/A np complex128 ifft_plan N/A N/A cudafft Plan n_fft N/A np complex128 N/A np float64 x_fft N/A N/A gpuarray empty cuda_fft_len N/A np complex128 x N/A N/A gpuarray empty N/A int n_fft N/A np float64 N/A N/A N/A logger info Using CUDA for FFT FIR filtering N/A N/A N/A Exception N/A exp N/A N/A N/A N/A logger info N/A CUDA not used, could not instantiate memory (arrays may be too large: "%s"), falling back to n_jobs=1 N/A str exp N/A N/A N/A N/A logger info CUDA not used, CUDA could not be initialized, falling back to n_jobs=1 N/A N/A n_jobs cuda_dict h_fft N/A fft_multiply_repeated N/A N/A h_fft x cuda_dict N/A N/A dict use_cuda False N/A N/A Do FFT multiplication by a filter function (possibly using CUDA)

    Parameters
    ----------
    h_fft : 1-d array or gpuarray
        The filtering array to apply.
    x : 1-d array
        The array to filter.
    cuda_dict : dict
        Dictionary constructed using setup_cuda_multiply_repeated().

    Returns
    -------
    x : 1-d array
        Filtered version of x.
     N/A N/A N/A cuda_dict N/A use_cuda N/A N/A x N/A N/A N/A N/A np real N/A ifft N/A h_fft N/A fft x overwrite_x True ravel N/A N/A cudafft N/A _get_cudafft N/A N/A N/A N/A cuda_dict N/A x set N/A N/A x astype N/A np float64 N/A N/A N/A cudafft fft N/A cuda_dict N/A x N/A cuda_dict N/A x_fft N/A cuda_dict N/A fft_plan N/A N/A _multiply_inplace_c128 h_fft N/A cuda_dict N/A x_fft N/A N/A N/A cudafft ifft N/A cuda_dict N/A x_fft N/A cuda_dict N/A x N/A cuda_dict N/A ifft_plan False N/A x N/A N/A np array N/A N/A N/A cuda_dict N/A x get dtype N/A x dtype subok True copy False N/A x N/A setup_cuda_fft_resample N/A N/A n_jobs W new_len N/A N/A N/A Set up CUDA FFT resampling

    Parameters
    ----------
    n_jobs : int | str
        If n_jobs == 'cuda', the function will attempt to set up for CUDA
        FFT resampling.
    W : array
        The filtering function to be used during resampling.
        If n_jobs='cuda', this function will be shortened (since CUDA
        assumes FFTs of real signals are half the length of the signal)
        and turned into a gpuarray.
    new_len : int
        The size of the array following resampling.

    Returns
    -------
    n_jobs : int
        Sets n_jobs = 1 if n_jobs == 'cuda' was passed in, otherwise
        original n_jobs is passed.
    cuda_dict : dict
        Dictionary with the following CUDA-related variables:
            use_cuda : bool
                Whether CUDA should be used.
            fft_plan : instance of FFTPlan
                FFT plan to use in calculating the FFT.
            ifft_plan : instance of FFTPlan
                FFT plan to use in calculating the IFFT.
            x_fft : instance of gpuarray
                Empty allocated GPU space for storing the result of the
                frequency-domain multiplication.
            x : instance of gpuarray
                Empty allocated GPU space for the data to resample.
    W : array | instance of gpuarray
        This will either be a gpuarray (if CUDA enabled) or np.ndarray.
        If CUDA is enabled, W will be modified appropriately for use
        with filter.fft_multiply().

    Notes
    -----
    This function is designed to be used with fft_resample().
     N/A cuda_dict N/A dict use_cuda False fft_plan None ifft_plan None x_fft None x None y_fft None y None N/A N/A n_fft_x n_fft_y N/A N/A len W new_len N/A cuda_fft_len_x N/A int N/A N/A N/A n_fft_x N/A n_fft_x 2 2 1 N/A cuda_fft_len_y N/A int N/A N/A N/A n_fft_y N/A n_fft_y 2 2 1 N/A N/A n_jobs cuda N/A N/A n_jobs 1 N/A N/A init_cuda N/A _cuda_capable N/A pycuda gpuarray N/A cudafft N/A _get_cudafft N/A N/A N/A W N/A N/A gpuarray to_gpu N/A N/A N/A N/A W N/A cuda_fft_len_x astype complex_ n_fft_y N/A N/A N/A cuda_dict update use_cuda True fft_plan N/A N/A cudafft Plan n_fft_x N/A np float64 N/A np complex128 ifft_plan N/A N/A cudafft Plan n_fft_y N/A np complex128 N/A np float64 x_fft N/A N/A gpuarray zeros N/A max cuda_fft_len_x cuda_fft_len_y N/A np complex128 x N/A N/A gpuarray empty N/A max N/A int n_fft_x N/A int n_fft_y N/A np float64 N/A N/A N/A logger info Using CUDA for FFT resampling N/A N/A N/A Exception N/A N/A N/A N/A logger info CUDA not used, could not instantiate memory (arrays may be too large), falling back to n_jobs=1 N/A N/A N/A N/A logger info CUDA not used, CUDA could not be initialized, falling back to n_jobs=1 N/A N/A n_jobs cuda_dict W N/A fft_resample N/A N/A x W new_len npads to_removes cuda_dict N/A N/A dict use_cuda False N/A N/A Do FFT resampling with a filter function (possibly using CUDA)

    Parameters
    ----------
    x : 1-d array
        The array to resample. Will be converted to float64 if necessary.
    W : 1-d array or gpuarray
        The filtering function to apply.
    new_len : int
        The size of the output array (before removing padding).
    npads : tuple of int
        Amount of padding to apply to the start and end of the
        signal before resampling.
    to_removes : tuple of int
        Number of samples to remove after resampling.
    cuda_dict : dict
        Dictionary constructed using setup_cuda_multiply_repeated().

    Returns
    -------
    x : 1-d array
        Filtered version of x.
     N/A N/A N/A x dtype N/A np float64 N/A N/A x N/A N/A x astype N/A np float64 N/A x N/A _smart_pad x npads N/A old_len N/A len x N/A shorter N/A new_len old_len N/A N/A N/A cuda_dict N/A use_cuda N/A N/A N N/A int N/A min new_len old_len N/A x_fft N/A N/A N/A rfft x ravel N/A x_fft N/A N/A W N/A N/A N/A N/A np arange 1 N/A N/A len x 1 2 real N/A y_fft N/A N/A np zeros new_len N/A np float64 N/A sl_1 N/A slice N N/A N/A y_fft N/A sl_1 N/A x_fft N/A sl_1 N/A N/A N/A N/A min new_len old_len 2 0 N/A N/A N/A new_len old_len N/A N/A N/A y_fft N/A N/A N 1 2.0 N/A y N/A N/A N/A irfft y_fft overwrite_x True ravel N/A N/A cudafft N/A _get_cudafft N/A N/A N/A N/A cuda_dict N/A x set N/A N/A np concatenate N/A x N/A N/A np zeros N/A max N/A new_len old_len 0 N/A x dtype N/A N/A N/A cudafft fft N/A cuda_dict N/A x N/A cuda_dict N/A x_fft N/A cuda_dict N/A fft_plan N/A N/A _multiply_inplace_c128 W N/A cuda_dict N/A x_fft N/A use_len N/A shorter new_len old_len N/A func N/A shorter _real_c128 _halve_c128 N/A N/A N/A use_len 2 0 N/A N/A nyq N/A int N/A N/A use_len N/A use_len 2 2 N/A N/A func N/A cuda_dict N/A x_fft slice N/A slice nyq N/A nyq 1 N/A N/A N/A cudafft ifft N/A cuda_dict N/A x_fft N/A cuda_dict N/A x N/A cuda_dict N/A ifft_plan scale False N/A y N/A N/A N/A N/A cuda_dict N/A x get N/A N/A shorter new_len None N/A N/A N/A N/A to_removes 0 any N/A N/A keep N/A N/A np ones new_len dtype bool N/A N/A keep N/A N/A to_removes N/A 0 False N/A N/A keep N/A N/A N/A to_removes N/A 1 False N/A y N/A N/A np compress keep y N/A y N/A _smart_pad N/A N/A x n_pad N/A N/A N/A Pad vector x
     N/A N/A N/A N/A n_pad 0 all N/A N/A x N/A N/A N/A N/A N/A n_pad 0 any N/A N/A N/A RuntimeError n_pad must be non-negative N/A l_z_pad N/A N/A np zeros N/A max N/A N/A N/A n_pad N/A 0 N/A len x 1 0 dtype N/A x dtype N/A r_z_pad N/A N/A np zeros N/A max N/A N/A N/A n_pad N/A 0 N/A len x 1 0 dtype N/A x dtype N/A N/A N/A np concatenate N/A l_z_pad N/A N/A 2 N/A x N/A 0 N/A x N/A N/A n_pad N/A 0 0 -1 x N/A N/A 2 N/A x N/A -1 N/A x N/A -2 N/A N/A N/A n_pad N/A 1 2 -1 r_z_pad N/A