Triangle: $\dfrac{8A}{\pi^2}\sum_{n=0}^{\infty}\dfrac{(-1)^n}{(2n+1)^2}\sin((2n+1)\omega t)$
Sawtooth: $\dfrac{2A}{\pi}\sum_{n=1}^{\infty}\dfrac{(-1)^{n+1}}{n}\sin(n\omega t)$
Combine up to 4 sine, square, triangle, or sawtooth components. Instantly compute RMS, peak, crest factor, THD, and visualize the composite waveform alongside its 512-point DFT frequency spectrum.
The core principle is that any periodic waveform can be constructed by summing a series of sine waves (harmonics). This is described by the Fourier Series. The general form for a waveform is:
$$x(t) = \sum_{n=1}^{\infty}\left[ a_n \cos(n \omega t) + b_n \sin(n \omega t) \right]$$Where $x(t)$ is the composite signal, $\omega = 2\pi f$ is the fundamental angular frequency, and $n$ is the harmonic number. The coefficients $a_n$ and $b_n$ determine the amplitude and phase of each harmonic and are unique for each target waveform.
The key metrics analyzed by the simulator are calculated from the composite signal. The Root Mean Square (RMS) voltage, which relates to power, is:
$$V_{rms}= \sqrt{\frac{1}{T} \int_0^T [x(t)]^2 \, dt}$$Where $T$ is the period. The Crest Factor (CF) is a simple ratio of the peak absolute value to the RMS value: $CF = V_{peak}/ V_{rms}$. A higher crest factor means a signal has more extreme peaks relative to its average power.
Audio Synthesis & Music Production: This is the foundation of subtractive synthesis used in analog synthesizers. By starting with a rich waveform (like a sawtooth or square wave built from harmonics) and then filtering out certain frequencies, musicians can create the vast array of sounds heard in electronic music.
Power Electronics & Motor Drives: Variable Frequency Drives (VFDs) control AC motor speed by synthesizing a variable-frequency AC waveform from a DC source. They use Pulse Width Modulation (PWM), which is essentially a complex square wave, and its harmonic content is critical for motor efficiency and noise.
Signal Integrity & Communications: In digital communications, a square wave represents a stream of 1s and 0s. Real circuits can't produce perfect squares, so engineers analyze the harmonic content to understand bandwidth requirements and prevent data corruption due to high-frequency loss.
Medical Device Testing: Patient simulators and equipment testers use precise waveform synthesis to generate ECG, EEG, or other physiological signals. The ability to control each harmonic allows engineers to create both standard test patterns and pathological waveforms for device validation.
When you start using this tool, there are a few common pitfalls to watch out for. First is the interpretation of "Amplitude". For a sine wave, amplitude A is directly the peak value, but it's a different story for square or triangle waves. For example, a square wave with a 1V amplitude has a peak value of 1V, but its RMS value is about 1V (for an ideal square wave). On the other hand, the RMS value of a 1V amplitude sine wave is about 0.707V. Since the same "1V amplitude" setting yields different RMS values depending on the waveform type, you need to be careful when considering power or energy.
Next is overlooking the effect of "Phase". Changing the phase between 0 and 180 degrees intuitively flips the waveform, but shifts of 90 or 270 degrees have more subtle effects. For instance, when synthesizing a fundamental wave with its 3rd harmonic, just changing the phase can significantly alter the shape of the resulting waveform (like peak sharpness or symmetry). In acoustics, this changes tonal nuances; in control systems, it affects transient response.
Finally, "Interpreting the Frequency Spectrum". You might find that the spikes from an FFT don't perfectly match the frequencies of the components you set. This is a frequency resolution issue. For example, with a fundamental frequency of 1Hz and an analysis time of 1 second, the resolution is 1Hz. So, a 1.5Hz component will appear spread out between 1Hz and 2Hz. In simulation, you know the theoretical values, so it's easy to miss, but when handling real measured data, always keep this "leakage" phenomenon in mind.
Design a square wave approximation for a 60 Hz industrial power signal. Set fundamental to 60 Hz, Amplitude 230 V (RMS equivalent peak ~325 V). Add 3rd harmonic at 180 Hz with amplitude 108 V (33% of fundamental) and 0° phase. Add 5th harmonic at 300 Hz with amplitude 65 V (20% of fundamental). Result: composite RMS ≈ 242 V, Peak ≈ 360 V, Crest Factor ≈ 1.49, THD ≈ 35.3%. Compare against pure sine (THD 0%, Crest Factor 1.414).