Skip to article frontmatterSkip to article content

Fourier transform

from pylab import *

1Fourier series

Let f:[π,π]Rf : [-\pi,\pi] \to \re be a function which is extended periodically to the whole real line. The Fourier series is defined as

Sf(x)=a0+k=1[akcos(kx)+bksin(kx)]Sf(x) = a_0 + \sum_{k=1}^\infty [ a_k \cos(k x) + b_k \sin(k x) ]

where

a0=ππf(x)dxak=ππf(x)cos(kx)dx,k=1,2,bk=ππf(x)sin(kx)dx,k=1,2,\begin{align*} a_0 &= \int_{-\pi}^\pi f(x) \ud x \\ a_k &= \int_{-\pi}^\pi f(x) \cos(k x) \ud x, \qquad k=1, 2, \ldots \\ b_k &= \int_{-\pi}^\pi f(x) \sin(k x) \ud x, \qquad k=1, 2, \ldots \end{align*}