src/transformers/models/speecht5/feature_extraction_speecht5.py/SpeechT5FeatureExtractor/_dft
class SpeechT5FeatureExtractor:    def _dft(frames, K, n_frames, n_samples, n_fft):
        dft = np.zeros([n_frames, K])

        for frame in range(n_frames):
            begin = frame * n_samples

            inwards_buffer = frames[begin : begin + n_samples]
            inwards_buffer = np.pad(inwards_buffer, (0, n_fft - n_samples), "constant")
            out = np.fft.rfft(inwards_buffer)

            dft[frame] = np.abs(out[:K])

        return dft