p1: add exm stuff

This commit is contained in:
leo 2023-03-15 20:13:09 +01:00
parent 880744f280
commit 2527b7b6ef
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -172,6 +172,10 @@ def plot_mutual_correlation(d1: pd.DataFrame, d2: pd.DataFrame, fname: str = 'xy
def plot_autocorrelation(dat: pd.DataFrame, fname: str = 'x', colour: str = '#1f77b4'): def plot_autocorrelation(dat: pd.DataFrame, fname: str = 'x', colour: str = '#1f77b4'):
d = auto_correlation(dat.tolist()) d = auto_correlation(dat.tolist())
# exm. TODO: check against matlab.
# z = pd.Series([.4, .5, .23, 2.5, -3.6, .4, -0.12, 2.2, 0.02, 14.4])
# a = auto_correlation(z.tolist())
# print(a)
pyplt.plot(range(0, len(d)), d, color=colour) pyplt.plot(range(0, len(d)), d, color=colour)
pyplt.title('Autocorrelation of ' + fname + ' (R' + fname + fname + ')') pyplt.title('Autocorrelation of ' + fname + ' (R' + fname + fname + ')')
pyplt.xlabel('shift') pyplt.xlabel('shift')