How to obtain the exact onset of a sound?

9 次查看(过去 30 天)
Hello!
I am presenting a sound using the function 'soundsc'. I want to send a marker exactly when the sound starts. I was using 'GetSecs' just after the 'soundsc' function to get the onset of the stimuli. Would that be accurate enough? If not, how could I now the exact onset of my sound?
Thank you in advance!

采纳的回答

Image Analyst
Image Analyst 2020-12-19
Why can't you just read the sound and find when the magnitude exceeds a threshold that you think is required for it to be audible. Like if your sound amplitude ranges from -1 to 1, and you think the value needs to be more than 0.05 to be audible, just do
[y, fs] = audioread(filename);
startingIndex = find(abs(y) > 0.05, 1, 'first');

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by