Python के साथ ऑडियो डेटा प्रोसेस करना
आपने देखा कि साउंड वेव्स को नंबरों में बदला जा सकता है, लेकिन वह पूरी कन्वर्ज़न दिखती कैसी है?
और एक दूसरी, मिलती-जुलती साउंड वेव का क्या? जो थोड़ी अलग हो?
इस अभ्यास में, हम MatPlotLib की मदद से good_morning की साउंड वेव को good_afternoon के मुकाबले प्लॉट करेंगे.
एक ही प्लॉट पर good_morning और good_afternoon की साउंड वेव्स को अलग-अलग पहचाने जा सकने लायक दिखाने के लिए, हम MatPlotLib का alpha पैरामीटर इस्तेमाल करेंगे.
आप good_morning ऑडियो को यहाँ और good_afternoon ऑडियो को यहाँ सुन सकते हैं.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Python में Spoken Language Processing
अभ्यास निर्देश
- जिस प्लॉट को हम बना रहे हैं, उसे दर्शाने वाला शीर्षक सेट करें.
- प्लॉट में
good_afternoonका time वैरिएबल (time_ga) और amplitude वैरिएबल (soundwave_ga) जोड़ें. - इसी तरह
good_morningका time वैरिएबल (time_gm) और amplitude वैरिएबल (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()