def fft(self, nfft=None):
from ..frequencyseries import FrequencySeries<EOL>if nfft is None:<EOL><INDENT>nfft = self.size<EOL><DEDENT>dft = npfft.rfft(self.value, n=nfft) / nfft<EOL>dft[<NUM_LIT:1>:] *= <NUM_LIT><EOL>new = FrequencySeries(dft, epoch=self.epoch, unit=self.unit,<EOL>name=self.name, channel=self.channel)<EOL>try:<EOL><INDENT>new.frequencies = npfft.rfftfreq(nfft, d=self.dx.value)<EOL><DEDENT>except AttributeError:<EOL><INDENT>new.frequencies = numpy.arange(new.size) / (nfft * self.dx.value)<EOL><DEDENT>return new<EOL>
Compute the one-dimensional discrete Fourier transform of
        this `TimeSeries`.

        Parameters
        ----------
        nfft : `int`, optional
            length of the desired Fourier transform, input will be
            cropped or padded to match the desired length.
            If nfft is not given, the length of the `TimeSeries`
            will be used

        Returns
        -------
        out : `~gwpy.frequencyseries.FrequencySeries`
            the normalised, complex-valued FFT `FrequencySeries`.

        See Also
        --------
        :mod:`scipy.fftpack` for the definition of the DFT and conventions
        used.

        Notes
        -----
        This method, in constrast to the :func:`numpy.fft.rfft` method
        it calls, applies the necessary normalisation such that the
        amplitude of the output `~gwpy.frequencyseries.FrequencySeries` is
        correct.