4 - Linear Constant Coefficient Difference Equations
4 - Linear Constant Coefficient Difference Equations
Alp Ertürk
[email protected]
Linear Constant-Coefficient
Difference Equations (LCCDE)
• We calculate the output (response) of an LTI system using
the input and the system’s impulse response
𝑦 𝑛 = 𝑦 𝑛 − 1 + 0.1𝑦 𝑛 − 1 + 𝑥[𝑛]
𝑦 𝑛 = 1.1𝑦 𝑛 − 1 + 𝑥[𝑛]
𝑁 𝑀
𝑎𝑘 𝑦[𝑛 − 𝑘] = 𝑏𝑘 𝑥[𝑛 − 𝑘]
𝑘=0 𝑘=0
OR:
𝑀 𝑁
1
𝑦𝑛 = 𝑏𝑘 𝑥[𝑛 − 𝑘] − 𝑎𝑘 𝑦[𝑛 − 𝑘]
𝑎0
𝑘=0 𝑘=1
LCCDE
• In most cases, 𝑎0 is distributed to the other coefficients,
resulting in:
𝑀 𝑁
𝑦 𝑛 = 𝑏𝑘 𝑥[𝑛 − 𝑘] − 𝑎𝑘 𝑦[𝑛 − 𝑘]
𝑘=0 𝑘=1
LCCDE
• As a special case, if the output of the system does not
depend on past output values:
𝑀
𝑦 𝑛 = 𝑏𝑘 𝑥[𝑛 − 𝑘]
𝑘=0
𝑀
𝑏 , 0≤𝑛≤𝑀
ℎ 𝑛 = 𝑏𝑘 𝛿[𝑛 − 𝑘] = ቊ 𝑘
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
𝑘=0
LCCDE
• In this special case, as the impulse response of the system is
the impulse coefficients, we have:
𝑀 𝑀
𝑦 𝑛 = 𝑏𝑘 𝑥[𝑛 − 𝑘] = ℎ[𝑘]𝑥[𝑛 − 𝑘]
𝑘=0 𝑘=0
𝑛 = −1 ∶ 𝑦 −1 = 𝑥 −1 + 𝑥 −2 = 1
𝑛 = 0 ∶ 𝑦 0 = 𝑥 0 + 𝑥 −1 = 3
𝑛 =1 ∶ 𝑦 1 =𝑥 1 +𝑥 0 =2
𝑛 = 2 ∶ 𝑦 2 = 𝑥 2 + 𝑥 1 = −1
𝑛 = 3 ∶ 𝑦 3 = 𝑥 3 + 𝑥 2 = −1
𝑛≥4 ∶ 𝑥 𝑛 = 0 𝑎𝑛𝑑 𝑦 𝑛 = 0
LCCDE
• The output is:
LCCDE: Recursive
• If an LCCDE system’s output depends only on the input’s
present and past values, this system is termed as non-
recursive
• If, on the other hand, the output also depends on the past
values of the output, then this system is termed as recursive
• For recursive systems, knowing only the input values are not
sufficient, and the starting conditions for the system should
be known / provided.
LCCDE: Recursive
• Example: Find the output of the accumulator system for the
input signal 𝑥 𝑛 shown below.
LCCDE: Recursive
• The accumulator system is:
𝑦 𝑛 = 𝑥[𝑘]
𝑘=−∞
• In LCCDE representation:
𝑦 𝑛 = 𝑦 𝑛 − 1 + 𝑥[𝑛]
LCCDE: Recursive
• Note that for this case we need an initial value for y:
𝑦 0 = 𝑦 −1 + 𝑥 0 , 𝑦 −1 =?
𝑦 0 = 𝑎𝑦 −1 + 𝑥 0 = 𝑎 + 𝑏
𝑦 1 = 𝑎𝑦 0 + 𝑥 1 = 𝑎 𝑎 + 𝑏 + 0 = 𝑎2 + 𝑎𝑏
𝑦 2 = 𝑎𝑦 1 + 𝑥 2 = 𝑎3 + 𝑎2 𝑏
𝑦 3 = 𝑎𝑦 2 + 𝑥 3 = 𝑎4 + 𝑎3 𝑏
...
LCCDE: Recursive
𝑦 −1 = 𝑎𝑦 −2 + 𝑥 −1 = 1 ⇒ 𝑦 −2 = 𝑎−1
𝑦 −2 = 𝑎𝑦 −3 + 𝑥 −2 = 𝑎−1 ⇒ 𝑦 −3 = 𝑎−2
𝑦 −4 = 𝑎−3
𝑦 −5 = 𝑎−4
...
LCCDE: Recursive
• Overall, the system output is:
𝑎 𝑛+1 + 𝑎 𝑛 𝑏 𝑛≥0
𝑦 𝑛 =ቊ
𝑎𝑛+1 𝑛<0
= 𝑎𝑛+1 + 𝑎𝑛 𝑏𝑢[𝑛]
𝑥 𝑛 = 0 ⇒ 𝑦 𝑛 = 𝑎𝑛+1
𝑦 0 = 𝑎𝑦 −1 + 𝑥 0 = 0 + 𝑏 = 𝑏
𝑦 1 = 𝑎𝑦 0 + 𝑥 1 = 𝑎 𝑏 + 0 = 𝑎𝑏
𝑦 2 = 𝑎𝑦 1 + 𝑥 2 = 𝑎2 𝑏
𝑦 3 = 𝑎𝑦 2 + 𝑥 3 = 𝑎3 𝑏
...
LCCDE: Recursive
𝑦 −1 = 𝑎𝑦 −2 + 𝑥 −1 = 0 ⇒ 𝑦 −2 = 0
𝑦 −2 = 𝑎𝑦 −3 + 𝑥 −2 = 0 ⇒ 𝑦 −3 = 0
𝑦 −4 = 0
𝑦 −5 = 0
...
LCCDE: Recursive
• Overall, in this case the system output is:
𝑦 𝑛 = 𝑎𝑛 𝑏𝑢[𝑛]
𝑎𝑘 𝑦[𝑛 − 𝑘] = 𝑏𝑘 𝑥[𝑛 − 𝑘]
𝑘=0 𝑘=0
• If 𝑥 𝑛 = 0 :
𝑎𝑘 𝑦[𝑛 − 𝑘] = 0
𝑘=0
𝑎𝑘 𝑦[𝑛 − 𝑘] = 𝑏𝑘 𝑥[𝑛 − 𝑘]
𝑘=0 𝑘=0
𝑦 𝑛 = 𝑦ℎ 𝑛 + 𝑦𝑝 𝑛
LCCDE: Zero-input and zero-state
• However, finding the system’s output for a particular input
signal can be challenging
𝑦 𝑛 = 𝑦𝑧𝑖 𝑛 + 𝑦𝑧𝑠 𝑛
𝑎𝑘 𝑦𝑧𝑖 [𝑛 − 𝑘] = 0
𝑘=0
LCCDE: Zero-input response
𝑁
⇒ 𝑎0 + 𝑎1 𝛾 −1 + ⋯ + 𝑎𝑁 𝛾 −𝑁 = 0
LCCDE: Zero-input response
• This equation is an N. degree polinome, and hence has N number of
roots
𝑄 𝛾 = 𝛾 − 𝛾1 𝛾 − 𝛾2 … 𝛾 − 𝛾𝑁 = 0
𝑄 𝛾 = 𝛾 − 𝛾1 𝑟 𝛾 − 𝛾𝑟+1 𝛾 − 𝛾𝑟+2 … 𝛾 − 𝛾𝑁 = 0
1 − 5𝛾 −1 + 6𝛾 −2 = 0
⇒ 1 − 3𝛾 −1 1 − 2𝛾 −1 = 0
⇒ 𝑦𝑧𝑖 𝑛 = 𝑐1 3𝑛 + 𝑐2 2𝑛
LCCDE: Zero-input response
• The starting conditions 𝑦 −1 = 1 and 𝑦 −2 = 0 are caused by the
zero-input response, therefore:
⇒ 𝑐1 = 9 , 𝑐2 = −4
1 − 3𝛾 −1 − 4𝛾 −2 = 0
⇒ 1 + 𝛾 −1 1 − 4𝛾 −1 = 0
⇒ 𝑦𝑧𝑖 𝑛 = 𝑐1 −1 𝑛 + 𝑐2 4𝑛
LCCDE: Zero-input response
• 𝑦 −1 = 5 and 𝑦 −2 = 0:
𝑦𝑧𝑖 −1 = 𝑐1 −1 −1 + 𝑐2 4−1 = 5
𝑦𝑧𝑖 −2 = 𝑐1 −1 −2 + 𝑐2 4−2 = 0
⇒ 𝑐1 = −1 , 𝑐2 = 16
1 + 6𝛾 −1 + 9𝛾 −2 = 0
⇒ 1 + 3𝛾 −1 1 + 3𝛾 −1 = 0
⇒ 𝑦𝑧𝑖 𝑛 = 𝑐1 + 𝑐2 𝑛 −3 𝑛
LCCDE: Zero-input response
• 𝑦 −1 = −1/3 and 𝑦 −2 = −2/9:
𝑦𝑧𝑖 −1 = 𝑐1 − 𝑐2 −3 −1 = −1/3
⇒ 𝑐1 = 4 , 𝑐2 = 3
⇒ 𝑦𝑧𝑖 𝑛 = 4 + 3𝑛 −3 𝑛
LCCDE: Impulse response
• LCCDE representation is:
𝑁 𝑀
𝑎𝑘 𝑦[𝑛 − 𝑘] = 𝑏𝑘 𝑥[𝑛 − 𝑘]
𝑘=0 𝑘=0
𝑁 𝑀
𝑄 𝐷 −1 = 𝑎𝑘 𝐷 −𝑘 𝑎𝑛𝑑 𝑃 𝐷 −1 = 𝑏𝑘 𝐷 −𝑘
𝑘=0 𝑘=0
𝑄 𝐷 −1 𝑦 𝑛 = 𝑃 𝐷 −1 𝑥[𝑛]
LCCDE: Impulse response
• For a unit impulse input, we have:
𝑄 𝐷 −1 ℎ 𝑛 = 𝑃 𝐷 −1 𝛿[𝑛]
𝑃 𝐷 −1
ℎ𝑛 = −1
𝛿[𝑛]
𝑄 𝐷
𝑀−𝑁
ℎ 𝑛 = 𝐴𝑘 𝛿[𝑛 − 𝑘] + 𝑦𝑑 𝑛 𝑢[𝑛]
𝑘=0
ℎ 𝑛 = 𝑦𝑑 𝑛 𝑢 𝑛 , 𝑀<𝑁
ℎ 𝑛 = 𝐴0 𝛿 𝑛 + 𝑦𝑑 𝑛 𝑢 𝑛 , 𝑀=𝑁
𝑀−𝑁
ℎ 𝑛 = 𝐴𝑘 𝛿[𝑛 − 𝑘] + 𝑦𝑑 𝑛 𝑢 𝑛 , 𝑀>𝑁
𝑘=0
• Let’s see how to find the impulse reponse through some examples:
LCCDE: Impulse response
• Example: Find the impulse response for the system defined by:
𝑦 𝑛 − 5𝑦 𝑛 − 1 + 6𝑦 𝑛 − 2 = 2𝑥 𝑛 − 𝑥[𝑛 − 1]
1 − 5𝛾 −1 + 6𝛾 −2 = 1 − 3𝛾 −1 1 − 2𝛾 −1 = 0
𝑦𝑑 𝑛 = 𝑐1 3𝑛 + 𝑐2 2𝑛
LCCDE: Impulse response
𝑦 𝑛 − 5𝑦 𝑛 − 1 + 6𝑦 𝑛 − 2 = 2𝑥 𝑛 − 𝑥[𝑛 − 1]
Note that the equation involves two delays on the left side and one on the
right side, which means N = 3 and M = 2
As M < N, we have:
ℎ 𝑛 = 𝑦𝑑 𝑛 𝑢 𝑛 = 𝑐1 3𝑛 + 𝑐2 2𝑛 𝑢[𝑛]
LCCDE: Impulse response
Trying y 𝑛 − 5𝑦 𝑛 − 1 + 6𝑦 𝑛 − 2 = 2𝑥 𝑛 − 𝑥[𝑛 − 1] for some
values of 𝑛 with the impulse input:
𝑛 = 0 ⇒ ℎ 0 − 5ℎ −1 + 6ℎ −2 = 2𝛿 0 − 𝛿 −1
⇒ ℎ 0 −0+0=2−0 ⇒ ℎ 0 =2
𝑛 = 1 ⇒ ℎ 1 − 5ℎ 0 + 6ℎ −1 = 2𝛿 1 − 𝛿 0
⇒ ℎ 1 − 10 + 0 = 0 − 1 ⇒ ℎ 1 = 9
𝑛 = 2 ⇒ ℎ 2 − 5ℎ 1 + 6ℎ 0 = 2𝛿 2 − 𝛿 1
⇒ ℎ 2 − 45 + 12 = 0 − 00 ⇒ ℎ 2 = 33
LCCDE: Impulse response
ℎ 𝑛 = 𝑦𝑑 𝑛 𝑢 𝑛 = 𝑐1 3𝑛 + 𝑐2 2𝑛 𝑢[𝑛]
ℎ 0 = 𝑐1 30 + 𝑐2 20 𝑢 𝑛 = 2
⇒ 𝑐1 + 𝑐2 = 2
ℎ 1 = 𝑐1 31 + 𝑐2 21 𝑢 𝑛 = 9
⇒ 3𝑐1 + 2𝑐2 = 9
⇒ 𝑐1 = 5 , 𝑐2 = −3
⇒ℎ 𝑛 = 5 3𝑛 + −3 2𝑛 𝑢[𝑛]
LCCDE: Impulse response
• Example: Find the impulse response for the system defined by:
𝑦𝑑 𝑛 = 𝑐1 0.6𝑛 + 𝑐2 0.2𝑛
LCCDE: Impulse response
𝑦 𝑛 − 0.8𝑦 𝑛 − 1 + 0.12𝑦 𝑛 − 2 = 0.3𝑥 𝑛 + 0.4𝑥 𝑛 − 1 + 0.2𝑥 𝑛 − 2
Note that the equation involves two delays on the left side and two on the
right side, which means N = 3 and M = 3
As M = N, we have:
⇒ ℎ 0 − 0 + 0 = 0.3 + 0 + 0 ⇒ ℎ 0 = 0.3
⇒ 𝐴0 + 𝑐1 + 𝑐2 = 0.3
𝑦𝑧𝑠 𝑛 = 𝑥 𝑛 ∗ ℎ[𝑛]
𝑦 𝑛 = 𝑦𝑧𝑖 𝑛 + 𝑦𝑧𝑠 𝑛
• Note that we prefer LTI systems overall, in which case zero-input response
will be zero, and the system’s total output is equal to the zero-state response