From d938708c3e697a3c6b1c4b8a4f0680c8c66bc68c Mon Sep 17 00:00:00 2001 From: beadleha Date: Tue, 14 Jul 2015 07:06:42 +0000 Subject: Added a noise generator --- client.py | 5 +++++ 1 file changed, 5 insertions(+) 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', '([, [, [, <0=linear interp (default), 1=nearest>[, ]]]])') class file_samp(object): LINEAR = 0 -- cgit v1.2.3-70-g09d2