[chronojump] Experimental code for util.R



commit cf60da1aca533d37385ae99692c735e2f5437e82
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Apr 8 09:19:20 2015 +0200

    Experimental code for util.R

 encoder/util.R |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/encoder/util.R b/encoder/util.R
index 44c3eac..1fcf0e8 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -208,6 +208,13 @@ getSpeed <- function(displacement, smoothing) {
 
        return (smooth.spline( 1:length(displacement), displacement, spar=smoothing))
 }
+#experimental. unused
+getSpeedByPosition <- function(displacement, smoothing) {
+       position <- cumsum(displacement)
+       speed <- smooth.spline( 1:length(position), position, spar=smoothing)
+       speed$y <- diff(speed$y)
+       return(speed)
+}
 
 getAcceleration <- function(speed) {
        #no change affected by encoderConfiguration


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]