C/C++ : Convolution Source Code

C/C++ : Convolution Source Code

In mathematics and, in particular, functional analysis, convolution is a mathematical operation on two functions f and g, producing a third function that is typically viewed as a modified version of one of the original functions (from wikipedia.com).

Convolution of two square pulses: the resulting waveform is a triangular pulse. One of the functions (in this case g) is first reflected about τ = 0 and then offset by t, making it g(t − τ). The area under the resulting product gives the convolution at t. The horizontal axis is τ for f and g, and t for f\ast g.

I get this picture convolution ilustration from wikipedia. We can ilustrated the convolution process with number. Please check the picture below, I try to create a convolution ilustration. So, we can create C/C++ : Convolution Source Code from this convolution ilustration :

Convolution Source Code Ilustration

This is a simple convolution ilustration with input two vector. From this ilustration, we can create a C/C++ : Convolution Source Code. This is a function to compute convolution 1D with C/C++ :

we can running this code with command :

./convolution length_vect_1 length_vect_2

example :

./convolution 4 6

This is sample output from C/C++ : Convolution Source Code:

You can download the complete C/C++ : Convolution Source Code with testing program at here.

Source :



Add a Comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.