commit 0cd310809efbc92238e7ff7a684d55ef4a51555e
parent c5e335704270e9c9ccbc806420e44b1bacb42ae7
Author: Martin Kloeckner <mjkloeckner@gmail.com>
Date: Tue, 3 Sep 2024 21:25:00 -0300
change plot window title to match file name
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/primera_parte/main.py b/primera_parte/main.py
@@ -7,19 +7,19 @@ file_names = ['InASentimentalMood.wav', 'Zombie.wav' ]
figures = []
for i in range(len(file_names)):
file_name = file_names[i]
+ figure_title='Gráfico de `' + str(file_name) + '` en el dominio del tiempo'
sample_rate, data = wavfile.read(file_name)
- print("`" + str(file_name)+ "` tasa de muestreo: " + str(sample_rate) + " Hz")
+ print("`" + str(file_name)+ "` sample_rate: " + str(sample_rate) + " Hz")
if len(data.shape) > 1:
data = data[:, 0]
time = np.arange(len(data)) / sample_rate
- figures.append(plt.figure(figsize=(12, 6)))
+ figures.append(plt.figure(num=figure_title, figsize=(12, 6)))
plt.plot(time, data, label='Señal de Audio')
- title='Archivo `', file_name, '` en Función del Tiempo'
- plt.title('Archivo `%s` en Función del Tiempo' %file_name)
+ plt.title(figure_title)
plt.xlabel('Tiempo [s]')
plt.ylabel('Amplitud')
plt.grid(True)