'Decimate the epochs.
.. note:: No filtering is performed. To avoid aliasing, ensure
your data are properly lowpassed.
Parameters
decim : int
The amount to decimate data.
offset : int
Apply an offset to where the decimation starts relative to the
sample corresponding to t=0. The offset is in samples at the
current sampling rate.
.. versionadded:: 0.12
verbose : bool, str, int, or None
If not None, override default verbose level (see
:func:`mne.verbose` and :ref:`Logging documentation <tut_logging>`
for more).
Returns
epochs : instance of Epochs
The decimated Epochs object.
See Also
mne.Evoked.decimate
mne.Epochs.resample
mne.io.Raw.resample
Notes
Decimation can be done multiple times. For example,
``epochs.decimate(2).decimate(2)`` will be the same as
``epochs.decimate(4)``.
.. versionadded:: 0.10.0'

@verbose
def decimate(self, decim, offset=0, verbose=None):

    (decim, offset, new_sfreq) = _check_decim(self.info, decim, offset)
    start_idx = int(round(((- self._raw_times[0]) * (self.info['sfreq'] * self._decim))))
    self._decim *= decim
    i_start = ((start_idx % self._decim) + offset)
    decim_slice = slice(i_start, None, self._decim)
    self.info['sfreq'] = new_sfreq
    if self.preload:
        self._data = self._data[:, :, decim_slice].copy()
        self._raw_times = self._raw_times[decim_slice].copy()
        self._decim_slice = slice(None)
        self._decim = 1
        self.times = self._raw_times
    else:
        self._decim_slice = decim_slice
        self.times = self._raw_times[self._decim_slice]
    return self
