The textbook definition of (linear) convolution is as follows: a convolution of two vectors and is a vector , where
i.e., the -th entry of the vector is the sum of all product such that the indices satisfy the condition .
This definition doesn't show convolution is related to applcations (it's more useful for proof exercises). Ok, what is an intuitive way to think about convolution?
Note that convolution is a linear operation, for which we can write it down as a matrix-vector multiplication. To make things concrete, suppose and , then we can write
which is the same as what's going on in equation (1).
What's interesting from this perspective is when the vector is sparse, i.e. has mostly zero entries. Let's say . Substitute this to the above, we have that
What does this say? If we think about that as some kind of signal, then this is saying that as a feature is presented in the span from the 2nd to the 4th entries.
We can leverage this intuition to think about applications related to bioinformatics. If the signal is a DNA string, and the feature represents a motif, e.g., it could be a k-mer, or a position frequency matrix, etc., then we have something meaningful: the sparse vector indicates where the motif is presented in the DNA string. Moreover, the non-zero entry in doesn't need to be . It could be an arbitrary value signifying the strength of the presense of in the DNA string.
The description above is just an analogy. To develop this idea further, we look at a classic problem in signal processing: convolutional dictionary learning.