viewing spectrum of an audio signal in matlab

Hello all,
I have an audio signal (.wav) and would like to view its spectrum in matlab. Can anybody help me in this manner?
Thanks in advance.

 Respuesta aceptada

Wayne King
Wayne King el 15 de Oct. de 2011
Read it in with wavread()
[signal,fs] = wavread('file.wav');
If signal is Nx2 (two columns), extract one of them
signal = signal(:,1);
If you have the Signal Processing Toolbox, enter
plot(psd(spectrum.periodogram,signal,'Fs',fs,'NFFT',length(signal)));

4 comentarios

Bahareh
Bahareh el 15 de Oct. de 2011
Thanks a lot.
lapis lapis
lapis lapis el 5 de Jun. de 2017
Editada: lapis lapis el 5 de Jun. de 2017
hi ; thanks for this reply ; and what about sound pressur level (SPL) of the acoustic signal, do you have any idea ?? thanks in advance
Regin Rex Pacaldo
Regin Rex Pacaldo el 30 de Oct. de 2017
How can i import my mp3 sound in matlab and analyze it?.
Priyanka Phadte
Priyanka Phadte el 22 de Dic. de 2017
use audioread('filename.mp3') in matlab version 2017

Iniciar sesión para comentar.

Más respuestas (1)

Ali Isik
Ali Isik el 15 de Oct. de 2011
you should first read the audio signal using wavread() function. as a result of reading, the signal will be vectorized. after that, you should use fft() function to get the fourier transform of vectorized signal. at the end plot() the fourier transform of signal. sample code
[xn fs]=wavread('signal_name.wav');
nf=1024; %number of point in DTFT
Y = fft(xn,nf);
f = fs/2*linspace(0,1,nf/2+1);
plot(f,abs(Y(1:nf/2+1)));

Categorías

Más información sobre Measurements and Spatial Audio en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 15 de Oct. de 2011

Comentada:

el 22 de Dic. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by