Effacer les filtres
Effacer les filtres

How to can I change axis from samples to time?

32 vues (au cours des 30 derniers jours)
nevin
nevin le 30 Sep 2014
Commenté : ladan hz le 9 Oct 2017
I have loaded my audio file with the following code "handles.myRecording = audioread (uigetfile('*.*','Load a File'));" Next I use "plot(handles.myRecording);" to plot the graph, but the x axis is in samples. How can I change it to time?

Réponse acceptée

Star Strider
Star Strider le 30 Sep 2014
You should also have a sampling frequency (Fs) variable in your audio file. To convert the index vector to a time vector:
samples = 0:10; % Sample Indices Vector
Fs = 44100; % Sampling Frequency (Hz)
t = samples/Fs; % Time Vector (seconds)
I assume a value for ‘Fs’ here, yours may be different.
  1 commentaire
ladan hz
ladan hz le 9 Oct 2017
what if the sample is a table of 170 rows and 54 column ? is it possible to convert it to time also ? the value of my table is in frames

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by