[chronojump] Uploaded R functions to calculate repetitions and dynamics of force sensor



commit b135144d562aeafbf8aca2cb87310c39e2a52d05
Author: Xavier Padullés <x padulles gmail com>
Date:   Wed Oct 9 17:50:22 2019 +0200

    Uploaded R functions to calculate repetitions and dynamics of force sensor

 r-scripts/forcePosition.R             | 203 ++++++++
 r-scripts/tests/Rubber-Band-clean.csv | 750 +++++++++++++++++++++++++++++
 r-scripts/tests/Rubber-Band-noisy.csv | 872 ++++++++++++++++++++++++++++++++++
 3 files changed, 1825 insertions(+)
---
diff --git a/r-scripts/forcePosition.R b/r-scripts/forcePosition.R
new file mode 100644
index 00000000..e4a9ebfc
--- /dev/null
+++ b/r-scripts/forcePosition.R
@@ -0,0 +1,203 @@
+#F = sqrt( (cos(angle) * (ForceSensor + Mass * accel))^2 +                   #Horizontal component
+#          (sin(angle) * (ForceSensor + Mass * accel) + Mass * 9.81)^2)      #Vertical component
+
+getDynamicsFromForceSensor <- function(file = 
"/home/xpadulles/.local/share/Chronojump/forceSensor/83/1_Xavier Padullés_2019-10-01_13-03-41.csv",
+                                       totalMass = 75,
+                                       angle = 0,
+                                       smooth = 5,
+                                       minDisplacement = 0.1
+)
+{
+        forceSensor = read.csv(file, sep =";", dec = ",", header = TRUE)
+        colnames(forceSensor) = c("time", "rawForce")
+        forceSensor$time = forceSensor$time / 1E6                               #Converting microseconds to 
seconds
+        
+        position = forceSensor$rawForce/71.97                                   #71.93 N/m measured in the 
black rubber
+        position2 = filter(position, rep(1/smooth, smooth, sides = 2))          #Moving average
+        
+        speed = NA
+        for(i in 2:(length(forceSensor$time) -1)){
+                speed = c(speed, (position2[i + 1] - position2[i - 1]) / (forceSensor$time[i+1] - 
forceSensor$time[i -1]) )
+        }
+        
+        speed = c(speed, speed[length(speed)])
+        speed2 = filter(speed, rep(1/smooth, smooth, sides = 2))
+        
+        
+        accel = NA
+        for(i in 2:(length(forceSensor$time) -1)){
+                accel = c(accel, (speed2[i + 1] - speed2[i - 1]) / (forceSensor$time[i+1] - 
forceSensor$time[i -1]) )
+        }
+        
+        accel = c(accel, accel[length(accel)])
+        accel2 = filter(accel, rep(1/smooth, smooth, sides = 2))
+        
+        resultantForce = sqrt( (cos(angle*pi/180) * (forceSensor$rawForce + totalMass * accel2))^2 +         
          #Horizontal component
+                                       (sin(angle*pi/180) * (forceSensor$rawForce + totalMass * accel2) + 
totalMass * 9.81)^2)      #Vertical component
+        power = speed2 * (forceSensor$rawForce + totalMass * accel2) +               #Power associated to 
the acceleration of the mass
+                speed2 * (sin(angle*pi/180) * totalMass * 9.81)                    #Power associated to the 
gravitatory field
+        
+        dynamics = matrix(c(forceSensor$time, forceSensor$rawForce, position, position2, speed, speed2, 
accel, accel2, resultantForce, power), ncol = 10)
+        colnames(dynamics) = c("time", "rawForce", "position", "position2", "speed", "speed2", "accel", 
"accel2", "resultantForce", "power")
+        
+        #Trimming rows with NA
+        dynamics = dynamics[(which(!is.na(dynamics[,"accel2"]))), ]
+        
+        # par(mfrow = c(1,1))
+        # # 
+        # #par(new = TRUE)
+        # plot(forceSensor$time, speed, type = "l", col = "green", axes = F, xlab ="", ylab = "") 
+        # #axis(side = 4, col = "green")
+        # lines(forceSensor$time, speed2, col = "green2")
+        # 
+        # 
+        # par(new = TRUE)
+        # plot(accel, type = "l", col = "pink", main = "", xlab = "", ylab = "", axes = F)
+        # lines(accel2, col = "magenta")
+        # par(new = T)
+        # 
+        # plot(forceSensor$time, forceSensor$rawForce, col = "grey", type = "l"
+        #      #,ylim =c(min(c(na.omit(forceSensor$rawForce), na.omit(resultantForce))), 
max(c(na.omit(forceSensor$rawForce), na.omit(resultantForce))))
+        #      #,axes = F
+        #      , ylab = "", xlab = ""
+        #      ,xlim = c(0, 8)
+        #      )
+        # lines(forceSensor$time, resultantForce, col = "blue")
+        # par(new = T)
+        # 
+        # plot(forceSensor$time, power, col = "red", type = "l",
+        #      axes = F, ylab = "", xlab = "")
+        # #axis(side = 4)
+        # par(new = T)
+        
+        repetitions = getRepetitions(dynamics[, "time"], dynamics[, "position"], dynamics[, "rawForce"], 
minDisplacement)
+        
+        plot(dynamics[, "time"]
+             ,dynamics[, "position"]
+             , type = "l", xlab = "Time", ylab = "Position"
+             #,xlim = c(0, 8)
+             #, ylim = c(0,0.04)
+             #, axes = F
+             )
+        #plot(position2, type = "l")
+        # lines(dynamics[, "time"], dynamics[, "position2"], col = "grey")
+        
+        # print(extremesSamples)
+        points(dynamics[repetitions$extremesSamples, "time"],
+               #extremesSamples,
+               dynamics[repetitions$extremesSamples,"position"])
+        text(dynamics[repetitions$extremesSamples, "time"], 
dynamics[repetitions$extremesSamples,"position"], pos =4
+             , paste("(", round(dynamics[repetitions$extremesSamples, "time"], digits = 2), ", ", 
round(dynamics[repetitions$extremesSamples,"position"], digits = 2), ")", sep="")
+        )
+        
+        return(list(
+                time=dynamics[,"time"],
+                rawForce=dynamics[,"rawForce"],
+                position=dynamics[,"position"],
+                position2=dynamics[,"position2"],
+                speed=dynamics[,"speed"],
+                speed2=dynamics[,"speed2"],
+                accel=dynamics[,"accel"],
+                accel2=dynamics[,"accel2"],
+                resultantForce=dynamics[,"resultantForce"],
+                power=dynamics[,"power"],
+                # minSamples = extremes$minSamples,
+                # maxSamples = extremes$maxSamples,
+                extremesSamples = repetitions$extremesSamples
+                ,RFDs = repetitions$RFDs
+                ,meanSpeeds = repetitions$meanSpeeds
+                )
+        )
+}
+
+getRepetitions <- function(time, position, force, minDisplacement){
+        
+        currentSample = 1
+        startDebounceSample = 1                 #Sample of a possible start of the phase
+        debouncing = FALSE                      #If an extreme is found we must check if it keeps increasing 
or decreasing for at least minDisplacement
+        RFDs = NA
+        meanSpeeds = NA
+        
+        #Detecting the first phase
+        
+        while(currentSample < length(position) -1){
+                
+                currentSample = currentSample +1
+                if(     #Minimum
+                        (position[currentSample] < position[currentSample -1] &  position[currentSample] < 
position[currentSample+1]) || 
+                        #Maximum
+                        (position[currentSample] > position[currentSample -1] &  position[currentSample] > 
position[currentSample + 1]))
+                {
+                        startDebounceSample = currentSample
+                }
+                if (position[currentSample] - position[startDebounceSample] > minDisplacement){
+                        print("Starting in Concentric")
+                        concentric = 1
+                        break()
+                } else if(position[currentSample] - position[startDebounceSample] < -minDisplacement){
+                        print("Starting in Eccentric")
+                        concentric = -1
+                        break()
+                }
+        }
+        
+        print(paste("force:", force[currentSample]))
+        extremesSamples = startDebounceSample
+        #debouncing = T
+        print(paste("extremeSamples:", extremesSamples))
+        print("-------------------end of First phase-------------------")
+        
+        currentSample = currentSample +1
+        
+        while(currentSample < length(position) -1){
+                
+                #Checking if it is an extreme.
+                if (concentric * position[currentSample +1] < concentric * position[currentSample]
+                    #&& concentric * position[currentSample -1] < concentric * position[currentSample]
+                    )
+                {
+                        lastRFD = (force[currentSample] - force[startDebounceSample]) / (time[currentSample] 
- time[startDebounceSample])
+                        lastMeanSpeed = (position[currentSample] - position[startDebounceSample]) / 
(time[currentSample] - time[startDebounceSample])
+                        
+                        startDebounceSample = currentSample             #The next debounces will be checked 
from this sample
+                        debouncing = TRUE                                  #Starting a new debounce process
+                        print(paste("startDebounceSample:", startDebounceSample))
+                        # print(paste("debouncin:", debouncing))
+                        concentric = -concentric
+                        
+                        # print(paste(currentSample, "Concentric =", concentric))
+                        # print(paste(position[currentSample],  position[currentSample +1]))
+                        # print(paste("startDebounceSample:", startDebounceSample))
+                }
+                
+                #if debouncing, check if the position is far enough from the last extreme
+                if(debouncing && concentric * (position[currentSample] - position[startDebounceSample]) > 
minDisplacement){
+                        print(paste("-----------minDisplacement detected at", currentSample))
+                        print(paste("Extreme added at:", startDebounceSample))
+                        #We can consider that the last extreme in an actual change of phase.
+                        extremesSamples = c(extremesSamples, startDebounceSample)
+                        RFDs = c(RFDs, lastRFD)
+                        meanSpeeds = c(meanSpeeds, lastMeanSpeed)
+                        #concentric = -concentric                        #The slope of the signal has changed
+                        print(paste("Current phase is", concentric))
+                        
+                        #End of debouncing
+                        debouncing = F
+                }
+                
+                currentSample = currentSample +1
+        }
+        
+        #Checking if the las sample is far enough from the last extreme
+        currentSample = currentSample + 1
+        if( abs(position[currentSample] - position[startDebounceSample]) > minDisplacement ) {
+                extremesSamples = c(extremesSamples, currentSample)
+        }
+        return(list(
+                extremesSamples = extremesSamples[1:length(extremesSamples)]
+                , RFDs = RFDs[2:length(RFDs)]
+                , meanSpeeds = meanSpeeds[2:length(meanSpeeds)]))
+}
+
+dynamics = getDynamicsFromForceSensor(file = 
"/home/xpadulles/.local/share/Chronojump/forceSensor/83/1_Xavier Padullés_2019-10-02_15-31-40.csv",
+                                      smooth = 10, totalMass = 0, angle = 0, minDisplacement = 0.5)
\ No newline at end of file
diff --git a/r-scripts/tests/Rubber-Band-clean.csv b/r-scripts/tests/Rubber-Band-clean.csv
new file mode 100644
index 00000000..0b9d0346
--- /dev/null
+++ b/r-scripts/tests/Rubber-Band-clean.csv
@@ -0,0 +1,750 @@
+Time (micros);Force(N)
+0;52,52
+968;52,77
+3324;52,87
+14628;53,01
+25964;53,26
+37304;53,34
+48624;53,6
+59964;53,61
+71300;53,85
+82640;53,92
+93980;54,06
+105308;54,17
+116648;54,29
+127988;54,55
+139324;54,58
+150656;54,78
+161996;54,85
+173336;55,11
+184668;55,22
+196000;55,25
+207332;55,4
+218660;55,37
+230004;55,49
+241332;55,44
+252680;55,57
+264012;55,61
+275352;55,66
+286684;55,73
+298024;55,71
+309360;55,8
+320692;55,69
+332024;55,78
+343360;55,68
+354700;55,59
+366028;55,52
+377364;55,37
+388696;55,42
+400028;55,24
+411376;55,24
+422708;55,06
+434040;55,16
+445384;55,07
+456712;54,94
+468052;54,91
+479384;54,63
+490724;54,57
+502056;54,3
+513396;54,34
+524736;54,24
+536060;54
+547396;53,94
+558736;53,78
+570072;53,77
+581412;53,59
+592744;53,56
+604076;53,34
+615416;53,25
+626748;53,09
+638084;52,78
+649424;52,71
+660756;52,56
+672088;52,53
+683428;52,27
+694756;52,22
+706092;52,21
+717424;52,15
+728756;52,15
+740104;51,97
+751432;51,98
+762776;51,85
+774104;51,91
+785448;51,82
+796780;51,67
+808112;51,68
+819448;51,69
+830788;51,82
+842128;51,68
+853448;51,72
+864788;51,67
+876128;51,71
+887460;51,71
+898800;51,57
+910132;51,65
+921468;51,54
+932800;51,63
+944140;51,58
+955472;51,54
+966804;51,58
+978132;51,52
+989476;51,62
+1000808;51,55
+1012140;51,62
+1023468;51,54
+1034800;51,65
+1046140;51,6
+1057484;51,52
+1068816;51,52
+1080156;51,4
+1091484;51,54
+1102816;51,52
+1114156;51,64
+1125488;51,61
+1136820;51,59
+1148160;51,65
+1159488;51,65
+1170828;51,77
+1182160;51,67
+1193492;51,76
+1204832;51,69
+1216160;51,63
+1227508;51,62
+1238848;51,64
+1250180;51,78
+1261508;51,69
+1272848;51,86
+1284188;51,76
+1295528;51,76
+1306868;51,72
+1318200;51,72
+1329532;51,69
+1340868;51,55
+1352200;51,62
+1363540;51,47
+1374868;51,49
+1386212;51,4
+1397540;51,43
+1408884;51,4
+1420224;51,31
+1431560;51,42
+1442892;51,16
+1454232;51,16
+1465564;51,07
+1476888;51,04
+1488232;50,9
+1499568;50,72
+1510900;50,75
+1522232;50,58
+1533568;50,59
+1544904;50,41
+1556248;50,28
+1567576;50,21
+1578912;50,04
+1590244;49,96
+1601584;49,66
+1612916;49,59
+1624252;49,37
+1635584;49,33
+1646916;49,09
+1658252;48,89
+1669580;48,75
+1680916;48,5
+1692252;48,43
+1703592;48,12
+1714928;48,04
+1726256;47,81
+1737596;47,68
+1748936;47,49
+1760264;47,19
+1771604;47,09
+1782932;46,84
+1794268;46,81
+1805608;46,59
+1816940;46,54
+1828280;46,54
+1839612;46,5
+1850944;46,59
+1862280;46,56
+1873628;46,74
+1884960;46,95
+1896300;47,42
+1907628;47,72
+1918972;48,09
+1930296;48,69
+1941632;49,24
+1952976;50,11
+1964308;50,9
+1975648;51,96
+1986976;52,76
+1998308;53,95
+2009648;55,12
+2020988;56,16
+2032328;57,54
+2043660;58,81
+2055000;60,24
+2066328;61,56
+2077668;63
+2088992;64,41
+2100340;65,74
+2111672;67,3
+2123012;68,69
+2134344;70,21
+2145684;71,53
+2157008;73,11
+2168348;74,46
+2179680;75,98
+2191008;77,55
+2202356;78,92
+2213692;80,35
+2225024;81,56
+2236364;82,91
+2247696;84,19
+2259028;85,41
+2270360;86,42
+2281700;87,28
+2293032;88,3
+2304364;89,02
+2315696;89,85
+2327024;90,48
+2338364;90,97
+2349692;91,33
+2361044;91,68
+2372372;91,9
+2383700;91,81
+2395044;91,76
+2406376;91,35
+2417704;90,87
+2429044;90,14
+2440376;89,27
+2451708;88,33
+2463048;87,26
+2474380;86,23
+2485712;84,95
+2497044;83,72
+2508384;82,33
+2519716;81,05
+2531048;79,66
+2542396;78,15
+2553732;76,84
+2565060;75,24
+2576400;73,74
+2587728;72,09
+2599064;70,54
+2610400;68,87
+2621740;67,19
+2633072;65,48
+2644408;63,56
+2655736;61,74
+2667080;59,74
+2678412;57,91
+2689748;55,87
+2701076;53,84
+2712416;51,74
+2723748;49,48
+2735080;47,31
+2746424;44,83
+2757752;42,46
+2769096;40,06
+2780420;37,88
+2791756;35,53
+2803100;32,97
+2814420;30,55
+2825760;27,99
+2837088;25,7
+2848428;23,29
+2859764;21,06
+2871100;18,84
+2882428;16,68
+2893768;14,7
+2905096;12,71
+2916436;11,13
+2927768;9,53
+2939056;8,26
+2950388;7,18
+2961720;6,45
+2973052;5,9
+2984384;5,23
+2995716;5,05
+3007044;5,09
+3018380;5,71
+3029728;6,08
+3041044;6,89
+3052388;7,88
+3063724;9,09
+3075052;10,5
+3086436;11,68
+3097772;13,23
+3109108;14,69
+3120448;16,41
+3131780;18,31
+3143116;20,31
+3154448;22,49
+3165780;24,55
+3177120;26,86
+3188460;29,08
+3199792;31,57
+3211128;33,9
+3222464;36,38
+3233796;38,94
+3245136;41,27
+3256468;43,78
+3267796;46,03
+3279132;48,39
+3290472;50,56
+3301800;52,96
+3313128;55,33
+3324464;57,55
+3335804;59,85
+3347132;61,95
+3358480;64,27
+3369808;66,52
+3381148;68,81
+3392480;71,11
+3403820;73,31
+3415152;75,56
+3426492;77,46
+3437836;79,57
+3449168;81,35
+3460496;83,07
+3471824;84,42
+3483164;85,96
+3494500;87,7
+3505832;89,33
+3517180;90,88
+3528508;91,92
+3539848;92,91
+3551180;93,49
+3562520;93,93
+3573852;94,28
+3585184;94,25
+3596524;94,06
+3607860;93,46
+3619200;92,88
+3630528;92,09
+3641860;91,3
+3653200;90,39
+3664540;89,15
+3675884;87,85
+3687216;86,3
+3698552;84,92
+3709892;83,33
+3721224;81,84
+3732556;80,09
+3743888;78,38
+3755228;76,66
+3766572;74,67
+3777904;72,95
+3789244;71,07
+3800568;69,3
+3811908;67,31
+3823240;65,34
+3834580;63,26
+3845912;60,97
+3857252;58,84
+3868580;56,43
+3879924;54,24
+3891256;51,83
+3902588;49,44
+3913928;46,91
+3925260;44,26
+3936592;41,76
+3947932;39,07
+3959252;36,51
+3970592;33,62
+3981932;30,67
+3993264;27,81
+4004604;24,99
+4015944;22,21
+4027284;19,22
+4038620;16,24
+4049960;13,18
+4061288;10,45
+4072628;7,74
+4083916;5,39
+4095248;3,26
+4106592;1,34
+4117916;-0,15
+4129268;-1,34
+4140604;-2,08
+4151936;-2,81
+4163280;-3,03
+4174612;-2,78
+4185952;-2,17
+4197280;-1,3
+4208624;-0,43
+4219960;0,92
+4231276;2,14
+4242620;3,57
+4253960;4,9
+4265292;6,05
+4276620;7,2
+4287960;8,21
+4299296;9,41
+4310624;10,55
+4322004;12,09
+4333336;13,76
+4344684;16,01
+4356020;18,82
+4367360;21,56
+4378688;24,1
+4390032;26,41
+4401364;29,04
+4412692;31,92
+4424032;35,2
+4435364;38,41
+4446696;41,35
+4458028;43,96
+4469368;46,23
+4480700;49,09
+4492032;51,78
+4503380;54,56
+4514712;57,2
+4526052;59,51
+4537384;61,41
+4548720;63,05
+4560044;65,48
+4571392;68,24
+4582724;71,21
+4594068;73,72
+4605392;75,96
+4616724;78,01
+4628060;79,87
+4639400;81,56
+4650736;83,06
+4662072;85,05
+4673404;86,58
+4684744;88,11
+4696080;89,66
+4707420;90,49
+4718752;91,06
+4730088;91,38
+4741428;91,91
+4752760;92,35
+4764092;92,56
+4775424;92,08
+4786756;91,05
+4798092;90,18
+4809440;89,14
+4820784;88,17
+4832116;87,17
+4843456;86,33
+4854788;85,06
+4866124;83,66
+4877464;82,11
+4888808;80,32
+4900140;78,71
+4911484;77,01
+4922812;75,26
+4934144;73,23
+4945488;70,99
+4956816;68,9
+4968160;66,9
+4979500;65,11
+4990832;62,98
+5002164;60,82
+5013504;58,38
+5024844;55,95
+5036188;53,38
+5047520;50,63
+5058852;48
+5070184;45,11
+5081528;42,36
+5092852;39,29
+5104196;36,3
+5115528;33,25
+5126868;30,11
+5138212;27,03
+5149536;23,84
+5160884;20,7
+5172216;17,31
+5183556;14,21
+5194888;10,96
+5206224;7,94
+5217520;5,26
+5228852;2,89
+5240192;0,9
+5251520;-0,85
+5262868;-2,37
+5274208;-3,44
+5285544;-3,8
+5296880;-4,02
+5308212;-3,84
+5319560;-3,24
+5330880;-2,48
+5342224;-1,13
+5353564;0,02
+5364876;1,17
+5376228;2,09
+5387548;3,17
+5398900;4,14
+5410228;4,78
+5421560;5,34
+5432900;5,6
+5444236;6,33
+5455584;7,27
+5466920;8,68
+5478252;10,74
+5489628;13,48
+5500964;16,71
+5512308;19,38
+5523640;21,93
+5534980;24,17
+5546312;26,9
+5557652;30,18
+5568984;33,64
+5580316;36,98
+5591656;39,64
+5602988;41,96
+5614332;44,25
+5625664;47,49
+5637004;50,59
+5648332;53,37
+5659676;55,9
+5671004;57,9
+5682336;59,73
+5693680;61,44
+5705012;64,15
+5716344;67,34
+5727684;70,36
+5739008;72,62
+5750348;74,47
+5761680;76,54
+5773024;78,26
+5784356;80,23
+5795700;81,99
+5807028;83,75
+5818360;85,2
+5829704;86,62
+5841036;88,13
+5852368;89,08
+5863692;90,09
+5875036;91,07
+5886372;92,1
+5897704;92,54
+5909036;92,54
+5920368;92,35
+5931708;91,67
+5943048;90,91
+5954388;90,01
+5965716;89,15
+5977060;88,02
+5988384;87,12
+5999728;86,15
+6011060;84,98
+6022392;83,9
+6033732;82,45
+6045060;81,23
+6056396;79,79
+6067724;78,37
+6079068;76,49
+6090400;74,32
+6101748;72,34
+6113080;70,54
+6124412;69,06
+6135748;67,13
+6147092;65,31
+6158428;63,35
+6169768;61,07
+6181092;58,89
+6192432;56,29
+6203772;53,86
+6215104;51,21
+6226440;48,84
+6237772;46,12
+6249116;43,31
+6260456;40,51
+6271788;37,66
+6283120;35,02
+6294448;32,07
+6305784;29,18
+6317124;26,12
+6328460;23,13
+6339800;20,18
+6351132;17,22
+6362468;14,59
+6373796;11,71
+6385128;8,91
+6396416;6,28
+6407752;3,97
+6419092;1,64
+6430432;-0,38
+6441776;-2,2
+6453120;-3,68
+6464440;-4,24
+6475788;-4,47
+6487128;-4,64
+6498464;-4,78
+6509800;-4,65
+6521136;-4,56
+6532468;-4,48
+6543804;-4,27
+6555136;-4,28
+6566472;-4,09
+6577804;-4,08
+6589152;-4,09
+6600480;-3,59
+6611828;-3,08
+6623140;-2,73
+6634500;-2,45
+6645828;-1,88
+6657164;-0,88
+6668492;0,42
+6679820;0,71
+6691152;0,19
+6702488;0,15
+6713820;0,47
+6725148;0,19
+6736484;-1,34
+6747844;-2,37
+6759184;-2,65
+6770524;-2,73
+6781848;-3,05
+6793188;-3,12
+6804532;-2,71
+6815868;-2,67
+6827200;-2,65
+6838536;-2,64
+6849868;-2,29
+6861204;-2,09
+6872528;-2,14
+6883876;-1,95
+6895204;-1,94
+6906540;-1,76
+6917888;-1,93
+6929216;-1,95
+6940548;-2,34
+6951876;-3,01
+6963212;-3,47
+6974556;-3,85
+6985884;-3,92
+6997224;-4,07
+7008556;-3,95
+7019892;-3,76
+7031220;-3,32
+7042556;-2,76
+7053892;-2,26
+7065224;-1,71
+7076564;-1,56
+7087896;-1,28
+7099232;-0,98
+7110556;-0,61
+7121892;-0,47
+7133224;-0,78
+7144560;-1,34
+7155900;-2,25
+7167228;-3,07
+7178556;-3,94
+7189892;-4,22
+7201224;-4,24
+7212556;-4,22
+7223896;-4,01
+7235224;-3,8
+7246564;-3,39
+7257904;-3,29
+7269244;-3,15
+7280564;-3,24
+7291912;-3,3
+7303244;-3,23
+7314584;-3,16
+7325912;-3,02
+7337248;-3,19
+7348588;-3,28
+7359916;-3,46
+7371248;-3,59
+7382588;-3,85
+7393924;-3,98
+7405256;-3,84
+7416596;-3,9
+7427932;-3,77
+7439260;-3,69
+7450600;-3,55
+7461940;-3,54
+7473268;-3,57
+7484608;-3,41
+7495940;-3,52
+7507272;-3,53
+7518600;-3,66
+7529932;-3,55
+7541264;-3,66
+7552592;-3,73
+7563924;-3,78
+7575260;-3,85
+7586600;-3,71
+7597936;-3,76
+7609256;-3,65
+7620596;-3,84
+7631924;-3,91
+7643264;-3,97
+7654592;-4,01
+7665920;-3,92
+7677256;-4,01
+7688584;-3,86
+7699920;-3,95
+7711252;-3,89
+7722588;-3,93
+7733928;-4,02
+7745260;-4,02
+7756596;-4,19
+7767936;-4,1
+7779260;-4,23
+7790600;-4,18
+7801940;-4,21
+7813272;-4,21
+7824608;-4,1
+7835936;-4,19
+7847268;-4,16
+7858600;-4,25
+7869932;-4,19
+7881272;-4,23
+7892604;-4,22
+7903944;-4,17
+7915280;-4,25
+7926612;-4,12
+7937936;-4,24
+7949264;-4,17
+7960604;-4,26
+7971936;-4,23
+7983268;-4,27
+7994600;-4,3
+8005936;-4,28
+8017264;-4,37
+8028596;-4,25
+8039932;-4,4
+8051264;-4,37
+8062600;-4,36
+8073940;-4,43
+8085272;-4,49
+8096600;-4,55
+8107924;-4,39
+8119272;-4,49
+8130600;-4,35
+8141936;-4,34
+8153268;-4,32
+8164608;-4,31
+8175944;-4,36
+8187276;-4,26
+8198600;-4,35
+8209936;-4,26
+8221264;-4,31
+8232604;-4,29
+8243940;-4,29
+8255272;-4,36
+8266612;-4,31
+8277932;-4,37
+8289272;-4,31
+8300612;-4,44
+8311940;-4,4
+8323268;-4,38
+8334604;-4,43
+8345936;-4,41
+8357276;-4,46
+8368596;-4,4
+8379924;-4,49
+8391256;-4,38
+8402592;-4,44
+8413936;-4,41
+8425268;-4,39
+8436596;-4,51
+8447920;-4,39
+8459260;-4,48
diff --git a/r-scripts/tests/Rubber-Band-noisy.csv b/r-scripts/tests/Rubber-Band-noisy.csv
new file mode 100644
index 00000000..a47bae38
--- /dev/null
+++ b/r-scripts/tests/Rubber-Band-noisy.csv
@@ -0,0 +1,872 @@
+Time (micros);Force(N)
+0;2,27
+908;1,96
+11644;2,2
+22604;2,03
+33552;2,1
+44504;2,05
+55452;1,95
+66416;2,03
+77352;1,83
+88316;2,04
+99264;1,73
+110224;1,99
+121176;1,73
+132128;1,95
+143084;1,82
+154032;1,89
+164992;1,95
+175944;1,91
+186892;2,09
+197848;1,86
+208800;2,04
+219740;1,81
+230716;2,06
+241664;1,79
+252616;1,99
+263568;1,91
+274524;1,98
+285476;2,05
+296420;1,92
+307380;2,07
+318328;1,81
+329288;2,05
+340236;1,8
+351196;2,09
+362136;1,86
+373100;2
+384052;1,91
+395012;1,94
+405952;2,06
+416908;1,92
+427872;2,14
+438820;1,9
+449776;2,15
+460732;1,86
+471668;2,08
+482628;1,94
+493588;2,03
+504536;1,94
+515484;1,83
+526444;1,92
+537400;1,79
+548348;1,99
+559308;1,73
+570264;2,06
+581196;1,84
+592172;2,04
+603108;1,87
+614068;1,95
+625020;1,94
+635972;1,86
+646928;1,97
+657872;1,8
+668836;2,06
+679784;1,78
+690740;2,09
+701688;1,91
+712652;2,11
+723604;1,99
+734556;2,13
+745516;2,17
+756464;2,14
+767412;2,39
+778368;2,29
+789320;2,78
+800268;2,88
+811228;3,5
+822184;3,59
+833132;3,9
+844092;3,89
+855044;4,11
+866004;4,45
+876952;4,7
+887904;5,45
+898860;5,85
+909808;6,77
+920768;7,19
+931724;8,16
+942664;8,91
+953632;10,07
+964612;10,94
+975572;11,88
+986524;13,01
+997480;13,93
+1008432;15,4
+1019384;16,49
+1030340;18,02
+1041284;18,95
+1052244;20,16
+1063204;20,8
+1074152;21,69
+1085096;22,53
+1096064;23,42
+1107012;24,57
+1117964;25,66
+1128916;27,42
+1139876;28,75
+1150828;30,44
+1161772;31,51
+1172732;33,06
+1183680;34,71
+1194640;37,4
+1205592;40,74
+1216544;44,31
+1227508;47,88
+1238456;50,73
+1249408;53,74
+1260360;56,07
+1271304;58,82
+1282268;61,23
+1293220;64
+1304160;66,15
+1315132;68,06
+1326076;69,59
+1337036;70,44
+1347988;71,19
+1358940;71,85
+1369892;73,06
+1380832;73,61
+1391804;74,79
+1402756;75,61
+1413704;76,74
+1424664;77,29
+1435620;77,42
+1446568;77,17
+1457528;76,52
+1468484;75,9
+1479436;74,54
+1490380;73,33
+1501344;70,93
+1512296;68,38
+1523240;64,57
+1534200;60,53
+1545156;56,27
+1556104;52,13
+1567060;48,38
+1578012;44,81
+1588964;41,71
+1599924;38,16
+1610868;35,02
+1621816;31,44
+1632772;28,77
+1643728;26,53
+1654680;25,13
+1665624;23,77
+1676584;22,55
+1687540;21,57
+1698484;20,19
+1709444;19,14
+1720396;17,58
+1731352;16,55
+1742292;15,13
+1753252;14,28
+1764204;13,23
+1775156;12,69
+1786108;12,32
+1797068;12,14
+1808016;12,42
+1818972;12,38
+1829924;12,7
+1840872;12,6
+1851824;13,16
+1862784;13,56
+1873736;14,86
+1884680;16,48
+1895636;18,71
+1906588;21,37
+1917532;24,32
+1928496;28,07
+1939440;31,85
+1950392;36,42
+1961356;40,4
+1972308;44,42
+1983260;47,69
+1994208;51,28
+2005168;54,4
+2016120;57,52
+2027068;60,35
+2038020;62,35
+2048976;64,31
+2059924;65,6
+2070884;67,17
+2081836;68,17
+2092792;69,67
+2103736;70,82
+2114688;72,36
+2125644;73,83
+2136588;75,34
+2147552;76,85
+2158504;77,98
+2169448;79,34
+2180404;80,13
+2191360;81,39
+2202312;82,26
+2213264;83,85
+2224216;85,12
+2235172;86,43
+2246112;87,38
+2257072;88,23
+2268024;89,42
+2278972;90,61
+2289936;92,53
+2300880;93,58
+2311828;94,79
+2322788;95,74
+2333740;96,97
+2344696;98,1
+2355640;99,54
+2366596;100,56
+2377592;100,96
+2388536;101,11
+2399500;100,87
+2410452;101,71
+2421396;102,46
+2432356;103,4
+2443308;102,79
+2454264;102,23
+2465220;101,94
+2476172;101,7
+2487120;101,1
+2498064;100,16
+2509024;100,11
+2519980;100,5
+2530924;101,28
+2541884;100,92
+2552836;100,59
+2563784;99,89
+2574692;99,64
+2585644;99,02
+2596600;98,2
+2607556;97,35
+2618512;96,23
+2629460;95,77
+2640404;95,43
+2651368;95,69
+2662320;95,28
+2673268;95,54
+2684216;95,24
+2695180;95,01
+2706120;94,7
+2717076;94,61
+2728028;94,77
+2738980;94,84
+2749928;95,17
+2760892;95,06
+2771832;95,29
+2782788;94,79
+2793740;94,75
+2804696;94,88
+2815640;95,53
+2826604;95,69
+2837556;95,61
+2848512;95,77
+2859460;95,85
+2870412;96,53
+2881364;96,86
+2892308;97,95
+2903272;98,82
+2914224;100,13
+2925208;100,78
+2936164;101,06
+2947120;100,92
+2958068;100,68
+2969020;100,89
+2979980;100,97
+2990928;101,9
+3001880;102,25
+3012840;103
+3023788;103,38
+3034732;104,12
+3045696;104,16
+3056648;103,84
+3067596;103,63
+3078552;103,83
+3089500;104,72
+3100452;105,17
+3111408;105,57
+3122360;104,83
+3133312;104,26
+3144256;103,23
+3155220;102,95
+3166168;102,43
+3177124;101,42
+3188076;99,77
+3198984;96,86
+3209940;92,98
+3220892;86,62
+3231848;78,34
+3242800;67,44
+3253748;56,53
+3264700;45,99
+3275652;37,31
+3286604;30,3
+3297564;24,85
+3308508;20,87
+3319452;17,61
+3330420;15,28
+3341372;12,62
+3352324;10,98
+3363264;9,1
+3374188;7,94
+3385140;6,85
+3396080;6,16
+3407044;5,52
+3418000;4,9
+3428940;4,53
+3439904;3,88
+3450848;3,74
+3461796;3,31
+3472764;3,5
+3483708;3,15
+3494664;3,18
+3505612;2,92
+3516564;2,91
+3527520;2,89
+3538468;2,68
+3549420;2,75
+3560376;2,43
+3571324;2,61
+3582288;2,31
+3593240;2,64
+3604188;2,5
+3615136;2,83
+3626100;2,97
+3637044;3,44
+3647996;4,3
+3658948;5,2
+3669900;6,59
+3680848;7,82
+3691812;10,17
+3702808;12,72
+3713760;16,58
+3724708;21,21
+3735664;27,04
+3746608;32,69
+3757564;38,44
+3768524;44,17
+3779480;49,09
+3790412;53,7
+3801384;57,36
+3812332;61,32
+3823280;64,57
+3834232;67,86
+3845188;70,27
+3856140;72,36
+3867088;73,86
+3878048;75,12
+3889004;76,46
+3899952;77,5
+3910904;79,03
+3921852;80,47
+3932812;82,06
+3943756;82,91
+3954716;84,18
+3965672;85,04
+3976616;86,24
+3987576;87,36
+3998532;88,31
+4009480;89,83
+4020432;90,94
+4031388;92,08
+4042328;92,52
+4053292;93,46
+4064244;94,46
+4075192;96,26
+4086156;97,46
+4097100;98,92
+4108060;100,42
+4119052;101,53
+4130012;102,91
+4140960;103,67
+4151904;104,61
+4162864;104,79
+4173812;105,6
+4184756;105,91
+4195716;106,34
+4206668;106,86
+4217624;107,83
+4228580;108,85
+4239528;109,47
+4250480;110,25
+4261424;110,44
+4272384;110,67
+4283336;110,05
+4294284;110,06
+4305236;109,66
+4316196;109,58
+4327144;109,78
+4338100;110,3
+4349048;110,72
+4360004;110,42
+4370956;110,09
+4381900;109,19
+4392860;108,65
+4403816;107,79
+4414772;108,08
+4425716;108,2
+4436676;108,18
+4447628;107,57
+4458580;106,75
+4469532;105,93
+4480488;105,06
+4491432;104,76
+4502388;104,04
+4513336;104,21
+4524296;104,08
+4535244;104,19
+4546196;103,65
+4557156;103,04
+4568100;102,28
+4579060;101,35
+4590016;100,4
+4600964;98,78
+4611880;97,3
+4622824;94,8
+4633780;92,94
+4644732;91,21
+4655688;90,56
+4666644;90,35
+4677596;90,82
+4688536;91,36
+4699500;91,72
+4710452;92,57
+4721408;93,26
+4732356;94,77
+4743308;95,76
+4754264;96,91
+4765212;97,53
+4776172;98,33
+4787120;98,66
+4798068;98,74
+4809024;98,98
+4819972;99,23
+4830936;99,9
+4841884;100,02
+4852876;100,38
+4863836;100,48
+4874780;101,59
+4885740;102,19
+4896692;102,51
+4907644;102,23
+4918600;102,02
+4929544;102,36
+4940504;102,91
+4951460;103,97
+4962408;104,15
+4973360;104,4
+4984304;104,07
+4995260;104
+5006212;103,86
+5017168;104,37
+5028128;105,02
+5039072;105,68
+5050028;106,22
+5060988;106,13
+5071944;106,18
+5082888;105,97
+5093840;106,86
+5104792;107,15
+5115752;107,67
+5126700;107,93
+5137656;108,3
+5148608;108,57
+5159552;108,55
+5170512;108,78
+5181464;108,49
+5192412;108,55
+5203364;108,51
+5214328;109,16
+5225280;109,23
+5236224;109,58
+5247184;109,52
+5258136;109,5
+5269080;109,44
+5280040;108,85
+5290996;107,98
+5301940;106,06
+5312892;103,89
+5323852;99,62
+5334760;93,56
+5345716;84,68
+5356668;74,19
+5367624;62,23
+5378572;50,54
+5389524;40,76
+5400476;32,56
+5411424;26,44
+5422384;21,34
+5433332;17,47
+5444276;13,64
+5455236;11,3
+5466188;9,17
+5477108;7,77
+5488048;6,59
+5499008;5,6
+5509960;5,02
+5520908;4,25
+5531868;3,97
+5542824;3,21
+5553772;3,13
+5564732;2,64
+5575676;2,64
+5586632;2,43
+5597580;2,43
+5608536;2,38
+5619492;2,23
+5630444;2,36
+5641400;2,01
+5652340;2,09
+5663292;1,8
+5674252;2,13
+5685208;2
+5696144;2,26
+5707112;2,27
+5718060;2,36
+5729020;2,47
+5739960;2,44
+5750924;2,72
+5761880;2,53
+5772820;2,9
+5783784;2,77
+5794728;3,34
+5805676;4,01
+5816628;5,98
+5827588;8,6
+5838540;12,21
+5849536;17,68
+5860488;25,22
+5871440;34,04
+5882384;42,33
+5893348;50,39
+5904300;56,9
+5915248;63,28
+5926208;68,35
+5937164;72,72
+5948108;76,06
+5959060;78,68
+5970012;80,86
+5980964;82,28
+5991912;84,49
+6002872;86,53
+6013828;88,39
+6024776;90,25
+6035728;92,04
+6046676;93,04
+6057628;94,48
+6068592;95,81
+6079548;97,01
+6090492;98,4
+6101436;99,35
+6112400;100,61
+6123404;101,05
+6134344;101,55
+6145304;101,17
+6156256;101,31
+6167204;101,93
+6178164;103,55
+6189116;105,08
+6200060;106,04
+6211016;106,6
+6221968;106,38
+6232916;106,47
+6243872;105,9
+6254824;106,1
+6265784;106,35
+6276728;107,29
+6287680;107,79
+6298640;108,1
+6309592;107,61
+6320540;106,08
+6331488;103,98
+6342444;100,34
+6353392;96,07
+6364300;90,46
+6375256;84,44
+6386204;76,84
+6397160;68,58
+6408112;59,32
+6419060;50,08
+6430016;41,52
+6440972;34,12
+6451928;28,52
+6462872;23,65
+6473832;20,28
+6484780;17,2
+6495724;15,19
+6506684;13,12
+6517640;11,63
+6528588;10,26
+6539548;9,23
+6550460;8,54
+6561400;7,88
+6572348;7,87
+6583312;7,53
+6594264;8,09
+6605200;8,97
+6616168;11,39
+6627164;14,74
+6638104;20,15
+6649064;26,84
+6660016;34,69
+6670968;43,13
+6681932;51,11
+6692880;59,08
+6703828;65,46
+6714784;71
+6725736;74,96
+6736684;78,16
+6747632;79,86
+6758596;81,72
+6769548;83,67
+6780496;85,27
+6791448;87,09
+6802396;88,87
+6813348;90,95
+6824308;92,28
+6835264;93,81
+6846216;94,3
+6857156;95,1
+6868120;95,53
+6879076;95,58
+6890016;94,88
+6900972;93,54
+6911928;92,04
+6922872;89,52
+6933832;86,66
+6944788;82,52
+6955732;77,91
+6966688;71,43
+6977644;64,03
+6988588;55,77
+6999536;47,77
+7010504;41,49
+7021448;37,84
+7032392;36,79
+7043352;35,55
+7054308;34,5
+7065252;32,62
+7076216;31,03
+7087168;28,78
+7098116;26,35
+7109060;23,36
+7120020;21,33
+7130976;21,75
+7141924;24,08
+7152876;28,79
+7163836;35,15
+7174788;43,09
+7185736;50,25
+7196700;56,93
+7207648;62,59
+7218600;67,86
+7229552;72,39
+7240508;76,15
+7251456;79,19
+7262408;81,13
+7273364;83,36
+7284312;85,03
+7295268;86,76
+7306224;87,47
+7317172;88,47
+7328124;89,11
+7339080;89,81
+7350036;90,56
+7360984;91,35
+7371940;92,65
+7382896;93,77
+7393844;94,78
+7404796;94,59
+7415748;94,71
+7426700;94,58
+7437660;95,08
+7448608;94,94
+7459560;94,41
+7470520;93,32
+7481468;91,38
+7492420;88,67
+7503368;84,34
+7514324;79,27
+7525280;72,86
+7536220;66,58
+7547180;59,76
+7558132;52,99
+7569080;45,62
+7580036;38,5
+7590988;32,34
+7601944;27,71
+7612892;25,68
+7623844;25,15
+7634796;25,91
+7645744;25,81
+7656704;25,92
+7667656;26,05
+7678596;27,91
+7689560;31,47
+7700516;36,53
+7711468;42,44
+7722416;48,17
+7733372;54,01
+7744320;59,15
+7755272;64,48
+7766224;68,56
+7777176;72,67
+7788128;76,03
+7799084;78,96
+7810036;81,48
+7820984;83,68
+7831948;85,64
+7842892;86,93
+7853848;88,33
+7864796;89,09
+7875744;90,28
+7886704;90,87
+7897652;91,92
+7908612;92,55
+7919568;93,19
+7930508;93,48
+7941468;93,34
+7952424;93,1
+7963380;92,27
+7974328;91,87
+7985272;91,08
+7996224;90,72
+8007180;89,55
+8018136;88,41
+8029088;86,2
+8040036;83,15
+8050996;79,08
+8061936;73,78
+8072900;67,72
+8083856;60,52
+8094800;53,57
+8105752;46,36
+8116704;40,08
+8127652;33,87
+8138612;28,83
+8149560;24,51
+8160512;21,15
+8171464;18,7
+8182412;16,67
+8193372;15,42
+8204328;14,07
+8215272;13,54
+8226224;13,09
+8237176;14,19
+8248136;16,88
+8259076;22,59
+8270036;30,03
+8280984;37,62
+8291940;44,84
+8302892;51,48
+8313848;58,37
+8324804;64,18
+8335756;69,82
+8346708;73,9
+8357664;77,32
+8368612;80,01
+8379560;82,47
+8390520;84,56
+8401460;86,16
+8412420;87,67
+8423376;88,5
+8434320;89,25
+8445284;89,77
+8456236;90,82
+8467192;90,95
+8478136;91,51
+8489092;91,57
+8500044;91,25
+8510988;90,47
+8521952;89,11
+8532908;87,6
+8543844;85,1
+8554808;82,18
+8565764;77,68
+8576716;72,84
+8587668;66,86
+8598612;60,91
+8609568;54,36
+8620516;47,77
+8631480;41,18
+8642424;34,6
+8653372;28,73
+8664332;23,19
+8675284;19,17
+8686228;15,55
+8697188;13,16
+8708144;10,83
+8719092;9,27
+8730004;7,8
+8740948;6,63
+8751912;5,76
+8762856;4,7
+8773808;3,92
+8784764;2,89
+8795708;2,52
+8806668;1,67
+8817620;1,32
+8828572;0,47
+8839520;-0,14
+8850484;-0,77
+8861440;-1,27
+8872392;-1,63
+8883356;-2,11
+8894308;-2,28
+8905256;-2,84
+8916208;-2,86
+8927156;-3,16
+8938116;-2,77
+8949068;-3,02
+8960016;-2,93
+8970976;-2,64
+8981920;-2,45
+8992884;-2,18
+9003836;-2,4
+9014780;-2,14
+9025744;-2,3
+9036684;-1,86
+9047640;-1,94
+9058596;-1,63
+9069552;-1,7
+9080496;-1,66
+9091460;-1,59
+9102400;-1,54
+9113364;-1,15
+9124312;-1,08
+9135256;-0,35
+9146212;-0,1
+9157156;0,38
+9168104;0,11
+9179056;0,21
+9190004;-0,05
+9200968;-0,27
+9211928;-0,39
+9222884;-0,52
+9233832;-0,21
+9244788;-0,34
+9255744;0,08
+9266656;-0,09
+9277640;0,22
+9288580;0,03
+9299524;0,14
+9310492;-0,07
+9321448;-0,29
+9332404;-0,28
+9343360;-0,31
+9354316;-0,22
+9365272;-0,59
+9376208;-0,13
+9387176;-0,31
+9398132;-0,12
+9409072;-0,29
+9420028;-0,28
+9430984;-0,45
+9441924;-0,54
+9452888;-0,39
+9463844;-0,56
+9474796;-0,37
+9485736;-0,57
+9496704;-0,23
+9507648;-0,48
+9518596;-0,25


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