Synthesize complex waveforms, explore Fourier series, and instantly analyze signals in both the Time and Frequency domains with this interactive audio-visual engine.
JavaScript is the default engine for instant calculations. For higher precision and advanced features, you can switch to the Python engine. Please note that Python requires a one-time setup of 10 - 20 seconds, depending on your connection speed. Wait for the "Ready" message to appear before continuing your work.
^ : Exponents (x^2)sqrt() : Square Rootabs() : Absolute Valuepi, e : Constantssin, cos, tan : Triglog, exp : Logarithmssign() : Square Wave conversionfloor(), ceil() : Stepssign(sin(x))x/pi - floor(x/pi + 0.5)(1 + 0.5*sin(x)) * sin(15*x)
sin(15*x + 5*sin(x))
e^(-0.2*x) * sin(5*x)
sec(x) / 10sin(10*x) + sin(11*x)
sin(x) / abs(sin(x) + 0.1)
The Waveform Generator is a rigorous mathematical instrument designed to bridge the gap between abstract trigonometric equations and physical acoustic phenomena. By translating continuous periodic functions—expressed as f(t)—into interactive geometric graphs and physical audio outputs, the engine provides a comprehensive platform for studying signal processing. Engineered for electrical engineers, acoustics researchers, and physics students, this synthesizer allows users to actively manipulate the harmonic series, explore Fourier analysis, and visually dissect the anatomy of complex waveforms across multiple domains without the need for heavy desktop simulation software.
Understanding a dynamic signal requires observing it through two distinct mathematical lenses. The tool features a dual-graph interface that simultaneously plots the geometry of the wave and its underlying harmonic spectrum.
The Time Domain graph plots the instantaneous amplitude of a signal as a function of time. The engine generates a discretized array of evaluation nodes across the user-defined domain, computing the exact spatial coordinate of the wave at any given microsecond. To handle complex piecewise signals or signals with sudden phase shifts (such as a pure square wave or sawtooth wave), the engine employs an algorithmic thresholding shield. By calculating the differential jump between adjacent coordinates, the plotter intelligently detects vertical asymptotes and inserts null values (NaN) to prevent false interconnecting lines, ensuring a mathematically accurate representation of discontinuous signals.
According to Fourier’s theorem, any complex periodic waveform can be decomposed into a sum of simple sinusoidal waves, each with a specific frequency, amplitude, and phase. The Frequency Domain graph (or spectrogram) visualizes this decomposition, plotting the magnitude of these individual constituent sine waves. While a pure sine wave will register as a single isolated spike on this graph, a rich, complex signal will reveal a dense "comb" of fundamental frequencies and cascading harmonic overtones.
The engine offers two distinct methodologies for generating and manipulating wave behaviors: physical additive synthesis and mathematical equation parsing.
The tool includes an interactive 8-channel harmonic mixer. Users define a fundamental base frequency (e.g., 220Hz), and the system automatically generates an array of integer-multiple overtones (2f, 3f, 4f, up to 8f). By adjusting the specific amplitude coefficients of these harmonics, users perform real-time additive synthesis. This allows for the precise, manual construction of classic synthesizer profiles—such as dialing in odd-harmonics to create a square wave, or a descending sequence of all harmonics to yield a sawtooth wave.
For advanced processing, users can bypass the mixer and input direct mathematical equations to define the waveform state. This allows for the exploration of non-linear signal modulation techniques:
Simultaneously plotting complex calculus matrices while generating high-fidelity audio requires a highly optimized, fully client-side microservices architecture.
When a user inputs a custom mathematical equation, the tool must mathematically "listen" to the resulting geometry to extract its frequencies. To achieve this, the application dynamically loads a WebAssembly (Wasm) compiled version of the Python SciPy and NumPy libraries. The engine runs a Real Fast Fourier Transform (scipy.fft.rfft) over the generated spatial array, isolating the exact magnitude spectrum. Furthermore, to map the custom equation back to the sliders, the engine applies Fourier orthogonality integration, using numerical trapezoidal approximations to calculate the exact b_n coefficients for the first eight harmonics.
Visualizing the math is only half the equation; the tool also physically synthesizes the data using the browser's native Web Audio API. The application abstracts the mathematical arrays into virtual hardware components. It dynamically spawns an array of OscillatorNodes (representing the specific harmonic frequencies) and routes them through independent GainNodes (representing the calculated amplitudes). These nodes are summed into a Master Gain controller and routed to the audio destination. This engine guarantees that the sound you hear is a perfect, sample-accurate physical manifestation of the mathematical equation you typed.
The data arrays are visually rendered using Plotly.js. The Time Domain utilizes hardware-accelerated 2D scatter lines for smooth panning and zooming across the wave cycle, while the Frequency Domain utilizes dynamic bar charts to explicitly quantify harmonic magnitudes. This layered rendering ensures high frame rates without visual artifacting.
Traditional Digital Signal Processing (DSP) environments, such as MATLAB or Max/MSP, carry steep financial costs and intensive hardware requirements. This visualizer democratizes signal analysis through an Open Access framework:
The Waveform Generator provides critical utility across numerous applied sciences:
To further enhance your computational workflow and explore different mathematical paradigms, seamlessly integrate this signal synthesizer with our specialized suite of analytical instruments: