matlab - Time delay of audio signal -


here scenario:

i'm generated signal is: 200ms @ 2khz 1000ms of zeros 200ms @ 2khz

and want calculate time delay between them, not between 2 synthetic audio part. playing signal on speaker , recording using microphone (adds noise)

fs = 44100

i tried: 1. cross correlation 2. calculation diff between 2 maximas of rms window @ size of 8820 samples. (we maxima when window on sound part.

the distance between speaker , mic around 30cm. cant steady result. why?

if want accurately , consistently 1 method have used in past loop 1 channel (e.g. left channel) output input , use other (i.e. right) channel timing test. can cross correlate between left (loopback) , right (actual audio) channels. eliminates many potential sources of error (buffer delays, hardware latency, software issues, etc), since left , right channels "in sync" , should able make measurements accurate +/- 1 sample period (+/- 12 µs @ 44.1 khz).


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -