Reply by kevinjmcee January 8, 20142014-01-08
Not sure I can help, but I took some courses about time delay estimation, and GCC was a prominent part of it.  But that was some 30 years ago, so I don't recall all of the details.

We started out with CC and found that it didn't work well for certain conditions (eg: low SNR, interfering sinusoid, etc.).  We then studied GCC and explored its various forms.  As you know, it uses a 'window' or shaping function in the frequency domain to emphasize those parts of spectrum where the SNR is expected to be higher, and deemphasize those parts that have more noise or interference.  In all the cases we looked at, the problem was posed as a two-hydrophone/passive sonar problem.

Depending on which mathematical terms you decided to keep or throw away, you could get the various forms of GCC � each one good at some things, or not so good at other things (eg: some forms of GCC are better at being able to handle sinusoidal interference).  Sometimes one type would devolve into another under certain conditions (eg: ML reduces to an Ekhart filter at low SNR).  Sometimes it was a bit confusing.  I think that one of the forms reduces to a toaster strudel at high SNR � or something like that.

That said, it seems that what you're doing is more of a matched filter operation rather than GCC.  Your equations look like an Ekhart filter, and your processing seems to be more of a single receiver/matched filter one - and Ekhart filters are often used in matched filtering (we studied Ekhart filters in one of the two-hydrophone GCC configurations).

At any rate, the processing can be tricky at times.  For instance, you have an obvious mistake in that you're not zero-padding your signals 'x' and 'y' (been there, done that).  It seems that I was constantly running into some problem with some of the equations or scaling or this or that (eg: how to compute certain variables needed by some of the more complicated GCC forms).

Since your SNR seems to be high enough, and you asked about reducing the noise � well, I suppose you could try some narrowband filtering on the front end.  Or you might use a single DFT bin tuned to the specific frequency that you're dealing with so as to get some processing gain (eg: see my answer at:

http://dsp.stackexchange.com/questions/11541/getting-an-specific-frequency-component-from-sampled-audio/11553#11553

I also posted a few references to GCC:

http://dsp.stackexchange.com/questions/8732/generalized-cross-correlation/8746#8746

I'm also sure I've posted about the same thing here at comp.dsp, but I don't recall off-hand which posts they were.

Kevin McGee
Reply by January 6, 20142014-01-06
On Sunday, January 5, 2014 12:05:05 AM UTC-5, robert bristow-johnson wrote:
> On 1/4/14 7:45 PM, mnentwig wrote: > > > > > > a sine burst is a bad signal for delay estimation. You'll see why when you > > > look at its crosscorrelation. It resembles itself too well. > > > A chirp is a better choice, for example. Generally, use the available > > > bandwidth, that is, ideally a constant power density (keywords: Cramer-Rao > > > bound; time-of-arrival TOA). > > > > yeah, as much broadbanded as possible. > > > > dunno if it would be better than a linear-swept chirp (it *would* have a > > slightly better crest factor) but maybe a maximum-length sequence would > > be the best choice for calculating cross correlation and time of arrival. > > > > maybe not. i dunno. > > > > > > -- > > > > r b-j rbj@audioimagination.com > > > > "Imagination is more important than knowledge."
Analog TV uses a windowed chirp for ghost echo cancelation. It is a pretty good model for a broad spectrum, yet still work inside of broadcast TV specs, signal. Clay
Reply by angrydude January 6, 20142014-01-06
On Friday, January 3, 2014 4:02:53 PM UTC-5, robert...@gmail.com wrote:
> Hi guys, I have to determine the time lag between two signals x and y for an acoustic distance measurement setup. The signal x is the test input signal and y is the reflected signal from the acoustic path. This is modeled the following: y = h * y + N whereas N is additional gaussian noise and h is the impulse response of the acoustic path. (The operator * states for a convolution operator). My first approach for determining the time delay was correlation based. Doing a cross-correlation (CC) between the two signals x and y and take the maximum of the absolute of it. Here is a little Matlab example of this trivial approach: [Rxy, k] = xcorr(y, x); [~, loc] = max(abs(Rxy)); lag = k(loc); The performance of this was not that good since there is a distortion through the acoustic path and noise. I looked up this problem a bit on the internet and found the generalized cross correlation (GCC) which introduces a weighting function in the frequency domain. I tried these approaches but did not get any meaningful results respectively an improvement to a simple CC as described above. Consider for example the following snipped with a PHAT weighting function: N = max(length(x), length(y)); X = fft(x, N); Y = fft(y, N); Gxy = conj(Y) .* X; Gxy = Gxy ./ abs(Gxy); Rxy = fftshift(real(ifft(Gxy))); This does not yield a meaningful result. There is no correlation visible when plotting this. Also other weighting functions (ROTH, HT, SCOT) do not really show an expected result. Can anyone help and give me some advice why there is no improvement using GCC or what I'm doing wrong with it? Thank you in advance! Cheers Robert
On Friday, January 3, 2014 4:02:53 PM UTC-5, robert...@gmail.com wrote:
> Hi guys, I have to determine the time lag between two signals x and y for an acoustic distance measurement setup. The signal x is the test input signal and y is the reflected signal from the acoustic path. This is modeled the following: y = h * y + N whereas N is additional gaussian noise and h is the impulse response of the acoustic path. (The operator * states for a convolution operator). My first approach for determining the time delay was correlation based. Doing a cross-correlation (CC) between the two signals x and y and take the maximum of the absolute of it. Here is a little Matlab example of this trivial approach: [Rxy, k] = xcorr(y, x); [~, loc] = max(abs(Rxy)); lag = k(loc); The performance of this was not that good since there is a distortion through the acoustic path and noise. I looked up this problem a bit on the internet and found the generalized cross correlation (GCC) which introduces a weighting function in the frequency domain. I tried these approaches but did not get any meaningful results respectively an improvement to a simple CC as described above. Consider for example the following snipped with a PHAT weighting function: N = max(length(x), length(y)); X = fft(x, N); Y = fft(y, N); Gxy = conj(Y) .* X; Gxy = Gxy ./ abs(Gxy); Rxy = fftshift(real(ifft(Gxy))); This does not yield a meaningful result. There is no correlation visible when plotting this. Also other weighting functions (ROTH, HT, SCOT) do not really show an expected result. Can anyone help and give me some advice why there is no improvement using GCC or what I'm doing wrong with it? Thank you in advance! Cheers Robert
If it's some kind of sonar-type device you can try pulse compression by using e.g. chirp-like signal or phase-modulated signal with Barker codes, followed by cross-correlation of transmitted and received signals What's the application ?
Reply by mnentwig January 5, 20142014-01-05
True. Cellular systems use for example Zhadoff-Chu sequences, which is just
that. 	 

_____________________________		
Posted through www.DSPRelated.com
Reply by robert bristow-johnson January 5, 20142014-01-05
On 1/4/14 7:45 PM, mnentwig wrote:
> > a sine burst is a bad signal for delay estimation. You'll see why when you > look at its crosscorrelation. It resembles itself too well. > A chirp is a better choice, for example. Generally, use the available > bandwidth, that is, ideally a constant power density (keywords: Cramer-Rao > bound; time-of-arrival TOA).
yeah, as much broadbanded as possible. dunno if it would be better than a linear-swept chirp (it *would* have a slightly better crest factor) but maybe a maximum-length sequence would be the best choice for calculating cross correlation and time of arrival. maybe not. i dunno. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by mnentwig January 4, 20142014-01-04
Hi,

 a sine burst is a bad signal for delay estimation. You'll see why when you
look at its crosscorrelation. It resembles itself too well.
A chirp is a better choice, for example. Generally,  use the available
bandwidth, that is, ideally a constant power density (keywords: Cramer-Rao
bound; time-of-arrival TOA).

A sine pulse will result in a periodic autocorrelation function with a
shallow peak but this doesn't sound like what you're describing (noise). So
the problem may be something different. 

You can find two implementations for delay estimators here: 
http://www.dsprelated.com/showarticle/26.php. In the absence of noise,
they'll achieve micro- and nanosample accuracy, respectively
(correlation-based / phase-based). They are not guaranteed to work if the
group delay varies strongly with frequency (as could be the case in an
acoustic enviroment). 

Generally, zero-padding (as you are doing with fft(signal, N) is
problematic as the result may get strongly biased towards maximizing the
overlap between the signals. If your test setup allows, try to capture one
cycle of a periodic test signal, when the output has reached steady state,
that is all reverberations of the turn-on transient have decayed.	 

_____________________________		
Posted through www.DSPRelated.com
Reply by Robert Caltay January 4, 20142014-01-04
On 2014-01-04 23:04:22 +0000, maury said:

> Can you specify signal x? If so, use a signal that is easier to detect > in noise, e.g. chirp.
I was trying with a sine burst with 1 to 10 periods. The problem is really the measuremenet noise and how to deal with it. The amplitude of it is quite high
Reply by maury January 4, 20142014-01-04
On Friday, January 3, 2014 3:02:53 PM UTC-6, robert...@gmail.com wrote:
> Hi guys, > > > > I have to determine the time lag between two signals x and y for an acoustic distance measurement setup. The signal x is the test input signal and y is the reflected signal from the acoustic path. This is modeled the following: > > > > y = h * y + N > > > > whereas N is additional gaussian noise and h is the impulse response of the acoustic path. (The operator * states for a convolution operator). > > > > My first approach for determining the time delay was correlation based. Doing a cross-correlation (CC) between the two signals x and y and take the maximum of the absolute of it. Here is a little Matlab example of this trivial approach: > > > > [Rxy, k] = xcorr(y, x); > > [~, loc] = max(abs(Rxy)); > > lag = k(loc); > > > > The performance of this was not that good since there is a distortion through the acoustic path and noise. > > > > I looked up this problem a bit on the internet and found the generalized cross correlation (GCC) which introduces a weighting function in the frequency domain. I tried these approaches but did not get any meaningful results respectively an improvement to a simple CC as described above. > > > > Consider for example the following snipped with a PHAT weighting function: > > > > N = max(length(x), length(y)); > > X = fft(x, N); > > Y = fft(y, N); > > Gxy = conj(Y) .* X; > > Gxy = Gxy ./ abs(Gxy); > > Rxy = fftshift(real(ifft(Gxy))); > > > > This does not yield a meaningful result. There is no correlation visible when plotting this. Also other weighting functions (ROTH, HT, SCOT) do not really show an expected result. > > > > Can anyone help and give me some advice why there is no improvement using GCC or what I'm doing wrong with it? > > > > Thank you in advance! > > Cheers Robert
Can you specify signal x? If so, use a signal that is easier to detect in noise, e.g. chirp.
Reply by Eric Jacobsen January 3, 20142014-01-03
On Sat, 4 Jan 2014 02:37:04 +0100, Robert Caltay
<robert.caltay@gmail.com> wrote:

>On 2014-01-04 00:56:59 +0000, radams2000@gmail.com said: > >> If your acoustic recordings were made in a highly reverberant >> environment , then this method does not work so well. > >The environment is not that reverberant. The problem is more the noise. >Doing a plain CC I can clearly see the correlation within the noise. I >would estimate the noise amplitude as a gaussion distribution with >parameters about N(0,3) to N(0,5) (roughly estimated). > >Doing a quick simulation (not the actual measurement, similar path >impulse response, NO noise) I can determine the time lag with GCC. > >So what would be a good approach to deal with the noise?
Processing gain is usually one good way to deal with noise. If you can make N larger, that'll help, plus any other ways to get processing gain (e.g., oversampling and decimating, etc.). Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
Reply by Robert Caltay January 3, 20142014-01-03
On 2014-01-04 00:56:59 +0000, radams2000@gmail.com said:

> If your acoustic recordings were made in a highly reverberant > environment , then this method does not work so well.
The environment is not that reverberant. The problem is more the noise. Doing a plain CC I can clearly see the correlation within the noise. I would estimate the noise amplitude as a gaussion distribution with parameters about N(0,3) to N(0,5) (roughly estimated). Doing a quick simulation (not the actual measurement, similar path impulse response, NO noise) I can determine the time lag with GCC. So what would be a good approach to deal with the noise? Robert