Spaces:
Running
on
Zero
Running
on
Zero
roychao19477
commited on
Commit
·
306d2bd
1
Parent(s):
ea5c419
Upload
Browse files
app.py
CHANGED
@@ -73,10 +73,10 @@ def enhance_and_plot(audio):
|
|
73 |
if orig_sr != sr:
|
74 |
out = librosa.resample(out, sr, orig_sr)
|
75 |
|
76 |
-
D = librosa.stft(out, n_fft=
|
77 |
S_db = librosa.amplitude_to_db(np.abs(D), ref=np.max)
|
78 |
fig, ax = plt.subplots()
|
79 |
-
img = librosa.display.specshow(S_db, sr=orig_sr, hop_length=
|
80 |
plt.colorbar(img, ax=ax, format="%+2.0f dB")
|
81 |
ax.set_title("Enhanced Output Spectrum")
|
82 |
|
|
|
73 |
if orig_sr != sr:
|
74 |
out = librosa.resample(out, sr, orig_sr)
|
75 |
|
76 |
+
D = librosa.stft(out, n_fft=512, hop_length=256)
|
77 |
S_db = librosa.amplitude_to_db(np.abs(D), ref=np.max)
|
78 |
fig, ax = plt.subplots()
|
79 |
+
img = librosa.display.specshow(S_db, sr=orig_sr, hop_length=256, x_axis='time', y_axis='hz', ax=ax)
|
80 |
plt.colorbar(img, ax=ax, format="%+2.0f dB")
|
81 |
ax.set_title("Enhanced Output Spectrum")
|
82 |
|