Skip to content

Commit

Permalink
update slope calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
slwatkins authored Nov 8, 2024
1 parent 9c5bdd5 commit 4b9960d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/splendsp/dsp/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ def slope(x, y, removemeans=True):
"""

x_mean = np.mean(x) if removemeans else 0
y_mean = np.mean(y) if removemeans else 0

return np.sum((x - x_mean) * (y - x_mean)) / np.sum((x - x_mean) ** 2)
return np.sum((x - x_mean) * (y - y_mean)) / np.sum((x - x_mean) ** 2)


def lowpassfilter(traces, cut_off_freq=100000, fs=625e3, order=1):
Expand Down

0 comments on commit 4b9960d

Please sign in to comment.