Hi, I'm trying to graph the spectrum of an audio, but when I use the spectrogram function it appears that my song is not written as vector and i dont know how to fix it. Can somebody help me please.
Code:
[x,fs]=audioread('estrellita.mp3');
window=hamming(100,'periodic')
spectrogram(x,window)

 채택된 답변

Star Strider
Star Strider 2019년 6월 9일

0 개 추천

Your song may be a two-channel stereo file. Stereo files are (Nx2) matrices.
Try this:
[x(:,1),fs]=audioread('estrellita.mp3');
window=hamming(100,'periodic')
spectrogram(x,window)
then this:
[x(:,2),fs]=audioread('estrellita.mp3');
window=hamming(100,'periodic')
spectrogram(x,window)
to see what works best for you.

댓글 수: 2

Fernanda Cortes
Fernanda Cortes 2019년 6월 14일
Thank you it worked!
Star Strider
Star Strider 2019년 6월 14일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

질문:

2019년 6월 9일

댓글:

2019년 6월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by