Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

xcorr_python

Cross-correlation coefficients in Python

Returns coefficients (or inner product) and lags

This might save someone a bit of time, I could not find a standard xcorr function (like MATLAB's) in Python, which returns the coefficients of a cross correlation of two signals (instead of the inner product).

This code is adapted from matplotlib's xcorr function, I just separated the normalization from the plotting behavior.

Calls numpy.correlate(x,y, mode='full')

This is the necessary transformation function (inner product -> coeffs.)

n = np.sqrt(np.dot(x, x) * np.dot(y, y))

coeffs = np.true_divide(innerproduct,n)

About

Cross-correlation coefficients in Python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages