teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

追記

2021/11/21 13:59

投稿

Riri09020500
Riri09020500

スコア6

title CHANGED
File without changes
body CHANGED
@@ -10,9 +10,11 @@
10
10
 
11
11
 
12
12
  #コード例
13
+ df2にデータが入っています。
13
14
 
14
15
 
16
+ ```Python
15
- #バターワースフィルタ(バンドパス)
17
+ バターワースフィルタ(バンドパス)
16
18
  def bandpass(x, samplerate, fp, fs, gpass, gstop):
17
19
  fn = samplerate / 2
18
20
  wp = fp / fn
@@ -35,16 +37,12 @@
35
37
 
36
38
 
37
39
 
38
- #
39
-
40
-
41
-
42
-
43
40
  gpass = 3
44
41
  gstop = 10
45
42
  samplerate = 250
46
43
  x = np.arange(0, len(df2[" EXG Channel 4"])) / samplerate # 波形生成のための時間軸の作成
47
44
 
45
+ for z in df2.columns:
48
46
  fp = np.array([1, 50])
49
47
  fs = np.array([0.5, 60])
50
48
  data_bandfilt = bandpass(result[0], samplerate, fp, fs, gpass, gstop)
@@ -52,4 +50,6 @@
52
50
 
53
51
  fp = np.array([40, 60])
54
52
  fs = np.array([45,55])
55
- df3[z] = bandstop(data_bandfilt, samplerate, fp, fs, gpass, gstop)
53
+ df3[z] = bandstop(data_bandfilt, samplerate, fp, fs, gpass, gstop)
54
+
55
+ ```

1

追記

2021/11/21 13:59

投稿

Riri09020500
Riri09020500

スコア6

title CHANGED
File without changes
body CHANGED
@@ -32,10 +32,6 @@
32
32
  y = signal.filtfilt(b, a, x)
33
33
  return y
34
34
 
35
- gpass = 3
36
- gstop = 10
37
- samplerate = 250
38
- x = np.arange(0, len(df2[" EXG Channel 4"])) / samplerate # 波形生成のための時間軸の作成
39
35
 
40
36
 
41
37
 
@@ -43,6 +39,12 @@
43
39
 
44
40
 
45
41
 
42
+
43
+ gpass = 3
44
+ gstop = 10
45
+ samplerate = 250
46
+ x = np.arange(0, len(df2[" EXG Channel 4"])) / samplerate # 波形生成のための時間軸の作成
47
+
46
48
  fp = np.array([1, 50])
47
49
  fs = np.array([0.5, 60])
48
50
  data_bandfilt = bandpass(result[0], samplerate, fp, fs, gpass, gstop)