naspro

view permafrost/examples/delay.pmf @ 178:7169a8909d53

Added Permafrost + small changes
author Stefano D'Angelo <zanga.mail@gmail.com>
date Sun May 02 14:19:58 2010 +0300 (2010-05-02)
parents
children
line source
1 # Permafrost - Physical modelling framework
2 #
3 # Copyright (C) 2009, 2010 Stefano D'Angelo <zanga.mail@gmail.com>
4 #
5 # See the COPYING file for license conditions.
7 import common;
9 system Delay_1_sample
10 {
11 sync input i;
12 sync output o;
14 delay_line d;
16 o = d.o;
17 d.i = i;
18 d.delay = 1;
19 d.delay_max = 1;
20 }
22 system Delay_10_samples
23 {
24 sync input i;
25 sync output o;
27 delay_line d;
29 o = d.o;
30 d.i = i;
31 d.delay = 10;
32 d.delay_max = 10;
33 }
35 system Delay_10000_samples
36 {
37 sync input i;
38 sync output o;
40 delay_line d;
42 o = d.o;
43 d.i = i;
44 d.delay = 10000;
45 d.delay_max = 10000;
46 }
48 system Delay_1_sec
49 {
50 sync input i;
51 sync output o;
53 delay_line d;
54 secs_to_samples s;
56 o = d.o;
57 d.i = i;
58 d.delay = s.samples;
59 d.delay_max = s.samples;
60 s.secs = 1;
61 }
63 system Delay_max_10_secs
64 {
65 sync input i;
66 sync output o;
67 async input seconds;
69 delay_line d;
70 secs_to_samples s;
71 secs_to_samples s_max;
73 o = d.o;
74 d.i = i;
75 d.delay = s.samples;
76 d.delay_max = s_max.samples;
77 s.secs = seconds;
78 s_max.secs = 10;
79 }