Python中的可逆STFT和ISTFT [英] Invertible STFT and ISTFT in Python

查看:169
本文介绍了Python中的可逆STFT和ISTFT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

短时傅立叶变换是否具有任何通用形式?转换为SciPy或NumPy或其他内容?

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

matplotlib中有pyplot specgram函数,该函数调用ax.specgram(),该函数调用mlab.specgram(),该函数调用

There's the pyplot specgram function in matplotlib, which calls ax.specgram(), which calls mlab.specgram(), which calls _spectral_helper():

#The checks for if y is x are so that we can use the same function to
#implement the core of psd(), csd(), and spectrogram() without doing
#extra calculations.  We return the unaveraged Pxy, freqs, and t.

但是

这是一个辅助功能,可实现 204#psd,csd和频谱图.它是 NOT 打算在mlab之外使用

This is a helper function that implements the commonality between the 204 #psd, csd, and spectrogram. It is NOT meant to be used outside of mlab

我不确定这是否可以用于STFT和ISTFT.还有什么,还是我应该翻译类似这些MATLAB函数的内容?

I'm not sure if this can be used to do an STFT and ISTFT, though. Is there anything else, or should I translate something like these MATLAB functions?

我知道如何编写自己的即席实现;我只是在寻找功能齐全的东西,它可以处理不同的开窗功能(但默认设置是健全的),并且可以通过COLA窗口(istft(stft(x))==x)完全反转,并经过多人测试,没有错位的错误,很好地处理了端点和零填充,实现了针对实际输入的快速RFFT实现,等等.

I know how to write my own ad-hoc implementation; I'm just looking for something full-featured, which can handle different windowing functions (but has a sane default), is fully invertible with COLA windows (istft(stft(x))==x), tested by multiple people, no off-by-one errors, handles the ends and zero padding well, fast RFFT implementation for real input, etc.

推荐答案

我有点迟了,但是意识到scipy已内置

I'm a little late to this, but realised scipy has inbuilt istft function as of 0.19.0

这篇关于Python中的可逆STFT和ISTFT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆