I am gonna apply Short Time Fourier Transform on this signal and plot the results using pcolormesh function. Then, I want to use Inverse Short Time Fourier Transform to reconstruct the signal. My question is how to use the output of the pcolormesh as input for signal.istft(Zxx) to get the signal back. In short this is what I want to do:
f, t, Zxx = signal.stft(sig, fs=250, nperseg=64)
mesh=plt.pcolormesh(t, f, np.abs(Zxx))
plt.axis('off')
plt.show()
which outputs this image. Then, apply the inverse Fourier Transform to reconstruct the signal:
_, xrec = signal.istft(mesh, fs=250)
Actually, I am not sure if the mesh input for the above function is the right way to do or not? And how I can get the correct input for the signal.istft(Zxx) instead of Zxx?
Thanks for your help.