Fourier Coefficient Calculator
Every periodic signal can be decomposed into a sum of sines and cosines, and the Fourier coefficients are the amplitudes of those components. This calculator estimates the cosine coefficient and sine coefficient for a chosen harmonic from evenly spaced samples covering one period, using the standard discrete Fourier formula. It also reports the mean term, the harmonic amplitude, and its phase. Enter your samples as a comma-separated list and pick the harmonic number to analyze. The samples should span exactly one period at equal spacing.
Fourier coefficient formulas
a_0 = (1/N) * sum of y_i (the mean)
a_k = (2/N) * sum y_i * cos(2*pi*k*i / N)
b_k = (2/N) * sum y_i * sin(2*pi*k*i / N)
amplitude = sqrt(a_k^2 + b_k^2)
i runs from 0 to N - 1
The discrete coefficients estimate the continuous Fourier series from equally spaced samples. The cosine and sine terms combine into a single harmonic amplitude and phase.
Notes on Fourier coefficients
- Samples must be evenly spaced and span exactly one full period.
- The harmonic number k must be a positive integer for a_k and b_k.
- Use at least two samples per harmonic to satisfy the Nyquist criterion.
- The mean term a_0 is the average sample value.
- Amplitude combines the cosine and sine parts of the harmonic.
Fourier coefficients: frequently asked questions
What are Fourier coefficients?
Fourier coefficients are the amplitudes of the sine and cosine terms that make up a periodic function's Fourier series. The cosine coefficient a_k and sine coefficient b_k together describe how much of harmonic k is present in the signal.
How are the coefficients estimated from samples?
Given N evenly spaced samples over one period, this calculator uses the discrete formula a_k = (2/N) times the sum of y times cos(2 pi k i / N) and b_k = (2/N) times the sum of y times sin(2 pi k i / N). The mean term a_0 is the average of the samples.
What is the harmonic number k?
The harmonic number k selects which frequency component you want: k = 1 is the fundamental, k = 2 the second harmonic, and so on. Each harmonic is an integer multiple of the fundamental frequency of the period.
What is the amplitude and phase of a harmonic?
The amplitude of harmonic k is the square root of a_k squared plus b_k squared, and the phase is the arctangent of minus b_k over a_k. Together they express the harmonic as a single shifted cosine wave.
How many samples should I provide?
Provide at least twice as many samples as the highest harmonic you want, to satisfy the Nyquist criterion. More samples give a more accurate estimate. The samples should span exactly one period at equal spacing.
Official sources
- NIST Digital Library of Mathematical Functions: Fourier series.
- NIST Digital Library of Mathematical Functions: Integral transforms.
Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.