Spectrogram of a song

4 次查看(过去 30 天)
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
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Time-Frequency Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by