aboutsummaryrefslogtreecommitdiff
path: root/client.py
diff options
context:
space:
mode:
authorbeadleha <beadleha@clarkson.edu>2015-07-14 07:06:42 +0000
committerbeadleha <beadleha@clarkson.edu>2015-07-14 07:06:42 +0000
commitd938708c3e697a3c6b1c4b8a4f0680c8c66bc68c (patch)
tree05a743a426ed395009c54179af787e9f6af630a8 /client.py
parente619561707ee8e21af6f77cc262e8c65d5c50763 (diff)
Added a noise generator
Diffstat (limited to 'client.py')
-rw-r--r--client.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/client.py b/client.py
index 5be9bd0..b4ad7d3 100644
--- a/client.py
+++ b/client.py
@@ -10,6 +10,7 @@ import struct
import socket
import optparse
import array
+import random
from packet import Packet, CMD, stoi
@@ -71,6 +72,10 @@ def square_wave(theta):
else:
return -1
+@generator('Random (noise) generator')
+def noise(theta):
+ return math.random() * 2 - 1
+
@generator('File generator', '(<file>[, <bits=8>[, <signed=True>[, <0=linear interp (default), 1=nearest>[, <swapbytes=False>]]]])')
class file_samp(object):
LINEAR = 0