Reply by September 15, 20062006-09-15
Grant wrote:
> So I have to first determine the time relationship between the two signals > (which are different content) when they are properly synced, then monitor > for loss of sync and re-sync them when necessary. The two are entirely > different audio material, possibly even with different beats.
Do you want to sync on the fly or during setup? Because, when you sync, the channels have to carry some identical information. And if you want to operate on the fly, forget it. Most likely there will be no acceptable compromise between noticable sync artefacts and the SNR during sync.
> They arrive in analog form and I sample them at 44.1 kHz. Then I assume > I'll need an algorithm in order to create a timing reference in each channel > which I can use to track whether they remain in sync.
At the moments where the channels get out of sync, you will loose data. Since one of the channels has a non-continuous time line at this point. Hopefully this will never happen during activity.
> I'd like to achieve > time measurement accuracy of better than the sample rate - a few > microseconds if possible.
Uh, you really want to know it? You told somthing of a 1 or 2 seconds sync window. This is an accouracy of 5 orders of magnitude. Do you have digital or analog input? What about the bandwith/transition function of the two channels? To get the benefit of the high precision sync you have to do the following steps at 96 or 192kHz, you know? And you know, nobody will ever notify the difference of some 100�s as long as the real audiosignals are not coherent. Marcel
Reply by Grant September 14, 20062006-09-14
"Marcel M&#4294967295;ller" <news.5.maazl@spamgourmet.org> wrote in message 
news:45091d31$0$17392$9b4e6d93@newsspool2.arcor-online.net...

<snip>

> It would have been helpful to know what you want to do. > Latency calibration? Digital watermarks? >
You're right ... :o) Here's what I'm trying to do. The application is hi-fi music recording. My studio has two different off-site audio channels arriving via two routes that I must combine into a single audio channel. The signals are synced at the source but there are cases where one signal path gets re-routed without notice through another location, causing a relative time shift between the two audio feeds upon arrival. In this situation I need to add delay to the earlier-arriving signal to restore the correct time relationship. I can't just use a fixed delay because the routing can vary. Also, I have to deal with the native audio as is without embedded timing references or other "crutches". So I have to first determine the time relationship between the two signals (which are different content) when they are properly synced, then monitor for loss of sync and re-sync them when necessary. The two are entirely different audio material, possibly even with different beats. They arrive in analog form and I sample them at 44.1 kHz. Then I assume I'll need an algorithm in order to create a timing reference in each channel which I can use to track whether they remain in sync. I'd like to achieve time measurement accuracy of better than the sample rate - a few microseconds if possible. Unusual problem, I know. Thanks for any guidance.
Reply by September 14, 20062006-09-14
Grant wrote:
> This is what I was looking for. So let's say the 20 kHz audio channel is > sampled at standard 44,100 Hz MP3 rate. 1/10th of that rate is 15 usec. Is > that a reasonable (ballpark) timing accuracy objective? Is there a way to > do an order of magnitude better? Will oversampling help?
If you use cross correlation you should be able to synchronize with an accouracy of less than one sample. Oversampling is only a technique to make filtering easier. It will not give you any additional information. The testing signal itself is completely irrelevant (in theory). The only real important thing ist that it must not repeat within the time window you want to use. And of course, it is like a key. You need to know it for creation and analysis. However, there are some recommendations: - If you have to deal with non-linearities (e.g. speakers) you should choose a signal that is short in the time domain. (Chrip, or whatever.) - If you have to deal with an unknown transition function you should choose a signal which is small in the frequency domain. In fact you need a frequency window where the amplitude and phase of your transition function is sufficiently linear. A filtered noise pattern will do. This will give something like an MLS noise. MLS sounds far less unpleasent than a chirp. To get an easy match it is a good advise to repeat the test-signal exactly: Marker: | Gerenrated output: 01234567890123456789 Part for cross | correlation: 5678901234 Reference for | cross correlation: 0123456789 Result of cross | correlation: 0000010000 Window where it | works from: 1234567890 to: 0123456789 You should not use a window function for the matching. It would have been helpful to know what you want to do. Latency calibration? Digital watermarks? Marcel
Reply by Grant September 14, 20062006-09-14
This is what I was looking for.  So let's say the 20 kHz audio channel is 
sampled at standard 44,100 Hz MP3 rate.  1/10th of that rate is 15 usec.  Is 
that a reasonable (ballpark) timing accuracy objective?  Is there a way to 
do an order of magnitude better?  Will oversampling help?


"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message 
news:Xd-dnWo0Bbq1dZXYnZ2dnUVZ_sydnZ2d@comcast.com...
> Jerry Avins wrote: > > (snip) > >> You could select five successive samples early in the file, then look for >> that sequence throughout the file. If it turns out not to to be unique, >> choose another sequence. When a unique sequence is found, that's your >> marker. > >> That seems too trivial to be what you want, but it also seems to be what >> you asked for. > > I thought he was asking for an actual audible sound that when digitized > could be identified to a specific point. > > My understanding, though I haven't actually tried doing it, is that a > chirp is used for that purpose. I know it has been used for autofocus > cameras where the distance has to be identified by a specific point > in time on the reflected signal. > > I might believe that it is possible to do somewhat better than the sample > interval, though I don't know how much better. I will guess > at 1/10th of the sample interval. That probably requires some amount > of linearity in the analog system, and reasonably S/N ratio. > > -- glen >
Reply by glen herrmannsfeldt September 14, 20062006-09-14
Jerry Avins wrote:

(snip)

> You could select five successive samples early in the file, then look > for that sequence throughout the file. If it turns out not to to be > unique, choose another sequence. When a unique sequence is found, that's > your marker.
> That seems too trivial to be what you want, but it also seems to be what > you asked for.
I thought he was asking for an actual audible sound that when digitized could be identified to a specific point. My understanding, though I haven't actually tried doing it, is that a chirp is used for that purpose. I know it has been used for autofocus cameras where the distance has to be identified by a specific point in time on the reflected signal. I might believe that it is possible to do somewhat better than the sample interval, though I don't know how much better. I will guess at 1/10th of the sample interval. That probably requires some amount of linearity in the analog system, and reasonably S/N ratio. -- glen
Reply by Jerry Avins September 13, 20062006-09-13
Grant wrote:
> Can someone point me in the right direction please? I need to calculate a > unique time "marker" in a hi-fi (20Hz - 20 kHz) audio path during a sample > period of a few seconds or so. > > It doesn't matter what sound event(s) go into the calculation or where the > marker is placed with respect to any particular sound events in the audio > path, so long as the marker is unique and repeatable. If necessary we can > continue the sample until the calculation produces a result. > > Second question: The calculation must be repeatable, given the same input > audio. In other words, multiple measurements of the same sample should > produce a marker in the same place. Is it practicable to get repeatability > much better than the period of the highest audio component (20 kHz)? > > Thanks for any help.
You could select five successive samples early in the file, then look for that sequence throughout the file. If it turns out not to to be unique, choose another sequence. When a unique sequence is found, that's your marker. That seems too trivial to be what you want, but it also seems to be what you asked for. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Grant September 13, 20062006-09-13
Can someone point me in the right direction please?  I need to calculate a 
unique time "marker" in a hi-fi (20Hz - 20 kHz) audio path during a sample 
period of a few seconds or so.

It doesn't matter what sound event(s) go into the calculation or where the 
marker is placed with respect to any particular sound events in the audio 
path, so long as the marker is unique and repeatable.  If necessary we can 
continue the sample until the calculation produces a result.

Second question:  The calculation must be repeatable, given the same input 
audio.  In other words, multiple measurements of the same sample should 
produce a marker in the same place.  Is it practicable to get repeatability 
much better than the period of the highest audio component (20 kHz)?

Thanks for any help.