def stft(self, sample):
        """
        Short-time Fourier transform.
        For more details, see `torch.stft`.

        The size of the Fourier transform is obtained by `n_fft`, and the distance
        between neighboring sliding window frames `hop_length` defined in
        the __init__ functions.

        Parameters
        ----------
        sample: Tensor
            channel representation with size (batch_size, n_times)
        Returns
        -------
        spectral: Tensor
            Absolute value of the Fourier transform with size
            (batch_size, n_fft // 2 + 1, n_times // hop_length + 1)
        """
        spectral = torch.stft(
            input=sample.squeeze(1),
            n_fft=int(self.n_fft),
            hop_length=self.hop_length,
            center=False,
            onesided=True,
            return_complex=True,
        )
        return torch.abs(spectral)

        Short-time Fourier transform.
        For more details, see `torch.stft`.

        The size of the Fourier transform is obtained by `n_fft`, and the distance
        between neighboring sliding window frames `hop_length` defined in
        the __init__ functions.

        Parameters
        ----------
        sample: Tensor
            channel representation with size (batch_size, n_times)
        Returns
        -------
        spectral: Tensor
            Absolute value of the Fourier transform with size
            (batch_size, n_fft // 2 + 1, n_times // hop_length + 1)
        
braindecode/models/biot.py