//-- Calculate the instantaneous frequency
// phase of differential spectrum
d_frame = fft.fft(fft.fftshift(d_window * y[sample:(sample + n_fft)])).conj()
t = d_frame - 1.j * freq_angular * frame
After Change
//-- Calculate the instantaneous frequency
// phase of differential spectrum
d_frame = fft.fft(fft.fftshift(d_window * y[sample:(sample + n_fft)]))
t = freq_angular + (d_frame * frame).imag / power
if_gram[:, i] = t[:if_gram.shape[0]] * sr / (2 * np.pi)
// Compensate for windowing effects, store STFT
// sum(window) takes out integration due to window, 2 compensates for negative