Evaluating bids

Ondas en pyton

Published on the February 21, 2017 in IT & Programming

About this project

Open

Necesito generar una onda triangular y otra diente de sierra en pyton parecida a esta que es cuadrada

class Square:
    def __init__(self,frecuenciamuestreo,profundidadbits,tiempo,tono):
        self.muestreo = frecuenciamuestreo
        self.bits = profundidadbits
        self.duracion = tiempo * frecuenciamuestreo
        self.tono = tono

    def generar(self):
        wavearray = []
        for i in range(self.duracion):
            x = math.sin(2*math.pi*self.tono*i/self.muestreo)
            if x >= 0:
                wavearray.append(1)
            elif x < 0:
                wavearray.append(-1)
        return wavearray

    def graficar(self,arreglo):
        plt.plot(arreglo)
        plt.show()


gracias

Category IT & Programming
Subcategory Other
Project size Small
Is this a project or a position? Project
I currently have I have specifications
Required availability As needed
Experience in this type of projects No (I haven’t managed this kind of project before)

Delivery term: Not specified

Skills needed