keras/src/layers/preprocessing/audio_preprocessing.py/MelSpectrogram/_spectrogram
class MelSpectrogram:    def _spectrogram(self, inputs):
        real, imag = self.backend.math.stft(
            inputs,
            sequence_length=self.sequence_length,
            sequence_stride=self.sequence_stride,
            fft_length=self.fft_length,
            window=self.window,
            center=True,
        )
        # abs of complex  = sqrt(real^2 + imag^2)
        spec = self.backend.numpy.sqrt(
            self.backend.numpy.add(
                self.backend.numpy.square(real), self.backend.numpy.square(imag)
            )
        )
        spec = self.backend.numpy.power(spec, self.mag_exp)
        return spec