A 1 kHz tone is generated, and its harmonic spectrum is shown for various types of distortion, with the Total Harmonic Distortion (THD) in % relative to the fundamental tones level.
This example demonstrates the use of Signal Processing functions to introduce distortion and perform analysis on the resulting signal. A simulated sine wave of 1 kHz is used as the base signal, with various distortion options. The frequency power spectrum and harmonic levels on the distorted signal are then displayed along with the Total Harmonic Distortion.
Software
The code can be run as-is since all processing is done on a simulated signal.
1. Run the VI.
2. Try changing the Amplitude (V RMS) and notice the observe in the graphs.
3. Try changing the Distortion Type and observe the change in the graphs.
4. Try changing the Relative distortion (%) and observe the change in the graphs.
5. Click the Stop button to stop the VI.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
I'm acquiring a voltage signal using NI DAQ assist(NI ELVIS 2 board). My sampling rate is 250000. The fundamental frequency is 50Hz. My concern is: I want to find the THD of successive 8 cycles and average it. How to do it in NI LabVIEW and Mathscript modules? The cycle should begin from the first zero crossing(Thereby I can get a complete sin wave).
I'm a beginner. So plz help me to do this