Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


TWM - TracePQM Wattmeter

TWM is developed in scope of EMPIR project TracePQM.

TWM is a transparent, metrology grade measurement system for traceable measurement of the Power and Power Quality (PQ) parameters. However, it is not restricted to power and PQ area only. It is designed to allow recording of the voltage and current waveforms using various digitizers and processing the measured waveforms using ANY algorithm. It is composed of two main components:

Both components are connected together into the single interactive application using GOLPI interface. Note the current version does not support Matlab yet, however interface to the Matlab is already in development.

The TWM concept is modular, so it can be simply extended by various digitizer drivers whereas the rest of the application stays unchanged. In the current version the TWM supports:

  • niScope drivers for control of NI's PXI-5922 digitizer for wideband measurements (can be unlocked for other cards as well...),
  • Synchronized HP/Agilent/Keysight 3458A sampling multimeters for precision measurements,
  • DirectSound driver for ordinary soundcard for test purposes and low accuracy measurements,
  • Simulated digitizer for debug purposes (synthesizer of the composite harmonics signal).

Modularity of the Power and PQ calculation algorithms used by the TWM is ensured by the QWTB toolbox.


Current version includes following algorithms:

  • TWM-PSFE: Calculation of fundamental harmonic parameters by Phase Sensitive Frequency Estimator for non-coherent sampling (frequency, amplitude and phase).
  • TWM-FPNLSF: Calculation of fundamental harmonic parameters by four parameter fitting for non-coherent sampling (frequency, amplitude, phase, offset).
  • TWM-MFSF: Multi-harmonic fitting for non-coherent sampling (frequency, amplitudes, phases, offset, THD).
  • TWM-MODTDPS: Calculation of amplitude modulation parameters for sine and rectangular modulation for non-coherent sampling.
  • TWM-Flicker: Calculation of short-term flicker severity according IEC 61000-4-15 for non-coherent sampling.
  • TWM-THDWFFT: Total Harmonic Distortion calculator and harmonics analyser for non-coherent sampling.
  • TWM-PWRTDI: Four quadrant power meter by time-domain integration method for non-coherent sampling.
  • TWM-PWRFFT: Four quadrant power meter by FFT method for coherent sampling.
  • TWM-HCRMS: Half-cycle RMS calculator for PQ event detection according IEC 61000-3-40 for non-coherent sampling.
  • TWM-InDiSwell: PQ event detection according IEC 61000-3-40 for non-coherent sampling.
  • TWM-WRMS: RMS level calculation by time-domain integration method for non-coherent sampling.
  • TWM-WFFT: Windowed FFT for single or multiharmonic estimation.
  • TWM-InpZ: Estimator of digitizer input impedance (no uncertainty).

Details on the algorithms can be found in the draft document A2.4.4 - Algorithms Description.


The project is still under development! In current version it can do following:

  • Digitize waveforms using one of the supported digitizers in given configuration.
  • Store the digitized waveforms in unified format independent of the digitizer.
  • Display measured waveforms.
  • Load the measured data and execute m-script on them using GNU Octave or Matlab:
    • Direct call of the user m-code,
    • or call of the algorithm from the QWTB toolbox.
  • Display calculated results.
  • Batch processing of recorded data.


Important changes and news:

  • 2017-11-20: First release.
  • 2017-12-08: Matlab support.
  • 2018-03-16: Improved GUI, few algorithms added.
  • 2018-08-23: Improved GUI, 8 of 10 algorithms included (not validated yet!).
  • 2019-01-24: Improved GUI, 10 of 10 algorithms included (not all validated yet!).
  • 2019-04-04: Improved GUI, 12 algorithms included (not all validated yet!).
  • 2019-04-15: Improved GUI, minor fixes.


Builds are available in separate Git: smaslan/TWM-builds


The TWM is distributed under MIT license. Note the algorithms in the QWTB toolbox may have different licenses.


Traceable Power Quality Wattmeter




No releases published


No packages published