LEC 3 Convolution - Continue
LEC 3 Convolution - Continue
DSP course
Convolution
continue
Convolution provides the mathematical framework for DSP.
Convolution
From the viewpoint of the input signal From the viewpoint of the output signal
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
Convolution example
by
Matlab Code
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
h = [1 -0.5 -0.2 0 ];
Convolution
Detailed Mathematics of Convolution
From the viewpoint of the input signal
Matlab Code for Convolution
% input signal x (( 9 samples ))
x= [0 -1 -1.4 2 1.4 1.5 0.8 0 -0.5 ];
From the viewpoint of the input signal From the viewpoint of the output signal
Convolution
𝒙𝟑 =𝟐 𝒙 𝟒 = 𝟏. 𝟒 𝒙 𝟓 = 𝟏.5
𝒙 𝟔 = 𝟎. 𝟖 𝒙𝟕 =𝟎 𝒙 𝟖 = −𝟎.5
X[0] X[0] X[0] X[0]
h[0] h[1] h[2] h[3]
X[1] X[1] X[1] X[1]
h[0] h[1] h[2] h[3]
X[2] X[2] X[2] X[2]
h[0] h[1] h[2] h[3]
X[3] X[3] X[3] X[3]
h[0] h[1] h[2] h[3]
X[4] X[4] X[4] X[4]
h[0] h[1] h[2] h[3]
X[5] X[5] X[5] X[5]
h[0] h[1] h[2] h[3]
X[6] X[6] X[6] X[6]
h[0] h[1] h[2] h[3]
X[7] X[7] X[7] X[7]
h[0] h[1] h[2] h[3]
X[8] X[8] X[8] X[8]
h[0] h[1] h[2] h[3]
Convolution
The
output
side
algorith
m
Calculate
Calculate
y[3]
y[8]
Convolution
The output side algorithm
Problem
When calculating y[0], it is trying
to receive input from samples:
x[-3], x[-2], x[-1 ], and x[0] . The
problem is, three of these
samples: x[-3], x[-2], and x[-1] ,
do not exist! Calculate
y[0]
This same dilemma arises when
calculating y[11], where the Calculate
convolution machine tries to y[11]
accept samples to the right of
the defined input signal, points
x[9], x[10], and x[11] .
Convolution
The output side algorithm
Problem
One way to handle this problem is by inventing the nonexistent samples. This
involves adding samples to the ends of the input signal, with each of the added
samples having a value of zero.
This is called padding the signal with zeros. Instead of trying to access a
nonexistent value, the convolution machine receives a sample that has a value
of zero. Since this zero is eliminated during the multiplication, the result is
mathematically the same as ignoring the nonexistent inputs.
Convolution
The output side algorithm
End Effect Problem
Convolution
The output side algorithm End Effect Problem
The far left and far right samples in the output signal are based on incomplete
information. In DSP jargon, the impulse response is not fully immersed in the
input signal.
If the impulse response is M points in length, the first and last M-1 samples in
the output signal are based on less information than the samples between.
Convolution
The output side algorithm
End Effect Problem
The input signal is a sine wave plus a DC component. The desire is to remove the
DC part of the signal, while leaving the sine wave intact. This calls for a highpass
filter.
Convolution
The output side algorithm
End Effect Problem
The problem is, the first and last 30 points are a mess!
These “End Effect” problems are widespread in DSP. As a general rule, expect the
beginning and ending samples in processed signals will be quite useless.
Convolution
Convolution Sum
If x[n] is an N point signal running from 0 to N-1, and h[n] is an M point signal
running from 0 to M-1,
It allows each point in the output signal to be calculated independently of all other points.
Convolution
Convolution Sum
From the viewpoint of the output signal
Matlab Code for Convolution
% input signal x (( 9 samples ))
x= [0 -1 -1.4 2 1.4 1.5 0.8 0 -0.5 ];
Error
% output ((9+4-1 = 12 samples))
y(1:12) =0;
✓
y(1:12) =0;
Same
result
Convolution
Convolution Sum
Same
result
Convolution
The sum of weighted inputs
convolution
Why convolution is important in machine
signal processing ??
Convolution
The sum of weighted inputs
convolution
machine
Look back at the convolution machine, and ignore that
the signal inside the dotted box is an impulse response.
convolution
machine
Taking this further, the weighing coefficients do not need to
be restricted to the left side of the output sample being
calculated.
Mathematically, there is only one concept here: convolution as defined by the above
equation.
However, science and engineering problems approach this single concept from two distinct
directions..
Sometimes you will want to think of Other times you will understand
a system in terms of what its the system as a set of weighing
impulse response looks like coefficients.