How to plot WAV file

28 visualizaciones (últimos 30 días)
John
John el 23 de Nov. de 2011
Comentada: Anzzza el 9 de Feb. de 2022
Hello,
I'd like to plot .wav file in time and frequency domain.

Respuesta aceptada

Wayne King
Wayne King el 23 de Nov. de 2011
If this is the output of wavread, then see if you have two channels in y
[y,fs] = wavread(filename);
If y is two-channels, Nx2, then just plot one:
y = y(:,1);
dt = 1/fs;
t = 0:dt:(length(y)*dt)-dt;
plot(t,y); xlabel('Seconds'); ylabel('Amplitude');
figure
plot(psd(spectrum.periodogram,y,'Fs',fs,'NFFT',length(y)));
  10 comentarios
irtaza mazhar
irtaza mazhar el 26 de En. de 2022
wht if channel is 1??
Anzzza
Anzzza el 9 de Feb. de 2022
when you have stereo audio, you got two channels. if you can, it's easier to work with one

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by