Fourier Series Calculator
Calculate Fourier series coefficients for periodic functions. Enter values for instant results with step-by-step formulas.
Reviewed by Manoj Kumar, Mathematics Educator
Formula
f(x) = a0/2 + sum(an*cos(n*omega*x) + bn*sin(n*omega*x))
Where a0 is the DC component (average value), an and bn are the Fourier cosine and sine coefficients for the n-th harmonic, and omega = 2*pi/T is the fundamental angular frequency with period T.
Worked Examples
Example 1: Square Wave Fourier Coefficients
Problem:Find the first 5 non-zero Fourier coefficients and approximate value at x = 0.5 for a square wave with amplitude 1 and period 2*pi.
Solution:Square wave: f(x) = (4/pi) * sum of sin(nx)/n for odd n\nb1 = 4/(1*pi) = 1.2732\nb3 = 4/(3*pi) = 0.4244\nb5 = 4/(5*pi) = 0.2546\nb7 = 4/(7*pi) = 0.1819\nb9 = 4/(9*pi) = 0.1415\nApprox at x=0.5: 1.2732*sin(0.5) + 0.4244*sin(1.5) + 0.2546*sin(2.5) + 0.1819*sin(3.5) + 0.1415*sin(4.5) = 0.9955
Result:5-term approximation at x=0.5: 0.9955 | THD: 48.3%
Example 2: Triangle Wave Analysis
Problem:Compute the Fourier series of a triangle wave with amplitude 2 and period 2*pi using 10 terms.
Solution:Triangle wave: f(x) = (8A/pi^2) * sum of [(-1)^((n-1)/2) / n^2] * sin(nx) for odd n\nb1 = 8*2/pi^2 = 1.6211\nb3 = -8*2/(9*pi^2) = -0.1801\nb5 = 8*2/(25*pi^2) = 0.0649\nb7 = -8*2/(49*pi^2) = -0.0331\nCoefficients decrease as 1/n^2 - much faster convergence than square wave
Result:Triangle wave converges rapidly | b1 = 1.6211 | b3 = -0.1801 | THD: 12.1%
Frequently Asked Questions
What is a Fourier series and why is it important?
A Fourier series is a mathematical representation of a periodic function as an infinite sum of sine and cosine functions, each with specific amplitudes and frequencies. Named after Joseph Fourier, this decomposition reveals the frequency content hidden within any periodic signal. The importance of Fourier series lies in their ability to break complex waveforms into simple harmonic components that are much easier to analyze individually. This principle is fundamental to signal processing, audio engineering, telecommunications, quantum mechanics, heat transfer, and image compression. Without Fourier analysis, technologies like MP3 compression, MRI imaging, and digital communications would not exist.
What do the Fourier coefficients a_n and b_n represent?
The Fourier coefficients a_n and b_n represent the amplitudes of the cosine and sine components at each harmonic frequency. The coefficient a0 divided by 2 gives the DC offset or average value of the function over one period. The coefficient a_n multiplies cos(n*omega*t), representing the even (symmetric) component at the n-th harmonic, while b_n multiplies sin(n*omega*t), representing the odd (antisymmetric) component. Together, they determine the magnitude and phase of each frequency component. A large coefficient at harmonic n means that frequency contributes significantly to the overall shape of the waveform. These coefficients are calculated using integral formulas that essentially measure how much the original function correlates with each sine and cosine basis function.
How does a square wave relate to its Fourier series?
A square wave is represented by a Fourier series containing only odd harmonics with coefficients that decrease as 1/n. Specifically, a square wave of amplitude A has the series (4A/pi) times [sin(x) + sin(3x)/3 + sin(5x)/5 + sin(7x)/7 + ...]. The even harmonics (2nd, 4th, 6th) are all zero due to the half-wave symmetry of the square wave. This slow 1/n decay means many terms are needed for a good approximation, which is why the overshoot at discontinuities (Gibbs phenomenon) is prominent. The square wave Fourier series is one of the most studied examples in mathematics and engineering because it clearly demonstrates how sharp transitions require high-frequency content.
What is the Gibbs phenomenon in Fourier series?
The Gibbs phenomenon is an overshoot that occurs near discontinuities when approximating a function with a finite number of Fourier terms. At any jump discontinuity, the partial sum of the Fourier series overshoots by approximately 8.95 percent of the jump, regardless of how many terms are included. Adding more terms makes the overshoot narrower but not shorter. This was discovered by Henry Wilbraham in 1848 and later rediscovered by Josiah Willard Gibbs in 1899. The Gibbs phenomenon has practical implications in signal processing, where it causes ringing artifacts near sharp transitions. Engineers use windowing functions like Hamming or Hann windows to reduce these overshoots at the cost of slightly worse frequency resolution.
References
Reviewed by Manoj Kumar, Mathematics Educator ยท Editorial policy