Spaces:
Running
on
Zero
Running
on
Zero
roychao19477
commited on
Commit
·
b90c1fd
1
Parent(s):
eca5e51
Update figs
Browse files
app.py
CHANGED
|
@@ -104,13 +104,13 @@ def enhance(filepath, model_name):
|
|
| 104 |
# noisy
|
| 105 |
D_noisy = librosa.stft(wav, n_fft=1024, hop_length=512)
|
| 106 |
S_noisy = librosa.amplitude_to_db(np.abs(D_noisy), ref=np.max)
|
| 107 |
-
librosa.display.specshow(S_noisy, sr=orig_sr, hop_length=512, x_axis="time", y_axis="hz", ax=axs[0])
|
| 108 |
axs[0].set_title("Noisy Spectrogram")
|
| 109 |
|
| 110 |
# enhanced
|
| 111 |
D_clean = librosa.stft(out, n_fft=1024, hop_length=512)
|
| 112 |
S_clean = librosa.amplitude_to_db(np.abs(D_clean), ref=np.max)
|
| 113 |
-
librosa.display.specshow(S_clean, sr=orig_sr, hop_length=512, x_axis="time", y_axis="hz", ax=axs[1])
|
| 114 |
axs[1].set_title("Enhanced Spectrogram")
|
| 115 |
|
| 116 |
plt.tight_layout()
|
|
|
|
| 104 |
# noisy
|
| 105 |
D_noisy = librosa.stft(wav, n_fft=1024, hop_length=512)
|
| 106 |
S_noisy = librosa.amplitude_to_db(np.abs(D_noisy), ref=np.max)
|
| 107 |
+
librosa.display.specshow(S_noisy, sr=orig_sr, hop_length=512, x_axis="time", y_axis="hz", ax=axs[0], vmax=0)
|
| 108 |
axs[0].set_title("Noisy Spectrogram")
|
| 109 |
|
| 110 |
# enhanced
|
| 111 |
D_clean = librosa.stft(out, n_fft=1024, hop_length=512)
|
| 112 |
S_clean = librosa.amplitude_to_db(np.abs(D_clean), ref=np.max)
|
| 113 |
+
librosa.display.specshow(S_clean, sr=orig_sr, hop_length=512, x_axis="time", y_axis="hz", ax=axs[1], vmax=0)
|
| 114 |
axs[1].set_title("Enhanced Spectrogram")
|
| 115 |
|
| 116 |
plt.tight_layout()
|