def _st(x, start_f, windows):
 n_samp = x.shape[(-1)]
 ST = np.empty((x.shape[:(-1)] + (len(windows), n_samp)), dtype=np.complex)
 Fx = fftpack.fft(x)
 XF = np.concatenate([Fx, Fx], axis=(-1))
 for (i_f, window) in enumerate(windows):
  f = (start_f + i_f)
  ST[..., i_f, :] = fftpack.ifft((XF[..., f:(f + n_samp)] * window))
 return ST

def _st ( x , start_f , windows ) : n_samp = x . shape [ ( - 1 ) ] ST = np . empty ( ( x . shape [ : ( - 1 ) ] + ( len ( windows ) , n_samp ) ) , dtype = np . complex ) Fx = fftpack . fft ( x ) XF = np . concatenate ( [ Fx , Fx ] , axis = ( - 1 ) ) for ( i_f , window ) in enumerate ( windows ) : f = ( start_f + i_f ) ST [ ... , i_f , : ] = fftpack . ifft ( ( XF [ ... , f : ( f + n_samp ) ] * window ) ) return ST
implementation based on ali moukadem matlab code .