Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python-matplotlib.mlab.specgram中的window_none()_Python_Matplotlib - Fatal编程技术网

Python-matplotlib.mlab.specgram中的window_none()

Python-matplotlib.mlab.specgram中的window_none(),python,matplotlib,Python,Matplotlib,我正在使用函数matplotlib.mlab.specgram . 它的一个参数是window函数,默认参数是hanning窗口 我正在应用函数的信号比信号被分割成的块的大小长,即光谱图的单个切片(我使用NFFT=512) 这里是我的问题和我的问题:我想将window函数从默认值-hanning\u window()-更改为window\u none()。matplotlib.mlab.specgram的一个参数实际上是window以更改窗口函数。但是,如果我只是在specgram函数wind

我正在使用函数
matplotlib.mlab.specgram
. 它的一个参数是window函数,默认参数是hanning窗口

我正在应用函数的信号比信号被分割成的块的大小长,即光谱图的单个切片(我使用NFFT=512)

这里是我的问题和我的问题:我想将window函数从默认值-
hanning\u window()
-更改为
window\u none()
matplotlib.mlab.specgram
的一个参数实际上是
window
以更改窗口函数。但是,如果我只是在specgram函数
window=matplotlib.mlab.window\u none()
的参数之间写入,则会发生错误,因为我没有指定必须应用window函数的数组。鉴于窗口函数必须应用于多个大小为NFFT的数组,而不是单个数组,即信号被分割的长度为NFFT的每个块,我如何指定此参数

从您链接的

matplotlib.mlab.specgram(x,NFFT=256,Fs=2,detrend=,window=,noverlap=128,pad_to=None,sides='default', 按比例缩放(频率=无)

[……]

窗口:可调用或ndarray

因为它要求
window
是可调用的(类似于函数句柄;请参见),所以它想要的是函数,而不是函数的结果。给我

window=matplotlib.mlab.window_none, window=matplotlib.mlab.window_none, 
    <other args here as necessary>)
window=matplotlib.mlab.window\u无,window=matplotlib.mlab.window\u无,
)

它将使用(非)窗口功能

作为旁注,mlab的这一部分刚刚进行了一次大的修改。正如@Bonlenfum所建议的那样,更改默认窗口函数的正确方法只是
window=matplotlib.mlab.window\u none
而不是
window=matplotlib.mlab.window\u none()。谢谢