Update app.py
Browse files
app.py
CHANGED
|
@@ -72,19 +72,20 @@ def visualize(hr, lr, recon, sr):
|
|
| 72 |
|
| 73 |
fig, (ax1, ax2, ax3) = plt.subplots(3, 1, sharey=True, sharex=True, figsize=(16, 12))
|
| 74 |
ax1.title.set_text('Оригинальный сигнал')
|
| 75 |
-
ax1.set_xlabel('Время, с')
|
| 76 |
-
ax1.set_ylabel('Частота, Гц')
|
| 77 |
ax2.title.set_text('Сигнал с потерями')
|
| 78 |
-
ax2.set_xlabel('Время, с')
|
| 79 |
-
ax2.set_ylabel('Частота, Гц')
|
| 80 |
ax3.title.set_text('Улучшенный сигнал')
|
| 81 |
-
ax3.set_xlabel('Время, с')
|
| 82 |
-
ax3.set_ylabel('Частота, Гц')
|
| 83 |
|
| 84 |
canvas = FigureCanvas(fig)
|
| 85 |
p = librosa.display.specshow(librosa.amplitude_to_db(stft_hr), ax=ax1, y_axis='log', x_axis='time', sr=sr)
|
| 86 |
p = librosa.display.specshow(librosa.amplitude_to_db(stft_lr), ax=ax2, y_axis='log', x_axis='time', sr=sr)
|
| 87 |
p = librosa.display.specshow(librosa.amplitude_to_db(stft_recon), ax=ax3, y_axis='log', x_axis='time', sr=sr)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
return fig
|
| 89 |
|
| 90 |
packet_size = CONFIG.DATA.EVAL.packet_size
|
|
|
|
| 72 |
|
| 73 |
fig, (ax1, ax2, ax3) = plt.subplots(3, 1, sharey=True, sharex=True, figsize=(16, 12))
|
| 74 |
ax1.title.set_text('Оригинальный сигнал')
|
|
|
|
|
|
|
| 75 |
ax2.title.set_text('Сигнал с потерями')
|
|
|
|
|
|
|
| 76 |
ax3.title.set_text('Улучшенный сигнал')
|
|
|
|
|
|
|
| 77 |
|
| 78 |
canvas = FigureCanvas(fig)
|
| 79 |
p = librosa.display.specshow(librosa.amplitude_to_db(stft_hr), ax=ax1, y_axis='log', x_axis='time', sr=sr)
|
| 80 |
p = librosa.display.specshow(librosa.amplitude_to_db(stft_lr), ax=ax2, y_axis='log', x_axis='time', sr=sr)
|
| 81 |
p = librosa.display.specshow(librosa.amplitude_to_db(stft_recon), ax=ax3, y_axis='log', x_axis='time', sr=sr)
|
| 82 |
+
|
| 83 |
+
ax1.set_xlabel('Время, с')
|
| 84 |
+
ax1.set_ylabel('Частота, Гц')
|
| 85 |
+
ax2.set_xlabel('Время, с')
|
| 86 |
+
ax2.set_ylabel('Частота, Гц')
|
| 87 |
+
ax3.set_xlabel('Время, с')
|
| 88 |
+
ax3.set_ylabel('Частота, Гц')
|
| 89 |
return fig
|
| 90 |
|
| 91 |
packet_size = CONFIG.DATA.EVAL.packet_size
|