def fftgram(self, fftlength, overlap=None, window='<STR_LIT>', **kwargs):
from ..spectrogram import Spectrogram<EOL>try:<EOL><INDENT>from scipy.signal import spectrogram<EOL><DEDENT>except ImportError:<EOL><INDENT>raise ImportError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if isinstance(fftlength, units.Quantity):<EOL><INDENT>fftlength = fftlength.value<EOL><DEDENT>nfft = int((fftlength * self.sample_rate).decompose().value)<EOL>if not overlap:<EOL><INDENT>noverlap = nfft // <NUM_LIT:8><EOL><DEDENT>else:<EOL><INDENT>noverlap = int((overlap * self.sample_rate).decompose().value)<EOL><DEDENT>[frequencies, times, sxx] = spectrogram(self,<EOL>fs=self.sample_rate.value,<EOL>window=window,<EOL>nperseg=nfft,<EOL>noverlap=noverlap,<EOL>mode='<STR_LIT>',<EOL>**kwargs)<EOL>return Spectrogram(sxx.T,<EOL>name=self.name, unit=self.unit,<EOL>xindex=self.t0.value + times,<EOL>yindex=frequencies)<EOL>
Calculate the Fourier-gram of this `TimeSeries`.

        At every ``stride``, a single, complex FFT is calculated.

        Parameters
        ----------
        fftlength : `float`
            number of seconds in single FFT.

        overlap : `float`, optional
            number of seconds of overlap between FFTs, defaults to the
            recommended overlap for the given window (if given), or 0

        window : `str`, `numpy.ndarray`, optional
            window function to apply to timeseries prior to FFT,
            see :func:`scipy.signal.get_window` for details on acceptable


        Returns
        -------
            a Fourier-gram