Properties of Convolution

WooSeongkyun·2023년 1월 20일
0

기타수학

목록 보기
1/8

Visual explanation of Convolution

  • Definition
    - (fg)(t)=f(τ)g(tτ)dτ(f *g)(t)=\displaystyle\int_{-\infty }^{\infty }{f(\tau)g(t-\tau)d \tau}

  • 1. Express each function in terms of a dummy variable ττ.
    2. Reflect one of the functions: g(τ)g(τ) g(τ).g(−τ).
    3. Add a time-offset t, which allows g(τ)g(−τ) to slide along the ττ-axis. If t is a positive value, then g(tτ)g(t−τ) is equal to g(τ)g(−τ) that slides or is shifted along the ττ axis toward the right (toward +∞) by the amount of t. If t is a negative value, then g(tτ)g(t−τ) is equal to g(τ)g(−τ) that slides or is shifted toward the left (toward -∞) by the amount of t|t|.
    4. Start t at −∞ and slide it all the way to ++∞. Wherever the two functions intersect, find the integral of their product. In other words, at time t, compute the area under the function f(τ)f(τ) weighted by the weighting function g(tτ)g(t−τ).

The resulting waveform (not shown here) is the convolution of functions ff and gg.

If f(t)f(t) is a unit impulse, the result of this process is simply g(t)g(t).

  • In this example, the red-colored "pulse", g(τ)g(τ) is an even function ( g(τ)=g(τ) )( g(−τ)=g(τ) ) so convolution is equivalent to correlation. A snapshot of this "movie" shows functions g(tτ)g(t−τ) and f(τ)f(τ) (in blue) for some value of parameter tt which is arbitrarily defined as the distance along the ττ axis from the point τ=0τ=0 to the center of the red pulse. The amount of yellow is the area of the product f(τ)g(tτ)f(τ)⋅g(t−τ) computed by the convolution/correlation integral. The movie is created by continuously changing tt and recomputing the integral. The result (shown in black) is a function of tt but is plotted on the same axis as ττ for convenience and comparison.
  • In this depiction, f(τ)f(τ)could represent the response of an RC circuit to a narrow pulse that occurs at τ=0τ=0. In other words, if g(τ)=δ(τ)g(τ)=δ(τ), the result of convolution is just f(t)f(t) But when g(τ)g(τ)is the wider pulse (in red), the response is a "smeared" version of f(t)f(t). It begins at t=0.5t=−0.5, because we defined tt as the distance from the τ=0τ=0 axis to the center of the wide pulse (instead of the leading edge).

Convolution of CNN

  • Let's briefly review why it is called convolution. In mathematics, the convolution between two functions says f,g:RdRf,g: \mathbb{R} ^{d}\to \mathbb{R} is defined as
    - (fg)(x)=f(z)g(xz)dz(f *g)(\boldsymbol{x})=\displaystyle\int_{}^{}{f(\boldsymbol{z})g(\boldsymbol{x}-\boldsymbol{z})d \boldsymbol{z}}
  • That is, we measure the overlap between ff and gg when one function is "flipped" and shifted by x\boldsymbol{x}
  • Whenever we have discrete objects, the integral turns into a sum
  • For instance
    - for vectors from the set of square summable infinite dimensional vectors with index running over Z\mathbb{Z} , we obtain the following definition
    - (fg)(i)=af(a)g(ia)(f *g)(i)=\displaystyle\sum_{a}^{}{f(a)g(i-a)}
  • For two-dimensional tensors
    - we have a corresponding sum with indices (a,b)(a,b) for ff and (ia,jb)(i-a,j-b) for gg , respectively :
    - (fg)(i,j)=abf(a,b)g(ia,jb)(f *g)(i,j)=\displaystyle\sum_{a}^{}{\displaystyle\sum_{b}^{}{f(a,b)g(i-a,j-b)}}
  • This looks similar to [H]i,j=u+a=ΔΔb=ΔΔ[V]a,b[X]i+a,j+b[\boldsymbol{H}]_{i,j}=u+\displaystyle\sum_{a=-\Delta}^{\Delta}{\displaystyle\sum_{b=-\Delta}^{\Delta}{[\boldsymbol{V}]_{a,b}[\boldsymbol{X}]_{i+a,j+b}}} , with one major difference. Rather than using (i+a,j+b)(i+a,j+b) we are using the difference instead

Convolution Thorem (of Fourier Transform)

  • Condition
    - Consider two function g(x),h(x)g(x),h(x) with Fourier transform G,HG,H. and let F\mathcal{F} denotes the Fourier Transform
    - G(f)=F(g)=g(t)e2πiftdtG(f)=\mathcal{F}(g)=\displaystyle\int_{\infty }^{\infty }{g(t)e^{-2\pi i ft}dt}
    - H(f)=F(h)=h(t)e2πiftdtH(f)=\mathcal{F}(h)=\displaystyle\int_{\infty }^{\infty }{h(t)e^{-2\pi i ft}dt}
  • The convolution of gg and hh is defined by
    - (gh)(t)=g(τ)h(tτ)dτ(g *h)(t)=\displaystyle\int_{-\infty }^{\infty }{g(\tau)h(t-\tau)d \tau}
  • Statement
    - F(gh)=G(f)H(f)\mathcal{F}(g*h)=G(f)H(f)
  • Proof
    - F(gh)=[g(τ)h(tτ)dτ]e2πiftdt=[h(tτ)e2πiftdt]g(τ)dτ\mathcal{F}(g*h)=\displaystyle\int_{-\infty }^{\infty }[{\displaystyle\int_{-\infty }^{\infty }{g(\tau)h(t-\tau)d \tau}}]e^{-2 \pi i ft}dt=\displaystyle\int_{-\infty }^{\infty }{[\displaystyle\int_{-\infty }^{\infty }{h(t- \tau)e^{-2\pi i ft}dt}]g(\tau)d \tau}
    - (by Fubini's Theorem )
    - let t=tτt'=t-\tau . then t=t+τt=t'+\tau , dt=dtdt=dt' : as we see τ\tau as a constant
    - =[h(t)e2πif(t+τ)dt]g(τ)dτ=\displaystyle\int_{-\infty }^{\infty }{[\displaystyle\int_{-\infty }^{\infty }{h(t')e^{-2\pi i f(t'+\tau)}}dt']g(\tau)d \tau}
    - =H(f)g(τ)e2πifτdτ=H(f)G(f)=H(f) \displaystyle\int_{-\infty }^{\infty }{g(\tau)e^{-2 \pi i f \tau}d \tau}=H(f)G(f)

Convolution Thorem (of Laplace Transform)

  • Condition
    - Consider two function g(x),h(x)g(x),h(x) with Laplace transform G,HG,H. and let L\mathcal{L} denotes the Laplace Transform
    - G(s)=L(g)=g(t)estdtG(s)=\mathcal{L}(g)=\displaystyle\int_{\infty }^{\infty }{g(t)e^{-st}dt}
    - H(s)=L(h)=h(t)estdtH(s)=\mathcal{L}(h)=\displaystyle\int_{\infty }^{\infty }{h(t)e^{-st}dt}
  • The convolution of gg and hh is defined by
    - (gh)(t)=g(τ)h(tτ)dτ(g *h)(t)=\displaystyle\int_{-\infty }^{\infty }{g(\tau)h(t-\tau)d \tau}
  • Statement
    - L(gh)=G(s)H(s)\mathcal{L}(g*h)=G(s)H(s)
  • Proof
    - L(gh)=[g(τ)h(tτ)dτ]estdt=[h(tτ)estdt]g(τ)dτ\mathcal{L}(g*h)=\displaystyle\int_{-\infty }^{\infty }{[\displaystyle\int_{-\infty }^{\infty }{g(\tau)h(t-\tau)d \tau}]}e^{-st}dt=\displaystyle\int_{-\infty }^{\infty }{[\displaystyle\int_{-\infty }^{\infty }{h(t-\tau)e^{-st}dt}]g(\tau)d \tau}
    - (by Fubini's Theorem )
    - let t=tτt'=t-\tau . then t=t+τt=t'+\tau , dt=dtdt=dt' : as we see τ\tau as a constant
    - =[h(t)es(t+τ)dt]g(τ)dτ=\displaystyle\int_{-\infty }^{\infty }{[\displaystyle\int_{-\infty }^{\infty }{h(t')e^{-s(t'+\tau)}}dt']g(\tau)d \tau}
    - =H(s)g(τ)esτdτ=H(s)G(s)=H(s) \displaystyle\int_{-\infty }^{\infty }{g(\tau)e^{-s\tau}d \tau}=H(s)G(s)
profile
안녕하세요!

0개의 댓글