1
#N canvas 190 29 773 821 12;
2
#N canvas 0 0 450 300 graph1 0;
3
#X array E01-signal 882 float 0;
4
#X coords 0 5 882 -5 200 130 1;
5
#X restore 531 41 graph;
7
#N canvas 0 0 450 300 graph1 0;
8
#X array E01-spectrum 128 float 0;
9
#X coords 0 4300 127 -40 257 130 1;
10
#X restore 485 226 graph;
11
#X text 134 243 <-- click to graph;
12
#N canvas 45 83 558 569 fft 0;
19
#X obj 85 248 tabwrite~ E01-spectrum;
20
#X obj 332 109 block~ 4096 1;
21
#X obj 19 181 biquad~ 0 0 0 0 1;
22
#X text 83 93 Fourier series;
23
#X text 88 146 magnitude;
24
#X text 86 131 calculate;
25
#X text 21 3 This subpatch computes the spectrum of the incoming signal
26
with a (rectangular windowed) FFT. FFTs aren't properly introduced
28
#X text 83 62 signal to analyze;
29
#X text 182 166 delay two samples;
30
#X text 181 182 for better graphing;
31
#X obj 90 425 samplerate~;
32
#X obj 90 402 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
34
#X floatatom 90 472 5 0 0 0 - - -;
36
#X obj 90 378 loadbang;
37
#X floatatom 90 541 5 0 0 0 - - -;
38
#X obj 98 494 s fundamental;
40
#X text 146 540 <-just out of curiosity \, here's the pitch;
41
#X text 14 319 At load time \, calculate a good choice of fundamental
42
frequency for showing spectra: the 16th bin in a 4096-point spectrum
43
\, so SR*16/4096 or SR/256.;
44
#X text 135 216 "bang" into this inlet to graph it;
62
#X restore 51 279 pd fft;
63
#X text 531 173 ---- 0.02 seconds ----;
64
#X obj 111 244 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
66
#X obj 40 332 output~;
67
#X obj 111 279 tabwrite~ E01-signal;
68
#X text 523 800 updated for Pd version 0.37;
77
#X text 520 378 -- partial number --;
79
#X obj 42 42 r fundamental;
81
#X obj 63 136 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
85
#X obj 106 136 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
89
#X obj 149 136 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
94
#X obj 192 136 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
98
#X obj 235 136 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
102
#X obj 278 136 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
110
#X text 303 136 <-- On/Off;
111
#X text 337 152 for each;
112
#X text 339 168 partial;
113
#X text 595 11 WAVEFORM;
114
#X text 578 204 SPECTRUM;
115
#X text 25 415 The next series of patches demonstrates various kinds
116
of modulation: AM \, waveshaping \, and FM. We will need a tool for
117
graphing spectra which is introduced here. In this patch the signal
118
to be analyzed is a simple sum of up to six partials of a fundamental
119
frequency (which is 172 Hz \, close to F below middle C \, if your
120
sample rate happens to be 44100 Hz. The fundamental is chosen to agree
121
with the analysis patch ("pd FFT") and is computed within it).;
122
#X text 25 546 The partials are numbered 0 through 5 \, where 0 means
123
DC \, or zero frequency \, 1 is the fundamental \, and so on. The toggle
124
switches allow you to turn them on and off separately. You have to
125
press the "click to graph" button to update the two graphs.;
129
#X text 26 631 The upper graph is just the (time domain) waveform \,
130
about four periods long. The lower graph is the magnitude spectrum.
131
Its peaks are the magnitudes of the partials. Note that a DC signal
132
of amplitude one is considered a partial of magnitude 1 \, but the
133
other partials \, which have peak amplitudes of 1 (and RMS 0.707) \,
134
have peak magnitudes of only 0.5 in the spectrum.;
139
#X text 96 5 GRAPHING SPECTRA OF AUDIO SIGNALS;
140
#X text 24 742 Here we're introducing a new feature: multiple signals
141
connected to a signal inlet (as in the "*~ 1") are added. This is the
142
most convenient way to sum the six partials.;
147
#X connect 20 0 40 0;
148
#X connect 20 0 41 0;
149
#X connect 20 0 30 0;
150
#X connect 20 0 42 0;
151
#X connect 20 0 43 0;
152
#X connect 20 0 44 0;
153
#X connect 21 0 23 0;
154
#X connect 22 0 23 1;
155
#X connect 23 0 56 0;
156
#X connect 24 0 26 0;
157
#X connect 25 0 26 1;
158
#X connect 26 0 56 0;
159
#X connect 27 0 29 0;
160
#X connect 28 0 29 1;
161
#X connect 29 0 56 0;
162
#X connect 30 0 27 0;
163
#X connect 31 0 33 0;
164
#X connect 32 0 33 1;
165
#X connect 33 0 56 0;
166
#X connect 34 0 36 0;
167
#X connect 35 0 36 1;
168
#X connect 36 0 56 0;
169
#X connect 37 0 39 0;
170
#X connect 38 0 39 1;
171
#X connect 39 0 56 0;
172
#X connect 40 0 21 0;
173
#X connect 41 0 24 0;
174
#X connect 42 0 31 0;
175
#X connect 43 0 34 0;
176
#X connect 44 0 37 0;