LEC 2 Convolution
LEC 2 Convolution
DSP course
Convolution
Convolution provides the mathematical framework for DSP.
Convolution
Examples How convolution is used to process signals
How ??
Convolution
Examples How convolution is used to process signals
How ??
Convolution
Additional Examples How convolution is used to process signals
The inverting attenuator flips the signal top-for-bottom, and reduces its amplitude.
How ??
Convolution
Additional Examples How convolution is used to process signals
(also called the first difference), results in an output signal related to the slope of the input signal.
How ??
Lecture 2
DSP course
Convolution
Convolution provides the mathematical framework for DSP.
Convolution
Signal Decomposition
Convolution
Impulse decomposition
Impulse decomposition breaks an N samples signal into N component signals,
each containing N samples. Each of the component signals contains one point
from the original signal, with the remainder of the values being zero. A single
nonzero point in a string of zeros is called an impulse.
Convolution
Impulse decomposition
Impulse decomposition
Convolution
is a mathematical way of combining two signals to form a third signal.
It is the single most important technique in Digital Signal Processing. Using the
strategy of impulse decomposition, systems are described by a signal called the
impulse response.
We present convolution from two different viewpoints, called the input side
algorithm and the output side algorithm. Convolution provides the mathematical
framework for DSP.
Convolution
0
0 1 2 3 4 5 6
Convolution
1
The Delta Function and Impulse Response
0
The Delta Function 𝜹[𝒏] 0 1 2 3 4 5 6
The delta function is a normalized impulse, that is, sample number zero has a value of one,
while all other samples have a value of zero. For this reason, the delta function is frequently
called the unit impulse.
Impulse Response
The impulse response is the signal that exits a system when a delta function (unit impulse) is
the input.
Convolution
h[n]
Of course, this can be changed if a more descriptive name is available, for instance, f[n]
might be used to identify the impulse response of a filter.
Convolution
?
Convolution
0.5 𝛿[𝑛 − 3]
Convolution
1
0
-1
-2
-3
0 1 2 3 4 5 6 7 8 9
Consider a signal, a[n] , composed of all zeros except sample number 8, which has a value of -3.
This is the same as a delta function shifted to the right by 8 samples, and multiplied by -3.
𝑎 𝒏 = −𝟑𝜹[𝒏 − 𝟖]
Convolution
Scaling and shifting the input results in an identical scaling and shifting of the
output. If 𝜹[𝒏] results in h[n] , it follows that -𝟑𝜹[𝒏 − 𝟖] results in -3h[n- 8] .
In words, the output is a version of the impulse response that has been shifted
and scaled by the same amount as the delta function on the input.
If you know a system's impulse response, you immediately know how it will
react to any impulse
Convolution
𝑎 𝒏 = −𝟑𝜹[𝒏 − 𝟖]
Convolution
Convolution is a formal mathematical operation, just as multiplication, addition, and
integration. Addition takes two numbers and produces a third number, while convolution
takes two signals and produces a third signal.
The input signal convolved with the impulse response is equal to the output signal. Just as
addition is represented by the plus, +, and multiplication by the cross, ×, convolution is
represented by the star, t. It is unfortunate that most programming languages also use the star
to indicate multiplication. A star in a computer program means multiplication, while a star in an
equation means convolution
Convolution
Some
Examples
Convolution
Examples
Convolution being used for Low-pass and High-pass filtering
The impulse response for the low-pass filter is a smooth arch, resulting in only
the slowly changing ramp waveform being passed to the output
Convolution
Examples How convolution is used to process signals
Similarly, the high-pass filter, allows only the more rapidly changing sinusoid to
pass
Convolution
Additional Examples How convolution is used to process signals
The inverting attenuator flips the signal top-for-bottom, and reduces its amplitude.
Convolution
Additional Examples How convolution is used to process signals
(also called the first difference), results in an output signal related to the slope of the input signal.
Convolution
a simple convolution problem: a 9 point input signal, x[n] , is passed through a system with a 4
point impulse response, h[n] , resulting in a 9+4-1=12 point output signal, y[n] . In mathematical
terms, x[n] is convolved with h[n] to produce y[n] .
Convolution
This first viewpoint of convolution is based on the fundamental concept of DSP: decompose the
input, pass the components through the system, and synthesize the output. In this example,
each of the nine samples in the input signal will contribute a scaled and shifted version of the
impulse response to the output signal. These nine signals are shown in next slide. Adding these
nine signals produces the output signal, y[n] .
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
𝜹𝒏 𝒉[𝒏]
𝑥 𝟎 = 𝟎 𝜹[𝒏]
output
𝑥 𝟎 ∗ 𝒉 𝒏 − 𝟎 = 𝟎 ∗ ℎ[𝒏 − 𝟎]
this is the impulse response, h[n] , multiplied by 0
Convolution
𝜹𝒏 𝒉[𝒏]
𝑥 𝟎 = 𝟎 𝜹[𝒏]
output
𝑥 𝟎 ∗ 𝒉 𝒏 − 𝟎 = 𝟎 ∗ ℎ[𝒏 − 𝟎]
this is the impulse response, h[n] , multiplied by 0
Convolution
𝜹𝒏 𝒉[𝒏]
𝑥 𝟏 = −𝟏 𝜹[𝒏 − 𝟏]
output
𝑥 𝟏 ∗ 𝒉 𝒏 = −𝟏 ℎ[𝒏 − 𝟏]
this is the impulse response, h[n] , multiplied by -1, and shifted one sample to the right
Convolution
𝜹𝒏 𝒉[𝒏]
𝑥 𝟏 = −𝟏 𝜹[𝒏 − 𝟏]
output
𝑥 𝟏 ∗ 𝒉 𝒏 = −𝟏 ℎ[𝒏 − 𝟏]
this is the impulse response, h[n] , multiplied by -1, and shifted one sample to the right
Convolution
𝜹𝒏 𝒉[𝒏]
𝑥 𝟐 = −𝟏. 𝟒 𝜹[𝒏 − 𝟐]
output
𝑥 𝟐 ∗ 𝒉 𝒏 − 𝟐 = −𝟏. 𝟒 ℎ[𝒏 − 𝟐]
this is the impulse response, h[n] , multiplied by -1.4, and shifted two samples to the rig
Convolution
𝜹𝒏 𝒉[𝒏]
𝑥 𝟐 = −𝟏. 𝟒 𝜹[𝒏 − 𝟐]
output
𝑥 𝟐 ∗ 𝒉 𝒏 − 𝟐 = −𝟏. 𝟒 ℎ[𝒏 − 𝟐]
this is the impulse response, h[n] , multiplied by -1.4, and shifted two samples to the rig
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
𝒙𝟑 =𝟐 𝒙 𝟒 = 𝟏. 𝟒 𝒙 𝟓 = 𝟏.5
𝒙 𝟔 = 𝟎. 𝟖 𝒙𝟕 =𝟎 𝒙 𝟖 = −𝟎.5
Convolution Shifted and Scaled
Detailed Mathematics of Convolution Impulse Responses
From the viewpoint of the input signal
𝒙𝟎 =𝟎 𝒙 𝟏 = −𝟏 𝒙 𝟐 = −𝟏.4
The nine signals
𝒙𝟑 =𝟐 𝒙 𝟒 = 𝟏. 𝟒 𝒙 𝟓 = 𝟏.5
𝒙 𝟔 = 𝟎. 𝟖 𝒙𝟕 =𝟎 𝒙 𝟖 = −𝟎.5
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
In most DSP applications, the input signal is hundreds, thousands, or even millions of samples
in length. The impulse response is usually much shorter, say, a few points to a few hundred
points. The mathematics behind convolution doesn't restrict how long these signals are. It
does, however, specify the length of the output signal. The length of the output signal is equal
to the length of the input signal, plus the length of the impulse response, minus one.
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
Reverse the Situation
In the previous example, x[n] is a nine point signal and h[n] is a four point signal.
We will reverse the situation by making x[n] a four point signal, and h[n] a nine
point signal.
The same two waveforms are used, they are just swapped. As shown by the output signal
components, the four samples in x[n] result in four shifted and scaled versions of the nine
point impulse response. Just as before, leading and trailing zeros are added as place holders.
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
Reverse the Situation
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
Reverse the Situation
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
Reverse the Situation
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
Reverse the Situation
The mathematics does not care which is the input signal and which is the impulse
response, only that two signals are convolved with each other. Although the mathematics
may allow it, exchanging the two signals has no physical meaning in system theory.
The input signal and impulse response are two totally different things and exchanging
them doesn't make sense. What the commutative property provides is a mathematical
tool for manipulating equations to achieve various results.
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
Convolution example
by
Matlab Code