Create spectogram using an audio file and save it as an image

조회 수: 17 (최근 30일)
Mario Stronda
Mario Stronda 2021년 10월 3일
답변: Rahul 2024년 11월 5일 4:17
Ok so, I don't know anything about this program at all, but I really need to turn an audio file into a spectrogram, preferably one that can be turned back into an audio.
I searched everywhere to see if I could find a way to do it, but everything about spectrograms I could find about this program was related to making it with "math" or something like that.
  댓글 수: 1
DGM
DGM 2021년 10월 3일
편집: DGM 2021년 10월 3일
I don't have a complete answer, but you should look at stft() and istft().
Note the comment that about "perfect reconstruction"

댓글을 달려면 로그인하십시오.

답변 (1개)

Rahul
Rahul 2024년 11월 5일 4:17
Hi Mario,
I understand that you wish to obtain a spectrogram of your audio signals, plot it and save it as an image.
You can use the 'spectrogram' or 'melspectrogram' functions according to your specific use-case.
The 'spectrogram' function uses the short-time Fourier transform to obtain the time-localized frequency of the signal.
The function 'istft' can be used for reconstruction of the signal from frequency to time domain.
The function 'imagesc' can be used to display the figure with the spectrogram and 'saveas' to save the figure as an image.
You can also refer to this MATLAB answer for an alternative approach using the Signal Processing Toolbox: https://www.mathworks.com/matlabcentral/answers/18357-viewing-spectrum-of-an-audio-signal-in-matlab
You can refer to the following MathWorks documentations to know more about these functions:
Hope this helps! Thanks.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by