#N canvas 619 23 517 723 12;
#X text 281 681 updated for Pd version 0.39;
#X text 94 15 MORE ON MEASURING SPECTRA: HETERODYNING;
#X obj 112 263 phasor~ 100;
#X obj 165 317 phasor~;
#X floatatom 165 294 5 0 999 0 - \$0-freq - 0;
#X obj 165 355 cos~;
#X obj 208 371 cos~;
#X obj 208 346 +~ 0.25;
#X obj 112 570 snapshot~;
#N canvas 536 459 382 265 startup 0;
#X obj 22 14 loadbang;
#X obj 22 38 bng 19 250 50 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000;
#X obj 22 67 f \$0;
#X text 35 195 This subpatch loads initial;
#X text 37 211 values in number boxes.;
#X obj 223 132 metro 250;
#X obj 223 107 r \$0-metro;
#X obj 223 156 s \$0-tick;
#X msg 22 91 \; \$1-freq 100 \; \$1-lop 2 \; \$1-metro 1;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 8 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X restore 353 625 pd startup;
#X obj 113 415 *~;
#X obj 157 415 *~;
#X obj 113 473 lop~;
#X obj 157 473 lop~;
#X floatatom 182 442 3 0 100 0 - \$0-lop - 0;
#X obj 291 570 snapshot~;
#X floatatom 112 598 5 0 0 0 - - - 0;
#X floatatom 291 598 5 0 0 0 - - - 0;
#X obj 259 500 r \$0-tick;
#X obj 259 524 t b b;
#X obj 112 636 expr sqrt($f1*$f1+$f2*$f2);
#X floatatom 112 662 5 0 0 0 - - - 0;
#X text 37 259 signal to;
#X text 51 273 analyze;
#X text 36 47 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).;
#X text 32 129 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.;
#X text 272 335 modulate;
#X text 269 371 to DC;
#X text 268 353 test frequency;
#X text 197 473 low-pass filter;
#X text 73 595 real;
#X text 73 609 part;
#X text 254 605 part;
#X text 219 592 imaginary;
#X text 163 663 magnitude;
#X text 208 294 <= test frequency;
#X text 211 442 <= responsiveness;
#X msg 378 289 \; pd dsp \$1;
#X obj 378 263 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X connect 2 0 10 0;
#X connect 2 0 11 0;
#X connect 3 0 5 0;
#X connect 3 0 7 0;
#X connect 4 0 3 0;
#X connect 5 0 10 1;
#X connect 6 0 11 1;
#X connect 7 0 6 0;
#X connect 8 0 16 0;
#X connect 10 0 12 0;
#X connect 11 0 13 0;
#X connect 12 0 8 0;
#X connect 13 0 15 0;
#X connect 14 0 13 1;
#X connect 14 0 12 1;
#X connect 15 0 17 0;
#X connect 16 0 20 0;
#X connect 17 0 20 1;
#X connect 18 0 19 0;
#X connect 19 0 8 0;
#X connect 19 1 15 0;
#X connect 20 0 21 0;
#X connect 38 0 37 0;
