#N canvas 545 63 534 746 12;
#X obj 105 258 phasor~ 100;
#X obj 158 328 phasor~;
#X floatatom 158 290 5 0 999 0 - \$0-freq - 0;
#X obj 158 366 cos~;
#X obj 201 382 cos~;
#X obj 201 357 +~ 0.25;
#X obj 106 581 snapshot~;
#X obj 106 426 *~;
#X obj 150 426 *~;
#X obj 106 484 lop~;
#X obj 150 484 lop~;
#X floatatom 175 453 3 0 100 0 - \$0-lop - 0;
#X obj 285 581 snapshot~;
#X floatatom 106 612 5 0 0 0 - - - 0;
#X floatatom 285 612 5 0 0 0 - - - 0;
#X obj 253 501 r \$0-tick;
#X obj 253 525 t b b;
#X obj 106 647 expr sqrt($f1*$f1+$f2*$f2);
#X floatatom 106 674 5 0 0 0 - - - 0;
#X text 38 57 Another method for picking out the strengths of partials in a sound is heterodyning. We guess the frequency of a partial (as in the previous patch) but this time we multiply by a complex exponential to frequency-shift the partial down to zero (DC)., f 62;
#X text 38 121 Then a low-pass filter (applied separately on the real and imaginary parts) removes all but the DC component thus obtained. The result is two audio signals (which we take snapshots of) holding the real and imaginary parts of the complex amplitude of the partial we want. Compared to the previous method \, this had the advantage of reporting the phase of the partial as well as its frequency., f 62;
#X text 67 605 real;
#X text 67 619 part;
#X text 248 619 part;
#X text 213 606 imaginary;
#X text 153 673 magnitude;
#X obj 347 247 ../5.reference/set-dsp-tgl;
#X text 378 250 DSP on/off;
#X msg 347 284 \; pd dsp \$1;
#X text 201 289 <-- test frequency, f 9;
#X text 261 355 modulate test frequency to DC, f 15;
#X text 204 453 <-- responsiveness;
#N canvas 834 434 361 258 init 0;
#X obj 68 22 loadbang;
#X obj 68 46 bng 19 250 50 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000;
#X obj 68 75 f \$0;
#X obj 213 95 metro 250;
#X obj 213 70 r \$0-metro;
#X obj 213 119 s \$0-tick;
#X msg 68 99 \; \$1-freq 100 \; \$1-lop 2 \; \$1-metro 1;
#X text 47 183 This subpatch initializes the patch and loads values in number boxes., f 35;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 3 0 5 0;
#X connect 4 0 3 0;
#X restore 423 356 pd init;
#X text 40 477 low-pass filters, f 8;
#X text 33 252 signal to analyze, f 9;
#X obj 77 18 cnv 5 5 25 empty empty Measuring\ Spectra\ With\ Heterodyning 15 13 0 16 #dfdfdf #202020 0;
#X connect 0 0 7 0;
#X connect 0 0 8 0;
#X connect 1 0 3 0;
#X connect 1 0 5 0;
#X connect 2 0 1 0;
#X connect 3 0 7 1;
#X connect 4 0 8 1;
#X connect 5 0 4 0;
#X connect 6 0 13 0;
#X connect 7 0 9 0;
#X connect 8 0 10 0;
#X connect 9 0 6 0;
#X connect 10 0 12 0;
#X connect 11 0 10 1;
#X connect 11 0 9 1;
#X connect 12 0 14 0;
#X connect 13 0 17 0;
#X connect 14 0 17 1;
#X connect 15 0 16 0;
#X connect 16 0 6 0;
#X connect 16 1 12 0;
#X connect 17 0 18 0;
#X connect 26 0 28 0;
