def thetaModIdx(self, x1):
    '\n        Calculates a theta modulation index of a spike train based on the cells\n        autocorrelogram\n\n        Parameters\n        ----------\n        x1: np.array\n            The spike time-series\n        Returns\n        -------\n        thetaMod: float\n            The difference of the values at the first peak and trough of the\n            autocorrelogram\n        '
    y = self.xcorr(x1)
    (corr, _) = np.histogram(y[(y != 0)], bins=201, range=np.array([(- 500), 500]))
    from scipy.signal import periodogram
    (freqs, power) = periodogram(corr, fs=200, return_onesided=True)
    b = signal.boxcar(3)
    h = signal.filtfilt(b, 3, power)
    sqd_amp = (h ** 2)
    theta_band_max_idx = np.nonzero((sqd_amp == np.max(sqd_amp[np.logical_and((freqs > 6), (freqs < 11))])))[0][0]
    mtbp = np.mean(sqd_amp[(theta_band_max_idx - 1):(theta_band_max_idx + 1)])
    other_band_idx = np.logical_and((freqs > 2), (freqs < 50))
    mobp = np.mean(sqd_amp[other_band_idx])
    return ((mtbp - mobp) / (mtbp + mobp))
Calculates a theta modulation index of a spike train based on the cells
autocorrelogram

Parameters
----------
x1: np.array
    The spike time-series
Returns
-------
thetaMod: float
    The difference of the values at the first peak and trough of the
    autocorrelogram
def thetaModIdx(self, x1):
    '\n        Calculates a theta modulation index of a spike train based on the cells\n        autocorrelogram\n\n        Parameters\n        ----------\n        x1: np.array\n            The spike time-series\n        Returns\n        -------\n        thetaMod: float\n            The difference of the values at the first peak and trough of the\n            autocorrelogram\n        '
    y = self.xcorr(x1)
    (corr, _) = np.histogram(y[(y != 0)], bins=201, range=np.array([(- 500), 500]))
    from scipy.signal import periodogram
    (freqs, power) = periodogram(corr, fs=200, return_onesided=True)
    b = signal.boxcar(3)
    h = signal.filtfilt(b, 3, power)
    sqd_amp = (h ** 2)
    theta_band_max_idx = np.nonzero((sqd_amp == np.max(sqd_amp[np.logical_and((freqs > 6), (freqs < 11))])))[0][0]
    mtbp = np.mean(sqd_amp[(theta_band_max_idx - 1):(theta_band_max_idx + 1)])
    other_band_idx = np.logical_and((freqs > 2), (freqs < 50))
    mobp = np.mean(sqd_amp[other_band_idx])
    return ((mtbp - mobp) / (mtbp + mobp))