Invertible STFT and ISTFT in Python

后端 未结 10 2027
自闭症患者
自闭症患者 2020-12-02 07:57

Is there any general-purpose form of short-time Fourier transform with corresponding inverse transform built into SciPy or NumPy or whatever?

There\'s the pyplot

10条回答
  •  爱一瞬间的悲伤
    2020-12-02 08:32

    I also found this on GitHub, but it seems to operate on pipelines instead of normal arrays:

    http://github.com/ronw/frontend/blob/master/basic.py#LID281

    def STFT(nfft, nwin=None, nhop=None, winfun=np.hanning):
        ...
        return dataprocessor.Pipeline(Framer(nwin, nhop), Window(winfun),
                                      RFFT(nfft))
    
    
    def ISTFT(nfft, nwin=None, nhop=None, winfun=np.hanning):
        ...
        return dataprocessor.Pipeline(IRFFT(nfft), Window(winfun),
                                      OverlapAdd(nwin, nhop))
    

提交回复
热议问题