Harmonic Analysis
GX-TXT DEV112 P011-bis
Identify the fundamental and the harmonics of a signal and compare amplitudes, phases and distortion indices.
GX-TXT P011-bis · module 1.2.0. Harmonic Analysis searches for components around the multiples of a fundamental in a linear amplitude spectrum. It publishes frequencies, relative amplitudes, plots and the harmonic distortion computed on the resolved orders.
Generate the signal and compute the FFT
- From Session → New Session → Generate Session choose the Generator
harmonic_analysisand create a Standalone Session. In Datasets openharmonic.source. - Enable FFT Spectrum & Error Analysis. Bind
primary.time_sandprimary.distorted_V. To get the spectrum of the example choosefull_record, windowrectangularand DC removalmean. Clear Data Selection and Temporal Set if already assigned. Run the FFT from Run. FFT procedure and parameter choice. - Enable
harmonic.source.spectrum, open Preview, Metadata and Open Dataset → Canonical table. Usefrequency_Hzand the linear valueamplitudein V.magnitude_dBcalready uses a logarithmic relative scale.


Configure the detection
In Configuration → Modules → Analysis & Services search for Harmonic Analysis, check Health and enable it with Enable module. In Analysis open the tab and tick Run / recalculate now. In Dataset sources assign harmonic.source.spectrum to primary. + Add source adds an alias and Remove releases a source. In Variable bindings choose primary.frequency_Hz for Frequency and primary.amplitude for Amplitude spectrum. auto lets the program resolve the role from the available metadata.
- Fundamental detection
auto_peaksearches for the maximum in the admitted region.explicitlocates the fundamental near the given frequency.- Explicit fundamental frequency
- Comes into play with
explicit. Use 100 Hz to replicate the second example. - Highest harmonic order
- Highest order number searched. With 5, the default, the fundamental and the harmonics up to the fifth are considered. With 3 it stops at the third.
- Local harmonic search half-width [bins]
- Half-width of the local search in bins around the expected multiple. The default is 2. In the explicit example use 1. Overlapping windows can select the same bin.
- Low-frequency bins excluded from automatic fundamental search
- Number of initial bins to exclude from the automatic search. The value 1 discards the DC component of the example FFT.
- Harmonic result Dataset ID
harmonic_analysis.resultis the default ID. Setharmonic_analysis.explicitto keep the explicit test alongside.

Compare the components and the distortion
In Run update the plan and start the selective analysis. In Results read harmonic_analysis_report.txt. Open the Dataset in Preview, Metadata and Canonical table. The columns are order, expected and detected frequencies, error in Hz, amplitude, dBc level and percentage of the fundamental.
The automatic case found 100 Hz and 1 V. The second and third harmonics measure about 0.1 V and 0.05 V. The root-sum-square of the tracked harmonics relative to the fundamental is 11.4017543% up to order 5 and 11.1803399% up to order 3. The set of orders and the FFT normalization affect the measurement.

Open and present the plots
In Plots select 01_harmonic_levels_dbc for the relative levels, 02_harmonic_levels_percent for the percentages or 03_harmonic_levels_linear for the amplitudes. The persistent variants appear as rows Plot p…. Select a row Plot p… of type plot.dataset to change the title. Choose Presentation → Title and labels…, customize the title, save and use Render → Rerender. Graph → Open PNG 1:1 opens the full-size rendering.

