ENع
→Inverse Z-transform
الدرس 34 · The Z-transform

The inverse Z-transform with partial fractions

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

16 دقيقة10 خطوات5 أسئلةAdvanced
عن هذا الدرس

Go back from X(z) to the samples x[n]. Take X(z) = 1/(1 − 0.75z⁻¹ + 0.125z⁻²) with ROC |z| > 0.5: factor the bottom to find the poles 0.5 and 0.25, split it into two simple fractions with the cover-up rule, look each one up in the pair aⁿu[n] ↔ 1/(1 − az⁻¹), and let the region of convergence choose right-sided or left-sided. The answer x[n] = 2(0.5)ⁿ − (0.25)ⁿ is checked against the recursion the same X(z) describes, and against SciPy's residuez and lfilter. It builds on the lesson on the Z-transform and its region of convergence; the Laplace version of the same method is in the Circuits lesson on Laplace analysis.

ستتعلّم

حدّد ما تشعر بأنك أتقنته. هذا التقييم الذاتي لا يؤثر في درجة الدرس.

شكل 34 · تفاعلي
01 / 10

From X(z) back to x[n]

The Z-transform turned a list of samples into a function of z. Now go back. Here X(z) = 1/(1 − 0.75z⁻¹ + 0.125z⁻²) with ROC |z| > 0.5. Which samples x[n] made it? Finding them is the inverse Z-transform.

given   X(z) = 1 / (1 − 0.75z⁻¹ + 0.125z⁻²)
        ROC (region of convergence): |z| > 0.5
wanted  x[n] for every n

three ways back:
  partial fractions + a pair table   <- this lesson
  long division (a power series in z⁻¹)
  a contour integral (residues)

z⁻¹ = "one sample later"
جارٍ تحميل الرسم…
أو ← →
اقرأ الدرس خطوة بخطوة
  1. From X(z) back to x[n]

    The Z-transform turned a list of samples into a function of z. Now go back. Here X(z) = 1/(1 − 0.75z⁻¹ + 0.125z⁻²) with ROC |z| > 0.5. Which samples x[n] made it? Finding them is the inverse Z-transform.

    given   X(z) = 1 / (1 − 0.75z⁻¹ + 0.125z⁻²)
            ROC (region of convergence): |z| > 0.5
    wanted  x[n] for every n
    
    three ways back:
      partial fractions + a pair table   <- this lesson
      long division (a power series in z⁻¹)
      a contour integral (residues)
    
    z⁻¹ = "one sample later"
  2. Factor the bottom: the poles

    Factor the denominator: 1 − 0.75z⁻¹ + 0.125z⁻² = (1 − 0.5z⁻¹)(1 − 0.25z⁻¹). It is zero at z = 0.5 and z = 0.25, so X(z) blows up there: the poles. A zero is where X(z) equals 0; here z = 0, twice.

    1 − 0.75z⁻¹ + 0.125z⁻²
      = (1 − 0.5z⁻¹)(1 − 0.25z⁻¹)
    check: 0.5 + 0.25 = 0.75,  0.5 × 0.25 = 0.125
    
    X(z) = z² / ((z − 0.5)(z − 0.25))
    
    poles  (×)  z = 0.5,  z = 0.25
    zeros  (○)  z = 0, twice
    
    poles = numbers that make the bottom 0
  3. Split into partial fractions

    Two different poles, so X(z) can be written as a sum of two simple fractions, one pole each: A/(1 − 0.5z⁻¹) + B/(1 − 0.25z⁻¹). This works because the top (degree 0 in z⁻¹) is lower than the bottom (degree 2).

    X(z) = A / (1 − 0.5z⁻¹)  +  B / (1 − 0.25z⁻¹)
    
    one fraction per pole (all poles different)
    
    needs: degree of top < degree of bottom
      top 1           degree 0 in z⁻¹
      bottom ...z⁻²   degree 2   -> fine
    (otherwise divide first; the leftover
     polynomial is the "k" part)
  4. Cover-up: find A and B

    Cover up one factor and put its pole into what is left. For A, z = 0.5 so z⁻¹ = 2: A = 1/(1 − 0.25·2) = 2. For B, z = 0.25 so z⁻¹ = 4: B = 1/(1 − 0.5·4) = −1.

    A = (1 − 0.5z⁻¹)·X(z) at z = 0.5
      = 1 / (1 − 0.25z⁻¹),  z⁻¹ = 2
      = 1 / (1 − 0.5) = 2
    
    B = (1 − 0.25z⁻¹)·X(z) at z = 0.25
      = 1 / (1 − 0.5z⁻¹),   z⁻¹ = 4
      = 1 / (1 − 2) = −1
    
    check: 2(1 − 0.25z⁻¹) − (1 − 0.5z⁻¹)
         = 2 − 0.5z⁻¹ − 1 + 0.5z⁻¹ = 1  ✓
  5. Look each piece up

    One pair does all the work: aⁿu[n] ↔ 1/(1 − az⁻¹). Here u[n] is the unit step: 1 for n ≥ 0, 0 before. Piece one has a = 0.5, piece two has a = 0.25. Each fraction is a geometric sequence in disguise.

    aⁿ·u[n]  ->  sum of aⁿz⁻ⁿ for n ≥ 0
              = 1 / (1 − a·z⁻¹)   (geometric series,
                                   needs |a·z⁻¹| < 1)
    
    u[n] = 1 for n ≥ 0, 0 for n < 0
    
    piece 1:  2/(1 − 0.5z⁻¹)   a = 0.5
    piece 2: −1/(1 − 0.25z⁻¹)  a = 0.25
  6. The ROC picks the answer

    Two different sequences share the fraction 1/(1 − az⁻¹); only the ROC tells them apart. Our ROC |z| > 0.5 lies outside both poles, so both pieces are right-sided (causal). With |z| < 0.25, both would be left-sided.

    same fraction, two sequences:
      aⁿ·u[n]       ROC |z| > |a|
      −aⁿ·u[−n−1]   ROC |z| < |a|
    
    the ROC never contains a pole
    our ROC |z| > 0.5: outside 0.5 and 0.25
      -> both pieces use aⁿ·u[n]
    
    ROC 0.25 < |z| < 0.5 would mix them:
      −2(0.5)ⁿu[−n−1] − (0.25)ⁿu[n]
  7. Two shrinking sequences

    Piece one is 2(0.5)ⁿu[n]: 2, 1, 0.5, 0.25 … Piece two is −(0.25)ⁿu[n]: −1, −0.25, −0.0625 … Each pole sets how fast its piece shrinks. The pole nearer 0 dies out faster.

    n            0     1      2       3
    2·(0.5)ⁿ     2     1      0.5     0.25
    −(0.25)ⁿ    −1    −0.25  −0.0625 −0.015625
    
    each step multiplies by the pole:
      piece 1 halves, piece 2 quarters
    |pole| < 1 -> the piece decays to 0
  8. Add them, sample by sample

    x[n] = 2(0.5)ⁿ − (0.25)ⁿ for n ≥ 0. So x[0] = 2 − 1 = 1, x[1] = 1 − 0.25 = 0.75, x[2] = 0.4375, x[3] = 0.234375. That is the inverse Z-transform.

    x[n] = 2·(0.5)ⁿ·u[n] − (0.25)ⁿ·u[n]
    
     x[0] = 2      − 1        = 1
     x[1] = 1      − 0.25     = 0.75
     x[2] = 0.5    − 0.0625   = 0.4375
     x[3] = 0.25   − 0.015625 = 0.234375
     x[4] = 0.125  − 0.00390625
          = 0.12109375
    
    (cells show 4 decimals)
  9. Check with the recursion

    Cross-multiply: X(z)(1 − 0.75z⁻¹ + 0.125z⁻²) = 1. In time that says x[n] = 0.75x[n−1] − 0.125x[n−2] + δ[n], where the unit impulse δ[n] is 1 at n = 0, else 0. Run it: 1, 0.75, 0.4375, 0.234375. Same numbers, so the split was right.

    X(z) − 0.75z⁻¹X(z) + 0.125z⁻²X(z) = 1
    z⁻¹ = one sample later, 1 <-> δ[n]:
    x[n] = 0.75x[n−1] − 0.125x[n−2] + δ[n]
    
     x[0] = 1
     x[1] = 0.75·1             = 0.75
     x[2] = 0.75·0.75 − 0.125·1 = 0.4375
     x[3] = 0.328125 − 0.09375  = 0.234375
    
    this is also "long division", one
    sample at a time
  10. Partial fractions in Python

    In Python 3 with SciPy, signal.residuez(b, a) does the split: residues r = [−1, 2] (our B and A) at poles p = [0.25, 0.5]. signal.lfilter on an impulse runs the recursion. Both give x[n] = 1, 0.75, 0.4375 …

    from scipy import signal
    b, a = [1], [1, -0.75, 0.125]
    r, p, k = signal.residuez(b, a)
    d = [1, 0, 0, 0, 0]
    x = signal.lfilter(b, a, d)
    
    >>> r, p, k
    (array([-1.,  2.]), array([0.25, 0.5 ]),
     array([], dtype=float64))
    >>> x
    array([1.        , 0.75      , 0.4375    ,
           0.234375  , 0.12109375])
    
    (Python 3, SciPy 1.18; p sorted by size)

اختبار يتاح بعد الخطوة الأخيرة.