File:Convolution Animation (Boxcar and Ramp).gif

Convolution_Animation_(Boxcar_and_Ramp).gif(360 × 222 pixels, file size: 683 KB, MIME type: image/gif, looped, 161 frames)

Captions

Captions

Add a one-line explanation of what this file represents
Description
English: An animation of the convolution of two functions, f(t) and g(t).
,
where H(x) is the Heaviside step function.
Also shown is the time-reversed and shifted g(τ−t) in solid blue, the product f(t)g(τ−t) (green) and the convolution h(t)=f(t)g(t) (black, equal to the area of the product at the particular τ)
Date
Source Own work
Author Inductiveload
Permission
(Reusing this file)
Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

Mathematica Code edit

(*Function definitions*)
boxcar[x_, {a_, b_}] := UnitStep[x - a] - UnitStep[x - b];

f[t_] := 0.7*boxcar[t, {-1/4, 1/4}];
g[t_] := Piecewise[
   {{0, t < 0},
    {t, 0 < t < 1},
    {0, t > 1}}];
h[y_] := Module[
   {t},
   Convolve[f[t], g[t], t, y]
   ];

(*Parts of the drawing that only need to be computed once*)
constplots = Plot[
   {f[t], g[t], h[t]},
   {t, -2, 2},
   PlotStyle -> {Red, {Blue, Dashed}, Black},
   ClippingStyle -> False,
   Axes -> False,
   Exclusions -> False
   ];

anim =
  Table[Show[
    {
     (*The plots we generated earlier*)
     constplots,
     
     (*Plot the time reversed g[t], g[\[Tau]-t]*)
     Plot[g[\[Tau] - t],
      {t, -5, 5},
      PlotPoints -> 100,
      ClippingStyle -> False,
      PlotStyle -> Blue,
      Exclusions -> False,
      Axes -> False],
     
     (*Plot the product of the f[t] and g[\[Tau]-t]*)
     Plot[f[t]*g[\[Tau] - t],
      {t, -5, 5},
      PlotPoints -> 100,
      ClippingStyle -> False,
      Filling -> Axis,
      FillingStyle -> Directive[Green, Opacity[0.2]],
      PlotStyle -> Green,
      Exclusions -> False,
      Axes -> False],
     
     (*Plot the embellishments*)
     Graphics[
      {{Blue, Line[{{\[Tau], -0.05}, {\[Tau], 1.1}}]},
       {Red, Text[f, {.2, .76}, Background -> None]},
       {Blue, Text[g, {.48, .55}, Background -> None]},
       {Blue, 
        Text["g(\[Tau]-t)", {\[Tau] - .58, .4}, Background -> None]},
       {Green, 
        Text["f(t)g(\[Tau]-t)", {\[Tau] - 0.55, -0.04}, 
         Background -> None]},
       {Black, Text[Star[f, g], {.65, .15}, Background -> None]},
       {Blue, Text["\[Tau]", {\[Tau], -0.1}, Background -> White]}
       }]
     },
    PlotRange -> {{-1.9, 1.9}, {-.2, 1}}],
   
   {\[Tau], -2, 2, .025}(*Table index is the time delay*)
   ];

ListAnimate[anim]

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current04:56, 5 March 2009Thumbnail for version as of 04:56, 5 March 2009360 × 222 (683 KB)Inductiveload (talk | contribs){{Information |Description={{en|1=An animation of the convolution of two functions, ''f''(''t'') and ''g''(''t'').}} |Source=Own work by uploader |Author=Inductiveload |Date=2009/03/05 |Permission={{PD-self}} |other_versions= }} [[C

There are no pages that use this file.

Metadata