aboutsummaryrefslogtreecommitdiff
path: root/smooth_triple.pd
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2007-11-27 23:38:33 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2007-11-27 23:38:33 +0000
commit29bed0995cc5ef96798204dc54cdd4bda031d795 (patch)
tree878903ddafd535f339ef8e36cfbe58fc17d2d664 /smooth_triple.pd
parentd0441a85a78ea946920362deea21da7e01dcb91e (diff)
- added single, double and triple exponential smoothing objects based on NIST
alorgithms (the links are included in the patches). This was originally inspired by Fredrik Olofsson's f0.smooth and f0.smooth2, but I added triple exponential smoothing, and made them as Pd patches. svn path=/trunk/externals/mapping/; revision=9058
Diffstat (limited to 'smooth_triple.pd')
-rw-r--r--smooth_triple.pd89
1 files changed, 89 insertions, 0 deletions
diff --git a/smooth_triple.pd b/smooth_triple.pd
new file mode 100644
index 0000000..44d9e6e
--- /dev/null
+++ b/smooth_triple.pd
@@ -0,0 +1,89 @@
+#N canvas 122 353 991 458 10;
+#X obj 21 12 inlet;
+#X obj 260 12 inlet;
+#X obj 260 66 purepd/float_argument \$1 0.15;
+#X obj 271 39 loadbang;
+#X obj 59 421 outlet;
+#X obj 21 57 trigger float bang;
+#X obj 126 153 float;
+#X text 162 153 St1;
+#X obj 260 102 clip 0 1;
+#X obj 175 421 outlet;
+#X obj 450 12 inlet;
+#X obj 461 39 loadbang;
+#X obj 450 102 clip 0 1;
+#X text 428 265 bt = y * (St - St1) + (1 - y) * bt1;
+#X text 509 102 y;
+#X text 319 102 a;
+#X obj 176 265 expr $f4 * ($f1 - $f2) + (1 - $f4) * $f3;
+#X obj 294 154 float;
+#X text 332 153 bt1;
+#X obj 450 66 purepd/float_argument \$2 0.3;
+#X obj 59 207 expr $f4*$f1+(1-$f4) * ($f2 + $f3);
+#X obj 302 391 pddp/pddplink http://www.itl.nist.gov/div898/handbook/pmc/section4/pmc435.htm
+;
+#X obj 245 421 outlet;
+#X obj 630 12 inlet;
+#X obj 641 39 loadbang;
+#X obj 630 102 clip 0 1;
+#X text 689 102 B;
+#X text 274 208 St = a*(Yt / It1+(1-a)*St1;
+#X text 524 223 we are only using 2L as the "season";
+#X obj 245 349 expr $f4 * ($f2/$f1) + (1 - $f4) * $f3;
+#X text 482 351 It = B * (Yt/St) + (1 - B) * It1;
+#X text 467 311 It;
+#X obj 630 66 purepd/float_argument \$3 0.6;
+#X obj 810 12 inlet;
+#X obj 821 39 loadbang;
+#X obj 810 102 int;
+#X obj 810 127 min 1;
+#X text 857 99 how many periods;
+#X obj 810 66 purepd/float_argument \$4 1;
+#N canvas 198 494 450 300 keep 0;
+#X obj 313 36 inlet;
+#X obj 214 255 outlet;
+#X obj 71 34 inlet;
+#X obj 71 92 list append;
+#X obj 186 165 list split;
+#X connect 0 0 4 1;
+#X connect 2 0 3 0;
+#X connect 3 0 4 0;
+#X connect 4 0 3 1;
+#X connect 4 1 1 0;
+#X connect 4 2 3 1;
+#X restore 334 309 pd keep old It values;
+#X connect 0 0 5 0;
+#X connect 1 0 2 0;
+#X connect 2 0 8 0;
+#X connect 3 0 2 0;
+#X connect 5 0 20 0;
+#X connect 5 1 6 0;
+#X connect 5 1 17 0;
+#X connect 6 0 16 1;
+#X connect 6 0 20 1;
+#X connect 8 0 20 3;
+#X connect 10 0 19 0;
+#X connect 11 0 19 0;
+#X connect 12 0 16 3;
+#X connect 16 0 17 1;
+#X connect 16 0 9 0;
+#X connect 16 0 29 1;
+#X connect 17 0 16 2;
+#X connect 17 0 20 2;
+#X connect 19 0 12 0;
+#X connect 20 0 4 0;
+#X connect 20 0 6 1;
+#X connect 20 0 16 0;
+#X connect 20 0 29 0;
+#X connect 23 0 32 0;
+#X connect 24 0 32 0;
+#X connect 25 0 29 3;
+#X connect 29 0 22 0;
+#X connect 29 0 39 0;
+#X connect 32 0 25 0;
+#X connect 33 0 38 0;
+#X connect 34 0 38 0;
+#X connect 35 0 36 0;
+#X connect 36 0 39 1;
+#X connect 38 0 35 0;
+#X connect 39 0 29 2;