2016-08-03 89 views
1

在MATLAB中有一个函数mscohere我需要在Python中实现它。 的MATLAB代码如下:Python中是否有MATLAB函数`mscohere`的模拟器?

[Cxy,~] = mscohere(LS,RS); 

LS,RS - 阵列型浮动。

做模块来计算一致性吗?或者任何人都可以预期它在Python?

Documentation mscohere in MATLAB

+1

也许[此](http://stackoverflow.com/问题/ 31829604/why-is-cohere-function-in-matplotlib-python-give-answer-different-from-mscoher)可能是一个很好的起点。 – Abdou

回答

2

是的,它具有一个在SciPy的模块中:

scipy.signal.coherence(x, y, fs=1.0, window='hann', nperseg=256, noverlap=None, nfft=None, detrend='constant', axis=-1) 

结合实例详细文档可以发现here

+0

但我使用'matplotlib.mlab.cohere(x,y,NFFT = 256,Fs = 1)'http://matplotlib.org/api/mlab_api.html#matplotlib.mlab.cohere – EmptyMan

+0

尽管响应也是工作版本,然后我返回:) – EmptyMan