def stftSynth(mY, pY, M, H):
 hM1 = int(math.floor(((M + 1) / 2)))
 hM2 = int(math.floor((M / 2)))
 nFrames = mY[:, 0].size
 y = np.zeros((((nFrames * H) + hM1) + hM2))
 pin = hM1
 for i in range(nFrames):
  y1 = DFT.dftSynth(mY[i, :], pY[i, :], M)
  y[(pin - hM1):(pin + hM2)] += (H * y1)
  pin += H
 y = np.delete(y, range(hM2))
 y = np.delete(y, range((y.size - hM1), y.size))
 return y

def stftSynth ( mY , pY , M , H ) : hM1 = int ( math . floor ( ( ( M + 1 ) / 2 ) ) ) hM2 = int ( math . floor ( ( M / 2 ) ) ) nFrames = mY [ : , 0 ] . size y = np . zeros ( ( ( ( nFrames * H ) + hM1 ) + hM2 ) ) pin = hM1 for i in range ( nFrames ) : y1 = DFT . dftSynth ( mY [ i , : ] , pY [ i , : ] , M ) y [ ( pin - hM1 ) : ( pin + hM2 ) ] += ( H * y1 ) pin += H y = np . delete ( y , range ( hM2 ) ) y = np . delete ( y , range ( ( y . size - hM1 ) , y . size ) ) return y
synthesis of a sound using the short-time fourier transform my: magnitude spectra .