Plot time of audio file in milliseconds

3 visualizaciones (últimos 30 días)
Chris79
Chris79 el 24 de Nov. de 2017
Comentada: Star Strider el 25 de Nov. de 2017
Hi there,
I have imported a .wav file into MATLAB, I am plotting this audio file in amplitude/time but I need it to be displayed in milliseconds rather than seconds.
The .wav file is configured in the workspace as data and fs.
The code I am using to plot the file in time is :
>> t=[0:length(data)-1] / fs;
>> plot(t, data);
Many thanks in advance for your time.

Respuesta aceptada

Star Strider
Star Strider el 24 de Nov. de 2017
Try this:
plot(t*1E+3, data);
That converts seconds to milliseconds. The plot otherwise remains the same.
  4 comentarios
Chris79
Chris79 el 25 de Nov. de 2017
Again this is great and really useful.
Thank-you for sharing your knowledge and for explaining it too, it is much appreciated.
Star Strider
Star Strider el 25 de Nov. de 2017
Thank you.
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Axis Labels 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