def transform(self, X):
        """Return the selected Fourier coefficients for each sample.

        Parameters
        ----------
        X : array-like, shape (n_samples, n_timestamps)
            Input data.

        Returns
        -------
        X_new : array, shape (n_samples, n_coefs)
            The selected Fourier coefficients for each sample.

        """
        check_is_fitted(self, 'support_')
        X = check_array(X, dtype='float64')
        n_samples, n_timestamps = X.shape

        ss = StandardScaler(self.norm_mean, self.norm_std)
        X = ss.fit_transform(X)
        X_fft = np.fft.rfft(X)
        X_fft = np.vstack([np.real(X_fft), np.imag(X_fft)])
        if n_timestamps % 2 == 0:
            X_fft = X_fft.reshape(n_samples, n_timestamps + 2, order='F')
            X_fft = np.c_[X_fft[:, 0], X_fft[:, 2:-1]]
        else:
            X_fft = X_fft.reshape(n_samples, n_timestamps + 1, order='F')
            X_fft = np.c_[X_fft[:, 0], X_fft[:, 2:]]
        if self.drop_sum:
            X_fft = X_fft[:, 1:]
        return X_fft[:, self.support_]
Return the selected Fourier coefficients for each sample.

        Parameters
        ----------
        X : array-like, shape (n_samples, n_timestamps)
            Input data.

        Returns
        -------
        X_new : array, shape (n_samples, n_coefs)
            The selected Fourier coefficients for each sample.

        
pyts/approximation/dft.py