63 lines
1.2 KiB
Python
63 lines
1.2 KiB
Python
import matplotlib.pyplot as plt
|
|
import os
|
|
import glob
|
|
import IPython
|
|
import numpy as np
|
|
from IPython import embed
|
|
from jar_functions import parse_dataset
|
|
|
|
|
|
datasets = [(os.path.join('D:\\jar_project\\JAR\\2020-06-22-ab\\beats-eod.dat'))]
|
|
# (os.path.join('D:\\jar_project\\JAR\\2020-06-22-ac\\beats-eod.dat'))]
|
|
|
|
time = []
|
|
frequency = []
|
|
amplitude = []
|
|
|
|
for dataset in datasets:
|
|
t, f, a, e= parse_dataset(dataset)
|
|
embed()
|
|
time.append(t)
|
|
frequency.append(f)
|
|
amplitude.append(a)
|
|
|
|
|
|
minimum = min(len(frequency[0]), len(frequency[1]))
|
|
f1 = frequency[0][:minimum]
|
|
f2 = frequency[1][:minimum]
|
|
|
|
frequency = f1 + f2
|
|
embed()
|
|
#frequency = np.array(frequency)
|
|
|
|
mean = np.mean(frequency, axis=0)
|
|
|
|
for i in range(len(minimum)):
|
|
mean(frequency[0][i], frequency[1][i])
|
|
|
|
for f in frequency:
|
|
print(np.mean(f))
|
|
|
|
# mean_f = np.mean(x) for x in zip(freqeuncies1, frequencies2)
|
|
|
|
|
|
embed()
|
|
|
|
#nächste Schritt: weitere Messungen einfügen und dann über alle Trials mitteln, evtl. normiert darstellen (frequency / baseline frequency?)?
|
|
#Zeitkonstante: von sec. 0 bis 63%? relative JAR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'''
|
|
plt.plot(t, f)
|
|
|
|
plt.xlabel('time [s]')
|
|
plt.ylabel('frequency [Hz]')
|
|
plt.xlim([-10,200])
|
|
plt.title('second try because first try was sold out')
|
|
plt.show()'''
|