Software apps and online services
Every periodic signal can be described as a sum of sine waves with different frequencies, amplitudes, and phase shifts. This gives possibility of synthesizing signals with sine waves and analyze all kinds of signals to determine sine waves that makes the signal.
Decomposition of signal shape (data in time domain) to sine waves that make the signal (data in frequency domain) is done by 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 - base frequency. It is equal to frequency of the first sine wave. Next sine waves in the sum have frequencies multiplicated by its index - for example, second sine wave has frequency equal to 2 * base frequency.
Index of the sine wave is called a harmonic. I will show how to measure amplitudes of harmonics in signal, that is, amplitude of specific sine wave in signal.
Unfortunately, we can't measure phase of the sine waves, because phase FFT algorithm is not yet implemented in Digilent WaveForms (it's possible to do this in WaveForms SDK, FFT needs only samples of the signal).
Torun this example, you need AnalogDiscovery 2 and PC.
Connect Analog Discovery 2 to your computer.
Connect 1+ (oscilloscope positive input) to W1 (waveform generator output) and 1-(oscilloscope negative input) to GND (ground).
We will play waveforms by WaveGen and observe shapes of the signal and measure harmonics (FFT) using Scope.
1. To launch the Waveform Generator, click on the Wavegen button.
2. Switch to the custom mode - we will implement additivegenerator.
3. Click on New, paste the code provided below to the script field. By modifying amp and phase values, we will generate different shapes of signals. If you click the generate button, you will see the generated shape.
var amp =[1,0,0,0,0,0,0,0,0,0]; //amplitudevalues 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-360degrees) Y = amp *sin((1 * 2*PI*X) + 2*PI*ph) + amp *sin((2 * 2*PI*X) + 2*PI*ph) + amp *sin((3 * 2*PI*X) + 2*PI*ph) + amp *sin((4 * 2*PI*X) + 2*PI*ph) + amp *sin((5 * 2*PI*X) + 2*PI*ph) + amp *sin((6 * 2*PI*X) + 2*PI*ph) + amp *sin((7 * 2*PI*X) + 2*PI*ph) + amp *sin((8 * 2*PI*X) + 2*PI*ph) + amp *sin((9 * 2*PI*X) + 2*PI*ph) + amp * sin((10 * 2*PI*X) + 2*PI*ph);
1. To launch the Oscilloscope, click on the Scope button.
2.Trigger options (Fig. 10 below):
Source: Channel 1;
3.Time options (Fig. 11 below):
4.Unclick Channel 2.
Click on the sprocket wheel button and unclick Noise checkbox.
6. Click on View->FFT to show FFT window.
The setup is done, so we can now take some measurements.