问题描述
短时傅立叶变换是否具有任何通用形式?转换为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()
,该函数调用 _spectral_helper()
:
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.
但是
我不确定这是否可以用于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已内置 istft 功能,自0.19.0起
I'm a little late to this, but realised scipy has inbuilt istft function as of 0.19.0
这篇关于Python中的可逆STFT和ISTFT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!