Pulse shaping and bandwidth
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.
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
Read the lesson step by step
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) takesBits 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)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 spectrumThe 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)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%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)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³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 frequencyThe 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 lessonPulse 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)
5 quick questions
Choose one answer per question. You can change your choices before checking them.
01What does the pulse-shaping filter do in a PAM transmitter?
The mapper makes the numbers a_k; the filter's impulse response is p(t), so a spike a_k·δ(t − kT) comes out as a_k·p(t − kT). The sum of all the copies is s(t).
02Polar NRZ uses a rectangular pulse one symbol wide. Why is its signal not band-limited?
The Fourier transform of a rectangle is a sinc, and sinc² has lobes at every frequency, shrinking like 1/f². About 90.3% of the power is below 1/T, but keeping 99% needs about 10.3/T.
03A raised-cosine pulse with roll-off β = 0.25 carries 2000 symbols per second. What baseband bandwidth does it use?
T = 0.5 ms, so the bandwidth is (1 + β)/(2T) = 1.25 / 0.001 s = 1250 Hz. With β = 0 (a sinc) it would be the Nyquist bandwidth, 1000 Hz.
04Why is the sinc pulse, the narrowest of the three, hard to use in practice?
A spectrum with a sharp edge needs a pulse that lasts forever. The raised cosine rounds the edge, spends β more bandwidth, and its tails shrink like 1/t³, so a short filter is enough.
05The receiver samples s(t) = Σ a_j·p(t − jT) at t = kT. Which property of p makes s(kT) = a_k?
Then every other copy is zero at t = kT and only a_k·p(0) = a_k is left. Sinc, raised cosine and the one-symbol rectangle all have this property (Gallager calls it ideal Nyquist).
Glossary
- Symbol time T
- The time between symbols; one bit per symbol here, so T = 1/R = 1 ms at 1000 bit/s.
- PAM (pulse-amplitude modulation)
- Sending a sequence of numbers a_k as s(t) = Σ a_k·p(t − kT): each number sets the height of one copy of the pulse.
- Pulse-shaping filter
- The transmit filter whose impulse response is the pulse p(t); it turns each symbol spike into a pulse.
- Power spectral density (PSD)
- How a random signal's power is spread over frequency. For independent, equally likely ±1 symbols, S(f) = |P(f)|²/T.
- Bandwidth
- The range of positive frequencies a signal occupies. For a pulse that never stops leaking, say what share of the power you mean, such as 90% or 99%.
- Nyquist bandwidth
- 1/(2T): the smallest bandwidth that can carry 1/T symbols a second with no interference at the sampling times; the sinc pulse uses exactly this.
- Raised cosine, roll-off β
- A pulse whose spectrum is flat, then falls along a cosine to zero at (1 + β)/(2T); β is the extra bandwidth as a fraction of 1/(2T).
- sinc(x)
- sin(πx)/(πx), equal to 1 at x = 0 and zero at every other whole number; numpy.sinc uses this definition.
Notes and sources
- The bits, the rate of 1000 bit/s and the roll-off β = 0.35 are a chosen example; every curve and number in the figure is computed from this model (sums of the actual pulses, and the spectra from their Fourier transforms).
- The spectrum plot is the power spectral density for a long run of independent, equally likely bits, S(f) = |P(f)|²/T, not the spectrum of these eight bits alone. It is drawn for f ≥ 0; it is the same for negative f.
- Real links split the raised cosine between transmitter and receiver as two root-raised-cosine filters (see the matched filter lesson). Gallager notes roll-offs as small as 5-10% are used in practice.
- R. G. Gallager, MIT OCW 6.450 Principles of Digital Communications I, course notes ch. 6: PAM, the Nyquist criterion and raised-cosine pulses (eq. 6.17-6.18)
- MIT OpenCourseWare 6.450 Principles of Digital Communications I (L. Zheng, R. Gallager, Fall 2006)
- Stanford EE179 Analog and Digital Communication Systems, notes 'Line Coding for Digital Communication' (PSD of polar signalling |P(f)|²/T)
- J. G. Proakis, M. Salehi, Digital Communications, 5th ed., McGraw-Hill (preface: ch. 3 power spectra, ch. 9 band-limited channels)
- A. V. Oppenheim, A. S. Willsky, S. H. Nawab, Signals and Systems, 2nd ed., Pearson (Fourier transform of a rectangular pulse)
- MIT OpenCourseWare 6.003 Signals and Systems (D. Freeman, Fall 2011)
- MIT OpenCourseWare 6.02 Introduction to EECS II: Digital Communication Systems (H. Balakrishnan, G. Verghese, Fall 2012)
- Raised-cosine filter (Wikipedia): impulse response, bandwidth (1 + β)/(2T), value at t = ±T/(2β)
- Pulse shaping (Wikipedia): rectangular pulse gives an unlimited spectrum; sinc and raised cosine
- Nyquist ISI criterion (Wikipedia)
- NumPy documentation: numpy.sinc (sin(πx)/(πx))
- NumPy documentation: numpy.convolve (mode 'same')
Quiz Unlocks after the last step.