https://github.com/vadim-v-lebedev/audio_style_tranfer/blob/master/audio_style_transfer.ipynb
a = np.zeros_like(a_content[0])
a[:N_CHANNELS,:] = np.exp(t[0]) - 1
# This code is supposed to do phase reconstruction
p = 2 * np.pi * np.random.random_sample(a.shape) - np.pi
for i in range(500):
S = a * np.exp(1j*p)
x = librosa.istft(S)
p = np.angle(librosa.stft(x, N_FFT))
OUTPUT_FILENAME = 'outputs/out.wav'
librosa.output.write_wav(OUTPUT_FILENAME, x, fs)
It works fine. I found out that the neural network works much better if i use the mel spectrogram instead of the spectrogram. Unfortunately I don't know how i can convert the mel spectrogram to audio or maybe to convert it to a spectrogram (and then i just can use the code above).
I checked the librosa code and I saw that me mel-sprectrogram is just computed by a (non-square) matrix multiplication which cannot be inverted (probably).
But is there a trick to reconstruct / approximate the initial spectrogram from the mel spectrogram?
Thank you very much
--
You received this message because you are subscribed to the Google Groups "librosa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to librosa+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/librosa/2a4572fe-1f7f-4bbc-be9d-dda43c848141%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/librosa/1f48bb6c-e5c4-448f-9eab-334bcdb8abfa%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to lib...@googlegroups.com.