Daqarta
Data AcQuisition And Real-Time Analysis
Scope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
The following is from the Daqarta Help system:

Features:

Oscilloscope

Spectrum Analyzer

8-Channel
Signal Generator

(Absolutely FREE!)

Spectrogram

Pitch Tracker

Pitch-to-MIDI

DaqMusiq Generator
(Free Music... Forever!)

Engine Simulator

LCR Meter

Remote Operation

DC Measurements

True RMS Voltmeter

Sound Level Meter

Frequency Counter
    Period
    Event
    Spectral Event

    Temperature
    Pressure
    MHz Frequencies

Data Logger

Waveform Averager

Histogram

Post-Stimulus Time
Histogram (PSTH)

THD Meter

IMD Meter

Precision Phase Meter

Pulse Meter

Macro System

Multi-Trace Arrays

Trigger Controls

Auto-Calibration

Spectral Peak Track

Spectrum Limit Testing

Direct-to-Disk Recording

Accessibility

Applications:

Frequency response

Distortion measurement

Speech and music

Microphone calibration

Loudspeaker test

Auditory phenomena

Musical instrument tuning

Animal sound

Evoked potentials

Rotating machinery

Automotive

Product test

Contact us about
your application!

Sound Card Lissajous (X vs. Y) Mini-App

[Lissajous (44K image)]

Introduction:

To run the included Lissajous macro mini-app, hit the F8 key followed by the L key, or hit CTRL+F8 to open the Macro Dialog and double-click on Lissajous in the Macro List.

The Lissajous macro uses a Custom Controls dialog with controls for test signal frequencies, phase, FM modulation, and channel selection, plus a phase meter and a "just for fun" color modulator.

Note that you can open this Help topic by right-clicking anywhere in the Lissajous control dialog.

Lissajous ("Lee-sah-zhoo") figures are traditionally created with an oscilloscope displaying two signals in "X-Y" mode.

A conventional analog scope display might be called "Y-T" mode. It shows two signals as separate traces, plotting each as instantaneous voltage versus time. For each channel, the electron beam creates a spot on the screen whose vertical deflection is proportional to the instantaneous voltage. With no horizontal deflection, the spot would simply move up and down on the screen to create a vertical line. With no vertical signal either, the spot would sit in the center of the screen.

A "time base" inside the scope applies a ramp waveform to the horizontal deflection of the beam. This moves the spot from left to right at a controlled rate, and when the right edge of the screen is reached the ramp waveform drops back to zero to "instantly" bring the spot back to the left edge. When a vertical signal is present, this time base action causes the waveform of the signal voltage to be plotted versus time.

In X-Y mode the Y signal is used for vertical deflection as above. However, the horizontal time base is replaced with the designated X input signal.

When the two signals are identical, the resulting trace is a diagonal line from lower left to upper right. This can be understood by considering that each signal controls the position of the electron beam on its respective X or Y axis. As the vertical signal increases and the spot move up, the horizontal increases an equal amount and the spot moves to the right.

The most useful application is when both waves are sinusoids. If they are identical, we get the diagonal line as above. But if one is shifted slightly in time (phase) relative to the other, the diagonal line opens out into an ellipse. When they are 90 degrees apart, the ellipse becomes a circle (if the vertical and horizontal sensitivities are the same). Further shifting causes the circle to be squashed into a line from upper left to lower right at 180 degrees.

The phase difference between the two signals can be determined from the ellipse. Measure the vertical height of the ellipse at its center, and divide by the maximum height. This is the sine of the phase angle.

Phase measurement is rather crude when done from a scope screen, but the Lissajous macro has a Phase Meter button that performs an analogous operation directly on the raw data and shows the phase in degrees on a Custom Meter.

Note that when the phase difference exceeds 180, the readings go down: 179 instead of 181, etc, down to 0 at 360 degrees. This is the absolute phase difference between the two signals, and is the same phenomenon you would see with the physical screen measurement method.

With clean low-noise signals the reading is accurate to 0.01 degree from 0 to 180 degrees at the default 100 Hz test frequency, but at high frequencies (over 1000 Hz) it is susceptible to errors at certain "bad" frequencies. For example, at 16000 Hz a 45.00 degree true phase is reported as nearly 60 degrees, while at 16020 Hz it is back to 45.00 again.

You can understand this problem by looking at the Lissajous figure. (You may want to toggle the normal channel display buttons off to see this more clearly.) At 16000 Hz the Lissajous figure is a triangle instead of an ellipse! As the signal frequency increases or decreases from this "bad" spot, the triangle rotates faster and faster, until it appears as a fat ellipse... and the readout is accurate. (See the Phase Meter Mini-App for precision phase measurements.)

Although these "bad" frequencies may give poor phase readings, they can lead to some wonderful rotating stars. (Try 19999 and 20000 Hz.) You can toggle the L.Out and R.Out display channels off if you don't like the "dense" high-frequency waveform display as a background.

Besides phase measurement, Lissajous figures can be used as a graphical display of relative frequency. When the two sinusoids are at slightly different frequencies, the ellipse appears to wobble as it moves through all the phase angles between the waves. The time it takes to move through one complete cycle is equal to the difference in frequency. If you are manually adjusting one frequency to match another, the two are identical when the ellipse stops changing.

When the Y frequency is much larger than the X frequency, the display appears as a wavy rotating horizontal ring, as if the Y waveform were displayed on a circular axis. Conversely, if the X frequency is greater the ring is oriented vertically.

When the X and Y frequencies are integer multiples, the ring stops rotating. The number of cycles around the ring is the integer frequency ratio. Just as when adjusting frequencies for a perfect match, adjusting for a stationary ring allows setting exact frequency multiples. If your adjustment is a bit off, the ring will rotate proportionally, slowing down as you get closer, and reversing direction if you go too far.

The Lissajous macro loads a Generator setup called Lissajous.GEN, and by default starts with Y set to Left Out and X set to Right Out, each at 100 Hz but with Left Phase set to 45 degrees.

The macro also invokes the _Liss_Ctrls macro to use the Custom Controls dialog for easy experimentation with frequencies and phase. You can also apply frequency modulation (FM) to the Right Out channel to slowly (0.2 Hz) change its frequency over an adjustable range (deviation).

The actual display operations are done by _Liss_Task, which is a multitasking macro that runs in the background on every trace update. It is installed by Lissajous before the _Liss_Ctrls macro is opened, and removed after it is closed.

Buttons in the Custom Controls dialog allow selection of Input channels instead of the default Outputs, as well as toggling the Phase Meter. You can thus measure the phase difference between two external signals, or adjust frequency ratios. Likewise, you can adjust an external signal to match one of the Generator signals. You can use a Generator output to provide a reference signal to an external circuit, and measure the phase shift caused by the circuit.

Just for fun, there is an additional Input Color Mod button that adds the Left Input signal to the selected Y channel. (You need to select the desired Mic or Line input from the Input dialog, as well as setting the sensitivity level.)

If the Y and X channels are at their default Left and Right Output settings, the ellipse will be modulated by the input signal, with peaks in the signal causing outward deflection and dips causing inward.

In addition, the color of the trace changes in proportion to the signal strength, from red through orange, yellow, green, and so on to magenta. (It jumps to white beyond that.) This demonstrates the use of the {\b colr()} function to map a linear value (input signal strength) onto a color circle.


Lissajous Macro Listing:

;<Help=H4904
Close=
Spect=0
Sgram=0
Trig=1
Xpand=0
UI=Input
A.LoadGEN="Lissajous"
Input=UI
Ctrls="<<Lissajous (X-Y) Controls "
Ctrl0="<<Left Gen Frequency"
Ctrl0="<S(10,1000)"
Ctrl0=100
Ctrl1="<<Right Gen Frequency"
Ctrl1="<S(10,1000)"
Ctrl1=100
Ctrl2="<<Left Phase"
Ctrl2="<S(0,360)"
Ctrl2=45
Ctrl3="<<Right FM Deviation"
Ctrl3="<S(0,10)"
Ctrl3=0

Btn0="<M(3)"
Btn0=2
Btn0="Y= " + Btn0(c)
Btn1="<M(3)"
Btn1=3
Btn1="X = " + Btn1(c)
Btn2="Phase Meter"
Mtr0="<<Phase - Degrees"
Mtr0="<C(0)"
Mtr0="<B(hFFFFFF)"
Mtr0="<H4904"
Btn3="Input Color Mod"

Buf0="<dWB(255)"
Buf0="<dX1"
Buf0#Z=0

Task="_Liss_Task"
@_Liss_Ctrls=Ctrls
Task="-_Liss_Task"
Buf0="<d-"
Mtr0=


_Liss_Ctrls Macro Listing:

;<Help=H4904
IF.Ctrls=0
    L.0.ToneFreq=Ctrl0
ENDIF.

IF.Ctrls=1
    R.0.ToneFreq=Ctrl1
ENDIF.

IF.Ctrls=2
    L.0.TonePhase=Ctrl2
ENDIF.

IF.Ctrls=3
    R.0.FMdev=Ctrl3
ENDIF.

IF.Ctrls=4
    Btn0="Y= " + Btn0(c)
ENDIF.

IF.Ctrls=5
    Btn1="X= " + Btn1(c)
ENDIF.

IF.Ctrls=6
    IF.Btn2=0
        Mtr0=
    ELSE.
        Mtr0="<H4904"
    ENDIF.
ENDIF.

IF.Ctrls=7
    IF.Btn3=1
        Input=1
    ELSE.
        Buf0="<dWB(255)"
    ENDIF.
ENDIF.


_Liss_Task Macro Listing:

;<Help=H4904
Buf0="<=W(Btn0)"
Buf1="<=W(Btn1)"
IF.Btn2=1
    Buf2="<=B0"
    Buf3="<=B1"
    Buf2="</(pkB(2)/32767)"
    Buf4="<=B2"
    Buf3="</(pkB(3)/32767)"
    Buf2="<-B3"
    B=pkB(2)/32767
    Buf4="<+B3"
    A=pkB(4)/32767
    IF.A=<B
        Y=180 - 2 * asin(A/2) * 360 / (2 * pi)
    ELSE.
        Y=2 * asin(B/2) * 360 / (2 * pi)
    ENDIF.
    IF.Y=>=0
        Mtr0=Y
    ENDIF.
ENDIF.
IF.Btn3=1
    Buf2="<=W0"
    Ch=2
    C=BwSig(0,1023) / 32767
    C=C*1535 * 30
    IF.C=>1535
        C=1791
    ENDIF.
    Buf0="<dWB(colr(C))"
    Buf2="<*(32)"
    Buf0="<+B2"
ENDIF.
Buf1="</(129)"
Buf1="<+(256)"


See also Macro Examples and Mini-Apps, Phase Meter Mini-App

GO:

Questions? Comments? Contact us!

We respond to ALL inquiries, typically within 24 hrs.
INTERSTELLAR RESEARCH:
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2023 by Interstellar Research
All rights reserved