diff options
author | Luca <deri@ntop.org> | 2021-03-11 09:39:52 +0100 |
---|---|---|
committer | Luca <deri@ntop.org> | 2021-03-11 09:39:52 +0100 |
commit | 192fad440269046a8d60a07dd398f288061f47a8 (patch) | |
tree | 54b1336d03fdb7d58805ee3d7bf1addd0e734bd3 /src/include | |
parent | 6833ee2bbec4c2de2489a2091f6c2d1ce0b7b558 (diff) |
Added double exponential smoothing implementation
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ndpi_api.h.in | 5 | ||||
-rw-r--r-- | src/include/ndpi_typedefs.h | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/include/ndpi_api.h.in b/src/include/ndpi_api.h.in index cb5e45931..118240916 100644 --- a/src/include/ndpi_api.h.in +++ b/src/include/ndpi_api.h.in @@ -1479,6 +1479,11 @@ extern "C" { /* ******************************* */ + int ndpi_des_init(struct ndpi_des_struct *des, double alpha, double beta, float significance); + int ndpi_des_add_value(struct ndpi_des_struct *des, const u_int32_t _value, double *forecast, double *confidence_band); + + /* ******************************* */ + int ndpi_jitter_init(struct ndpi_jitter_struct *hw, u_int16_t num_periods); void ndpi_jitter_free(struct ndpi_jitter_struct *hw); float ndpi_jitter_add_value(struct ndpi_jitter_struct *s, const float value); diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index de9a404c8..aac7b56db 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -1672,6 +1672,15 @@ struct ndpi_ses_struct { double sum_square_error, last_forecast, last_value; }; +struct ndpi_des_struct { + struct { + double alpha, beta, ro; + } params; + + u_int32_t num_values; + double sum_square_error, last_forecast, last_trend, last_value; +}; + /* **************************************** */ /* Prototype used to define custom DGA detection function */ |