In [1]:
import data_utils
import matplotlib.pyplot as plt

In [3]:
Engy, F0, Y = data_utils.LoadData('train')
Engy, F0 = data_utils.IgnoreLowEnergyFrequence(Engy, F0)
Engy, F0 = data_utils.TrimData(Engy, F0)
#Engy, F0 = data_utils.LogData(Engy, F0)
Engy, F0 = data_utils.NormalizeDataLengthWithInterpolation(Engy, F0, result_len=120)
data_utils.SaveData(Engy, F0, Y, 'train')

x = [i for i in xrange(120)]

for f0, y in zip(F0, Y):
    if y == 0:
        plt.plot(x, f0)
plt.savefig('train-0.png')
plt.show()

for f0, y in zip(F0, Y):
    if y == 1:
        plt.plot(x, f0)
plt.savefig('train-1.png')
plt.show()
for f0, y in zip(F0, Y):
    if y == 2:
        plt.plot(x, f0)
plt.savefig('train-2.png')
plt.show()

for f0, y in zip(F0, Y):
    if y == 3:
        plt.plot(x, f0)
plt.savefig('train-3.png')
plt.show()



In [4]:
Engy, F0, Y = data_utils.LoadData('val')
Engy, F0 = data_utils.IgnoreLowEnergyFrequence(Engy, F0)
Engy, F0 = data_utils.TrimData(Engy, F0)
# Engy, F0 = data_utils.LogData(Engy, F0)
Engy, F0 = data_utils.NormalizeDataLengthWithInterpolation(Engy, F0, result_len=120)

data_utils.SaveData(Engy, F0, Y, 'val')

x = [i for i in xrange(120)]

for f0, y in zip(F0, Y):
    if y == 0:
        plt.plot(x, f0)
plt.savefig('val-0.png')
plt.show()

for f0, y in zip(F0, Y):
    if y == 1:
        plt.plot(x, f0)
plt.savefig('val-1.png')
plt.show()
for f0, y in zip(F0, Y):
    if y == 2:
        plt.plot(x, f0)
plt.savefig('val-2.png')
plt.show()

for f0, y in zip(F0, Y):
    if y == 3:
        plt.plot(x, f0)
plt.savefig('val-3.png')
plt.show()



In [5]:
Engy, F0, Y = data_utils.LoadData('test')
Engy, F0 = data_utils.IgnoreLowEnergyFrequence(Engy, F0)
Engy, F0 = data_utils.TrimData(Engy, F0)
# Engy, F0 = data_utils.LogData(Engy, F0)
Engy, F0 = data_utils.NormalizeDataLengthWithInterpolation(Engy, F0, result_len=120)

data_utils.SaveData(Engy, F0, Y, 'test')

x = [i for i in xrange(120)]

for f0, y in zip(F0, Y):
    if y == 0:
        plt.plot(x, f0)
plt.savefig('test-0.png')
plt.show()

for f0, y in zip(F0, Y):
    if y == 1:
        plt.plot(x, f0)
plt.savefig('test-1.png')
plt.show()
for f0, y in zip(F0, Y):
    if y == 2:
        plt.plot(x, f0)
plt.savefig('test-2.png')
plt.show()

for f0, y in zip(F0, Y):
    if y == 3:
        plt.plot(x, f0)
plt.savefig('test-3.png')
plt.show()