Borrar filtros
Borrar filtros

Spectrogram of a song

6 visualizaciones (últimos 30 días)
Fernanda Cortes
Fernanda Cortes el 9 de Jun. de 2019
Comentada: Star Strider el 14 de Jun. de 2019
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)

Respuesta aceptada

Star Strider
Star Strider el 9 de Jun. de 2019
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 comentarios
Fernanda Cortes
Fernanda Cortes el 14 de Jun. de 2019
Thank you it worked!
Star Strider
Star Strider el 14 de Jun. de 2019
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Time-Frequency Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by