Thursday, April 17, 2008

Convolution

Convolution is one of the jewels of Fourier analysis.
It is the Fourier transform of the multiplication operator and useful in physics and signal processing.The integral equation for using the quantum mechanical propagator K reduces to a convolution if it depends only on relative differences in space and time. K=K(x-x',t-t')Here is a patch using convolution with a drifting time series and a set of different kernel functions. The output time series is the convolution of the input time series and the kernel function. Click on all of the different kernel functions to see how they change the output signal.
We are colonizing a field. Source code in comments section.

1 comment:

Tony said...

max v2;
#N vpatcher 163 44 801 627;
#P user panel 364 112 22 15;
#X brgb 0 255 0;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 288 399 21 17;
#X brgb 0 0 255;
#X frgb 0 0 255;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 252 186 23 196617 f;
#P newex 260 399 25 196617 f;
#P newex 275 369 27 196617 f;
#N vpatcher 617 403 1396 817;
#P window setfont "Sans Serif" 9.;
#P message 367 268 142 196617 setpixel 254 127 255 255 0;
#P newex 340 211 20 196617 t b;
#P message 362 229 186 196617 linesegment 250 127 254 129 0 255 0;
#P message 380 192 174 196617 linesegment 253 \$2 254 \$1 0 0 255;
#P newex 473 147 48 196617 pack 1 2;
#P newex 511 112 27 196617 int;
#P newex 463 82 58 196617 t i i b;
#P newex 463 55 104 196617 scale -5. 127. 0 124;
#P inlet 463 35 15 0;
#P message 178 190 174 196617 linesegment 253 \$2 254 \$1 0 255 0;
#P newex 271 145 48 196617 pack 1 2;
#P newex 309 110 27 196617 int;
#P newex 261 80 58 196617 t i i b;
#P newex 261 53 104 196617 scale -5. 127. 0 124;
#P inlet 261 33 15 0;
#P newex 91 146 48 196617 pack 1 2;
#P newex 129 111 27 196617 int;
#P newex 81 81 58 196617 t i i b;
#P newex 81 54 104 196617 scale -5. 127. 0 124;
#P message 91 170 309 196617 scrollrect 1 0 255 255 -1 0 \, linesegment 253 \$2 254 \$1 255 0 0;
#P inlet 81 34 15 0;
#P outlet 91 202 15 0;
#P connect 1 0 3 0;
#P connect 3 0 4 0;
#P fasten 4 0 6 0 86 134 96 134;
#P connect 6 0 2 0;
#P connect 18 0 0 0;
#P connect 21 0 0 0;
#P connect 2 0 0 0;
#P connect 12 0 0 0;
#P connect 4 2 5 0;
#P fasten 5 0 6 1 134 134 134 134;
#P fasten 4 1 5 1 110 104 151 104;
#P connect 11 0 12 0;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P fasten 9 0 11 0 266 133 276 133;
#P connect 9 2 10 0;
#P fasten 10 0 11 1 314 133 314 133;
#P fasten 9 1 10 1 290 103 331 103;
#P connect 18 0 20 0;
#P connect 20 0 19 0;
#P connect 1 0 21 0;
#P connect 17 0 18 0;
#P connect 13 0 14 0;
#P connect 14 0 15 0;
#P fasten 15 0 17 0 468 135 478 135;
#P connect 15 2 16 0;
#P fasten 16 0 17 1 516 135 516 135;
#P fasten 15 1 16 1 492 105 533 105;
#P pop;
#P newobj 184 392 55 196617 p draw;
#P user lcd 314 360 273 127 1 0 1 0 0;
#P number 261 63 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 314 93 175 196617 0.05 0.1 0.15 0.2 0.2 0.15 0.1 0.05;
#P slider 219 251 15 128 0 1;
#P slider 199 251 15 128 0 1;
#P toggle 214 61 15 0;
#P newex 214 83 57 196617 qmetro 50;
#P number 241 131 31 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 214 107 65 196617 drunk 128 4;
#P newex 189 186 49 196617 vexpr 0.;
#P message 367 132 97 196617 0.1 0.2 0.4 0.2 0.1;
#P newex 252 236 27 196617 t l l;
#P newex 327 153 27 196617 t l l;
#P message 327 132 36 196617 1. -1.;
#P newex 275 319 47 196617 zl iter 1;
#P newex 275 347 27 196617 + 0.;
#P newex 260 294 40 196617 t b l 0.;
#P newex 252 268 79 196617 vexpr $f1*$f2;
#P newex 252 213 38 196617 zl join;
#P newex 280 186 51 196617 zl ecils 1;
#P comment 327 112 100 196617 kernel;
#P user panel 250 149 22 15;
#X brgb 255 0 0;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 17 0 22 0;
#P fasten 9 0 12 0 332 174 194 174;
#P fasten 14 0 17 0 246 169 185 169 185 243 204 243;
#P connect 16 0 15 0;
#P connect 15 0 13 0;
#P fasten 24 0 18 0 265 420 243 420 243 245 224 245;
#P connect 18 0 22 2;
#P fasten 13 0 14 0 219 126 246 126;
#P fasten 14 0 25 0 246 169 257 169;
#P connect 25 0 3 0;
#P connect 3 0 10 0;
#P fasten 12 0 10 0 194 233 257 233;
#P connect 10 0 4 0;
#P fasten 4 0 5 0 257 290 265 290;
#P connect 5 0 24 0;
#P connect 20 0 15 1;
#P fasten 5 1 7 0 280 315 280 315;
#P connect 7 0 6 0;
#P connect 6 0 23 0;
#P connect 23 0 24 1;
#P fasten 10 1 2 0 274 258 335 258 335 181 285 181;
#P connect 2 0 3 1;
#P fasten 23 0 6 1 280 392 307 392 307 343 297 343;
#P fasten 5 2 6 1 295 314 332 314 332 343 297 343;
#P fasten 22 0 21 0 189 423 172 423 172 428 319 428;
#P fasten 9 1 4 1 349 263 326 263;
#P fasten 19 0 9 0 319 150 332 150;
#P fasten 11 0 9 0 372 150 332 150;
#P connect 8 0 9 0;
#P pop;