Changeset 4197

Show
Ignore:
Timestamp:
06/18/07 16:28:27 (8 years ago)
Author:
DrewCormier
Message:

wrong variable name

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • experimental/AWG/trunk/AWG/sources.py

    r4196 r4197  
    4141 
    4242    def gen_sine(self): 
    43         '''freq is frequency in cycles per packet.  len is the length of the packet.  type is the data type to return (e.g., "float", "short", "int")''' 
     43        '''freq is frequency in cycles per packet.  signal_len is the length of the packet.  type is the data type to return (e.g., "float", "short", "int")''' 
    4444 
    4545        count = 0 
    4646        sine = [] 
    47         while count < self.parent.len: 
    48             sine.append(math.sin(self.parent.freq*2*math.pi*count/self.parent.len)) 
     47        while count < self.parent.signal_len: 
     48            sine.append(math.sin(self.parent.freq*2*math.pi*count/self.parent.signal_len)) 
    4949            count = count + 1 
    5050 
     
    5353 
    5454    def gen_cosine(self): 
    55         '''freq is frequency in cycles per packet.  len is the length of the packet.  type is the data type to return (e.g., "float", "short", "int")''' 
     55        '''freq is frequency in cycles per packet.  signal_len is the length of the packet.  type is the data type to return (e.g., "float", "short", "int")''' 
    5656 
    5757        count = 0 
    5858        cosine = [] 
    59         while count < self.parent.len: 
    60             cosine.append(math.cos(self.parent.freq*2*math.pi*count/self.parent.len)) 
     59        while count < self.parent.signal_len: 
     60            cosine.append(math.cos(self.parent.freq*2*math.pi*count/self.parent.signal_len)) 
    6161            count = count + 1 
    6262 
     
    7272        if tmp_rand_type == 'random': 
    7373            count = 0 
    74             while count < self.parent.len: 
     74            while count < self.parent.signal_len: 
    7575                data.append(random.random()) 
    7676                count = count + 1 
    7777        elif tmp_rand_type == 'uniform': 
    7878            count = 0 
    79             while count < self.parent.len: 
     79            while count < self.parent.signal_len: 
    8080                data.append(random.uniform()) 
    8181                count = count + 1 
     
    8888        '''returns a list of zeros''' 
    8989        data = [] 
    90         for n in range(self.parent.len): 
     90        for n in range(self.parent.signal_len): 
    9191            data.append(0) 
    9292        return data