From 02ed4bfce4b94096a5420fe8a5af0ddac3e60c99 Mon Sep 17 00:00:00 2001 From: LexvanGastel <l.vangastel@studen.utwente.nl> Date: Mon, 31 Mar 2025 14:44:40 +0200 Subject: [PATCH] Initial commit - Added DataRetrieval and SignalProcessing classes --- main.py | 31 ++++++++++++++++++++++++++++++- vraag3.py | 2 -- vraag4.py | 8 -------- 3 files changed, 30 insertions(+), 11 deletions(-) delete mode 100644 vraag3.py delete mode 100644 vraag4.py diff --git a/main.py b/main.py index 959c90c..35fe7e3 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import scipy.io +from scipy.signal import butter, filtfilt def load_emg_data(file_path): @@ -28,4 +29,32 @@ chosen_muscles = { 'rectus_fomoris': 0, 'tibialis_anterior': 7 } -print(f"Gekozen spieren: {chosen_muscles}") \ No newline at end of file +print(f"Gekozen spieren: {chosen_muscles}") + +class DataRetrieval: + def __init__(self, file_path): + self.file_path = file_path + self.emg_data = None + self.channel_names = None + + def load_data(self): + mat_data = scipy.io.loadmat(self.file_path) + self.emg_data = mat_data['emg_data_walking'] + self.channel_names = emg_data['data_headers'][0][0] + self.channel_names = [ch[0] for ch in self.channel_names[0]] + + def get_channel_names(self): + return self.channel_names + +class SignalProcessing: + def __init__(self, emg_data, fs): + self.emg_data = emg_data + self.fs = fs + + def bandpass_filter(self, data, lowcut, highcut): + #komt nog filters + pass + + def power_spectral_analysis(self, data): + #methode + pass \ No newline at end of file diff --git a/vraag3.py b/vraag3.py deleted file mode 100644 index 088a5c0..0000000 --- a/vraag3.py +++ /dev/null @@ -1,2 +0,0 @@ -t = "hoi" -print(t) \ No newline at end of file diff --git a/vraag4.py b/vraag4.py deleted file mode 100644 index c42b30e..0000000 --- a/vraag4.py +++ /dev/null @@ -1,8 +0,0 @@ -import numpy as np -import scipy.signal as signal - -class Dataretrieval: - def __init__(self, filiepath: str): - self.filepath = filepath - self.data = None - self.sampling_rate \ No newline at end of file -- GitLab