## Pythagorean Theorem with negative numbers

## Pythagorean Theorem with negative numbers

(OP)

To skip the background of my question go to the last two lines of this post.

I work in a materials science lab doing spectroscopy with a rather crude type of instrumentation. We use modulation to improve our signal to noise ratio, and we record two signals, one in phase, and one ninety degrees out of phase. So each time we use the spectrometer we record two signals, one in phase and one out of phase, and then we adjust the phasing until the entire signal is in the in phase signal, and the out of phase consists only of noise.

However for the experiment I'm currently working on, I am changing one variable while keeping all other variables the same, which means I have to keep the phase the same. But, the phase of the signal seems to be changing as I am changing my independent variable.

I have both phases recorded, one in phase, and one 90 degrees out of phase.

Since the two signals are 90 degrees from each other, this is the perfect condition to use the pythagorean theorem and sum the squares of both signals, and then take the square root of that sum. I could definitely do this to find the actual signal amplitude. HOWEVER, these signals include both positive and negative values. When I do the pythagorean theorem it churns out only positive numbers. There are also times when one phase is positive and the other is negative.

So, my question, simplified is:

I have two columns containing two phases of a modulated signal that are orthogonal to each other. How can I do a version of the pythagorean theorem in excel on these two columns each containing 4096 data points, when one or both columns is sometimes negative?

Thank you

-Derek

I work in a materials science lab doing spectroscopy with a rather crude type of instrumentation. We use modulation to improve our signal to noise ratio, and we record two signals, one in phase, and one ninety degrees out of phase. So each time we use the spectrometer we record two signals, one in phase and one out of phase, and then we adjust the phasing until the entire signal is in the in phase signal, and the out of phase consists only of noise.

However for the experiment I'm currently working on, I am changing one variable while keeping all other variables the same, which means I have to keep the phase the same. But, the phase of the signal seems to be changing as I am changing my independent variable.

I have both phases recorded, one in phase, and one 90 degrees out of phase.

Since the two signals are 90 degrees from each other, this is the perfect condition to use the pythagorean theorem and sum the squares of both signals, and then take the square root of that sum. I could definitely do this to find the actual signal amplitude. HOWEVER, these signals include both positive and negative values. When I do the pythagorean theorem it churns out only positive numbers. There are also times when one phase is positive and the other is negative.

So, my question, simplified is:

I have two columns containing two phases of a modulated signal that are orthogonal to each other. How can I do a version of the pythagorean theorem in excel on these two columns each containing 4096 data points, when one or both columns is sometimes negative?

Thank you

-Derek

## RE: Pythagorean Theorem with negative numbers

## RE: Pythagorean Theorem with negative numbers

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

[IMG http://tinyurl.com/7ofakss]

Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers

Of course I can. I can do anything. I can do absolutely anything. I'm an expert!

There is a homework forum hosted by engineering.com: http://www.engineering.com/AskForum/aff/32.aspx

## RE: Pythagorean Theorem with negative numbers

I also tried calculating the angle between the two signals and multiplying the in phase by the cosine of that angle, and the out of phase by the sine. This method never resulted in a signal with an amplitude larger than either of the two signals.

I've attached the excel file I'm working with.

## RE: Pythagorean Theorem with negative numbers

Your first tab should not have been using the average of anything, since there was no plausible reason to do so, and you didn't do anything remotely like that on the second tab. E10 should be more like:

=ABS(IF(ABS(B10)>ABS(C10),B10/SIN(D10),C10/COS(D10)))

Either way results in some pathological results.

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

[IMG http://tinyurl.com/7ofakss]

Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers

Of course I can. I can do anything. I can do absolutely anything. I'm an expert!

There is a homework forum hosted by engineering.com: http://www.engineering.com/AskForum/aff/32.aspx