summaryrefslogtreecommitdiff
path: root/tran/white.alg
diff options
context:
space:
mode:
Diffstat (limited to 'tran/white.alg')
-rw-r--r--tran/white.alg24
1 files changed, 24 insertions, 0 deletions
diff --git a/tran/white.alg b/tran/white.alg
new file mode 100644
index 0000000..8fc3832
--- /dev/null
+++ b/tran/white.alg
@@ -0,0 +1,24 @@
+(WHITE-ALG
+(NAME "white")
+(ARGUMENTS ("time_type" "t0") ("rate_type" "sr") ("time_type" "d"))
+(STATE )
+(TERMINATE (AFTER "d"))
+(INNER-LOOP "output = (sample_type) (rand() * rand_scale - 1.0);")
+(SAMPLE-RATE "sr")
+(SUPPORT-HEADER "
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03 rbd all systems now use rand(), based on DM's modifications
+ */
+
+#include <stdlib.h>
+#include <math.h>
+
+/* rand returns from 0 to RAND_MAX. Scale and offset
+ * to get range from -1 to +1
+ */
+#define rand_scale (2.0/RAND_MAX)
+
+")
+)
+