Assigning time on x axis for audio samples
Show older comments
Hello,
I have audio samples and I know the sampling rate (44.1KHz per sec)) I also have loads of samples of varying lengths(titled calla etc). Is there a way for me to assign time in msec on the x axis in a way that I do not have to customize for each sample length?
Thanks! Sonia
Answers (1)
Wayne King
on 8 Apr 2012
You can create a time vector for your longest recording and then use subsets for a particular vector.
If N is the length of the longest:
Fs = 44.1e3;
t = 0:1/Fs:(N*1/Fs)-1/Fs;
Then for a particular vector, say x:
L = length(x);
tx = t(1:L);
1 Comment
Sonia Wiemann
on 16 Apr 2012
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!