How to obtain the exact onset of a sound?

4 ビュー (過去 30 日間)
Laura Colomar
Laura Colomar 2020 年 12 月 19 日
回答済み: Image Analyst 2020 年 12 月 19 日
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 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by