#N struct mtx_vis-plot float x float y array mtx_vis-array mtx_vis-element 1;
#N struct mtx_vis-element float x float y float c float dx float dy;
#N canvas 790 257 463 717 10;
#X declare -lib iemmatrix;
#X obj 366 124 matrix;
#X msg 11 124 bang;
#X obj 11 191 mtx_cumsum;
#X msg 11 147 1 16;
#X obj 11 169 mtx_ones;
#X obj 11 213 mtx_- 1;
#X obj 49 255 mtx_* 0;
#X floatatom 140 210 5 0 0 0 - - - 0;
#X text 184 208 <-- scroll here to select frequency;
#X obj 172 255 / 8;
#X obj 49 326 t a a;
#X text 298 124 see also:;
#X obj 49 300 mtx_cos;
#X obj 103 255 * 3.14159;
#X text 109 300 cosine wave;
#X obj 208 472 mtx_int;
#X obj 49 463 mtx_int;
#X obj 208 423 mtx_+ 0.5;
#X obj 49 423 mtx_+ 0.5;
#X obj 140 231 t b f;
#N canvas 450 271 494 171 META 0;
#X text 12 105 AUTHOR IOhannes m zmoelnig;
#X text 12 85 OUTLET_0 matrix;
#X text 12 125 HELP_PATCH_AUTHORS IOhannes m zmölnig;
#X text 12 25 LICENSE GPL-2+;
#X text 12 65 INLET_0 matrix;
#X text 12 5 KEYWORDS control matrix math;
#X obj 16 147 declare -lib iemmatrix;
#X text 12 44 DESCRIPTION complex-valued FFT of each matrix row;
#X restore 381 16 pd META;
#X obj 366 170 mtx_rfft;
#X obj 49 380 mtx_fft, f 27;
#X obj 208 326 t a a;
#X obj 208 300 mtx_sin;
#X obj 49 484 mtx_print fft.re;
#X obj 208 492 mtx_print fft.im;
#X obj 235 351 mtx_print orig.im;
#X obj 76 351 mtx_print orig.re;
#X text 268 300 sine wave;
#X obj 49 278 t a a, f 27;
#X obj 46 512 mtx_plot 200 50;
#X obj 256 512 mtx_plot 200 50;
#X obj 208 448 t a a;
#X obj 208 402 mtx_./ 16;
#X obj 49 401 mtx_./ 16;
#X obj 49 443 t a a;
#X text 89 15 [mtx_fft];
#X text 46 34 forward complex FFT of each matrix row;
#X text 7 60 you can calculate the FFTs in column direction \; matrix has to have 2^k columns \; the result is a matrix with the same dimensions.;
#X obj 366 147 mtx_ifft;
#X connect 1 0 3 0;
#X connect 2 0 5 0;
#X connect 3 0 4 0;
#X connect 4 0 2 0;
#X connect 5 0 6 0;
#X connect 6 0 30 0;
#X connect 7 0 19 0;
#X connect 9 0 13 0;
#X connect 10 0 22 0;
#X connect 10 1 28 0;
#X connect 12 0 10 0;
#X connect 13 0 6 1;
#X connect 15 0 26 0;
#X connect 16 0 25 0;
#X connect 17 0 33 0;
#X connect 18 0 36 0;
#X connect 19 0 1 0;
#X connect 19 1 9 0;
#X connect 22 0 35 0;
#X connect 22 1 34 0;
#X connect 23 0 22 1;
#X connect 23 1 27 0;
#X connect 24 0 23 0;
#X connect 30 0 12 0;
#X connect 30 1 24 0;
#X connect 33 0 15 0;
#X connect 33 1 32 0;
#X connect 34 0 17 0;
#X connect 35 0 18 0;
#X connect 36 0 16 0;
#X connect 36 1 31 0;
