epsi1on / RpiPicoOsciloscope

An software defined osciloscope with WPF and C# for RPI PICO with single channel and 500Ksps rate
GNU General Public License v3.0
0 stars 1 forks source link

Total Harmonic Distortion (THD) #9

Open epsi1on opened 1 month ago

epsi1on commented 1 month ago

Need some discussion

epsi1on commented 1 month ago

some refs: Total Harmonic Distortion explained https://www.youtube.com/v/imfz1xrSSdM

Measuring Total Harmonic Distortion THD using an FFT on an oscilloscope https://www.youtube.com/watch?v=s_cVP5gu4SY

Understanding Harmonic Distortion Measurements https://www.youtube.com/watch?v=FFQjkkDMQGs

What is the Inverse Fourier Transform? (reconstruct original signal from sin waves) https://www.youtube.com/watch?v=WrE5lgeZHyk

epsi1on commented 1 month ago

inputs

n: length of samples signalShape : type uint16[], with length of n, raw ADC values samplingRate: type double, samples per second $\alpha$, $\beta$, calibration values, for converting ADC values into volt: Volt=alpha*ADC+beta

fft: Dft of signalShape, with length n, output of FFT function, type: complex[]

output

need to calculate THD in whatever unit. how?