Tensorflow is not reconstructing the original signal when applying the STFT followed by the inverse STFT when using no window. The problems arise when the frames of the STFT overlap: It seems like every frame contributes with a weight of 1 regardless of the number of overlapping frames N = frame_size / frame_step. As a result, the central part of the signal is N times larger than the original. Here is a minimal code to reproduce the error:
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
size = 2048
frame_length = 512
frame_step = 128
waveform = np.sin(np.arange(size) * 1 / 100)
stft = tf.signal.stft(waveform, frame_length, frame_step, window_fn=None)
inverse_stft = tf.signal.inverse_stft(stft, frame_length, frame_step, window_fn=None)
plt.plot(waveform)
plt.plot(inverse_stft)
plt.show()
plt.clf()
Broken stft --> istft applied to sinusoidal signal:

Notice that I'm using no window. If I put the Hann window, the central part works well but the borders are smoothly going to zero, a related but surprisingly different bug that is already documented here: #36616. The implementation of scipy works well under all circumstances.
I'm using Tensorflow 2.6.0 installed with tensorflow-macos on an Apple M1 MacBookPro.
Tensorflow is not reconstructing the original signal when applying the STFT followed by the inverse STFT when using no window. The problems arise when the frames of the STFT overlap: It seems like every frame contributes with a weight of 1 regardless of the number of overlapping frames
N = frame_size / frame_step. As a result, the central part of the signal isNtimes larger than the original. Here is a minimal code to reproduce the error:Broken stft --> istft applied to sinusoidal signal:

Notice that I'm using no window. If I put the Hann window, the central part works well but the borders are smoothly going to zero, a related but surprisingly different bug that is already documented here: #36616. The implementation of scipy works well under all circumstances.
I'm using Tensorflow 2.6.0 installed with tensorflow-macos on an Apple M1 MacBookPro.