DSPRelated.com
Forums

phase difference between two channels

Started by Unknown May 28, 2008
I want to find the phase difference between two channels(x and y) due
to instrumental effects. For that I am passing a signal from a noise
generator through the two channels. Then I switch off the noise
generator and note the outputs from the two channels. Subtraction of
the noise-off signal from the noise-on signal should remove any other
spurious signals so I get only the signal from the noise generator at
the output of the two channels. cross correlating the two channels now
would mean (xon - xoff)* conj(yon-yoff) in the frequency domain which
will yield the phase difference. However since it is a real time
problem, I have xon and yon at a time and not the off states so I can
perform a correlation like xon*conj(yon) and  xoff*conj(yoff) and
subtract them. In the previous case I get two additional
multiplication terms i,e xon*conj(yoff) and xoff*conj(yoff). Since
these are uncorrelated, I should get same result but my simulation
shows different results when I plot the phases for the two cases. What
is wrong in the approach? How do I get better results?
On 28 Mai, 17:32, koyel.a...@gmail.com wrote:
> I want to find the phase difference between two channels(x and y) due > to instrumental effects. For that I am passing a signal from a noise > generator through the two channels.
Do you feed the same signal into the two channels?
> Then I switch off the noise > generator and note the outputs from the two channels.
Switch off? What signal do you see, then? Or do you mean that you have stored the signal and proceed with off-line analysis?
> Subtraction of > the noise-off signal from the noise-on signal should remove any other > spurious signals so I get only the signal from the noise generator at > the output of the two channels.
That might be true in a perfect world, but this world is far from perfect. For that to work, you would have to know absolutely everything about your system, and with infinite precision. Skip this step. Find some other method to achieve the goal of this step, or better, avoid it alltogether.
> cross correlating the two channels now > would mean (xon - xoff)* conj(yon-yoff) in the frequency domain which > will yield the phase difference. However since it is a real time > problem, I have xon and yon at a time and not the off states so I can > perform a correlation like xon*conj(yon) and �xoff*conj(yoff) and > subtract them. In the previous case I get two additional > multiplication terms i,e xon*conj(yoff) and xoff*conj(yoff). Since > these are uncorrelated, I should get same result but my simulation > shows different results when I plot the phases for the two cases. What > is wrong in the approach?
Frist, the signal conditioning is seriously flawed. Second, the conj() stuff works in frequency domain for narrow-band signals. Since you use a noise generator you have broadband signals.
> How do I get better results?
There is too much to sort out in what little you have written here. The short answer is to get a book like Bendat & Piersol: Random Data (Wiley, 2000) get to know it and find something in there which resembles what you want to do and take it from there. Rune
Thank you very much for this reply

> Do you feed the same signal into the two channels?
yes!
> > Then I switch off the noise > > generator and note the outputs from the two channels. > > Switch off? What signal do you see, then? Or do you mean that you > have stored the signal and proceed with off-line analysis?
I see minor fluctuations due to thermal effects, which is close to none. But this is to remove any other signal if present which would be in reality. No not offline! I continuously turn on the noise generator on for sometime and fine the xon*conj(yon). Similarly I turn it off for some time and find xoff*conj(yoff). Then I accumulate the spectra and proceed to offline processing thereafter.
> > Subtraction of > > the noise-off signal from the noise-on signal should remove any other > > spurious signals so I get only the signal from the noise generator at > > the output of the two channels. > > That might be true in a perfect world, but this world is > far from perfect. For that to work, you would have to know > absolutely everything about your system, and with infinite > precision.
I want the variation due to system differences so anything because of the system characteristics is included. I need that. I only want to remove external sources.
> Skip this step. Find some other method to achieve the goal > of this step, or better, avoid it alltogether.
Do you have any other idea?
> > cross correlating the two channels now > > would mean (xon - xoff)* conj(yon-yoff) in the frequency domain which > > will yield the phase difference. However since it is a real time > > problem, I have xon and yon at a time and not the off states so I can > > perform a correlation like xon*conj(yon) and �xoff*conj(yoff) and > > subtract them. In the previous case I get two additional > > multiplication terms i,e xon*conj(yoff) and xoff*conj(yoff). Since > > these are uncorrelated, I should get same result but my simulation > > shows different results when I plot the phases for the two cases. What > > is wrong in the approach? > > Frist, the signal conditioning is seriously flawed. Second, the > conj() stuff works in frequency domain for narrow-band signals. > Since you use a noise generator you have broadband signals.
Could you explain why?This is what we do in the correlator. Multiplying the signal channel by channel . Though it's a broadband, I am dividing that into 1 Mhz channels.
koyel.aphy@gmail.com wrote:
> I want to find the phase difference between two channels(x and y) due > to instrumental effects. For that I am passing a signal from a noise > generator through the two channels. Then I switch off the noise > generator and note the outputs from the two channels. Subtraction of > the noise-off signal from the noise-on signal should remove any other > spurious signals so I get only the signal from the noise generator at > the output of the two channels. cross correlating the two channels now > would mean (xon - xoff)* conj(yon-yoff) in the frequency domain which > will yield the phase difference. However since it is a real time > problem, I have xon and yon at a time and not the off states so I can > perform a correlation like xon*conj(yon) and xoff*conj(yoff) and > subtract them. In the previous case I get two additional > multiplication terms i,e xon*conj(yoff) and xoff*conj(yoff). Since > these are uncorrelated, I should get same result but my simulation > shows different results when I plot the phases for the two cases. What > is wrong in the approach? How do I get better results?
There are many misconceptions here. I'll discuss just one. The phase difference you seek is a function of frequency. The time delay through your two channels may depend on frequency as well. You have chosen a broad-band source. If youy calculation yielded a number, what would it mean? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
On May 28, 6:35&#4294967295;pm, Jerry Avins <j...@ieee.org> wrote:
> koyel.a...@gmail.com wrote: > > I want to find the phase difference between two channels(x and y) due > > to instrumental effects. For that I am passing a signal from a noise > > generator through the two channels. Then I switch off the noise > > generator and note the outputs from the two channels. Subtraction of > > the noise-off signal from the noise-on signal should remove any other > > spurious signals so I get only the signal from the noise generator at > > the output of the two channels. cross correlating the two channels now > > would mean (xon - xoff)* conj(yon-yoff) in the frequency domain which > > will yield the phase difference. However since it is a real time > > problem, I have xon and yon at a time and not the off states so I can > > perform a correlation like xon*conj(yon) and &#4294967295;xoff*conj(yoff) and > > subtract them. In the previous case I get two additional > > multiplication terms i,e xon*conj(yoff) and xoff*conj(yoff). Since > > these are uncorrelated, I should get same result but my simulation > > shows different results when I plot the phases for the two cases. What > > is wrong in the approach? How do I get better results? > > There are many misconceptions here. I'll discuss just one. > > The phase difference you seek is a function of frequency. The time delay > through your two channels may depend on frequency as well. You have > chosen a broad-band source. If youy calculation yielded a number, what > would it mean? >
Time delay is what yields the phase difference in the frequency domain. y(t) = h(t) * x(t-td) in time domain---where td is the time delay Y(W) = H(W) X(W) exp(-jwtd) ----wtd is the phase which is a function of frequency. What do you mean time delay as a function of frequency? Please explain.
May be the details are missing here but though my source is a
broadband, I am sampling it and digitizing the signal and then
processing it for each and every spectral channel. Since the source
for the two channels are same, there should be same frequency
components only delayed by different amounts. My calculation yields
one number for one spectral channel so different frequency components
do not come into picture at a time.
koyel.aphy@gmail.com wrote:

   ...

> I want the variation due to system differences so anything because of > the system characteristics is included. I need that. I only want to > remove external sources.
... What comes out of a system when there is no input is not a constant. Do you suppose that recording "silence" in a concert hall and subtracting that from an orchestral rendition would better represent the orchestra? 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;
koyel.aphy@gmail.com wrote:

   ...

> Time delay is what yields the phase difference in the frequency > domain.
True. Do you have reason to believe that it is the same for all frequencies? For real channels, frequency-independent time delay is only approximately true, and then only over a limited bandwidth.
> y(t) = h(t) * x(t-td) in time domain---where td is the time delay > Y(W) = H(W) X(W) exp(-jwtd) ----wtd is the phase which is a function > of frequency. What do you mean time delay as a function of frequency? > Please explain.
The transit time for one frequency component can differ from that of another. That is called "dispersion". Most channels are dispersive. 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;
On May 28, 7:01&#4294967295;pm, Jerry Avins <j...@ieee.org> wrote:
> koyel.a...@gmail.com wrote: > > &#4294967295; &#4294967295;... > > > Time delay is what yields the phase difference in the frequency > > domain. > > True. Do you have reason to believe that it is the same for all > frequencies? For real channels, frequency-independent time delay is only > approximately true, and then only over a limited bandwidth. > > > y(t) = h(t) * x(t-td) in time domain---where td is the time delay > > Y(W) = H(W) X(W) exp(-jwtd) &#4294967295;----wtd is the phase which is a function > > of frequency. What do you mean time delay as a function of frequency? > > Please explain. > > The transit time for one frequency component can differ from that of > another. That is called "dispersion". Most channels are dispersive. >
you are right. Thank you for the explanation. In my equation td is the delay due to dispersion for one frequency component. It will vary for different frequencies. The equation above is for one frequency
koyel.aphy@gmail.com wrote:
> May be the details are missing here but though my source is a > broadband, I am sampling it and digitizing the signal and then > processing it for each and every spectral channel. Since the source > for the two channels are same, there should be same frequency > components only delayed by different amounts. My calculation yields > one number for one spectral channel so different frequency components > do not come into picture at a time.
You don't account for different frequency components having different delays. You correlate the whole signal, not the components separately. 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;