使用 Python 处理音频数据
本练习是课程的一部分
Python 语音语言处理
练习说明
- 设置标题,使其能够反映我们要绘制的图。
- 将
good_afternoon的时间变量 (time_ga) 和幅度变量 (soundwave_ga) 添加到图中。 - 以同样方式,将
good_morning的时间变量 (time_gm) 和幅度变量 (soundwave_gm) 添加到图中。 - 将 alpha 参数设置为
0.5。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Setup the title and axis titles
plt.title('Good Afternoon vs. Good ____')
plt.ylabel('Amplitude')
plt.xlabel('Time (seconds)')
# Add the Good Afternoon data to the plot
plt.plot(____, ____, label='Good Afternoon')
# Add the Good Morning data to the plot
plt.plot(____, ____, label='Good Morning',
# Set the alpha variable to 0.5
alpha=____)
plt.legend()
plt.show()