#N canvas 532 66 705 636 12;
#X declare -stdpath ./;
#X obj 188 267 line~;
#X obj 94 380 cos~;
#X obj 188 243 pack 0 50;
#X floatatom 188 171 4 0 0 0 - - - 0;
#X obj 94 272 -~ 0.5;
#X obj 94 331 *~;
#X obj 188 195 / 10;
#X obj 94 356 clip~ -0.5 0.5;
#X text 224 172 bandwidth;
#X obj 188 291 +~ 1;
#X obj 95 403 +~ 1;
#X obj 253 376 cos~;
#X obj 95 442 *~;
#X floatatom 271 224 5 0 0 0 - - - 0;
#X obj 271 248 / 10;
#X obj 253 350 *~;
#X obj 188 219 max 0;
#X obj 271 320 line~;
#X obj 271 296 pack 0 50;
#X obj 271 272 max 0;
#X floatatom 94 221 5 0 0 0 - \$0-fundamental - 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X array spectrum 128 float 0;
#X coords 0 500 128 0 302 187 1;
#X restore 344 350 graph;
#N canvas 590 187 344 278 fft 0;
#X obj 46 48 inlet~;
#X obj 137 179 tabwrite~ spectrum;
#X obj 137 46 inlet;
#X obj 46 78 rfft~;
#X obj 46 111 *~;
#X obj 78 111 *~;
#X obj 78 142 sqrt~;
#X obj 156 235 block~ 1024;
#X obj 207 46 inlet;
#X obj 207 80 metro 250;
#X connect 0 0 3 0;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 3 0 4 1;
#X connect 3 1 5 0;
#X connect 3 1 5 1;
#X connect 4 0 6 0;
#X connect 5 0 6 0;
#X connect 6 0 1 0;
#X connect 8 0 9 0;
#X connect 9 0 1 0;
#X restore 119 480 pd fft;
#X text 339 544 0;
#X text 622 544 5512;
#X text 46 69 Here's the spectrum you get. Note that even if you put the center frequency right on a partial \, there is significant energy in neighboring partials (try fundamental 440 \, "center freq" 30 \, bandwidth 0.), f 43;
#X text 384 91 The center frequency is in units of ten per partial \, or in other words a value of "30" means "centered on the third partial"., f 35;
#X obj 95 531 output~;
#X obj 138 453 bng 19 250 50 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000;
#X text 258 201 center freq.;
#X text 70 184 fundamental frequency, f 11;
#X obj 32 21 cnv 5 5 25 empty empty Windowed\ Packet\ Spectrum 15 13 0 16 #dfdfdf #202020 0;
#N canvas 238 316 368 300 init 0;
#X obj 122 223 declare -stdpath ./;
#X obj 131 97 loadbang;
#X obj 131 166 s \$0-fundamental;
#X msg 131 134 220;
#X text 81 28 This subpatch initializes the patch and loads a value in the number box., f 29;
#X connect 1 0 3 0;
#X connect 3 0 2 0;
#X restore 241 550 pd init;
#X obj 94 246 phasor~;
#X obj 180 480 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X text 160 451 <-- graph once;
#X text 202 480 <-- graph repeatedly, f 10;
#X text 385 172 This technique only works if you're doing Hanning-window shaped PWM -- you can't combine this naturally with FM or with the waveshaping technique we'll see later., f 35;
#X connect 0 0 9 0;
#X connect 1 0 10 0;
#X connect 2 0 0 0;
#X connect 3 0 6 0;
#X connect 4 0 5 0;
#X connect 4 0 15 0;
#X connect 5 0 7 0;
#X connect 6 0 16 0;
#X connect 7 0 1 0;
#X connect 9 0 5 1;
#X connect 10 0 12 0;
#X connect 11 0 12 1;
#X connect 12 0 22 0;
#X connect 12 0 27 0;
#X connect 13 0 14 0;
#X connect 14 0 19 0;
#X connect 15 0 11 0;
#X connect 16 0 2 0;
#X connect 17 0 15 1;
#X connect 18 0 17 0;
#X connect 19 0 18 0;
#X connect 20 0 33 0;
#X connect 28 0 22 1;
#X connect 33 0 4 0;
#X connect 34 0 22 2;
