How to calculate Time stamp

4 次查看(过去 30 天)
Mukesh Vaidya
Mukesh Vaidya 2012-11-2
Hi All, I have audio file i.e .wav. I have read this file using wavread...After that plotted a graph between time and amplitude. Now, I have to calculate the time stamp at which the amplitude changes first (i.e. where the vocal response starts fist). This audio file contains more than vocal responses. Difficulty is how to find best way to calculate the occurrence of first voice in each case. Can you please suggest me code.
  2 个评论
Jan
Jan 2012-11-2
编辑:Jan 2012-11-2
Please use a more meaningful title to the question. You want to locate the time of a voice, but this is not a "time stamp".
What have you tried so far?
Mukesh Vaidya
Mukesh Vaidya 2012-11-5
Hi Jan,till now I have written a function which is calculating the reaction time when there is only one stimuli and its response but this program fails when there is more than one response in audio file thing is that it is also contains i.e. audio file fmri scanner noise. I am sharing you with my function, Please help me how to improve this. Thanks

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2012-11-2
编辑:Image Analyst 2012-11-2
From the help:
"[y, Fs] = wavread(filename) returns the sample rate (Fs) in Hertz used to encode the data in the file."
So can't you do something like this
firstLoudElement = find(y > thresholdValue, 1, 'first');
itsTime = firstLoudElement / Fs;
I'm not sure because I don't deal with sound signals very often. Of course you would have to define thresholdValue based on your signal and what you consider to be louder (a signal with higher amplitude) than the background sound. Of course if you have loud background sounds, like music, and want to find just where the voices start, ignoring the music, then you will have to get a signal where you have just voices first, like using frequency filtering, or something fancier and more effective like ICA:

类别

Help CenterFile Exchange 中查找有关 Simulation, Tuning, and Visualization 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by