0% found this document useful (0 votes)
5 views54 pages

LEC 2 Convolution

The document discusses convolution as a fundamental mathematical operation in Digital Signal Processing (DSP), detailing its role in processing signals through impulse decomposition and the relationship between input signals, output signals, and impulse responses. It explains the delta function and how different impulses can be represented, emphasizing the properties of homogeneity and shift invariance in system responses. Additionally, the document covers the detailed mathematics of convolution, including examples of low-pass and high-pass filtering, and the implications of signal lengths in convolution operations.

Uploaded by

Sherif Said
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views54 pages

LEC 2 Convolution

The document discusses convolution as a fundamental mathematical operation in Digital Signal Processing (DSP), detailing its role in processing signals through impulse decomposition and the relationship between input signals, output signals, and impulse responses. It explains the delta function and how different impulses can be represented, emphasizing the properties of homogeneity and shift invariance in system responses. Additionally, the document covers the detailed mathematics of convolution, including examples of low-pass and high-pass filtering, and the implications of signal lengths in convolution operations.

Uploaded by

Sherif Said
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

Lecture 2

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

The discrete derivative

(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 is important because:

❑ it allows signals to be examined one sample at a time.

❑ Similarly, systems are characterized by how they respond to impulses. By


knowing how a system responds to an impulse, the system's output can be
calculated for any given input. This approach is called convolution.
Convolution

Impulse decomposition

Example of impulse decomposition. An N


point signal is broken into N components,
each consisting of a single nonzero point.
Convolution

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.

Convolution is important because it relates the three signals of interest: the


input signal, the output signal, and 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

The Delta Function and Impulse Response


Convolution

The Delta Function and Impulse Response

The Delta Function 𝜹[𝒏]


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.

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

The Impulse Response Symbol

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

Any impulse other than delta function


1 1
0
-1
-2
-3
0 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 1
𝜹[𝒏] 0.5 ?
0
0 1 2 3 4 5 6

?
Convolution

Any impulse other than delta function


Any impulse can be
1 1
represented as 0
a shifted and scaled delta -1
function -2
-3
0 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 1
𝜹[𝒏] −3 𝛿[𝑛 − 8]
0.5
0
0 1 2 3 4 5 6

0.5 𝛿[𝑛 − 3]
Convolution

Any impulse other than delta function


Any impulse can be represented as a shifted and scaled delta function

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

The Properties of Homogeneity and Shift Invariance

If the input to a system is an impulse, such as −𝟑𝜹[𝒏 − 𝟖],


what is the system’s output?
Convolution

The Properties of Homogeneity and Shift Invariance


If the input to a system is an impulse, such as −𝟑𝜹[𝒏 − 𝟖],
what is the system’s output?

𝜹[𝒏] System 𝒉[𝒏]

-3 𝜹[𝒏 − 𝟖] System −𝟑 𝒉[𝒏 − 𝟖]


Convolution

The Properties of Homogeneity and Shift Invariance


If the input to a system is an impulse, such as −𝟑𝜹[𝒏 − 𝟖],
what is the system’s output?

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

The Delta Function and Impulse Response


The fundamental concept of DSP: the input signal is decomposed into simple additive
components, each of these components is passed through a linear system, and the resulting
output components are synthesized (added). The signal resulting from this divide-and-
conquer procedure is identical to that obtained by directly passing the original signal through
the system.

Original Signal System Output

Component 1 System Output 1

Component 2 System Output 2 Output

Component 3 System Output 3


Convolution

The Delta Function and Impulse Response

𝑎 𝒏 = −𝟑𝜹[𝒏 − 𝟖]
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.

How convolution is used in DSP. The


output signal from a linear system is
equal to the input signal convolved
with the system's impulse response.
Convolution is denoted by a star when
writing equations.

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 input signal is the sum of two components:

- three cycles of a sine wave (representing a


high frequency),
- plus a slowly rising ramp (composed of low
frequencies).
Convolution
Examples How convolution is used to process signals

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

The discrete derivative

(also called the first difference), results in an output signal related to the slope of the input signal.
Convolution

Detailed Mathematics of Convolution

From the viewpoint of the input signal


The input side algorithm
Convolution

Detailed Mathematics of Convolution


From the viewpoint of the input signal
The input side algorithm
Convolution

Detailed Mathematics of Convolution


From the viewpoint of the input signal

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

Detailed Mathematics of Convolution


From the viewpoint of the input signal

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

The nine signals


Convolution

Detailed Mathematics of Convolution


From the viewpoint of the input signal

𝜹𝒏 𝒉[𝒏]

𝑥 𝟎 = 𝟎 𝜹[𝒏]
output
𝑥 𝟎 ∗ 𝒉 𝒏 − 𝟎 = 𝟎 ∗ ℎ[𝒏 − 𝟎]
this is the impulse response, h[n] , multiplied by 0
Convolution

Detailed Mathematics of Convolution


From the viewpoint of the input signal

𝜹𝒏 𝒉[𝒏]

𝑥 𝟎 = 𝟎 𝜹[𝒏]
output
𝑥 𝟎 ∗ 𝒉 𝒏 − 𝟎 = 𝟎 ∗ ℎ[𝒏 − 𝟎]
this is the impulse response, h[n] , multiplied by 0
Convolution

Detailed Mathematics of Convolution


From the viewpoint of the input signal

𝜹𝒏 𝒉[𝒏]

𝑥 𝟏 = −𝟏 𝜹[𝒏 − 𝟏]

output
𝑥 𝟏 ∗ 𝒉 𝒏 = −𝟏 ℎ[𝒏 − 𝟏]
this is the impulse response, h[n] , multiplied by -1, and shifted one sample to the right
Convolution

Detailed Mathematics of Convolution


From the viewpoint of the input signal

𝜹𝒏 𝒉[𝒏]

𝑥 𝟏 = −𝟏 𝜹[𝒏 − 𝟏]

output
𝑥 𝟏 ∗ 𝒉 𝒏 = −𝟏 ℎ[𝒏 − 𝟏]
this is the impulse response, h[n] , multiplied by -1, and shifted one sample to the right
Convolution

Detailed Mathematics of Convolution


From the viewpoint of the input signal

𝜹𝒏 𝒉[𝒏]

𝑥 𝟐 = −𝟏. 𝟒 𝜹[𝒏 − 𝟐]

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

𝜹𝒏 𝒉[𝒏]

𝑥 𝟐 = −𝟏. 𝟒 𝜹[𝒏 − 𝟐]

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

The nine signals


Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
𝒙𝟎 =𝟎 𝒙 𝟏 = −𝟏 𝒙 𝟐 = −𝟏.4
The nine signals

𝒙𝟑 =𝟐 𝒙 𝟒 = 𝟏. 𝟒 𝒙 𝟓 = 𝟏.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

The nine signals


Convolution

The length of the Signals


Convolution

The length of the Signals

each output signal is: 81 + 31 - 1 = 111 samples long.


The input signal runs from sample 0 to 80,
the impulse response from sample 0 to 30,
and the output signal from sample 0 to 110.
Convolution

The length of the Signals

Notice the lengths of the signals in previous figures.


The input signals are 81 samples long,
while each impulse response is composed of 31 samples.

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

Convolution is commutative: a[n] * b[n] = b[n] * a[n] .

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

You might also like