[chronojump] Testing smoothing the whole signal



commit 86961635c9b07e792e9f0abb2122ed7dc2a89b20
Author: Xavier Padullés <x padulles gmail com>
Date:   Thu Jun 4 12:18:23 2015 +0200

    Testing smoothing the whole signal

 encoder/tests/smooth-2015.R |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/encoder/tests/smooth-2015.R b/encoder/tests/smooth-2015.R
index f272b3c..87b12fe 100644
--- a/encoder/tests/smooth-2015.R
+++ b/encoder/tests/smooth-2015.R
@@ -101,8 +101,12 @@ getSpeedByPosition <- function(position) {
 #Real displacement and the  resulting compressed curve
 displacement = c(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 
0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 
1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 
0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 
1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 
1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 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2 1 0*3 1 0*5 1 0*10"
+signal <- scan(file="chronojump/encoder/tests/signal_inertial.txt", sep=",")
 
 position <- getPositionFromCompressed(curve, 0.7)
 plot(position, type="l")
 speed <- getSpeedByPosition(position)
 plot(speed$y, type="l")
+
+speed.smoothed <- list(s01=smooth.spline(signal,spar=0.1), s02=smooth.spline(signal,spar=0.2), 
s03=smooth.spline(signal,spar=0.3), s04=smooth.spline(signal,spar=0.4), s05=smooth.spline(signal,spar=0.5), 
s06=smooth.spline(signal,spar=0.6), s07=smooth.spline(signal,spar=0.7), s08=smooth.spline(signal,spar=0.8), 
s09=smooth.spline(signal,spar=0.9))
+accel.smoothed <- list(s01 = getAcceleration(speed.smoothed$s01), s02 = getAcceleration(speed.smoothed$s02), 
s03 = getAcceleration(speed.smoothed$s03), s04 = getAcceleration(speed.smoothed$s04), s05 = 
getAcceleration(speed.smoothed$s05), s06 = getAcceleration(speed.smoothed$s06), s07 = 
getAcceleration(speed.smoothed$s07), s08 = getAcceleration(speed.smoothed$s08), s09 = 
getAcceleration(speed.smoothed$s09))


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