- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to plot MFCC in Python using Matplotlib?
To plot MFCC in Python, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Open and read a WAV file.
- Compute MFCC features from an audio signal.
- Create a figure and a set of subplots.
- Interchange two axes of an array
- Display the data as an image, i.e., on a 2D regular raster.
- To display the figure, use show() method.
Example
from python_speech_features import mfcc import scipy.io.wavfile as wav import matplotlib.pyplot as plt import numpy as np plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True (rate, sig) = wav.read("my_audio.wav") mfcc_data = mfcc(sig, rate) fig, ax = plt.subplots() mfcc_data = np.swapaxes(mfcc_data, 0, 1) cax = ax.imshow(mfcc_data, interpolation='nearest', cmap='copper', origin='lower') plt.show()
Output
- Related Articles
- How to plot vectors in Python using Matplotlib?
- How to plot an array in Python using Matplotlib?
- How to plot 3D graphs using Python Matplotlib?
- How to plot longitudinal magnitude spectrum in Matplotlib using Python?
- How to plot an angle spectrum using Matplotlib in Python?
- How to a plot stem plot in Matplotlib Python?
- How to plot CSV data using Matplotlib and Pandas in Python?
- How to plot signal in Matplotlib in Python?
- How to plot cdf in Matplotlib in Python?
- Frequency plot in Python/Pandas DataFrame using Matplotlib
- How to plot collections.Counter histogram using Matplotlib?
- How to plot magnitude spectrum in Matplotlib in Python?
- How to plot a density map in Python Matplotlib?
- How to plot a multivariate function in Python Matplotlib?
- How to Plot Cluster using Clustermaps class in Matplotlib

Advertisements