def draw(self, ax, time=None, cycles=1, **kwargs): """Draws the signals wave shape""" #if time is not provided draw the wave shape 'cycles' times if time is None: time = cycles / np.float64(self.freq) try: kwargs['density'] *= cycles except KeyError: kwargs['density'] = 100 * cycles Generator.draw(self, ax, time, **kwargs)
def draw(self, ax, time=1.0, **kwargs): """ Draws the shape of the output signal along with its input The shape will be drawn for 'cycles' cycles of the input """ #draw the amplifiers output Generator.draw(self, ax, time, **kwargs) try: kwargs['alpha'] *= 0.5 except KeyError: kwargs['alpha'] = 0.5 #draw the amplifiers input self.input.draw(ax, time, **kwargs)
def draw(self, ax, time=1.0, **kwargs): """ Draws the shape of the output signal along with its inputs """ #draw the output signal Generator.draw(self, ax, time, **kwargs) #draw inputs' output signals for i in range(len(self.inputs)): try: kwargs['alpha'] *= 0.5 except KeyError: kwargs['alpha'] = 0.5 try: kwargs['scale'] *= self.levels[i] except KeyError: kwargs['scale'] = self.levels[i] self.inputs[i].draw(ax, time, **kwargs)