필터 지우기
필터 지우기

How to can I change axis from samples to time?

조회 수: 32 (최근 30일)
nevin
nevin 2014년 9월 30일
댓글: ladan hz 2017년 10월 9일
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?

채택된 답변

Star Strider
Star Strider 2014년 9월 30일
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
ladan hz
ladan hz 2017년 10월 9일
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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by