Digital Signal Processing Reference
In-Depth Information
[y1,y1Ind] = LVUnitStepSeq(2,-10,10);
[y2,y2Ind] = LVUnitStepSeq(-3,-10,10);
y = 3*y1 - 2*y2; stem(y1Ind,y)
As another example, we can express the four-sample sequence [1,1,1,1] having time vector [-
1,0,1,2] as a sum of unit step sequences and verify the answer using MathScript. To start, we generate a
unit step sequence starting at
n
= -1 and subtract from it a unit step sequence starting at
n
=3:
y
=
u
[
n
+
1
]−
u
[
n
−
3
]
To verify, we can modify the code from the previous example; the results are shown in Fig. 2.6.
[y1,y1Ind] = LVUnitStepSeq(-1,-10,10);
[y2,y2Ind] = LVUnitStepSeq(3,-10,10);
y = y1 - y2; stem(y1Ind,y)
1
0.5
0
−0.5
−1
−10
−5
0
5
10
Sample Index
Figure 2.6:
A plot over time indices -10 to +10 of the sequence defined as
y
[
n
]
=
u
[
n
+
1
]−
u
[
n
−
3
]
.
2.4.5 REAL EXPONENTIAL SEQUENCE
A signal generated as
a
n
y
[
n
]=