ENع
←Pulse shaping
Lesson 54 · Digital communications: bits on a wire

Pulse shaping and bandwidth

18 min10 steps5 questionsAdvanced
About this lesson

A transmitter turns bits into a voltage by sending one pulse per symbol: s(t) = Σ a_k·p(t − kT). The pulse shape p(t) decides how much bandwidth the signal takes. Follow eight bits at 1000 bit/s through a pulse-shaping filter with three pulses: the rectangle of NRZ (whose spectrum never ends), the sinc (500 Hz, the Nyquist bandwidth) and the raised cosine with β = 0.35 (675 Hz). Then sample at t = kT to get the bits back, and do it all in Python with numpy. Builds on the lessons Bits on the wire, Line coding: NRZ, Manchester and friends, The Fourier transform, and Power spectral density and white noise. Why the zeros at t = kT matter, and how to design for them, come later in Intersymbol interference, The Nyquist pulse and raised cosine, and The matched filter.

You'll learn to

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

Fig 54 · Interactive
01 / 10

Bits to send

We want to send eight bits, 1 0 1 1 0 0 1 0, at 1000 bits per second. One bit leaves every T = 1 ms, the symbol time. A wire cannot carry numbers; it carries a voltage that changes over time.

bits     1 0 1 1 0 0 1 0
rate     R = 1000 bit/s
symbol   T = 1 / R = 1 ms

the job of this lesson:
  bits  ->  a voltage s(t) on the wire
  and how much bandwidth s(t) takes
Loading figure…
or ← →
Read the lesson step by step
  1. Bits to send

    We want to send eight bits, 1 0 1 1 0 0 1 0, at 1000 bits per second. One bit leaves every T = 1 ms, the symbol time. A wire cannot carry numbers; it carries a voltage that changes over time.

    bits     1 0 1 1 0 0 1 0
    rate     R = 1000 bit/s
    symbol   T = 1 / R = 1 ms
    
    the job of this lesson:
      bits  ->  a voltage s(t) on the wire
      and how much bandwidth s(t) takes
  2. Bits become amplitudes

    First each bit becomes a number: 1 → +1 V and 0 → −1 V. This is polar signalling, from the line coding lesson. Picture each number a_k as a thin spike at its own time t = kT.

    mapper:  a_k = 2·bit − 1
    
     k    0   1   2   3   4   5   6   7
     bit  1   0   1   1   0   0   1   0
     a_k  +1  −1  +1  +1  −1  −1  +1  −1
    
    spike train: Σ a_k·δ(t − kT)
    (δ = an impulse: all its area at one instant)
  3. A filter turns spikes into pulses

    A pulse-shaping filter replaces each spike with one fixed pulse p(t), scaled by a_k and centred at kT. Adding all the copies gives the signal on the wire: s(t) = Σ a_k·p(t − kT).

    filter impulse response = p(t)
    spike a_k·δ(t − kT)  ->  a_k·p(t − kT)
    
    s(t) = Σ a_k·p(t − kT),  k = 0 .. 7
    
    this is pulse-amplitude modulation (PAM):
    the bits set the heights,
    the pulse sets the shape and the spectrum
  4. The rectangle: NRZ

    The simplest pulse is a rectangle one symbol wide: p(t) = 1 for |t| < T/2. The copies sit edge to edge and make the familiar NRZ square wave. Its sudden jumps are the problem, as its spectrum shows.

    p(t) = 1  for |t| < T/2
           0  elsewhere
    
    s(t) jumps between +1 V and −1 V
    exactly at t = kT + T/2
    
    s(t) = +1 −1 +1 +1 −1 −1 +1 −1
    (one level per symbol: polar NRZ)
  5. Its spectrum never ends

    For random bits the power spectrum is S(f) = T·sinc²(fT). It is zero at 1, 2, 3 kHz but never ends: 90.3% of the power lies below 1 kHz, and keeping 99% takes about 10.3 kHz.

    power spectral density (PSD) for random ±1 bits:
      S(f) = |P(f)|² / T
    rect: P(f) = T·sinc(fT),  sinc(x) = sin(πx)/(πx)
      S(f) = T·sinc²(fT)
    
    plot: 10·log10(S(f)/T) in dB (0 dB at f = 0)
    nulls at f = 1, 2, 3 ... kHz
    first side lobe −13.3 dB at 1.43 kHz
    
    power below 1 kHz   90.3%
    power below 10.3 kHz 99%
  6. The narrowest: a sinc pulse

    The sinc pulse p(t) = sinc(t/T) has a flat spectrum up to 1/(2T) = 500 Hz and none above. Nothing narrower can carry 1000 symbols a second without them interfering. The cost: in time it never ends, and its tails shrink only like 1/t.

    p(t) = sinc(t/T)
    P(f) = T  for |f| < 1/(2T)
           0  above
    
    bandwidth 1/(2T) = 500 Hz  (100% of the power)
    this is the Nyquist bandwidth: the least
    any zero-ISI pulse at 1/T symbols/s can use
    
    p(kT) = 0 for every k ≠ 0
    tails fall like 1/t: very long filters
    (why zeros at kT matter: the lesson
     The Nyquist pulse and raised cosine)
  7. The practical one: raised cosine

    The raised-cosine pulse rounds off the spectrum's edge, here with roll-off β = 0.35. It uses (1 + β)/(2T) = 675 Hz, 35% more than sinc, but its tails shrink like 1/t³, so a short filter can make it.

    P(f)/T = 1                     |f| ≤ (1−β)/(2T)
           = cos²(πT/(2β)·(|f| − (1−β)/(2T)))
                                   up to (1+β)/(2T)
           = 0                     above
    
    β = 0.35:  flat to 325 Hz, zero above 675 Hz
    p(t) = sinc(t/T)·cos(πβt/T) / (1 − (2βt/T)²)
    p(kT) = 0 for k ≠ 0, tails fall like 1/t³
  8. Time against bandwidth

    Same bits, three pulses. The rectangle needs about 1 kHz for 90% and leaks forever; raised cosine needs 675 Hz, sinc 500 Hz. Short, sharp pulses spread in frequency; smooth, long pulses stay narrow.

    at 1000 bit/s (T = 1 ms):
    
    pulse          bandwidth        length in time
    rect           ~1 kHz (90%),    T
                   10.3 kHz (99%)
    raised cosine  675 Hz (100%)    tails ~ 1/t³
    sinc           500 Hz (100%)    tails ~ 1/t
    
    narrow in time  <->  wide in frequency
  9. The receiver samples at t = kT

    The receiver reads s(t) once per symbol, at t = kT. Each raised-cosine copy is zero at every other symbol's time, so s(kT) = a_k exactly. The sign gives each bit back: 1 0 1 1 0 0 1 0.

    s(kT) = Σ_j a_j·p((k − j)T) = a_k
    because p(0) = 1 and p(mT) = 0 for m ≠ 0
    
     k      0    1    2    3    4    5    6    7
     s(kT) +1   −1   +1   +1   −1   −1   +1   −1
     bit    1    0    1    1    0    0    1    0
    
    between the sampling times the copies overlap:
    harmless here. If another copy is NOT zero
    at a sampling time (wrong pulse, a smearing
    channel, a timing error) it adds to that
    sample: intersymbol interference (ISI),
    the Intersymbol interference lesson
  10. Pulse shaping in Python

    In Python with numpy: make the ±1 symbols, place them 16 samples apart in an array of zeros, and convolve with raised-cosine taps p. Every 16th output sample is a symbol again.

    import numpy as np
    bits = [1, 0, 1, 1, 0, 0, 1, 0]
    t = np.arange(-48, 49) / 16       # time in T, ±3T
    p = np.sinc(t) * np.cos(np.pi*0.35*t) \
        / (1 - (2*0.35*t)**2)
    a = 2*np.array(bits) - 1
    up = np.zeros(8*16)
    up[::16] = a
    s = np.convolve(up, p, "same")
    print(s[::16])
    
    [ 1. -1.  1.  1. -1. -1.  1. -1.]
    
    (Python 3 with numpy; 16 samples per symbol;
     "same" keeps s lined up with up)

Quiz Unlocks after the last step.