aboutsummaryrefslogtreecommitdiff
path: root/pd/doc/3.audio.examples/20.pulse.spectrum.pd
diff options
context:
space:
mode:
Diffstat (limited to 'pd/doc/3.audio.examples/20.pulse.spectrum.pd')
-rw-r--r--pd/doc/3.audio.examples/20.pulse.spectrum.pd136
1 files changed, 136 insertions, 0 deletions
diff --git a/pd/doc/3.audio.examples/20.pulse.spectrum.pd b/pd/doc/3.audio.examples/20.pulse.spectrum.pd
new file mode 100644
index 00000000..49d21cbd
--- /dev/null
+++ b/pd/doc/3.audio.examples/20.pulse.spectrum.pd
@@ -0,0 +1,136 @@
+#N canvas 15 126 887 588 12;
+#X obj 189 166 line~;
+#X obj 42 187 cos~;
+#X graph graph1 0 -1.02 882 1.02 633 508 833 378;
+#X array pulse-output 882 float 0;
+#X pop;
+#X floatatom 71 317 0 0 0;
+#N canvas 159 26 495 266 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 425 153 t b f;
+#X obj 397 117 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 397 92 r master-lvl;
+#X obj 83 42 r master-lvl;
+#X obj 338 210 s master-lvl;
+#X obj 22 181 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X obj 199 100 s master-lvl;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 20 158 audio;
+#X text 93 110 show level;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 13 0;
+#X connect 5 0 13 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 9 1 4 1;
+#X connect 10 0 24 0;
+#X connect 11 0 1 1;
+#X connect 11 0 9 0;
+#X connect 12 0 10 0;
+#X connect 12 0 18 0;
+#X connect 14 0 22 0;
+#X connect 15 0 17 0;
+#X connect 15 0 20 0;
+#X connect 18 0 19 0;
+#X connect 21 0 22 1;
+#X connect 22 0 23 0;
+#X connect 22 0 23 1;
+#X connect 24 0 21 0;
+#X restore 42 345 pd output;
+#X msg 118 319 MUTE;
+#X obj 189 142 pack 0 50;
+#X floatatom 189 41 0 0 0;
+#X text 598 545 updated for Pd version 0.26;
+#X obj 43 114 -~ 0.5;
+#X obj 43 140 *~;
+#X obj 189 67 / 10;
+#X obj 189 91 moses 0;
+#X msg 189 115 0;
+#X obj 42 163 clip~ -0.5 0.5;
+#X obj 42 289 hip~ 5;
+#X graph graph1 0 0 128 500 503 285 759 155;
+#X array spectrum 128 float 0;
+#X pop;
+#X text 184 23 bandwidth;
+#X obj 115 267 tabwrite~ pulse-output;
+#X msg 105 229 bang;
+#X text 143 226 <-- click to graph;
+#X obj 189 191 +~ 1;
+#N canvas 204 17 358 238 fft 0;
+#X obj 46 48 inlet~;
+#X obj 159 181 tabwrite~ spectrum;
+#X obj 159 145 inlet;
+#X obj 46 78 rfft~;
+#X obj 46 111 *~;
+#X obj 77 111 *~;
+#X obj 46 141 sqrt~;
+#X obj 191 45 block~ 1024 1;
+#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 restore 53 267 pd fft;
+#X obj 43 90 phasor~ 172.266;
+#X obj 42 211 +~ 1;
+#X text 63 1 PULSE SPECTRUM MEASUREMENT;
+#X text 16 377 Here is a measured amplitude spectrum for the pulse
+train. Nutice that \, other than a smallish spillover \, the energy
+sits in one "lobe" whose changing width justifies our calling the squeeze
+factor the "bandwidth.";
+#X text 16 442 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.;
+#X text 17 518 The spectrum measurement is done in the "pd fft" subwindow
+\, but see the "FFT examples" for information about that.;
+#X text 501 291 0;
+#X text 749 288 5512;
+#X text 633 511 ---- 0.02 seconds ----;
+#X text 160 319 <-- output;
+#X connect 0 0 21 0;
+#X connect 1 0 24 0;
+#X connect 3 0 4 1;
+#X connect 4 0 3 0;
+#X connect 5 0 4 2;
+#X connect 6 0 0 0;
+#X connect 7 0 11 0;
+#X connect 9 0 10 0;
+#X connect 10 0 14 0;
+#X connect 11 0 12 0;
+#X connect 12 0 13 0;
+#X connect 12 1 6 0;
+#X connect 13 0 6 0;
+#X connect 14 0 1 0;
+#X connect 15 0 4 0;
+#X connect 19 0 18 0;
+#X connect 19 0 22 1;
+#X connect 21 0 10 1;
+#X connect 23 0 9 0;
+#X connect 24 0 22 0;
+#X connect 24 0 15 0;
+#X connect 24 0 18 0;