ConvolvGUI is a MatLab tool designed to help visualize the concepts behind the Convolution process. The purpose of this page is not to describe how convolution works (that is done elsewhere), but to show how to install and use ConvolveGUI. To install the code, download the zipped archive, ConvolveGui.zip, and save the files in the MatLab path.
To run the code, enter the command "ConvolveGUI" at the MatLab prompt. You will get a display similar to the one shown below.

The window shows the convolution of two signals, f(t) and h(t). The functions f(t) and h(t) are specified by the drop-down boxes in the upper left part of the window. The upper right set of axes shows the two functions. The lower left set of axes shows the functions f(
), h(t- ) and their product f( )h(t-&tax;) as a function of . The value of t is specified by the position of the slider above the graph (or by entering text into the box). The range of can be changed by entering text into the appropriate boxes. The convolution is shown on the graph on the lower right of the window. The specific value of t specified by the slider is shown as a black dot. Animation
To animate the demonstration, hit the "Animate" button. The number of frames and speed of the demonstration are specified by hitting the "Animation Parameters" button. There are also options to create a movie from the animation, though this can take a long time.
Adding your own functions to the GUI
If you would like to add functions to the drop down menus you need to edit the file "ConvolveFuncs.m" and run it. This stores a list of functions that are loaded by the ConvolveGUI function when it loads. The format of the function definitions is best explained by giving an example. The code below (taken from the ConvolveFuncs.m file) shows the definition of two functions, a rectangular pulse and an exponential that starts at t=0.
s='U(t).*exp(-2*t)'; d='Exponential, fast'; cFuncExpFast={s d}; s='U(t)-U(t-1)'; d='Pulse (1 sec)'; cFuncPulse1={s d};The first line in each definition is a string that is evaluated to define the function. It must be proper MatLab syntax. Note that I have defined the function U(t) in the ConvolveFuncs.m file such that U(t)=0 for t<0 and U(t)=1 for t>0. The second line of the function definition is simply the string displayed in the ConvolveGUI drop down menus. The two strings are combined in a cell array. The name of the array is not important but must start with the characters "cFunc" and must be unique from the other arrays defined in the file (only variables beginning with the characters "cFunc" are saved).
© Copyright 2005-2012 Erik Cheever This page may be freely used for educational purposes.
Erik Cheever Department of Engineering Swarthmore College