Skip to content
Henry Yip
Henry Yip

Henry Yip

MSc Physics student at ETH Zürich. Tropical cyclones, atmospheric modelling and machine learning for weather prediction.

Kernels in Fourier Series: Dirichlet and Fejér

This is an introduction to Fourier series, written while I was trying to understand the Dirichlet kernel from my Honours Analysis course. Parts of it are inspired by my notes from Honours Analysis and Introductory Waves.

If you are new to Fourier series

A Fourier series decomposes a periodic function into sines and cosines. Adding more and more terms makes the sum look more and more like the original function. The graph below adds terms one at a time, and the sum approaches a sawtooth.

The function plotted is

\[1+\frac{4}{\pi}\sum_{n=1}^{m}\frac{\sin\left(\pi nx\right)}{n},\]

with \(m\) increasing over time. For \(m=1000\):

Not every function has a convergent Fourier series; some regularity conditions are needed. Fourier series are also surprisingly effective for some classic problems, such as the Basel problem:

To understand how and why Fourier series work, we study their convergence (pointwise, uniform, \(L^2\), …). That is hard to do without Bessel’s inequality and Parseval’s theorem.

If you already know Fourier series

The section below follows this video in part:

Where the Dirichlet kernel comes from

The Dirichlet kernel arises naturally from Fourier series. Recall that on \(-L \leq x \leq L\) we write

\[f(x) =\frac{1}{2} a_0+\sum_{n=1}^{\infty}\left[a_n \cos \frac{n \pi x}{L}+b_n \sin \frac{n \pi x}{L}\right],\]

with

\[\begin{aligned} a_m &=\frac{1}{L} \int_{-L}^L f(x) \cos \left(\frac{m \pi x}{L}\right) d x, \\ b_m &=\frac{1}{L} \int_{-L}^L f(x)\sin \left(\frac{m \pi x}{L}\right) d x . \end{aligned}\]

From now on let \(f\) be \(2\pi\)-periodic, continuous, with a continuous first derivative, and take \(L = \pi\). Then

\[\begin{aligned} \frac{a_0}{2}&=\frac{1}{2 \pi} \int_{-\pi}^\pi f(x)\, dx, \\ a_n&=\frac{1}{ \pi} \int_{-\pi}^\pi f(x) \cos(nx)\, d x, \\ b_n&=\frac{1}{ \pi} \int_{-\pi}^\pi f(x) \sin(nx)\, d x . \end{aligned}\]

Substituting these into the \(N\)-th partial sum and using \(\cos ny \cos nx+\sin ny \sin nx = \cos n(x-y)\),

\[\begin{aligned} f_N(x) & =\frac{a_0}{2}+\sum_{n=1}^N\left(a_n \cos n x+b_n \sin n x\right) \\ & =\int_{-\pi}^\pi\Biggl[1+2 \sum_{n=1}^N \bigl(\cos n y \cos n x \\ &\qquad\qquad +\sin n y \sin n x\bigr)\Biggr] \frac{f(y)}{2 \pi}\, d y \\ &=\int_{-\pi}^\pi\left[1+2 \sum_{n=1}^N \cos n(x-y)\right] \frac{f(y)}{2 \pi}\, d y \\ & =\int_{-\pi}^\pi D_N(x-y)\, f(y)\, \frac{d y}{2 \pi}, \end{aligned}\]

which defines the Dirichlet kernel

\[D_N(\theta)=1+2 \sum_{n=1}^N \cos n \theta .\]

A closed form

Using Euler’s formula \(e^{i \theta}=\cos \theta+i \sin \theta\),

\[\begin{aligned} D_N(\theta)&=\sum_{k=-N}^N e^{i k \theta}=1+2 \sum_{k=1}^N \cos (k \theta) \\ &=\frac{\sin \left(\left(N+\tfrac12\right) \theta\right)}{\sin (\theta / 2)} . \end{aligned}\]

(Hint: sum the geometric series, then multiply the numerator and denominator by \(e^{-i\theta/2}\).)

Here is what it looks like:

Partial sums as convolutions

Because \(D_N\) is even, we can shift variables:

\[\begin{aligned} f_N(x) &=\int_{-\pi}^\pi D_N(y-x)\, f(y)\, \frac{d y}{2 \pi} \\ &=\int_{-\pi-x}^{\pi-x} D_N(\theta)\, f(x+\theta)\, \frac{d \theta}{2 \pi} . \end{aligned}\]

Since the integrand has period \(2\pi\), the interval of integration can be shifted back without changing the result:

\[f_N(x) = \int_{-\pi}^\pi D_N(\theta)\, f(x+\theta)\, \frac{d \theta}{2 \pi} .\]

For illustration, take \(f(x)=\frac{1+ \sin x}{2}\). Notice that the area between the moving vertical lines never changes:

The Fejér kernel

For the rest of the post it is convenient to use period \(1\), writing \(D_n(x)=\sum_{k=-n}^{n} e^{2\pi i k x} = \frac{\sin\left((2n+1)\pi x\right)}{\sin(\pi x)}\). The Fejér kernel is the average of the first \(N+1\) Dirichlet kernels:

\[F_N(x)=\frac{1}{N+1} \sum_{n=0}^N D_n(x) .\]

I will state without proof that

\[\begin{aligned} \sum_{n=0}^N D_n(x)&=\frac{1-\cos (2 \pi(N+1) x)}{2 \sin^2 (\pi x)} \\ &= \frac{\sin^2\left((N+1)\pi x\right)}{\sin^2(\pi x)} . \end{aligned}\]

Convolving with \(F_N\) gives the Cesàro means of the Fourier series, that is, the averages of its partial sums.

Approximate identities

A sequence of \(1\)-periodic functions \(k_n\) is called an approximate identity (or approximation to the identity) if

  1. \(k_n(x) \geq 0\) for all \(x \in \mathbb{R}\);
  2. \(\displaystyle\int_{-1/2}^{1/2} k_n(t)\, d t=1\);
  3. for every \(0<\delta \le 1/2\), \(\displaystyle\int_{-\delta}^\delta k_n(t)\, d t \rightarrow 1\) as \(n \rightarrow \infty\).

The key theorem is that for every continuous \(1\)-periodic \(f\),

\[\sup _{x \in \mathbb{R}}\left|f * k_n(x)-f(x)\right| \rightarrow 0,\]

so convolution with an approximate identity converges uniformly to \(f\).

The reader can check that the Fejér kernel satisfies (1), (2) and (3), while the Dirichlet kernel fails (1) because it takes negative values. This is the heart of Fejér’s theorem: the Cesàro means of the Fourier series of any continuous periodic function converge uniformly to it, even though the partial sums themselves need not.

In short, both kernels approximate \(f\) by convolution. The Fejér kernel does it more gently: averaging smooths out the oscillations of the Dirichlet kernel, so it copes much better with rough behaviour in \(f\).

Revised on 25 October 2026. The original had these errors:

  • The Dirichlet kernel was written \(K_N\), the symbol usually kept for the Fejér kernel, and later the Fejér kernel was also written \(K_N\).
  • One line read \(-\pi \le L \le \pi\) where it should have said \(L = \pi\).

The kernels are now \(D_N\) and \(F_N\), the closed form of the Fejér kernel is given, and the steps of the derivation are filled in. Previously titled “Kernels in Fourier Series”.

Filed under .