code: def to_frequencyseries(self, delta_f=None):
          
          from pycbc.fft import fft
          if not delta_f:
              delta_f = 1.0 / self.duration
  
          # add 0.5 to round integer
          tlen  = int(1.0 / delta_f / self.delta_t + 0.5)
          flen = int(tlen / 2 + 1)
  
          if tlen < len(self):
              raise ValueError("The value of delta_f (%s) would be "
                               "undersampled. Maximum delta_f "
                               "is %s." % (delta_f, 1.0 / self.duration))
          if not delta_f:
              tmp = self
          else:
              tmp = TimeSeries(zeros(tlen, dtype=self.dtype),
                               delta_t=self.delta_t, epoch=self.start_time)
              tmp[:len(self)] = self[:]
  
          f = FrequencySeries(zeros(flen,
                             dtype=complex_same_precision_as(self)),
                             delta_f=delta_f)
          fft(tmp, f)
          return f
docs: Return the Fourier transform of this time series
  
          Parameters
          ----------
          delta_f : {None, float}, optional
              The frequency resolution of the returned frequency series. By
          default the resolution is determined by the duration of the timeseries.
  
          Returns
          -------
          FrequencySeries:
              The fourier transform of this time series.