Fourier series express a periodic function as a sum of sines and cosines. Given defined on the interval , the series takes the form . Each coefficient captures a specific harmonic of the original signal, revealing how complex waves are built from simple oscillations.
The coefficients derive from integrals over a single period. Specifically, and . Because analytic integration can be tedious, this calculator approximates them numerically using Simpson's rule with many subdivisions. This approach balances accuracy with computational speed in the browser.
Enter a function of recognized by math.js
—for example, abs(x)
or x^2
. Specify the number of harmonics you want in the truncated series, then press Compute Series. The script samples the function, calculates integrals numerically, and displays the coefficients and up to the chosen order. It also outputs the constant term . Using these values, you can reconstruct an approximation to the original function or analyze its frequency content.
Each term in the Fourier series corresponds to a specific frequency. The fundamental frequency has , while higher values of represent harmonics. If your function is even, all coefficients vanish, leaving only cosines. If it is odd, the coefficients vanish. This symmetry property often simplifies calculations and provides insight into the underlying physical system.
Consider on . This function is even, so all coefficients are zero. The calculator computes numerical values for . Truncating after a few terms already gives a reasonable approximation to the characteristic "V" shape. By increasing the order, you see how the approximation improves, although some Gibbs phenomenon appears near the sharp corner at .
Fourier analysis underpins much of modern engineering, from audio processing to communications. In signal analysis, Fourier series reveal the frequency components present in a periodic waveform, guiding filter design and spectral analysis. In heat transfer, the technique solves partial differential equations by separating variables. The ability to express a complicated function as a combination of sines and cosines is therefore a central tool in both theoretical and applied contexts.
Joseph Fourier introduced his series in the early nineteenth century while studying the flow of heat. Though controversial at first, the idea that arbitrary functions could be written as sums of sines and cosines revolutionized mathematics and physics. Today, Fourier methods extend far beyond their original application, influencing everything from quantum mechanics to image compression. Appreciating this historical journey adds depth to your understanding of harmonic analysis.
Numerical integration can introduce errors if the function is highly oscillatory or discontinuous. To obtain stable coefficients, ensure your function is well-behaved on the interval and consider increasing the number of sample points in the script if needed. While this calculator provides a practical introduction, specialized software offers more advanced techniques such as fast Fourier transforms for discrete data.
Try computing series for different functions and orders. You might plot the partial sums alongside the original function to visualize convergence. Notice how increasing the number of terms reduces the error except near discontinuities, where overshoot persists. This phenomenon illustrates deep connections between Fourier series and the limits of approximation—insights crucial in fields like signal processing and vibration analysis.
Once comfortable with simple series, explore concepts like half-range expansions, which adapt the Fourier method to functions defined only on , or complex Fourier series, which use exponential functions for a more compact form. Each variation reveals new perspectives on periodic behavior. With this calculator as a starting point, you can dive deeper into harmonic analysis and its myriad applications.
Compute the QR decomposition of a 2x2 or 3x3 matrix using the Gram-Schmidt process.
Generate the Gram matrix for up to four vectors and explore inner products in linear algebra.
Find all complex roots of a polynomial using the Durand–Kerner method.