view run.py @ 5:d7b2784ff5a3

* Fixed some miscalculations from the way python does float division * Made data files more precise
author Carl Bussey <c.bussey@se10.qmul.ac.uk>
date Sun, 23 Feb 2014 16:58:00 +0000
parents 29cd3e735c4c
children 546dfcd45281
line wrap: on
line source
import cortical_model as cm
import numpy as np
import utils

t = np.array(range(44100))
sine = np.sin(2*np.pi*t*1000/44100)
sine1 = np.sin(2*np.pi*t*100/44100)
x = np.append(sine, sine1)

exc_i = cm.get_excitation_i(x, 44100, 60, verbose = True)
sl = cm.get_specific_loudness(exc_i)

#for i in range(39):
#    utils.plot_waveform(sl[i])

print "Loudness"
loudness = 2*np.sum(sl,0)

utils.plot_waveform(loudness)