在numpy.correlate中指定滞后 [英] Specify lag in numpy.correlate
问题描述
Matlab的互相关函数xcorr(x,y,maxlags)
具有选项maxlag
,该选项返回滞后范围[-maxlags:maxlags]
上的互相关序列. Numpy的numpy.correlate(N,M,mode)
具有三种模式,但是它们都不允许我设置特定的滞后,这与完全(N+M-1)
,相同的(max(M, N))
或有效的(max(M, N) - min(M, N) + 1 )
不同.对于len(N) = 60000
,len (M) = 200
,我想将滞后时间设置为100.
Matlab's cross-correlation function xcorr(x,y,maxlags)
has an option maxlag
, which returns the cross-correlation sequence over the lag range [-maxlags:maxlags]
. Numpy's numpy.correlate(N,M,mode)
has three modes, but none of them allow me to set a specific lag, which is different from full (N+M-1)
, same (max(M, N))
or valid (max(M, N) - min(M, N) + 1 )
. For len(N) = 60000
, len (M) = 200
, I want to set the lag as 100.
推荐答案
我建议您查看此处.
I would recommend looking at this file to determine how you would want to implement the correlation described here.
这篇关于在numpy.correlate中指定滞后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!