aboutsummaryrefslogtreecommitdiff
path: root/adaptive/examples/03.undermodeling.pd
diff options
context:
space:
mode:
Diffstat (limited to 'adaptive/examples/03.undermodeling.pd')
-rwxr-xr-xadaptive/examples/03.undermodeling.pd238
1 files changed, 238 insertions, 0 deletions
diff --git a/adaptive/examples/03.undermodeling.pd b/adaptive/examples/03.undermodeling.pd
new file mode 100755
index 0000000..7a194da
--- /dev/null
+++ b/adaptive/examples/03.undermodeling.pd
@@ -0,0 +1,238 @@
+#N canvas 0 68 891 823 10;
+#N canvas 10 567 633 314 unknown_system~ 0;
+#X obj 26 26 inlet~;
+#X obj 26 268 outlet~;
+#X obj 115 227 s~ unknown_signal;
+#X text 116 249 (for visualization);
+#X obj 26 113 fexpr~ $f2*$x1 + $f3*$x1[-1] + $f4*$x1[-2];
+#X obj 122 81 f 0.33;
+#X obj 218 81 f 0.33;
+#X obj 315 82 f 0.33;
+#X obj 122 53 r a0;
+#X obj 218 55 r a1;
+#X obj 315 56 r a2;
+#X connect 0 0 4 0;
+#X connect 4 0 1 0;
+#X connect 4 0 2 0;
+#X connect 5 0 4 1;
+#X connect 6 0 4 2;
+#X connect 7 0 4 3;
+#X connect 8 0 5 0;
+#X connect 9 0 6 0;
+#X connect 10 0 7 0;
+#X restore 245 268 pd unknown_system~;
+#X obj 305 434 tgl 20 0 audio_io empty empty 0 -6 0 8 -262144 -1 -1
+1 1;
+#X text 330 436 <- Audio IO;
+#N canvas 523 194 390 347 adaptive_filter~ 0;
+#X obj 37 35 inlet~;
+#X text 22 15 input signal;
+#X obj 143 35 inlet~;
+#X text 122 15 desired signal;
+#X obj 36 291 outlet~;
+#X msg 249 63 adaptation 1;
+#X obj 249 42 loadbang;
+#X obj 224 214 s~ adaptive_signal;
+#X text 224 234 (for visualization);
+#X obj 249 141 r clear;
+#X msg 248 162 clear;
+#X obj 116 293 outlet;
+#X obj 181 294 outlet;
+#X obj 249 94 r mu;
+#X msg 249 116 mu \$1;
+#X obj 37 156 lms2~ 2 0.01;
+#X obj 116 265 unpack f f;
+#X connect 0 0 15 0;
+#X connect 2 0 15 1;
+#X connect 5 0 15 0;
+#X connect 6 0 5 0;
+#X connect 9 0 10 0;
+#X connect 10 0 15 0;
+#X connect 13 0 14 0;
+#X connect 14 0 15 0;
+#X connect 15 0 4 0;
+#X connect 15 0 7 0;
+#X connect 15 2 16 0;
+#X connect 16 0 11 0;
+#X connect 16 1 12 0;
+#X restore 117 337 pd adaptive_filter~;
+#X obj 524 255 spectrum~;
+#N canvas 0 0 450 300 graph6 0;
+#X array adapt 512 float 0;
+#X coords 0 1 511 -1 200 140 1;
+#X restore 656 625 graph;
+#X text 700 769 -- 512 samples ---;
+#X obj 46 438 tgl 20 0 scopes_on empty empty 0 -6 0 8 -262144 -1 -1
+1 1;
+#X obj 524 238 r~ adaptive_signal;
+#X text 125 241 x[n];
+#X text 256 300 d[n];
+#X text 107 356 y[n];
+#X obj 775 238 r scopes_on;
+#X obj 775 26 r scopes_on;
+#X obj 524 26 r~ unknown_signal;
+#N canvas 0 0 450 300 graph6 0;
+#X array unkn 512 float 0;
+#X coords 0 1 511 -1 200 140 1;
+#X restore 654 453 graph;
+#X text 698 597 -- 512 samples ---;
+#X text 76 438 <- Visualization IO;
+#X text 481 137 (1);
+#X text 481 338 (2);
+#N canvas 452 215 456 231 scope_stuff 0;
+#X obj 45 38 r~ adaptive_signal;
+#X obj 83 63 r scopes_on;
+#X obj 279 69 r scopes_on;
+#X obj 241 44 r~ unknown_signal;
+#X obj 83 96 metro 1000;
+#X obj 44 139 tabwrite~ adapt;
+#X obj 279 95 metro 1000;
+#X obj 240 138 tabwrite~ unkn;
+#X connect 0 0 5 0;
+#X connect 1 0 4 0;
+#X connect 2 0 6 0;
+#X connect 3 0 7 0;
+#X connect 4 0 5 0;
+#X connect 6 0 7 0;
+#X restore 755 795 pd scope_stuff;
+#X text 582 510 (3);
+#X text 581 686 (4);
+#X text 86 760 (3) d[n] in time domain;
+#X text 86 777 (4) y[n] in time domain;
+#X text 86 742 (2) amplitude of the output signal y[n];
+#X text 86 711 (1) amplitude of the desired signal d[n] (= output of
+the unknown system);
+#X obj 84 599 bng 20 250 50 0 clear empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 113 601 <- clear coefficients \, so adaptation will start again
+;
+#X floatatom 46 471 5 0 100 0 - init_tlp tlp;
+#X obj 685 26 r tlp;
+#X obj 685 238 r tlp;
+#X text 90 469 <- temporal lowpass for spectrum view (0...100);
+#X text 54 689 VISUALIZATIONS:;
+#X text 42 522 unknown system:;
+#X text 72 546 d[n] =;
+#X floatatom 181 375 5 0 0 1 c0 - -;
+#X floatatom 245 375 5 0 0 1 c1 - -;
+#X text 40 578 adaptive filter:;
+#X floatatom 84 627 8 0 0 0 - mur mu;
+#X text 146 627 <- step size parameter mu (learning rate);
+#N canvas 215 124 617 210 init 0;
+#X msg 43 99 2;
+#X obj 269 45 loadbang;
+#X obj 43 122 s init_tlp;
+#X msg 138 98 0.33;
+#X msg 179 99 0.33;
+#X msg 223 100 0.33;
+#X obj 138 121 s a0r;
+#X obj 178 122 s a1r;
+#X obj 223 123 s a2r;
+#X obj 295 123 s mur;
+#X msg 294 99 0.01;
+#X msg 515 103 \; pd dsp \$1;
+#X obj 515 78 r audio_io;
+#X obj 381 123 s signalr;
+#X msg 380 98 0;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 1 0 3 0;
+#X connect 1 0 4 0;
+#X connect 1 0 5 0;
+#X connect 1 0 10 0;
+#X connect 1 0 14 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 5 0 8 0;
+#X connect 10 0 9 0;
+#X connect 12 0 11 0;
+#X connect 14 0 13 0;
+#X restore 699 795 pd init;
+#X floatatom 125 547 4 0 1 0 - a0r a0;
+#X text 158 547 x[n] +;
+#X text 244 547 x[n-1] +;
+#X floatatom 211 547 4 0 1 0 - a1r a1;
+#X floatatom 312 548 4 0 1 0 - a2r a2;
+#X text 345 549 x[n-2];
+#N canvas 741 100 479 337 PROBLEM_DESCRIPTION 0;
+#X text 75 224 d[n] = h0*x[n] + h1*x[n-1] + h2*x[n-2];
+#X text 35 188 unknown system:;
+#X text 74 209 FIR Filter \, order = 3;
+#X text 35 259 adaptive system:;
+#X text 77 292 step-size parameter mu;
+#X text 34 124 The unknown system is a FIR filter of order 3 and the
+adaptive system is an adaptive transversal filter using the LMS algorithm
+(see lms~ help-patch) with 2 coefficients.;
+#X text 77 278 LMS \, 2 coefficients (c0 \, c1);
+#X text 60 40 SYSTEM IDENTIFICATION: UNDERMODELING;
+#X text 33 85 In the case of undermodeling the order of the unknown
+system is higher than the order of the adaptive system.;
+#X restore 34 94 pd PROBLEM_DESCRIPTION;
+#N canvas 694 157 425 265 OBSERVATIONS 0;
+#X text 24 20 OBSERVATIONS;
+#X text 20 71 White Noise Case:;
+#X text 22 152 Non-White Case:;
+#X text 47 193 this case the error of the adaptive system is;
+#X text 48 209 much higher !;
+#X text 48 176 h0 \, h1 and h2 have influence on the error \, so in
+;
+#X text 51 96 only h1 and h2 have influence on the error;
+#X text 53 111 (min. error);
+#X restore 34 120 pd OBSERVATIONS;
+#X text 33 73 ReadMe:;
+#N canvas 0 0 642 300 input_signal~ 0;
+#X obj 77 90 noise~;
+#X obj 201 84 inlet;
+#X obj 77 217 *~;
+#X obj 210 273 outlet~;
+#X obj 201 115 sel 0 1;
+#X msg 91 190 1;
+#X msg 121 190 0;
+#X obj 325 88 noise~;
+#X text 53 64 white signal:;
+#X text 292 63 non white signal:;
+#X obj 322 224 *~;
+#X msg 336 197 1;
+#X msg 366 197 0;
+#X obj 324 112 hip~ 300;
+#X obj 492 148 bp~ 2543 2;
+#X obj 406 149 bp~ 1000 3;
+#X obj 323 148 bp~ 100 2;
+#X connect 0 0 2 0;
+#X connect 1 0 4 0;
+#X connect 2 0 3 0;
+#X connect 4 0 5 0;
+#X connect 4 0 12 0;
+#X connect 4 1 6 0;
+#X connect 4 1 11 0;
+#X connect 5 0 2 1;
+#X connect 6 0 2 1;
+#X connect 7 0 13 0;
+#X connect 10 0 3 0;
+#X connect 11 0 10 1;
+#X connect 12 0 10 1;
+#X connect 13 0 14 0;
+#X connect 13 0 15 0;
+#X connect 13 0 16 0;
+#X connect 14 0 10 0;
+#X connect 15 0 10 0;
+#X connect 16 0 10 0;
+#X restore 117 210 pd input_signal~;
+#X obj 117 162 vradio 20 1 1 2 empty signalr empty 0 -6 0 8 -262144
+-1 -1 0;
+#X text 144 163 white signal (noise);
+#X text 145 183 non white signal (filtered noise);
+#X obj 524 43 spectrum~;
+#X text 109 32 SYSTEM IDENTIFICATION: UNDERMODELING;
+#X connect 0 0 3 1;
+#X connect 3 1 36 0;
+#X connect 3 2 37 0;
+#X connect 8 0 4 0;
+#X connect 12 0 4 2;
+#X connect 13 0 55 2;
+#X connect 14 0 55 0;
+#X connect 30 0 55 1;
+#X connect 31 0 4 1;
+#X connect 51 0 0 0;
+#X connect 51 0 3 0;
+#X connect 52 0 51 0;