#N canvas 509 45 619 675 12;
#X declare -stdpath ./;
#X obj 193 274 line~;
#X obj 71 353 cos~;
#X obj 193 250 pack 0 50;
#X floatatom 147 149 4 0 100 0 - - - 0;
#X obj 71 221 -~ 0.5;
#X obj 71 258 *~;
#X obj 147 175 / 10;
#X obj 147 199 moses 0;
#X msg 147 223 0;
#X obj 71 324 clip~ -0.5 0.5;
#X text 192 149 bandwidth;
#X obj 193 299 +~ 1;
#X obj 71 381 +~ 1;
#X text 66 59 Here is a measured amplitude spectrum for the pulse train. Notice that \, other than a smallish spillover \, the energy sits in one "lobe" whose changing width justifies our calling the squeeze factor the "bandwidth.", f 68;
#X text 86 577 The spectrum is in units of amplitude. The sidelobes \, although they look small \, are actually only about 34 dB down. You can design more complicated pulse trains \, little Blackman window functions \, which control the sidelobes much better., f 68;
#X obj 71 487 output~;
#N canvas 715 281 520 493 fft 0;
#X obj 43 105 inlet~;
#X obj 142 264 inlet;
#X obj 63 136 rfft~;
#X obj 63 169 *~;
#X obj 95 169 *~;
#X obj 63 199 sqrt~;
#X obj 63 225 biquad~ 0 0 0 0 1;
#X text 127 137 Fourier series;
#X text 132 190 magnitude;
#X text 130 175 calculate;
#X text 60 26 This subpatch computes the spectrum of the incoming signal with a (rectangular windowed) FFT. FFTs aren't properly introduced until much later.;
#X text 105 104 signal to analyze;
#X text 194 216 delay two samples;
#X text 192 234 for better graphing;
#X obj 178 328 metro 500;
#X obj 178 292 inlet;
#X text 231 290 toggle to graph repeatedly, f 15;
#X text 185 264 bang to graph once;
#X obj 63 249 /~ 4096;
#X obj 43 422 tabwrite~ F03-signal;
#X obj 143 396 tabwrite~ F03-spectrum;
#X obj 366 153 block~ 4096;
#X text 368 126 Window size;
#X obj 142 360 b;
#X connect 0 0 2 0;
#X connect 0 0 19 0;
#X connect 1 0 23 0;
#X connect 2 0 3 0;
#X connect 2 0 3 1;
#X connect 2 1 4 0;
#X connect 2 1 4 1;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 6 0 18 0;
#X connect 14 0 23 0;
#X connect 15 0 14 0;
#X connect 18 0 20 0;
#X connect 23 0 20 0;
#X connect 23 0 19 0;
#X restore 119 449 pd fft;
#X obj 138 418 bng 19 250 50 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000;
#X obj 178 449 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 71 407 *~ 0.5;
#X obj 71 194 phasor~;
#N canvas 0 0 450 300 (subpatch) 0;
#X array F03-signal 882 float 0;
#X coords 0 1.02 882 -1.02 200 130 1;
#X restore 371 377 graph;
#N canvas 0 0 450 300 (subpatch) 0;
#X array F03-spectrum 259 float 0;
#X coords 0 0.51 258 -0.008 256 130 1;
#X restore 339 164 graph;
#X text 371 510 ---- 0.02 seconds ----;
#X text 368 295 2;
#X text 399 295 4;
#X text 338 295 0;
#X text 431 295 6;
#X text 464 295 8;
#X text 492 295 10;
#X text 524 295 12;
#X text 556 295 14;
#X obj 71 165 r freq;
#X text 199 448 <-- repeatedly;
#X text 160 418 <-- graph once;
#X obj 40 15 cnv 5 5 25 empty empty Pulse\ Spectrum\ Measurement 15 13 0 16 #dfdfdf #202020 0;
#X text 382 320 --- partial number ---;
#N canvas 241 111 402 454 init 0;
#X obj 102 214 samplerate~;
#X obj 102 163 bng 18 250 50 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000;
#X obj 102 241 / 256;
#X obj 102 135 loadbang;
#X obj 102 296 s fundamental;
#X text 44 45 At load time \, calculate a good choice of fundamental frequency for showing spectra: the 16th bin in a 4096-point spectrum \, so SR*16/4096 or SR/256., f 42;
#X obj 93 344 declare -stdpath ./;
#X floatatom 102 268 9 0 0 0 - - - 0;
#X text 45 14 This subpatch initializes the patch.;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 2 0 7 0;
#X connect 3 0 1 0;
#X connect 7 0 4 0;
#X restore 226 511 pd init;
#X connect 0 0 11 0;
#X connect 1 0 12 0;
#X connect 2 0 0 0;
#X connect 3 0 6 0;
#X connect 4 0 5 0;
#X connect 5 0 9 0;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 7 1 2 0;
#X connect 8 0 2 0;
#X connect 9 0 1 0;
#X connect 11 0 5 1;
#X connect 12 0 19 0;
#X connect 17 0 16 1;
#X connect 18 0 16 2;
#X connect 19 0 16 0;
#X connect 19 0 15 0;
#X connect 20 0 4 0;
#X connect 32 0 20 0;
