Plot time of audio file in milliseconds

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

采纳的回答

Star Strider
Star Strider 2017-11-24
Try this:
plot(t*1E+3, data);
That converts seconds to milliseconds. The plot otherwise remains the same.
  4 个评论
Chris79
Chris79 2017-11-25
Again this is great and really useful.
Thank-you for sharing your knowledge and for explaining it too, it is much appreciated.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by