Skip to content

Commit

Permalink
Fix linear detrend
Browse files Browse the repository at this point in the history
  • Loading branch information
myd7349 authored Sep 23, 2023
1 parent bee49d3 commit 46f08b3
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 46f08b3

Please sign in to comment.