Understanding phase results

I’m trying to understand the relation between phase degrees and phase seconds, as returned by the api.

Given the following requests and values with the QA401 connected in loopback on the left channel:

$ curl -d "" -X PUT http://localhost:9401/Settings/AudioGen/Gen1/On/1000/0
{ "SessionId":"1112921387" }
$ curl -d "" -X POST http://localhost:9401/Acquisition
{ "SessionId":"3406170928" }
$ curl http://localhost:9401/Phase/Seconds
{ "SessionId":"3406170928", "Left":"0.0005415955622442316", "Right":"0" }
$ curl http://localhost:9401/Phase/Degrees
{ "SessionId":"3406170928", "Left":"165.02559759207662", "Right":"NaN" }

It’s returning 0.541ms, and 165 degrees.

I’m trying the calculator here: https://voltage-disturbance.com/power-quality/calculating-phase-difference-between-two-waves/

And using 1000Hz and time delay of 0.541ms I get 194 degrees as the result:

I was hoping to get the same result as the api at around 165 degrees.
Maybe I’m using the wrong calculator for the purpose? Or is one of the values returned by the api wrong?

A lag of 166 degrees is the same as a lead of 194 degrees (and vice versa). 360-166 = 194. So, they are saying the same thing. There is an issue in the QA401 where there’s a 180 degree inversion due to hardware. Probably this should be fixed before the 1.0 release.

Phase is a simple concept but in practice can be tricky. You need to specify a reference point. What the QA401 (and QA401H) both use is the input to the DAC as the reference point. This means you have prop delay through the DAC, the DUT and the ADC all contributing to the phase. The QA401 has a plug-in where you can specify the right channel as the phase reference. There you can take the output, split it into a BNC T, run one output to the DUT, and run the other output to the right channel and more sensible reading.

A lag of 166 degrees is the same as a lead of 194 degrees (and vice versa). 360-166 = 194.

Ah, I understand. Thanks for the explanation!

I am able to calculate between the 2 now as follows:

(360 - 165.02559759207662) / 360 * 0.001 = 0.0005415955622442316
360 - (360 * 0.0005415955622442316 / 0.001) = 165.0255975920766

There is an issue in the QA401 where there’s a 180 degree inversion due to hardware. Probably this should be fixed before the 1.0 release.

Great!

Phase is a simple concept but in practice can be tricky. You need to specify a reference point.

Make sense. I think that’s a challenge for a later time :slight_smile:

I’m seeing some strange results with an amplifier I’m testing regarding phase:

Here is a frequency sweep, showing that it’s consistently out of phase across the range:

And an amplitude sweep showing the same:

All these examples are with an 8 ohm load.

With a 4 ohm load both channels are in phase with each other. Example with frequency sweep:

Do you think this could be related to the 180 degree inversion issue you mentioned? Or is this just an amplifier that don’t like 8 ohm loads?

If you want to know more about the amplifier, it’s discussed in this thread: Acceptable output quality for power calculation - diyAudio