aboutsummaryrefslogtreecommitdiff
path: root/pd/doc/3.audio.examples/F11.anharmonic.FM.pd
blob: 333a6e44af5ae308fd799fc639052935e6010277 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#N canvas 60 64 790 527 12;
#X obj 122 381 cos~;
#X floatatom 173 184 4 0 200 0 - - -;
#X obj 173 207 / 10;
#X text 173 103 center;
#X text 173 123 freq. (in;
#X text 173 143 tenths of;
#X text 173 163 fundamental);
#X floatatom 70 192 4 0 0 0 - - -;
#X text 46 145 fundamental;
#X text 46 165 (= mod freq);
#X text 251 208 index;
#X text 251 228 (percent);
#X floatatom 251 249 4 0 500 0 - - -;
#X obj 251 318 line~;
#X obj 201 338 *~;
#X obj 251 272 / 100;
#X obj 251 295 pack 0 50;
#X obj 122 358 +~;
#X text 204 364 modulating;
#X text 209 381 oscillator;
#X obj 123 459 output~;
#X obj 122 428 hip~;
#N canvas 122 211 558 609 fft 0;
#X obj 23 55 inlet~;
#X obj 210 303 inlet;
#X obj 27 215 rfft~;
#X obj 27 248 *~;
#X obj 58 248 *~;
#X obj 27 278 sqrt~;
#X obj 334 200 block~ 4096 1;
#X obj 27 304 biquad~ 0 0 0 0 1;
#X text 91 216 Fourier series;
#X text 96 269 magnitude;
#X text 94 254 calculate;
#X text 21 3 This subpatch computes the spectrum of the incoming signal
with a (rectangular windowed) FFT. FFTs aren't properly introduced
until much later.;
#X text 83 61 signal to analyze;
#X text 195 255 delay two samples;
#X text 193 273 for better graphing;
#X obj 292 79 samplerate~;
#X obj 240 352 metro 500;
#X obj 240 329 inlet;
#X text 293 327 toggle to graph repeatedly;
#X text 264 303 bang to graph once;
#X obj 27 328 /~ 4096;
#X obj 292 54 bang~;
#X msg 211 413 \; pd dsp 1;
#X obj 292 102 / 4096;
#X obj 58 135 osc~;
#X obj 58 163 +~ 1;
#X obj 28 188 *~;
#X text 113 138 hanning window;
#X obj 254 79 0.5;
#X obj 240 390 tabwrite~ F11-spectrum;
#X connect 0 0 26 0;
#X connect 1 0 22 0;
#X connect 1 0 29 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 7 0;
#X connect 7 0 20 0;
#X connect 15 0 23 0;
#X connect 16 0 29 0;
#X connect 17 0 16 0;
#X connect 17 0 22 0;
#X connect 20 0 29 0;
#X connect 21 0 15 0;
#X connect 21 0 28 0;
#X connect 23 0 24 0;
#X connect 24 0 25 0;
#X connect 25 0 26 1;
#X connect 26 0 2 0;
#X connect 28 0 24 1;
#X restore 176 428 pd fft;
#X obj 236 407 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 236 428 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X text 257 427 <-- repeatedly;
#X text 258 407 <-- graph once;
#X text 530 479 updated for Pd version 0.37;
#N canvas 0 0 450 300 graph1 0;
#X array F11-spectrum 259 float 0;
#X coords 0 0.51 258 -0.008 256 130 1;
#X restore 514 291 graph;
#X text 506 422 0;
#X text 568 432 -- frequency --;
#X text 743 427 2700;
#X obj 173 256 *;
#X obj 173 233 t b f;
#X obj 201 315 osc~;
#X obj 122 322 phasor~;
#X text 31 30 Here's what happens if you just slide the carrier frequency
around. The spectrum moves up and down all right \, but is only periodic
at the original period when the center frequency roosts on a harmonic.
;
#X text 50 308 carrier;
#X text 24 325 oscillator;
#X text 167 6 HOW NOT TO APPLY TWO-COSINE CARRIER TO FM;
#X connect 0 0 21 0;
#X connect 0 0 22 0;
#X connect 1 0 2 0;
#X connect 2 0 33 0;
#X connect 7 0 32 0;
#X connect 7 0 34 0;
#X connect 12 0 15 0;
#X connect 13 0 14 1;
#X connect 14 0 17 1;
#X connect 15 0 16 0;
#X connect 16 0 13 0;
#X connect 17 0 0 0;
#X connect 21 0 20 0;
#X connect 21 0 20 1;
#X connect 23 0 22 1;
#X connect 24 0 22 2;
#X connect 32 0 35 0;
#X connect 33 0 32 0;
#X connect 33 1 32 1;
#X connect 34 0 14 0;
#X connect 35 0 17 0;