Borrar filtros
Borrar filtros

Assigning time points on X axis

2 visualizaciones (últimos 30 días)
Sonia Wiemann
Sonia Wiemann el 16 de Abr. de 2012
I have a wav file imported as data points. I know the sampling rate is 44.1kHz per sec. I know that the file contains 18, 873 samples. How can I assign time on the x axis in msec?
  1 comentario
Geoff
Geoff el 16 de Abr. de 2012
http://www.mathworks.com.au/matlabcentral/answers/34874-assigning-time-on-x-axis-for-audio-samples

Iniciar sesión para comentar.

Respuesta aceptada

Kye Taylor
Kye Taylor el 17 de Abr. de 2012
If your sampling frequency is 44.1 kHz, then one millisecond comprises 44.1 time samples. So, if x represents the vector of 18,873 samples, the following yields integer values on the x-axis representing milliseconds, starting at time zero:
plot((0:length(x)-1)/44.1, x)

Más respuestas (0)

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by