diff --git a/Signal_prep.py b/Signal_prep.py index 731fe58..31f5d6c 100644 --- a/Signal_prep.py +++ b/Signal_prep.py @@ -101,7 +101,7 @@ def prep_df_for_trans(df:DataFrame): sample_rate = SAMPLE_RATE min, duration = Handler.get_min_max_timestamp(df) x = np.linspace(0, duration, SAMPLE_RATE * duration, endpoint=False) - y = np.array(df.iloc(1)) + y = df.iloc[:,1].to_numpy() return x, y, duration def normalize_wave(y_values): @@ -125,7 +125,7 @@ def plot_fft(x_f, y_f): plt.plot(x_f, np.abs(y_f)) plt.show() - +#''' handler = Handler.CSV_handler() file = "/Exp20201205_2myo_hardTypePP/HaluskaMarek_20201207_1810/myoLeftEmg.csv" df = handler.get_time_emg_table(file, 1) @@ -133,3 +133,4 @@ df = handler.get_time_emg_table(file, 1) trans_df = DataFrame(transformed_df(df)) #print(trans_df.info) plot_fft(trans_df) +#''' \ No newline at end of file diff --git a/Test_functions.py b/Test_functions.py index 4126d0d..5516b84 100644 --- a/Test_functions.py +++ b/Test_functions.py @@ -1,6 +1,6 @@ from Handle_emg_data import CSV_handler, get_min_max_timestamp import matplotlib.pyplot as plt -#import Signal_prep +import Signal_prep def test_df_extraction(emg_nr): handler = CSV_handler() @@ -24,4 +24,11 @@ def test_min_max_func(): print(min) print(max) -test_min_max_func() \ No newline at end of file +def test_fft_prep(): + handler = CSV_handler() + file = "/Exp20201205_2myo_hardTypePP/HaluskaMarek_20201207_1810/myoLeftEmg.csv" + df = handler.get_time_emg_table(file, 1) + + x, y, d = Signal_prep.prep_df_for_trans(df) + print(x) + print(y) diff --git a/__pycache__/Signal_prep.cpython-38.pyc b/__pycache__/Signal_prep.cpython-38.pyc index cea1047..fe0eed3 100644 Binary files a/__pycache__/Signal_prep.cpython-38.pyc and b/__pycache__/Signal_prep.cpython-38.pyc differ