Python 中是否有 MATLAB 函数“mscohere”的类似物?

Emp*_*Man 3 python matlab

MATLAB中有一个函数mscohereme,它需要在Python中实现。MATLAB代码如下:

[Cxy,~] = mscohere(LS,RS);
Run Code Online (Sandbox Code Playgroud)

LS,RS - 浮点型数组。

难道模块的计算要一致吗?或者有人能预料到 Python 会出现这种情况吗?

mscohereMATLAB 中的文档

Gau*_*ama 5

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

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

带有示例的详细文档可以在这里找到