# Path: ptsa/data/timeseries.py
# class TimeSeries(DimArray):
#     def __new__(cls, data, tdim, samplerate, *args, **kwargs):
#     def __setattr__(self, name, value):
#     def _ret_func(self, ret, axis):
#     def remove_buffer(self, duration):
#     def filtered(self,freq_range,filt_type='stop',order=4):
#     def resampled(self, resampled_rate, window=None,
#                   loop_axis=None, num_mp_procs=0, pad_to_pow2=False):
#     def baseline_corrected(self, base_range):
# 
# Path: ptsa/helper.py
# def next_pow2(n):
#     """
#     Returns p such that 2 ** p >= n
#     """
#     p = int(np.floor(np.log2(n)))
#     if 2 **  p == n:
#         return p
#     else:
#         return p + 1


import sys
import numpy as np
from scipy.signal import hilbert
from ptsa.data.timeseries import TimeSeries,Dim
from ptsa.helper import next_pow2
#emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
#ex: set sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
#   See the COPYING file distributed along with the PTSA package for the
#   copyright and license terms.
#
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##



freq_bands = [('delta', [2.0,4.0]),
              ('theta', [4.0,8.0]),
              ('alpha', [9.0,14.0]),

# Path: ptsa/data/timeseries.py
# class TimeSeries(DimArray):
#     def __new__(cls, data, tdim, samplerate, *args, **kwargs):
#     def __setattr__(self, name, value):
#     def _ret_func(self, ret, axis):
#     def remove_buffer(self, duration):
#     def filtered(self,freq_range,filt_type='stop',order=4):
#     def resampled(self, resampled_rate, window=None,
#                   loop_axis=None, num_mp_procs=0, pad_to_pow2=False):
#     def baseline_corrected(self, base_range):
# 
# Path: ptsa/helper.py
# def next_pow2(n):
#     """
#     Returns p such that 2 ** p >= n
#     """
#     p = int(np.floor(np.log2(n)))
#     if 2 **  p == n:
#         return p
#     else:
#         return p + 1


# Path: ptsa/hilbert.py
import sys
import numpy as np
from scipy.signal import hilbert
from ptsa.data.timeseries import TimeSeries,Dim
from ptsa.helper import next_pow2

#emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
#ex: set sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
#   See the COPYING file distributed along with the PTSA package for the
#   copyright and license terms.
#
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##



freq_bands = [('delta', [2.0,4.0]),
              ('theta', [4.0,8.0]),
              ('alpha', [9.0,14.0]),

              ('beta', [16.0,26.0]),