Friday, 10 July 2015

Introducing the xyscope


This is a short post about a type of measuring device patch I made in Pure Data (Pd) called an xyscope. It helps a lot when testing other Pd objects like Hilbert Transformers.

An xyscope is a tool for measuring phase relationships between pairs of input signals by representing the phase difference as geometric shapes, ranging from a perfect circle through a distorted circle all the way to a completely flat circle (i.e. a straight line). 

It's probably best to go ahead and demonstrate with some examples:


zero phase (in-phase)

Figure 1 - Inputs in phase

  1. In figure 1, the wave generator outputs a cosine wave from it's left and right outputs. The phase difference is set to 0.
  2. Both cosines are received by the xyscope which measures the phase difference (highlighted in orange) and graphs the relationship as a NE - SW straight line on the main display. 
  3. The left generator output is displayed in the oscilloscope for reference.

pi/2 (quadrature phase)

Figure 2 - Quadrature phase (pi/2)
  1. In figure 2, the wave generator outputs a cosine wave from it's left and right outputs. The phase difference this time is set to -pi/2, so the right output is actually a sine wave.
  2. The xyscope measures the phase difference (highlighted in orange in units of pi) and graphs the quadrature relationship as a perfect circle on the main display.

pi  (out-of-phase)

Figure 3 - Inputs out-of-phase
  1. In figure 3, the wave generator outputs a cosine wave from it's left and right outputs. The phase difference this time is set to -pi, so the right output is the inverted left output.
  2. The xyscope measures the phase difference and graphs the inverted relationship as a NW - SE straight line on the main display.

pi/4 (and miscellaneous phases)

All other phase relationships generate a distorted circle on the xyscope. 

Here is pi/4 for illustration:

Figure 4 - pi/4 phase difference
  1. In figure 4, the wave generator outputs a cosine wave from it's left and right outputs with phase difference pi/4.
  2. The xyscope represents this difference as a distorted circle.



So that is an overview of the xyscope.  It works by plotting the input signals against each other sample-by-sample in the main display, and by taking the arcsine and doing some trig for the number box measurements.

Let me know in the comments if you want the scope patch - I'll upload it once I've fixed the last few bugs!



No comments:

Post a Comment