Digital Signal Processing Reference
In-Depth Information
y
[
1
]=
x
[
0
]
h
[
1
]+
x
[
1
]
h
[
0
]=
(
1
)(
0
.
7
)
+
(
−
0
.
5
)(
1
)
=
0
.
2
y
[
2
]=
x
[
0
]
h
[
2
]+
x
[
1
]
h
[
1
]+
x
[
2
]
h
[
0
]=
0
.
49
+
(
−
0
.
5
)(
0
.
7
)
+
0
.
75
=
0
.
89
Example 2.5.
For the sequences above, compute
y
[
k
]
for
k
=
3.
We set
k
= 3 and
n
= 0:1:3. Then
y
[
3
]=
x
[
0
]
h
[
3
]+
x
[
1
]
h
[
2
]+
x
[
2
]
h
[
1
]+
x
[
3
]
h
[
0
]
which is
1
(
0
.
343
)
+
(
−
0
.
5
)(
0
.
49
)
+
0
.
75
(
0
.
7
)
+
0
(
1
)
=
0
.
623
Example 2.6.
Use m-code to compute the first 10 output values of the convolution of the two sequences
and 0
.
7
n
.
[
1
,
−
0
.
5, 0
.
75
]
MathScript provides the function
conv(x, y)
which convolves the two sequences
x
and
y
. We make the call
conv([1 -0.5 0.75],[0.7.ˆ(0:1:9)])
If the roles of the two sequences above had been reversed, that is to say, if we had defined the
sequence [1,-0.5, 0.75] as the impulse response
h
= 0.7.ˆ(0:1:9), the result would
be as shown in Fig. 2.21. Note that the first three samples of the convolution sequence are the same as
shown in Fig. 2.20.
[
n
]
in Eq. (2.6), and
x
[
n
]
Example 2.7.
In this example, we'll reverse the role of signal and impulse response and show that the
convolution sequence is the same. Let
x
[
n
]
= 0
.
7
.
ˆ
(
0
:
1
:
9
)
and
h
[
n
]
=
[
1
,
−
0
.
5
,
0
.
75
]
. Compute the
first three samples of the convolution sequence.
Note that
h
[
n
]
= 0 for
n<
0 and
n>
2. We set the range of
k
as 0:1:2, and
n
= 0:1:2. We get
2
y
[
0
]=
x
[
n
]
h
[
0
−
n
]
n
=
0
The sum above is, for
k
= 0:1:2
y
[
0
]=
x
[
0
]
h
[
0
]+
x
[
1
]
h
[−
1
]+
x
[
2
]
h
[−
2
]=
x
[
0
]
h
[
0
]=
1
y
[
1
]=
x
[
0
]
h
[
1
]+
x
[
1
]
h
[
0
]=
1
(
−
0
.
5
)
+
0
.
7
(
1
)
=
0
.
2