Martha MigliacioAlex Wong
Published © GPL3+

Measuring Harmonics in Signal with Analog Discovery 2

In this guide, I will show how to measure harmonics in signal with Analog Discovery 2 using FFT contained in Digilent WaveForms.

BeginnerFull instructions provided1 hour1,952
Measuring Harmonics in Signal with Analog Discovery 2

Things used in this project

Hardware components

Analog Discovery 2
Digilent Analog Discovery 2
×1

Software apps and online services

Digilent WaveForms

Story

Read more

Schematics

PDF Instructions

These are the project instructions in PDF format

Code

Waveform generator code

Plain text
Code used for waveform generator.
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]);

Credits

Martha Migliacio

Martha Migliacio

5 projects • 18 followers
Alex Wong

Alex Wong

14 projects • 53 followers
I work in Digilent and like creating projects
Thanks to Jakub Wiczyński.

Comments