def convolve(self, fir, window='<STR_LIT>'):
pad = int(numpy.ceil(fir.size/<NUM_LIT:2>))<EOL>nfft = min(<NUM_LIT:8>*fir.size, self.size)<EOL>in_ = self.copy()<EOL>window = signal.get_window(window, fir.size)<EOL>in_.value[:pad] *= window[:pad]<EOL>in_.value[-pad:] *= window[-pad:]<EOL>if nfft >= self.size/<NUM_LIT:2>:<EOL><INDENT>conv = signal.fftconvolve(in_.value, fir, mode='<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>nstep = nfft - <NUM_LIT:2>*pad<EOL>conv = numpy.zeros(self.size)<EOL>conv[:nfft-pad] = signal.fftconvolve(in_.value[:nfft], fir,<EOL>mode='<STR_LIT>')[:nfft-pad]<EOL>k = nfft - pad<EOL>while k < self.size - nfft + pad:<EOL><INDENT>yk = signal.fftconvolve(in_.value[k-pad:k+nstep+pad], fir,<EOL>mode='<STR_LIT>')<EOL>conv[k:k+yk.size-<NUM_LIT:2>*pad] = yk[pad:-pad]<EOL>k += nstep<EOL><DEDENT>conv[-nfft+pad:] = signal.fftconvolve(in_.value[-nfft:], fir,<EOL>mode='<STR_LIT>')[-nfft+pad:]<EOL><DEDENT>out = type(self)(conv)<EOL>out.__array_finalize__(self)<EOL>return out<EOL>
Convolve this `TimeSeries` with an FIR filter using the
           overlap-save method

        Parameters
        ----------
        fir : `numpy.ndarray`
            the time domain filter to convolve with

        window : `str`, optional
            window function to apply to boundaries, default: ``'hanning'``
            see :func:`scipy.signal.get_window` for details on acceptable
            formats

        Returns
        -------
        out : `TimeSeries`
            the result of the convolution

        See Also
        --------
        scipy.signal.fftconvolve
            for details on the convolution scheme used here
        TimeSeries.filter
            for an alternative method designed for short filters

        Notes
        -----
        The output `TimeSeries` is the same length and has the same timestamps
        as the input.

        Due to filter settle-in, a segment half the length of `fir` will be
        corrupted at the left and right boundaries. To prevent spectral leakage
        these segments will be windowed before convolving.