[chronojump] Testing the smoothing in the whole inertial signal
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Testing the smoothing in the whole inertial signal
- Date: Thu, 4 Jun 2015 16:24:24 +0000 (UTC)
commit 42860cccd9508ca455f29bfadcedd28350ec602e
Author: Xavier Padullés <x padulles gmail com>
Date: Thu Jun 4 13:26:55 2015 +0200
Testing the smoothing in the whole inertial signal
encoder/tests/smooth-2015.R | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/encoder/tests/smooth-2015.R b/encoder/tests/smooth-2015.R
index 87b12fe..2d1012e 100644
--- a/encoder/tests/smooth-2015.R
+++ b/encoder/tests/smooth-2015.R
@@ -101,12 +101,14 @@ 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,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 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0*2 1 0 1 0*2 1 0*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")
+#Testing the smoothing in the whole signal
+signal <- scan(file="chronojump/encoder/tests/signal_inertial.txt", sep=",")
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))
+accel.mean <- c(sum(abs(accel.smoothed$s01$y)), sum(abs(accel.smoothed$s02$y)),
sum(abs(accel.smoothed$s03$y)), sum(abs(accel.smoothed$s04$y)), sum(abs(accel.smoothed$s05$y)),
sum(abs(accel.smoothed$s06$y)), sum(abs(accel.smoothed$s07$y)), sum(abs(accel.smoothed$s08$y)),
sum(abs(accel.smoothed$s09$y)))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]