Using the Analog Discovery 2 to Measure Harmonics in a Signal

Every periodic signal can be described as a sum of sine waves with different frequencies, amplitudes and phase shifts. This raises the possibility of synthesizing signals with sine waves and analyzing all kind of signals to determine the sine waves that makes up those signals. Decomposition of the signal shape (data in time domain) to the sine waves that make up the signal (data in frequency domain) is done by using an FFT (Fast Fourier Transform). This algorithm is implemented in Digilent WaveForms. Frequencies of the sine waves are strictly described. Every periodic signal has its own frequency called a base frequency. It is equal to the frequency of the first sine wave. The further sine waves each are the base frequency multiplied by a specific index. For example the second sine wave's frequency is equal to 2 multiplied by the base frequency. The index of a sine wave is called the harmonic. This guide shows how to measure harmonics in a specific signal with the Analog Discovery 2 using an FFT in Digilent WaveForms.


Inventory


Decomposition of the square wave


Set Up

Hardware

Connect the Analog Discovery 2 to your computer.

Connect 1+ (oscilloscope positive input, orange wire) to W1 (waveform generator output, yellow wire) and 1- (oscilloscope negative input, orange and white wire) toGND(地面,黑线)。


软件

Next, open WaveForms. TheWaveGen仪器将用于生成信号,然后Scopeinstrument will be usedobserve the shapes of the signal and measure its harmonics (FFT).

  1. 要启动波形生成器,请单击WaveGenbutton
  2. Switch to thecustom模式
  3. Click onNew, and paste the code below into the text box
waveform generator code var amp = [1,0,0,0,0,0,0,0,0,0]; //amplitude values from 0 to 1 (0-100%) var ph = [0,0,0,0,0,0,0,0,0,0]; //phase values from 0 to 1 (0-360 degrees) Y = amp[0] * sin((1 * 2*PI*X) + 2*PI*ph[0]) + amp[1] * sin((2 * 2*PI*X) + 2*PI*ph[1]) + amp[2] * sin((3 * 2*PI*X) + 2*PI*ph[2]) + amp[3] * sin((4 * 2*PI*X) + 2*PI*ph[3]) + amp[4] * sin((5 * 2*PI*X) + 2*PI*ph[4]) + amp[5] * sin((6 * 2*PI*X) + 2*PI*ph[5]) + amp[6] * sin((7 * 2*PI*X) + 2*PI*ph[6]) + amp[7] * sin((8 * 2*PI*X) + 2*PI*ph[7]) + amp[8] * sin((9 * 2*PI*X) + 2*PI*ph[8]) + amp[9] * sin((10 * 2*PI*X) + 2*PI*ph[9]);

Different shapes of signals can be generated by modifying the amp and phase values. Click the generate button to generate shapes.

  1. 要启动示波器,请单击Scopebutton.
  2. Trigger options : source -Channel 1, condition -上升, level -0V
  3. 时间选项:位置:0s, base :1ms/div
  4. Disable Channel 2 by unchecking its box
  5. Channel options : offset :0V, range :500mV/div, Click on the gear button and uncheck the Noise checkbox.
  6. Click onView→FFTto show FFT window
  7. FFT options : Start :0Hz, Stop :50kHz, Top :0DBV, Bottom :-80dBV


Measurements

自定义测试向量,幅度值从0到1(0-100%):

FFT of signal generated in the Analog Discovery 2 Wave Generator:

与基本频率相比,FFT的结果分解为频率,谐波,分贝水平,电压和百分比:

Frequency Harmonic Level[dBV] Voltage[V] Compared to Base frequency[%]
1 1 -2.4 0.76 100.00%
3 3 -12.0 0.25 33.11%
5 5 -16.5 0.15 19.72%
7 7 -19.5 0.11 13.96%
9 9 -21.6 0.08 10.96%

Examples of Other Waveforms


WaveGen settings are as follows: Simple, Sine, Frequency: 500Hz, Amplitude: 1 V, Offset: 0 V, Symmetry: 50 %, Phase: 0 degrees

Oscilloscope settings are as follows: Repeated, normal, channel 1, rising edge, 0V

时间设置是位置:0 V和基础:500 US/DIV

Channel 1 setting are Offset: 0 V offset and Range: 500 mV/div

FFT设置开始:0Hz, Stop: 50 Khz, Top: 0 dB, Bottom: -80 dB


Wavegen设置如下:简单,三角形,频率:1 kHz,振幅:1 V,偏移:0 V,对称性:20%,阶段:0度

Oscilloscope settings are as follows: Repeated, normal, channel 1, rising edge, 0V

时间设置是位置:0 V和基础:1ms/div

Channel 1 settings are Offset: 0 V offset and Range: 500 mV/div

FFT设置开始:0Hz, Stop: 50 Khz, Top: 0 dB, Bottom: -80 dB


WaveGen settings are as follows: Custom waveform

Oscilloscope settings are as follows: Repeated, normal, channel 1, rising edge, 0V

时间设置是位置:0 V和基础:1ms/div

Channel 1 settings are Offset: 0 V offset and Range: 500 mV/div

FFT设置开始:0Hz, Stop: 50 Khz, Top: 0 dB, Bottom: -80 dB


WaveGen settings are as follows: Custom waveform

Oscilloscope settings are as follows: Repeated, normal, channel 1, rising edge, 0V

时间设置是位置:0 V和基础:1ms/div

Channel 1 settings are Offset: 0 V offset and Range: 500 mV/div

FFT设置开始:0Hz, Stop: 50 Khz, Top: 0 dB, Bottom: -80 dB


Next Steps

有关如何使用模拟发现2的更多指南,请返回设备的Resource Center.

For more information on WaveForms visit theWaveForms Reference Manual.

FFT的更多信息的访问Bores Signal Processing

要获得技术支持,请访问Test and MeasurementDigilent论坛的部分。