-
Notifications
You must be signed in to change notification settings - Fork 3
Topic: Quadratures
Suppose we have a digitized voltage signal where the
and
where
(and the data set contains an integer number of periods at
and
allowing you to estimate the magnitude and phase of a single frequency component.
The interface for estimating quadratures looks similar to this:

As you can see, there are a lot going on, and I've highlighted the three most important. First, if "Auto" is checked, whenever a new data set is collected, it will be transferred to the "Quadratures Raw Data" tab, its quadratures will be estimated for the shown frequency, and the resulting quadratures will be appended to the shown Databox Plotter. You probably want to adjust the plot script (red box on right) to visualize quantities of interest; the shown example plots the magnitude and phase of the first channel. Another common example is to adjust the phase of the first channels quadrature to be relative to the second channel, which can be accomplished with this:
q1 = d[2]+1j*d[3] # Complex phasor for Channel 1
q2 = d[4]+1j*d[5] # Complex phasor for Channel 2
q1r = q1*abs(q2)/q2 # q1 but with phase relative to that of q2
x = ( d[1] ) # Frequency for the x-data
y = ( abs(q1r), angle(q1r) ) # Scaled magnitude and phase for Channel 1
xlabels = 'Frequency (Hz)'
ylabels = ( 'Magnitude', 'Relative Phase' )We emphasize that it is important to ensure the incoming data sets contains an integer number of periods at ![f], or this interpretation is no longer valid. To assist, if "Truncate" is checked, it will automatically reduce the size of the incoming data set such that it contains an integer number of periods.
Finally, the "Sweep" button allows you to measure quadratures at different frequencies. Specifically it:
-
Sets all outputs to cosines of the specified amplitudes, and sets the frequency to that shown in "Sweep/Start".
-
Sends the waveform to the physical outputs and waits a time "Input/Settle" for the system to settle.
-
Collects an integer number of periods exceeding "Input/Collect" (provided the number of samples does not exceed "Input/Max_Samples"), and calculates the quadratures. This step is repeated as shown in "Input/Iterations".
-
Sets the output frequencies to the next value and returns to step 2.
On some interfaces, steps 2-3 can be performed with a "Go" button. As usual, you can find out more about each control by hovering your mouse.
quadratures follows the same naming conventions as the rest of our software, with a minimally cluttered name space that can be navigated with code completion. Here are some examples:
-
quadratures.plot_rawis the raw Databox Plotter. -
quadratures.plot_quadraturesis the quadratures Databox Plotter. -
quadratures.checkbox_autoandquadratures.checkbox_truncateare the check boxes mentioned above. -
quadratures.button_sweepis the "Sweep" button. -
quadratures.settingsis the Tree Dictionary on the left. - etc...