Decomposes a periodic waveform (square, triangle, sawtooth, or half/full-wave rectified sine) into its
harmonic components using the closed-form Fourier series for each waveform type. Enter the amplitude,
fundamental frequency and number of harmonics to compute per-harmonic frequency, amplitude, RMS value
and attenuation relative to the fundamental, plus a spectrum plot and a time-domain reconstruction
from the summed harmonics.
Half-Wave Rectified Sine:
For \(n=1\): $$ A_1 = \frac{U_m}{2} $$
For even \(n\): $$ A_n = \left| \frac{2 U_m}{\pi(1-n^2)} \right| $$
(Odd \(n > 1\) are zero)
Full-Wave Rectified Sine:
For even \(n\): $$ A_n = \left| \frac{4 U_m}{\pi(1-n^2)} \right| $$
(Odd \(n\) are zero)
Note: The fundamental frequency of the rectified signal is \(2f\) (period is halved).
Therefore, the 1st harmonic (\(f\)) of the source is empty, and the "main" component is at
\(2f\)
(2nd harmonic).