Online Interactive Waveform Generator: Sine, Square & Triangular Waves
Mathematical Foundation
The Sampling Theorem
To accurately reconstruct a signal, the sampling frequency \(F_s\) must be at least twice the highest frequency component \(f_{max}\):
\(F_s > 2 \cdot f_{max}\)
If \(F_s\) is too low, Aliasing occurs, where high-frequency signals masquerade as lower frequencies.
Noise Modelling (AWGN)
We add Additive White Gaussian Noise \(\eta(t)\) to simulate real-world interference:
\(x_{noisy}[n] = x[n] + \text{Random}(-1, 1) \cdot \sigma\)
This allows testing of signal-to-noise ratio (SNR) impacts.
System Overview: The Physics of the Simulation
1. Signal Synthesis Model
This simulator models a Discrete-Time Stochastic Signal. In the real world, signals are analog (continuous), but computers process them as a sequence of numbers (discrete). The total output is the sum of a deterministic waveform and a random noise component:
- \(s[n]\): The "Clean" signal (Sine, Square, or Sawtooth).
- \(\eta[n]\): Additive White Gaussian Noise (AWGN) controlled by \(\sigma\).
2. Signal-to-Noise Ratio (SNR)
The SNR is the primary metric for signal quality. It compares the strength of your desired signal to the background interference.
Noise Power (\(P_n\)): For Uniform Noise: \( \frac{\sigma^2}{3} \)
SNR (dB): \( 10 \cdot \log_{10}(\frac{P_s}{P_n}) \)
*Higher SNR means a cleaner signal. A 0dB SNR means the signal and noise have equal power.*
3. Why export the data?
The Export Dataset feature bridges the gap between visualization and engineering. By exporting to CSV, you are creating a Digital Twin of an analog signal. This data can be used in Python or MATLAB to design filters, perform Fast Fourier Transforms (FFT), or train Machine Learning models to recognize signal patterns amidst noise.