How to obtain the exact onset of a sound?
4 ビュー (過去 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!
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!