import math 10*math.log10(10./5.) 10*math.log10(5./10.) 10*math.log10(30./10.) 10*math.log10(100./1.) import scipy, math import matplotlib.pyplot as plt # Graphing helper function def setup_graph(title='', x_label='', y_label='', fig_size=None): fig = plt.figure() if fig_size != None: fig.set_size_inches(fig_size[0], fig_size[1]) ax = fig.add_subplot(111) ax.set_title(title) ax.set_xlabel(x_label) ax.set_ylabel(y_label) freq = 1 #hz - cycles per second amplitude = 10 time_to_plot = 2 # second sample_rate = 100 # samples per second num_samples = sample_rate * time_to_plot #afeixit per Pere per evitar representar log(0) time_origin=0.01 t = scipy.linspace(time_origin, time_to_plot, num_samples) #signal = [amplitude * math.sin(freq * i * 2*math.pi) for i in t] # Explain the 2*pi """ ver que signal es una lista de num_samples con las muestras de la funcion a samplear """ signal = [amplitude * math.log10(i) for i in t] setup_graph(x_label='', y_label='', title='log10') plot(t, signal)