sahakan commited on
Commit
86efccf
·
verified ·
1 Parent(s): 21bc6f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -112,9 +112,9 @@ def process_audio(audio_file):
112
  # แสดงกราฟเสียงต้นฉบับ
113
  fig, ax = plt.subplots(figsize=(10, 2))
114
  ax.plot(waveform)
115
- ax.set_title("รูปคลื่นเสียงต้นฉบับ")
116
- ax.set_xlabel("ตัวอย่าง")
117
- ax.set_ylabel("แอมพลิจูด")
118
  ax.grid(True, alpha=0.3)
119
  st.pyplot(fig)
120
 
@@ -134,9 +134,9 @@ def process_audio(audio_file):
134
  # แสดงกราฟเสียงที่มีเสียงรบกวน
135
  fig, ax = plt.subplots(figsize=(10, 2))
136
  ax.plot(noisy_waveform)
137
- ax.set_title("รูปคลื่นเสียงที่มีเสียงรบกวน")
138
- ax.set_xlabel("ตัวอย่าง")
139
- ax.set_ylabel("แอมพลิจูด")
140
  ax.grid(True, alpha=0.3)
141
  st.pyplot(fig)
142
 
@@ -175,9 +175,9 @@ def process_audio(audio_file):
175
  # แสดงกราฟเสียงที่แยกแล้ว
176
  fig, ax = plt.subplots(figsize=(10, 2))
177
  ax.plot(separated_waveform, color='green')
178
- ax.set_title("รูปคลื่นเสียงที่แยกแล้ว")
179
- ax.set_xlabel("ตัวอย่าง")
180
- ax.set_ylabel("แอมพลิจูด")
181
  ax.grid(True, alpha=0.3)
182
  st.pyplot(fig)
183
 
@@ -195,14 +195,14 @@ def process_audio(audio_file):
195
  # แสดงกราฟเปรียบเทียบ
196
  fig, ax = plt.subplots(2, 1, figsize=(10, 4), sharex=True)
197
  ax[0].plot(noisy_waveform)
198
- ax[0].set_title("เสียงต้นฉบับ/เสียงที่มีเสียงรบกวน")
199
- ax[0].set_ylabel("แอมพลิจูด")
200
  ax[0].grid(True, alpha=0.3)
201
 
202
  ax[1].plot(separated_waveform, color='green')
203
- ax[1].set_title("เสียงที่แยกแล้ว")
204
- ax[1].set_xlabel("ตัวอย่าง")
205
- ax[1].set_ylabel("แอมพลิจูด")
206
  ax[1].grid(True, alpha=0.3)
207
 
208
  plt.tight_layout()
@@ -215,14 +215,14 @@ def process_audio(audio_file):
215
 
216
  # สเปกโตรแกรมของเสียงที่มีเสียงรบกวน
217
  ax[0].specgram(noisy_waveform, Fs=sample_rate, NFFT=1024, noverlap=512, cmap='viridis')
218
- ax[0].set_title("สเปกโตรแกรมของเสียงที่มีเสียงรบกวน")
219
- ax[0].set_ylabel("ความถี่ (Hz)")
220
 
221
  # สเปกโตรแกรมของเสียงที่แยกแล้ว
222
  ax[1].specgram(separated_waveform, Fs=sample_rate, NFFT=1024, noverlap=512, cmap='viridis')
223
- ax[1].set_title("สเปกโตรแกรมของเสียงที่แยกแล้ว")
224
- ax[1].set_xlabel("เวลา (s)")
225
- ax[1].set_ylabel("ความถี่ (Hz)")
226
 
227
  plt.tight_layout()
228
  st.pyplot(fig)
 
112
  # แสดงกราฟเสียงต้นฉบับ
113
  fig, ax = plt.subplots(figsize=(10, 2))
114
  ax.plot(waveform)
115
+ ax.set_title("Original Waveform")
116
+ ax.set_xlabel("Samples")
117
+ ax.set_ylabel("Amplitude")
118
  ax.grid(True, alpha=0.3)
119
  st.pyplot(fig)
120
 
 
134
  # แสดงกราฟเสียงที่มีเสียงรบกวน
135
  fig, ax = plt.subplots(figsize=(10, 2))
136
  ax.plot(noisy_waveform)
137
+ ax.set_title("Noisy Waveform")
138
+ ax.set_xlabel("Samples")
139
+ ax.set_ylabel("Amplitude")
140
  ax.grid(True, alpha=0.3)
141
  st.pyplot(fig)
142
 
 
175
  # แสดงกราฟเสียงที่แยกแล้ว
176
  fig, ax = plt.subplots(figsize=(10, 2))
177
  ax.plot(separated_waveform, color='green')
178
+ ax.set_title("Separated Waveform")
179
+ ax.set_xlabel("Samples")
180
+ ax.set_ylabel("Amplitude")
181
  ax.grid(True, alpha=0.3)
182
  st.pyplot(fig)
183
 
 
195
  # แสดงกราฟเปรียบเทียบ
196
  fig, ax = plt.subplots(2, 1, figsize=(10, 4), sharex=True)
197
  ax[0].plot(noisy_waveform)
198
+ ax[0].set_title("Original/Noisy Waveform")
199
+ ax[0].set_ylabel("Amplitude")
200
  ax[0].grid(True, alpha=0.3)
201
 
202
  ax[1].plot(separated_waveform, color='green')
203
+ ax[1].set_title("Separated Waveform")
204
+ ax[1].set_xlabel("Samples")
205
+ ax[1].set_ylabel("Amplitude")
206
  ax[1].grid(True, alpha=0.3)
207
 
208
  plt.tight_layout()
 
215
 
216
  # สเปกโตรแกรมของเสียงที่มีเสียงรบกวน
217
  ax[0].specgram(noisy_waveform, Fs=sample_rate, NFFT=1024, noverlap=512, cmap='viridis')
218
+ ax[0].set_title("Spectrogram of Noisy Audio")
219
+ ax[0].set_ylabel("Frequency (Hz)")
220
 
221
  # สเปกโตรแกรมของเสียงที่แยกแล้ว
222
  ax[1].specgram(separated_waveform, Fs=sample_rate, NFFT=1024, noverlap=512, cmap='viridis')
223
+ ax[1].set_title("Spectrogram of Separated Audio")
224
+ ax[1].set_xlabel("Time (s)")
225
+ ax[1].set_ylabel("Frequency (Hz)")
226
 
227
  plt.tight_layout()
228
  st.pyplot(fig)