Dave
02-24-2005, 06:01 PM
I'm trying to design something in which data is collected from a dual
channel A/D. If the inputs are x and y, I need to get a 90 degree phase
shift of x, then multiply it by y.
x and y will both contain data points which should in principle be sine
waves (ignoring noise), since the A/D will be sampling sine waves. The
frequency is known to a high degree of accuracy.
One option (I think) is to work out how many samples collected in a
buffer constitute 90 degrees, ignore them, then do a multiply of the
rest. So if 1000 samples makes up a full wave, then 250 will make up a
quarter wave, so I should compute the output A as
A1=x[250]*y[1]
A2=x[251]*y[2]
A3=x[253]*y[3] etc
But if the frequency was not known (which I admit it is in my case),
that would be impossible.
My understanding is that the Hilbert transform of a sine wave gives a
cosine wave, and so doing a Hilbert transform will work. But when I use
Matlab to compute the Hilbert transform of a set of real numbers, the
result becomes complex.
Now I know imaginary numbers are used to represent phase angle. So I'm a
bit confused here. Two methods
* ignore data for a quarter wave, then do real multiples
* use all the data, performing a Hilbert transform on one
would seem to give very different answers.
Can anyone clarify where my logic is breaking down, since clearly
something is very wrong with my thinking?
channel A/D. If the inputs are x and y, I need to get a 90 degree phase
shift of x, then multiply it by y.
x and y will both contain data points which should in principle be sine
waves (ignoring noise), since the A/D will be sampling sine waves. The
frequency is known to a high degree of accuracy.
One option (I think) is to work out how many samples collected in a
buffer constitute 90 degrees, ignore them, then do a multiply of the
rest. So if 1000 samples makes up a full wave, then 250 will make up a
quarter wave, so I should compute the output A as
A1=x[250]*y[1]
A2=x[251]*y[2]
A3=x[253]*y[3] etc
But if the frequency was not known (which I admit it is in my case),
that would be impossible.
My understanding is that the Hilbert transform of a sine wave gives a
cosine wave, and so doing a Hilbert transform will work. But when I use
Matlab to compute the Hilbert transform of a set of real numbers, the
result becomes complex.
Now I know imaginary numbers are used to represent phase angle. So I'm a
bit confused here. Two methods
* ignore data for a quarter wave, then do real multiples
* use all the data, performing a Hilbert transform on one
would seem to give very different answers.
Can anyone clarify where my logic is breaking down, since clearly
something is very wrong with my thinking?