2016-08-03 68 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