21
$\begingroup$

For a (well-behaved) one-dimensional function $f: [-\pi, \pi] \rightarrow \mathbb{R}$, we can use the Fourier series expansion to write $$ f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty} \left( a_n \cos(nx) + b_n\sin(nx) \right)$$

For a function of two variables, Wikipedia lists the formula

$$f(x,y) = \sum_{j,k \in \mathbb{Z}} c_{j,k} e^{ijx}e^{iky}$$

In this formula, $f$ is complex-valued. Is there a similar series representation for real-valued functions of two variables?

$\endgroup$
2
  • 3
    $\begingroup$ Substitute $e^{i\omega} = \cos\omega + i\sin\omega$ and $c_{j,k} = a_{j,k} + ib_{j,k}$ in the formula you get from Wikipedia, and look only at the real value of the result. The formula gets a bit unwieldy due to the 4 $\sin\cos$ combinations you get, but it works... $\endgroup$
    – fgp
    Oct 12, 2012 at 15:06
  • $\begingroup$ Following fgp's step, you can actually get a compact formula if you allow the index running from negative infinity to positive inifinity (rather than the positive index usually used when expanded in terms of sine and cosine). $\endgroup$
    – Youjun Hu
    Mar 23, 2023 at 1:52

3 Answers 3

24
$\begingroup$

The full real-valued 2D Fourier series is: $$ \begin{align} f(x, y) & = \sum_{n=0}^{\infty}\sum_{m=0}^{\infty}\alpha_{n,m}cos\left(\frac{2\pi n x}{\lambda_x}\right)cos\left(\frac{2\pi m y}{\lambda_y}\right) \\ & + \sum_{n=0}^{\infty}\sum_{m=0}^{\infty}\beta_{n,m}cos\left(\frac{2\pi n x}{\lambda_x}\right)sin\left(\frac{2\pi m y}{\lambda_y}\right) \\ & + \sum_{n=0}^{\infty}\sum_{m=0}^{\infty}\gamma_{n,m}sin\left(\frac{2\pi n x}{\lambda_x}\right)cos\left(\frac{2\pi m y}{\lambda_y}\right) \\ & + \sum_{n=0}^{\infty}\sum_{m=0}^{\infty}\delta_{n,m}sin\left(\frac{2\pi n x}{\lambda_x}\right)sin\left(\frac{2\pi m y}{\lambda_y}\right) \\ \end{align} $$

The coefficients are found with: $$ \alpha_{n,m} = \frac{\kappa}{\lambda_x \lambda_y}\int_{y_0}^{y_0+\lambda_y}\int_{x_0}^{x_0+\lambda_x}f(x,y)cos\left(\frac{2\pi n x}{\lambda_x}\right)cos\left(\frac{2\pi m y}{\lambda_y}\right)dx dy \\ \beta_{n,m} = \frac{\kappa}{\lambda_x \lambda_y}\int_{y_0}^{y_0+\lambda_y}\int_{x_0}^{x_0+\lambda_x}f(x,y)cos\left(\frac{2\pi n x}{\lambda_x}\right)sin\left(\frac{2\pi m y}{\lambda_y}\right)dx dy \\ \gamma_{n,m} = \frac{\kappa}{\lambda_x \lambda_y}\int_{y_0}^{y_0+\lambda_y}\int_{x_0}^{x_0+\lambda_x}f(x,y)sin\left(\frac{2\pi n x}{\lambda_x}\right)cos\left(\frac{2\pi m y}{\lambda_y}\right)dx dy \\ \delta_{n,m} = \frac{\kappa}{\lambda_x \lambda_y}\int_{y_0}^{y_0+\lambda_y}\int_{x_0}^{x_0+\lambda_x}f(x,y)sin\left(\frac{2\pi n x}{\lambda_x}\right)sin\left(\frac{2\pi m y}{\lambda_y}\right)dx dy $$ $$ \begin{align} \text{Where } \kappa & = 1 \text{ if } n = 0 \text{ and } m = 0 \\ & = 2 \text{ if } n = 0 \text{ or } m = 0\\ & = 4 \text{ if } n> 0 \text{ and } m > 0 \end{align} $$ Example plot

$\endgroup$
4
  • $\begingroup$ are there any references for this? $\endgroup$
    – vlizana
    Apr 11, 2019 at 14:26
  • 1
    $\begingroup$ @vlizana Davis, John C. Statistics and Data Analysis in Geology. Wiley, 1973. $\endgroup$ Apr 11, 2019 at 23:44
  • $\begingroup$ @apprehensivebob If I am correct, then this representation has no assumption of Dirichlet condition at the boundaries of the rectangle and is the most general form ? $\endgroup$
    – Avrana
    Jun 8, 2020 at 6:54
  • $\begingroup$ The formula is derived directly from the Fourier expansion in terms of sine and cosine basis functions, so you need to handle the edge case of m=0 and/or n=0. If you start from Fourier expansion in terms of exp() and then take the real part, you will get a more compact formula, with its index ranging from -infinity to +infinity, and you need not handle any edge case. $\endgroup$
    – Youjun Hu
    Mar 23, 2023 at 2:00
23
$\begingroup$

Yes! And these types of expansions occur in a variety of applications, e.g., solving the heat or wave equation on a rectangle with prescribed boundary and initial data.

As a specific example, we can think of the following expansion as a two dimensional Fourier sine series for $f(x,y)$ on $0<x<a$, $0<y<b$: $$ f(x,y)=\sum_{n=1}^\infty \sum_{m=1}^\infty c_{nm}\sin\left({n\pi\, x\over a}\right)\sin\left({m\pi\, y\over b}\right), \quad 0<x<a,\ 0<y<b, $$ where the coefficients (obtained from the same type of orthogonality argument as in the 1D case) are given by \begin{align} c_{nm}&={\int_0^b \int_0^a f(x,y)\sin\left({n\pi\, x\over a}\right)\sin\left({m\pi\, y\over b}\right)\,dx\,dy\over \int_0^b \int_0^a \sin^2\left({n\pi\, x\over a}\right)\sin^2\left({m\pi\, y\over b}\right)\,dx\,dy}\\ &={4\over a b}\int_0^b \int_0^a f(x,y)\sin\left({n\pi\, x\over a}\right)\sin\left({m\pi\, y\over b}\right)\,dx\,dy, \quad n,m=1,2,3,\dots \end{align}

For example, the picture below shows (left) the surface $$f(x,y)=30x y^2 (1-x)(1-y)\cos(10x)\cos(10y), \quad 0<x<1,\ 0<y<1,$$ and a plot of the two dimensional Fourier sine series (right) of $f(x,y)$ for $n,m,=1,\dots,5$:

Mathematica graphics

Finally, keep in mind that we are not limited just to double sums of the form sine-sine. We could have any combination we like so long as they form a complete orthogonal family on the domain under discussion.

$\endgroup$
5
  • $\begingroup$ This representation seems to be valid only if the values of the function on the boundary of the rectangle are zero. $\endgroup$ Nov 13, 2013 at 11:59
  • $\begingroup$ Yes, that's why I said, "As a specific example..." The sine functions used there are the eigenfunctions obtained when solving the heat equation on a rectangle where zero boundary conditions are specified. $\endgroup$
    – JohnD
    Nov 14, 2013 at 0:47
  • 4
    $\begingroup$ What about the case where cosine terms are required? This answer is useless because it does not address the general case. $\endgroup$ Dec 21, 2013 at 14:19
  • 1
    $\begingroup$ @JohnD I know this is very old, but can you add a more general representation which is not restricted to the function having Dirichlet conditions on the boundaries. Should I ask a separate question ? $\endgroup$
    – Avrana
    Jun 8, 2020 at 6:42
  • 1
    $\begingroup$ @Avrana You can add a phase for x and y, and also add a rotation, to get a more general expression. $\endgroup$
    – user877329
    Oct 28, 2023 at 7:45
4
$\begingroup$

@JohnD only details about the coefficients. The correct formula is:

$$c_{n,m} = \frac{\int_{0}^a \int_0^b f(x,y)sin(\frac{n\pi x}{a})sin(\frac{n\pi y}{b})dxdy}{{\int_{0}^a \int_0^b sin^2(\frac{n\pi x}{a})sin^2(\frac{n\pi y}{b})dxdy}{}}$$

the impression that $c_{n,m}$ is $1$. That's not true. Cheers!

$\endgroup$
1
  • $\begingroup$ Yes, it was a typo (I had left off the squares in the denominator). Fixed now. $\endgroup$
    – JohnD
    Mar 6, 2013 at 4:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .