Dirichlet, Fejér and more

The Dirichlet kernel \[D_N(x) = \sum_{n=-N}^N e(nx)\] has a pivotal importance when studying Fourier series. In some sense it is an approximation of the 1-periodic Dirac delta when \(N\to \infty\). The slow decay is an issue when one enters into convergence problems.

A more regular version is the Fejér kernel, which is the Cesàro sum of the Dirichlet kernel except for shifting \(N\) into \(N-1\), \[F_N(x) = \sum_{n=-N}^N \Big( 1-\frac{|n|}{N} \Big) \exp(2\pi i nx)\] The quickest decay of this function at the cost of having thicker peaks (this also appears in digital windows) allows to prove a nice theorem (Fejér's theorem): If \(f\) is 1-periodic and continuous having \(\{a_m\}_{m\in\mathbb{Z}}\) as Fourier coefficients, then \[f(x)=\lim_{N\to \infty} \sum_{m=-N}^N \Big( 1-\frac{|m|}{N} \Big) a_m\exp(2\pi i mx) \qquad \text{uniformly in }x.\]

One may consider smoother versions, so to speak, of the Dirichlet kernel taking higher Cesàro sums. The natural object for \(k\) a nonnegative integer is \[C_{N,k}(x) = \sum_{n=-(N-k)}^{N-k} \binom{N-k}{|n|} \binom{N}{|n|}^{-1} \exp(2\pi i nx).\] Note that \[D_N(x)= C_{N,0}(x) \qquad\text{and}\qquad F_N(x)= C_{N,1}(x).\]

The following plots drawn with the code below show the cases \(k=0,1,2\) for some small values of \(N\).

cesarok_4_0 cesarok_4_1 cesarok_4_2
\(N=4,\)   \(k=0\) \(N=4,\)   \(k=1\) \(N=4,\)   \(k=2\)


cesarok_8_0 cesarok_8_1 cesarok_8_2
\(N=8,\)   \(k=0\) \(N=8,\)   \(k=1\) \(N=8,\)   \(k=2\)


cesarok_16_0 cesarok_16_1 cesarok_16_2
\(N=16,\)   \(k=0\) \(N=16,\)   \(k=1\) \(N=16,\)   \(k=2\)


cesarok_32_0 cesarok_32_1 cesarok_32_2
\(N=32,\)   \(k=0\) \(N=32,\)   \(k=1\) \(N=32,\)   \(k=2\)


It is interesting to observe the vertical scale. When \(k\) grows the peaks are shorter and wider. Note that \(\int_{-1/2}^{1/2}C_{N,k}=1\) as it must be if we want to mimic a Dirac delta.





The code

This is the SAGE code that produces all the images:
  
def cesarok(N, al):
  f = 1
  thi = 3
  if N>8: thi = 2
  if N>16: thi = 1
  for j in srange(1, N-al+1):
    f += 2*binomial(N-al,j)/binomial(N,j)*cos(2*pi*j*x)
  P = plot(f, x,-1.5,1.5, thickness=thi,tick_formatter="latex")
  P.fontsize(16)
  return P
  

# DIRICHLET-FEJER-CESARO
fs = 4
for al in srange(3):
  for N in [4, 8, 16, 32]:
    P = cesarok(N, al)
    P.save('../images/cesarok_'+str(N)+'_'+str(al)+'.png', figsize = fs)