Summary: Discrete-time systems and their description with the impulse response. The convolution operator. Filtering.
For our purposes, a
system is any processing element that, given as input a sequence
of samples
In this module we are only dealing with linear systems, thus meaning that the following principle holds:
Another important concept is time (and space) invariance.
A series connection of linear time-invariant (LTI) blocks is itself a linear and time-invariant system, and the order of blocks can be changed without affecting the input-output behavior.
LTI systems can be thoroughly described by the response they give to a unit-magnitude impulse.
We call
To have a physical analogy, we can think of regular strokes of a snare drum. The response to each stroke is distributed in time and overlaps with the responses to the following strokes.
Consider the signal
To generalize the example Example 1 we can define the operation of convolution.
The operation of convolution can be fully understood by the explicit construction of some examples of convolution product. The module Discrete-Time Convolution gives the graphic construction of an examples and it offers pointers to other examples.
The properties of the convolution operation are well illustrated in the module Properties of Convolution. The most interesting of such properties is the extension:
If
Therefore, the signal convolution product is longer than both the input signal and the impulse response.
Another interesting property is the commutativity of the convolution product, such that the input signal and the impulse response can change their roles without affecting the output signal.
The Fourier
Transform of the impulse response is called
Frequency Response and it is represented with
The frequency response shapes, in a multiplicative fashion, the input-signal spectrum or, in other words, it performs some filtering by emphasizing some frequency components and attenuating some others. A filtering can also operate on the phases of the spectral components, by delaying them of different amounts.
Filtering can be performed in the time domain (or space domain), by the operation of convolution, or in the frequency domain by multiplication of the frequency response.
Take the impulse response that is
zero everywhere but at the instants filtra() of the Sound Chooser presented in
the module Media Representation in
Processing. In this case filtering is operated in
the time domain by convolution.
void filtra(float[] DATAF, float[] DATA, float WC, float RO) {
//WC and R0 are useless, here kept only to avoid rewriting other
//parts of code
for(int i = 2; i < DATA.length-1; i++){
DATAF[i] = DATA[i+1] + 0.5*DATA[i] + 0.25*DATA[i-1];
}
}
The notion of causality is quite intuitive and it corresponds to the experience of stimulating a system and getting back a response only at future time instants. For discrete-time LTI systems, this happens when the impulse response is zero for negative (discrete) time instants. Causal LTI systems can produce with no appreciable delay an output signal sample-by-sample, because the convolution operator acts only on present and past values of the input signal. In 1 the impulse response is not causal, but this is not a problem because the whole input signal is already available, and the filter can process the whole block of samples.
The notions of impulse response, convolution, frequency response, and filtering naturally extend from 1D to 2D, thus giving the fundamental concepts of image processing.
As in the
1D case, the Fourier transform of the impulse response is
called Frequency response and it is indicated
by
Consider the Processing code of the blurring example and find the lines that implement the convolution operation.
for(int y=0; y<height; y++) {
for(int x=0; x<width/2; x++) {
float sum = 0;
for(int k=-n2; k<=n2; k++) {
for(int j=-m2; j<=m2; j++) {
// Reflect x-j to not exceed array boundary
int xp = x-j;
int yp = y-k;
//... omissis ...
//auxiliary code to deal with image boundaries
sum = sum + kernel[j+m2][k+n2] * red(get(xp, yp));
}
}
output[x][y] = int(sum);
}
}