28
$\begingroup$

From any textbook on fourier analysis:

"It is easily shown that for $f$ and $g$, both $2 \pi$-periodic functions on $[-\pi,\pi]$, we have $$(f \ast g)(x) = \int_{-\pi}^{\pi}f(x-y)g(y)\;dy = \int_{-\pi}^{\pi}f(z)g(x-z)\;dz = (g \ast f)(x),$$ by using the substitution $z = x-y.$"

I don't doubt that this is true, but I cannot figure out what happened to the negative sign coming from $dy = -dz\;$ after the change of variable $z = x - y$. In particular, after the change of variable $z = x-y,\;$ I am coming up with $ -\int_{-\pi}^{\pi}f(z)g(x-z)\;dz$. What am I missing here?
$\endgroup$
1
  • 12
    $\begingroup$ You should be coming up with $-\int_\pi^{-\pi}f(z)g(x-z)dz$. :-) $\endgroup$ Commented Sep 11, 2010 at 22:08

3 Answers 3

35
$\begingroup$

You need to check the bounds on your integral. since $y$ ranges from $-\pi$ to $\pi$, you'll have $z = x-y$ ranging from $x+\pi$ to $x-\pi$. Therefore: $$ \int_{-\pi}^{\pi}f(x-y)g(y)dy = -\int_{x+\pi}^{x-\pi}f(z)g(x-z)dz = \int_{x-\pi}^{x+\pi}f(z)g(x-z)dz = \int_{-\pi}^{\pi}f(z)g(x-z)dz $$ in the second-last step, I swapped the two bounds on the integral (this changes the sign). In the final step, I shifted both bounds on the integral by $-x$, which does not change the value because we are integrating over an interval of length $2\pi$ and the function is $2\pi$-periodic.

$\endgroup$
2
  • $\begingroup$ But then why does the below code give different results for fg and gf? clc; clear all; close all; t = -1*pi:0.001:1*pi; f = @(t) t; g = @(t) t.^2; f_g = @(t) integral(@(tau) f(tau)*g(t-tau),-100*pi,100*pi,'ArrayValued',true); f_g1 = @(t) integral(@(tau) g(tau)*f(t-tau),-100*pi,100*pi,'ArrayValued',true); figure(1); subplot(4, 1, 1); plot(t, f(t)); title("Time vs f(t)") subplot(4, 1, 2); plot(t, g(t)); title("Time vs g(t)") subplot(4, 1, 3); plot(t, f_g(t)); title("Time vs f * g(t)") subplot(4, 1, 4); plot(t, f_g1(t)); title("Time vs g * f(t)") $\endgroup$ Commented May 13 at 18:16
  • $\begingroup$ Because the formula only works when $f$ and $g$ are periodic with period $2\pi$ (this was mentioned in the original post!). It's also known as a "circular convolution". The other definition is to write: $$(f*g)(x) = \int_{-\infty}^\infty f(x-y)g(y)\,dy$$ In this case, you also have $f*g = g*f$ provided the integrals exist. In the example code you gave, this formula also wouldn't work since the convolution integral doesn't converge when $f(t)=t$ and $g(t)=t^2$. $\endgroup$ Commented May 14 at 23:31
6
$\begingroup$

Here is something I've sometimes wondered about. If $f,g$ are both nonnegative proving commutativity of convolution can be done without a tedious change of variable.

Indeed, let $X$ be a random variable with density $f$ and let $Y$ be a random variable with density $g$. Its easy to see that $f$ convolved with $g$ is the density of $X+Y$ (or in your case $X+Y ~{\rm mod} ~2 \pi$). By commutativity of addition, the density of $X+Y$ is the same as the density of $Y+X$ and we are done!

I wonder if an argument of this sort can work in the general case.

$\endgroup$
6
$\begingroup$

\begin{align*} \\&\int_0^tf(t-u)g(u)\cdot\text du\\ \\\text{let } v=t-u\\ \text dv=-\text du\\ \\ u=0\rightarrow v=t\\u=t\rightarrow v=0\\ &=\int_t^0f(v)g(t-v)\cdot -\text dv\\ &=\int_0^tf(v)g(t-v)\cdot \text dv\\ \\&\\ \\&\\ \\&\\ \\&\\ \end{align*} \begin{align*}\mathcal L\left\{\int\limits_0^tf(t-u)g(u)\cdot\text du\right\} &=\int\limits_0^\infty\int\limits_0^t f(t-u)g(u)\cdot\text du\cdot e^{-pt}\cdot\text dt\\ &=\int\limits_0^\infty e^{-pt}\int\limits_0^t f(t-u)g(u)\cdot\text du\cdot\text dt\\ u=0\rightarrow t=u\\ u=t \rightarrow t=\infty\\ &=\int\limits_0^\infty g(u)\int\limits_u^\infty e^{-pt}f(t-u)\cdot\text dt\cdot\text du\\ \text{let }v=t-u\\ \text dv =\text dt\\ t=u\rightarrow v=0\\ t=\infty \rightarrow v=\infty\\ &=\int\limits_0^\infty g(u)\int\limits_{0}^\infty e^{-p(v+u)}f(v)\cdot\text dv\cdot\text du\\ &=\int\limits_0^\infty g(u)e^{-up}\cdot\text du\times\int\limits_{0}^\infty f(v)e^{-pv}\cdot\text dv\\ \\&=G(p)F(p) \end{align*}

$\endgroup$

You must log in to answer this question.

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