Analyse du mot “maintenant” : décembre 2025
Illustration des différentes représentations graphiques possibles sur les extractions effectuées à partir de la plateforme PASSY-DPFV de la prononciation de maintenant. Ces extraits sont issus d’ESOL2 Entretien .
Script de traitement des signaux sonores pour produire à l’aide de la librairie parselmouth de Praat les différentes représentations pour une analyse individuelle des enregistrements.
Mise en oeuvre
# -------------------------------------------------------------------------------------------------------
# script de creation des representations en spectrogramme des realisations de maintenant extraits d'ESLO2
# Affichage du signal, du spectrogramme et du pitch sur le spectrogramme
# -------------------------------------------------------------------------------------------------------
import parselmouth
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
#Matplotlib is building the font cache; this may take a moment.
sns.set() # Use seaborn's default style to make attractive graphs
plt.rcParams['figure.dpi'] = 100 # Show nicely large images in this notebook
#liste des fichiers à traiter
files=["ESLO2_ENT_1005-ch_OB1-620.41-623.595-maintenant",
"ESLO2_ENTJEUN_1236-ZZ431-575.455-577.353-maintenant",
"ESLO2_ENT_1054-LD54-4620.389-4622.465-maintenant",
"ESLO2_ENT_1054-LD54-1949.647-1950.236-maintenant",
"ESLO2_ENT_1027-RW27-2492.963-2493.629-maintenant",
"ESLO2_ENT_1015-EW15-1737.593-1740.734-maintenant",
"ESLO2_ENT_1012-UC12-4447.426-4448.089-maintenant",
"ESLO2_ENTJEUN_1230-BQ576-689.444-690.392-maintenant",
"ESLO2_ENT_1059-MC59-293.247-294.374-maintenant",
"ESLO2_ENT_1004-ZF4-1111.268-1112.518-maintenant",
"ESLO2_ENTJEUN_1231-ZL473-995.933-996.553-maintenant",
"ESLO2_ENT_1004-ZF4-845.75-847.875-maintenant"]
# elaboration du spectrogramme de ce signal
def draw_spectrogram(spectrogram, dynamic_range=70):
X, Y = spectrogram.x_grid(), spectrogram.y_grid()
print(spectrogram.values)
sg_db = 10 * np.log10(spectrogram.values)
plt.pcolormesh(X, Y, sg_db, vmin=sg_db.max() - dynamic_range, cmap='afmhot')
plt.ylim([spectrogram.ymin, spectrogram.ymax])
plt.xlabel("time [s]")
plt.ylabel("frequency [Hz]")
def draw_intensity(intensity):
plt.plot(intensity.xs(), intensity.values.T, linewidth=3, color='w')
plt.plot(intensity.xs(), intensity.values.T, linewidth=1)
plt.grid(False)
plt.ylim(0)
plt.ylabel("intensity [dB]")
def draw_pitch(pitch):
# Extract selected pitch contour, and
# replace unvoiced samples by NaN to not plot
pitch_values = pitch.selected_array['frequency']
pitch_values[pitch_values==0] = np.nan
plt.plot(pitch.xs(), pitch_values, 'o', markersize=5, color='w')
plt.plot(pitch.xs(), pitch_values, 'o', markersize=2)
plt.grid(False)
plt.ylim(0, pitch.ceiling)
plt.ylabel("fundamental frequency [Hz]")
def prod(source):
snd = parselmouth.Sound("./audio/{}.mp3".format(source))
plt.figure()
plt.plot(snd.xs(), snd.values.T)
plt.xlim([snd.xmin, snd.xmax])
plt.xlabel("time [s]")
plt.ylabel("amplitude")
#plt.show() # or plt.savefig("sound.png"), or plt.savefig("sound.pdf")
plt.savefig(source+"_signal.png")
intensity = snd.to_intensity()
spectrogram = snd.to_spectrogram()
plt.figure()
draw_spectrogram(spectrogram)
plt.twinx()
draw_intensity(intensity)
plt.xlim([snd.xmin, snd.xmax])
#plt.show()
plt.savefig(source+"_spectro.png")
pitch = snd.to_pitch()
pre_emphasized_snd = snd.copy()
pre_emphasized_snd.pre_emphasize()
spectrogram = pre_emphasized_snd.to_spectrogram(window_length=0.03, maximum_frequency=8000)
plt.figure()
draw_spectrogram(spectrogram)
plt.twinx()
draw_pitch(pitch)
plt.xlim([snd.xmin, snd.xmax])
#plt.show()
plt.savefig(source+"_pitch.png")
for fichier in files:
prod(fichier)