Cross-Spectral and Transfer Function Analysis

GX-TXT DEV112 P011-bis

Use two distinct signals to estimate cross spectrum, transfer function, phase and coherence in GX-TXT.

Enable the module

In Configuration → Modules → Analysis & Services select Cross-Spectral & Transfer Function Analysis, ID analysis.cross_spectral_transfer. The package installed in P011-bis is 1.1.3 and uses math.numeric. With Health Available and state OFF press Enable module. Then in Analysis select Run / recalculate now to include it in the plan.

The Cross-Spectral module is installed and available to be enabled.
The Cross-Spectral module is installed and available to be enabled.

Generate a pair of synchronized signals

In New Session… → Generate Session… choose GX-TXT Public Session Generators → Signal Processing → Cross-Spectral Transfer Function. ID cross_spectral_transfer, version 1.0.2. Leave Standalone Session, give it a name and generate. The Dataset cross_spectral.source has time_s in seconds, input_V and output_V in volts. The Generator sets twelve one-second windows at 4096 Hz, with test tones at 64, 256 and 640 Hz. For this synthetic pair the output is 2.5 times the input.

In Dataset enable cross_spectral.source, read the contract from Preview and check columns, units and origin in Technical details. The Session contains the numerical source, the window definition and the expected values in the generated material.

Choice of the Generator that provides the numerical source and synchronized windows.
Choice of the Generator that provides the numerical source and synchronized windows.

Bind the common axis and the two signals

In Dataset sources choose cross_spectral.source as primary. Its Remove is disabled. In Input variable bindings select primary.time_s for Time / temporal variable, primary.input_V for Input signal X and primary.output_V for Output signal Y. The menus show the fields of the source and auto. Bind each column to its role to keep the input→output direction. The module requires two distinct signal columns. If you assign the same column to X and Y, the Run can end in an error even after the preliminary plan.

Use Temporal Window Set tset_001, with the name Twelve synchronized one-second windows. It must belong to the specified Dataset and time axis. None leaves the required input missing. A Window Set determines the windows over which each spectrum is estimated and then averaged. Each pair of windows is synchronized because X and Y share the time.

Each signal is bound to its own role and the Window Set has twelve windows.
Each signal is bound to its own role and the Window Set has twelve windows.

Set estimation, FFT and cache reuse

Run mode
recalculate recalculates and regenerates the plots. It is the choice set by the Generator. auto, the module default, chooses based on the validity of the cache. render_only reuses the available results to redo the representations. It requires a previous compatible computation. Use recalculate when you change signal, set or estimation parameters.
FFT weighting window
rectangular uses constant weights. hann, the default, tapers the ends. hamming keeps a residual weight at the ends. blackman attenuates the side lobes more strongly. blackman_harris increases their suppression with a wider lobe. flat_top favors the stability of the amplitude estimate near the center frequency. The same choice applies to X and Y.
Pre-FFT detrend / DC handling
none keeps the original signal, mean, the default, removes the mean and linear removes the estimated linear trend per window.
NFFT mode / Explicit NFFT
auto uses the window length. explicit uses Explicit NFFT, initially 4096. The value must accommodate the samples of the window. With 8192 on 4096-sample windows you get a 0.5 Hz spacing. Zero-padding makes the spectral sampling denser.
Parallel workers
auto delegates the choice, serial uses serial execution and a positive integer fixes the requested number. The Generator sets serial. Try 2 with an explicit NFFT and read in the report the requested workers and the outcome of the computation.
Variant with 8192 points, Blackman window and two workers requested.
Variant with 8192 points, Blackman window and two workers requested.

Run and interpret the published values

In Run check that the plan shows the primary Dataset and start. After Selective analysis completed, in Dataset open cross_spectral.source.cross_spectral.v0002.v0003.tset_001. Preview gives the contract spectrum.table. Open Dataset → Canonical table allows numerical reading. Metadata shows the origin of the product and Technical details the fingerprint, the HDF5 format and the list of variables.

Result columns
frequency, input_psd, output_psd, input_psd_db, output_psd_db
Reading
Frequency in Hz, auto-spectral densities in V²/Hz and the corresponding logarithmic representations.
Result columns
cross_psd_real, cross_psd_imag, cross_psd_magnitude, cross_phase_deg
Reading
Parts of the averaged product of the conjugate input and the output, and phase in degrees.
Result columns
h1_real, h1_imag, h1_magnitude, h1_gain_db, h1_phase_deg, h1_phase_unwrapped_deg
Reading
Components, magnitude, gain and phase of H1, the ratio Sxy/Sxx. The unwrapped phase shows continuity beyond the 360° jumps.
Result columns
h2_real, h2_imag, h2_magnitude, h2_gain_db, h2_phase_deg, h2_phase_unwrapped_deg
Reading
The same forms for H2, the ratio of Syy to the conjugate of Sxy. The choice between H1 and H2 depends on where the noise is assumed to be in the measurement.
Result columns
coherence
Reading
Magnitude-squared coherence, |Sxy|²/(Sxx Syy), ideally between 0 and 1. Evaluate it in the bands where the densities contain measurable energy.

In Results uses cross_spectral_report.txt to check the effective parameters and the convention. At the three test tones H1 and H2 have a magnitude of about 2.5, a gain of about 7.96 dB, a phase of about 0° and a coherence of about 1. The spectrum contains 2049 bins at NFFT 4096 and 4097 bins at NFFT 8192.

Canonical table of the result of the computation with NFFT 8192.
Canonical table of the result of the computation with NFFT 8192.

Open and customize the plots

In Plots select 01_transfer_gain, 02_transfer_phase, 03_coherence or 04_input_output_psd. The views show, respectively, the H1/H2 level, the phase, the coherence and the two PSDs against frequency. The rows Plot p… are editable native variants associated with the same data.

Transfer gain computed and opened in the Plots panel.
Transfer gain computed and opened in the Plots panel.

To change the title of the gain variant, choose Plot p0001 in the test Session and open Presentation → Title and labels…. In Graph title enter H1 e H2 – guadagno di trasferimento, save and use Render → Rerender. Graph → Open PNG 1:1 opens the updated image. Check the title in the image and keep the canonical table as the reference for the numerical values.

Native gain variant selected before the change.
Native gain variant selected before the change.
Reprocessed plot with the custom title.
Reprocessed plot with the custom title.