Skip to content
Snippets Groups Projects
Commit f5fe7c04 authored by Jade PHAM's avatar Jade PHAM
Browse files

TANGODEVIC-2159 - correction of RMS

parent 1a44c7b9
Branches
Tags
No related merge requests found
......@@ -9,7 +9,7 @@
<groupId>fr.soleil.device</groupId>
<artifactId>BPMLibera-${aol}-${mode}</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<packaging>nar</packaging>
<name>BPMLibera</name> <!-- use for the name of executable -->
......
......@@ -445,8 +445,8 @@ void SAHistory::compute_statistics (size_t _n)
//TODO: THIS IS PARTIAL OPTIMIZATION - TO BE IMPROVED IN A NEAR FUTURE
//---------------------------------------------------------------------
i64 x_rms_pow2 = (xx_sum - ((i64)x_mean * x_mean)) / (((i64)sample_counter - 1) * kINV_NM_TO_MICRON_POW2);
i64 z_rms_pow2 = (zz_sum - ((i64)z_mean * z_mean)) / (((i64)sample_counter - 1) * kINV_NM_TO_MICRON_POW2);
i64 x_rms_pow2 = kINV_NM_TO_MICRON_POW2*(xx_sum/ ((i64)sample_counter ) - (i64)x_mean * x_mean);
i64 z_rms_pow2 = kINV_NM_TO_MICRON_POW2*(zz_sum/ ((i64)sample_counter ) - (i64)z_mean * z_mean);
this->x_rms_ = static_cast<bpm::FPDataType>(::sqrt((double)x_rms_pow2));
this->z_rms_ = static_cast<bpm::FPDataType>(::sqrt((double)z_rms_pow2));
......@@ -542,14 +542,12 @@ void SAHistory::compute_statistics (size_t _n)
: 0;
this->x_rms_ =
::sqrt(kMM_TO_MICRON_POW2
* (1. / (static_cast<bpm::FPDataType>(sample_counter) - 1.))
* (xx_sum - (this->x_mean_ * this->x_mean_)));
::sqrt(kMM_TO_MICRON_POW2 *
(xx_sum/ (static_cast<bpm::FPDataType>(sample_counter) ) - (x_mean_ * x_mean_)));
this->z_rms_ =
::sqrt(kMM_TO_MICRON_POW2
* (1. / (static_cast<bpm::FPDataType>(sample_counter) - 1.))
* (zz_sum - (this->z_mean_ * this->z_mean_)));
::sqrt(kMM_TO_MICRON_POW2 *
(zz_sum / (static_cast<bpm::FPDataType>(sample_counter)) - (z_mean_ * z_mean_)));
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment