#N canvas 344 22 580 601 10; #X obj 204 126 tabread x; #N canvas 0 22 450 300 (subpatch) 0; #X array x 10 float 1; #A 0 0 0 1 0 0 0 0 0 0 0; #X coords 0 1 9 -1 200 140 1; #X restore 41 283 graph; #X obj 204 82 r n; #X text 38 18 MA.pd; #X text 38 39 Moving Average example; #X text 35 61 2011-09-13 Dan Ellis dpwe@ee.columbia.edu for E4810; #X text 580 11 Time (n) counter; #N canvas 0 22 450 300 (subpatch) 0; #X array y 10 float 1; #A 0 0 0 0 0 0 0 0 0 0 0; #X coords 0 1 9 -1 200 140 1; #X restore 41 442 graph; #X text 65 263 Input signal; #X text 67 425 Output signal; #X obj 204 172 Z-1; #X obj 204 199 Z-1; #X obj 249 167 * 0.33; #X obj 250 193 * 0.33; #X obj 251 221 * 0.33; #X obj 358 234 tabwrite y; #X obj 597 451 tabwrite x; #X floatatom 654 429 5 0 0 0 - - -; #X floatatom 597 428 5 0 0 0 - - -; #X text 595 412 Value; #X text 651 412 n; #X floatatom 153 222 5 0 0 0 - - -; #X floatatom 152 196 5 0 0 0 - - -; #X floatatom 152 168 5 0 0 0 - - -; #X obj 341 199 summer; #X obj 37 126 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 37 148 s reset; #X obj 597 137 r reset; #X obj 41 202 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 41 223 s next; #X floatatom 244 104 5 0 0 0 - - -; #X text 24 97 Click this to reset to; #X text 24 108 initial conditions; #X text 14 173 Click this to advance; #X text 25 185 the time index n; #X text 233 83 Receives the current time; #X text 217 103 n =; #X text 269 126 Reads x(n) from the x array below; #X text 330 169 The actual function ...; #X text 431 233 Writes the output to; #X text 431 244 the y array below; #X obj 585 64 ncounter; #X floatatom 585 86 5 0 0 0 - - -; #X text 583 27 (receives reset and next \;; #X text 583 40 sends newstep and n); #X text 650 137 Reset the output array; #X text 592 318 Initialize the x array; #X obj 415 214 r prestep; #X msg 597 158 \; y resize 10 \; y const 0 \; y xlabel -1.1 0 1 2 3 4 5 6 7 8 9; #X msg 597 334 \; x resize 10 \; x const 0 \; x 2 1 0 0 0 \; x xlabel -1.1 0 1 2 3 4 5 6 7 8 9; #N canvas 0 22 450 300 (subpatch) 0; #X array time 10 float 1; #A 0 0 0 0 0 0 0 0 0 0 0; #X coords 0 1 9 -1 200 140 1; #X restore 39 599 graph; #X obj 596 220 r reset; #X text 649 220 Reset the time array; #X msg 596 241 \; time resize 10 \; time const 0 \;; #X obj 64 125 loadbang; #X connect 0 0 12 0; #X connect 0 0 10 0; #X connect 0 0 23 0; #X connect 2 0 30 0; #X connect 2 0 0 0; #X connect 10 0 11 0; #X connect 10 0 13 0; #X connect 10 0 22 0; #X connect 11 0 14 0; #X connect 11 0 21 0; #X connect 12 0 24 0; #X connect 13 0 24 0; #X connect 14 0 24 0; #X connect 17 0 16 1; #X connect 18 0 16 0; #X connect 24 0 15 0; #X connect 25 0 26 0; #X connect 27 0 48 0; #X connect 28 0 29 0; #X connect 41 0 42 0; #X connect 47 0 15 1; #X connect 51 0 53 0; #X connect 54 0 26 0;