ENع
←Shift, scale, flip
Lesson 03 · Signals and systems in continuous time

Shifting, scaling and flipping signals

14 min9 steps5 questionsBeginner
About this lesson

Three simple changes to the time of a signal come up everywhere in signals and systems: shifting it (a delay), scaling it (playing faster or slower) and flipping it (playing backwards). Follow a 2-second voltage pulse on a tape: a player reads the tape at a new time τ = a·t + b and writes y(t) = x(τ). You will see why x(t − 1) moves right, why x(2t) squeezes, why x(−t) mirrors, and how to do two at once in the right order. It helps to have done the lessons What a signal is and Periodic, even, odd, energy and power signals.

You'll learn to

Tick what you feel confident about. These self-checks do not affect your lesson score.

Fig 3 · Interactive
01 / 09

A pulse stored on tape

A recorder stored a voltage pulse x(t) on tape. It stays at 1 V for one second, then falls steadily to 0 V at t = 2 s. The coloured stretch of tape, from 0 to 2 s, holds it.

x(t) = 1 V        for 0 ≤ t ≤ 1 s
x(t) = 2 − t  V   for 1 ≤ t ≤ 2 s
x(t) = 0          everywhere else

x(0)   = 1 V
x(1.5) = 0.5 V   <- we follow this point
x(2)   = 0 V

the pulse is not symmetric,
so a flip will be easy to see
Loading figure…
or ← →
Read the lesson step by step
  1. A pulse stored on tape

    A recorder stored a voltage pulse x(t) on tape. It stays at 1 V for one second, then falls steadily to 0 V at t = 2 s. The coloured stretch of tape, from 0 to 2 s, holds it.

    x(t) = 1 V        for 0 ≤ t ≤ 1 s
    x(t) = 2 − t  V   for 1 ≤ t ≤ 2 s
    x(t) = 0          everywhere else
    
    x(0)   = 1 V
    x(1.5) = 0.5 V   <- we follow this point
    x(2)   = 0 V
    
    the pulse is not symmetric,
    so a flip will be easy to see
  2. Playback: read τ, write y(t)

    A player makes a new signal y(t). At each output time t, its read head sits at an input time τ (tau) and copies that value: y(t) = x(τ). Plain playback reads τ = t, so y is a copy of x.

    every operation in this lesson is
    one rule for the read head:
    
      y(t) = x(τ),   τ = a·t + b
    
    plain playback: a = 1, b = 0
      t =     0  ->  τ =     0  ->  y = 1.0 V
      t =     1  ->  τ =     1  ->  y = 1.0 V
      t =   1.5  ->  τ =   1.5  ->  y = 0.5 V
    
    both heads move together
  3. Shift: x(t − 1) is 1 s late

    Now the player reads τ = t − 1: the read head stays 1 s behind. y(t) = x(t − 1) is the same pulse, 1 s later (right). Check: y(2.5) = x(1.5) = 0.5 V. A plus, x(t + 1), moves it earlier.

    y(t) = x(t − 1)     a = 1, b = −1
      t =     1  ->  τ =     0  ->  y = 1.0 V
      t =     2  ->  τ =     1  ->  y = 1.0 V
      t =   2.5  ->  τ =   1.5  ->  y = 0.5 V
      t =     3  ->  τ =     2  ->  y = 0.0 V
    
    pulse now from 1 s to 3 s
    
    x(t − t0), t0 > 0:  later  (right)
    x(t + t0), t0 > 0:  earlier (left)
    the sign looks backwards: think
    "y reads what x did t0 ago"
  4. Scale: x(2t) plays twice as fast

    With τ = 2t the read head covers 2 s of tape every second. The pulse now lasts 1 s instead of 2: y(t) = x(2t) is squeezed toward t = 0. Its height stays 1 V. Check: y(0.75) = x(1.5) = 0.5 V.

    y(t) = x(2t)        a = 2
      t =     0  ->  τ =     0  ->  y = 1.0 V
      t =   0.5  ->  τ =     1  ->  y = 1.0 V
      t =  0.75  ->  τ =   1.5  ->  y = 0.5 V
      t =     1  ->  τ =     2  ->  y = 0.0 V
    
    pulse now from 0 s to 1 s
    width 2 s / 2 = 1 s
    height unchanged: 1 V
    t = 0 stays where it is
  5. Scale: x(t/2) plays at half speed

    With τ = t/2 the head covers only half a second of tape per second, so the pulse stretches to 4 s. A number above 1 in front of t squeezes; a number between 0 and 1 stretches. Check: y(3) = x(1.5) = 0.5 V.

    y(t) = x(t/2)       a = 1/2
      t =     0  ->  τ =     0  ->  y = 1.0 V
      t =     2  ->  τ =     1  ->  y = 1.0 V
      t =     3  ->  τ =   1.5  ->  y = 0.5 V
      t =     4  ->  τ =     2  ->  y = 0.0 V
    
    pulse now from 0 s to 4 s
    width 2 s / (1/2) = 4 s
    
    x(a·t):  a > 1      squeeze
             0 < a < 1  stretch
  6. Flip: x(−t) plays backwards

    With τ = −t the read head runs backwards along the tape. y(t) = x(−t) is the mirror image of x about t = 0: it sits between −2 s and 0. Only a stored signal allows this: y(−2) needs x(2).

    y(t) = x(−t)        a = −1
      t =    −2  ->  τ =     2  ->  y = 0.0 V
      t =  −1.5  ->  τ =   1.5  ->  y = 0.5 V
      t =    −1  ->  τ =     1  ->  y = 1.0 V
      t =     0  ->  τ =     0  ->  y = 1.0 V
    
    pulse now from −2 s to 0 s
    the slope is on the left now
    
    while t moves forward,
    τ moves backward: time reversal
  7. Two at once: shift first

    Take y(t) = x(2t − 2). Do it in two moves. First the shift: v(t) = x(t − 2) moves the pulse 2 s later, to between 2 and 4 s. The −2 stays inside, with the input time.

    goal:  y(t) = x(2t − 2)
    
    move 1, shift by 2:
      v(t) = x(t − 2)
      t =     2  ->  τ =     0  ->  y = 1.0 V
      t =     3  ->  τ =     1  ->  y = 1.0 V
      t =   3.5  ->  τ =   1.5  ->  y = 0.5 V
      t =     4  ->  τ =     2  ->  y = 0.0 V
    
    pulse now from 2 s to 4 s
  8. Then scale: x(2t − 2)

    Then replace t with 2t: y(t) = v(2t) = x(2t − 2). The pulse is squeezed toward t = 0 and lands between 1 and 2 s. Check one point: y(1) = x(2·1 − 2) = x(0) = 1 V.

    move 2, scale by 2:
      y(t) = v(2t) = x(2t − 2)
      t =     1  ->  τ =     0  ->  y = 1.0 V
      t =   1.5  ->  τ =     1  ->  y = 1.0 V
      t =  1.75  ->  τ =   1.5  ->  y = 0.5 V
      t =     2  ->  τ =     2  ->  y = 0.0 V
    
    pulse from 1 s to 2 s
    
    wrong order: scale, then shift by 2
      x(2(t − 2)) = x(2t − 4)  -> 2 s to 3 s
    scale first? then shift by 2/2 = 1:
      x(2(t − 1)) = x(2t − 2)  ✓
  9. The same in Python

    In Python with numpy, write x as a function and call it with a new time: x(t - 1) shifts, x(2*t) squeezes, x(-t) flips. Here y, the output tape, holds x(2t − 2) at 801 times from −3 to 5 s.

    import numpy as np
    def x(t):
        return np.clip(2-t,0,1)*(t>=0)
    t = np.linspace(-3, 5, 801)
    y = x(2*t - 2)
    
    >>> x(2*np.array([1, 1.75, 2]) - 2)
    array([1. , 0.5, 0. ])
    
    np.clip(2-t, 0, 1): 1 until t = 1,
      then 2 − t, then 0 from t = 2
    (t>=0): 0 before t = 0
    
    (Python 3 with numpy)

Quiz Unlocks after the last step.