Spaces:
Runtime error
Runtime error
Commit
·
1276458
1
Parent(s):
ff522d1
Add: requirements.txt
Browse files- baseline_wander_removal.py +1 -17
- requirements.txt +5 -0
baseline_wander_removal.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import numpy as np
|
| 2 |
from scipy.signal import medfilt
|
| 3 |
-
import matplotlib.pyplot as plt
|
| 4 |
# import seaborn as sns
|
| 5 |
|
| 6 |
# sns.set_theme()
|
|
@@ -80,19 +80,3 @@ def band_pass_filter(signal):
|
|
| 80 |
# result = result/max_val
|
| 81 |
|
| 82 |
return result
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
if __name__ == '__main__':
|
| 86 |
-
signal = np.loadtxt("./Lead 2/n1_lead2.txt")[:1000]
|
| 87 |
-
signal_bs = bw_remover(BASIC_SRATE, signal)
|
| 88 |
-
signal_flt = band_pass_filter(signal_bs)
|
| 89 |
-
plt.figure(figsize=(16, 9))
|
| 90 |
-
plt.subplot(2, 1, 1)
|
| 91 |
-
plt.plot(signal)
|
| 92 |
-
plt.grid(True)
|
| 93 |
-
plt.title("RAW signal")
|
| 94 |
-
plt.subplot(2, 1, 2)
|
| 95 |
-
plt.plot(signal_flt)
|
| 96 |
-
plt.title("baseline removed signal")
|
| 97 |
-
plt.grid(True)
|
| 98 |
-
plt.show()
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
from scipy.signal import medfilt
|
| 3 |
+
# import matplotlib.pyplot as plt
|
| 4 |
# import seaborn as sns
|
| 5 |
|
| 6 |
# sns.set_theme()
|
|
|
|
| 80 |
# result = result/max_val
|
| 81 |
|
| 82 |
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch
|
| 2 |
+
gradio
|
| 3 |
+
scipy
|
| 4 |
+
numpy
|
| 5 |
+
pywavelets
|