Mercurial > hg > fxanalyse
changeset 67:0159abc1a9d8
Fix slope measurement
For the update algorithm to work correclty the slope measurement must be
updated before the mean measurement. Other code is affected by the same issue.
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Mon, 29 Oct 2012 14:48:08 +0100 |
parents | aa125ad6e842 |
children | 64a7a1d3d75c |
files | FXAnalyse.c |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/FXAnalyse.c Mon Oct 29 14:48:01 2012 +0100 +++ b/FXAnalyse.c Mon Oct 29 14:48:08 2012 +0100 @@ -1256,8 +1256,8 @@ // update slope measurement Nsamples = Nsamples + 1; + measuredSlope = (measuredSlope * (Nsamples - 2) + 6 * (currentFreq - meanFreq) / Nsamples) / (Nsamples + 1); meanFreq = ((Nsamples - 1) * meanFreq + currentFreq) / Nsamples; - measuredSlope = (measuredSlope * (Nsamples - 2) + 6 * (currentFreq - meanFreq) / Nsamples) / (Nsamples + 1); previousFreq = currentFreq; // update indicator SetCtrlVal(MainPanel, PANEL_SLOPE_MEASURED, measuredSlope);