Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test.py
6 changes: 5 additions & 1 deletion blanco.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ class Blanco(object):
"""

def __init__(self, amplitud, tiempo_inicial, tiempo_final):
self.amp = amplitud
self.ti = tiempo_inicial
self.tf = tiempo_final
#TODO: completar con la inicializacion de los parametros del objeto
pass

def reflejar(self, senal, tiempo_inicial, tiempo_final):

ret = [senal[i]/4.0 for i in range(len(senal))]
return ret
#TODO ver como se encajan los tiempos del blanco y del intervalo de tiempo
#(interseccion de invervalos)
# despues aplicar los parametros del blanco sobre ese intervalo de tiempo
pass

9 changes: 5 additions & 4 deletions generador.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ def __init__(self, amplitud, fase, frecuencia):
def generar(self, tiempo_inicial, tiempo_final):

import math

import numpy.random as ran
cantidad_muestras = (tiempo_final - tiempo_inicial).seconds/\
self.frecuencia_muestreo

muestras = range(cantidad_muestras)
#TODO agregar un ruido blanco a la senal
#TODO agregar un ruido blanco a la senal ##################

ret = [self.amplitud*math.sin(2*(1/self.frecuencia)*i+self.fase) \
for i in muestras]
############################################################
ret = [self.amplitud*math.sin(2*(1/self.frecuencia)*i+self.fase + \
self.amplitud*ran.uniform(-1.,1.)*0.001) for i in muestras]

return ret
4 changes: 2 additions & 2 deletions medio.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
class Medio(object):

def __init__(self, blancos):
self.blancos = blancos
self.blancos = blanco


def reflejar(self, una_senal, tiempo_inicial, tiempo_final):
"""
Los blancos en el medio reflejan la senal
"""

ret = self.blancos.reflejar(una_senal,tiempo_inicial,tiempo_final)
#TODO reflejar en un medio debe reflejar en todos los blancos de un medio
#y devolver la senal reflejada
pass