Skip to content

Commit

Permalink
Fix linear detrend (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
myd7349 committed Sep 23, 2023
1 parent bee49d3 commit 4c21e69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data_handler/data_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ int detrend (double *data, int data_len, int detrend_operation)
if (detrend_operation == (int)DetrendOperations::LINEAR)
{
// use mean and gradient to find a line
double mean_x = data_len / 2.0;
double mean_x = (data_len - 1) / 2.0;
double mean_y = 0;
for (int i = 0; i < data_len; i++)
{
Expand Down

0 comments on commit 4c21e69

Please sign in to comment.