Skip to content

Physical Layer | Computer Science

flowchart TD
A[2_Physical Layer] --> B[Key Concepts]
A --> C[Core Principles]
A --> D[Practical Applications]
B --> E[Fundamental definitions]
C --> F[Design patterns]
D --> G[Real-world usage]

The physical layer deals with transmitting raw bits over a physical medium. Bandwidth determines how many signal changes per second a channel can carry, while noise limits how many distinct signal levels can be reliably distinguished. The Nyquist theorem bounds the maximum bit rate for noiseless channels, and Shannon’s theorem extends this to noisy channels by incorporating signal-to-noise ratio. These fundamental limits apply regardless of the encoding scheme or technology used.

Guided media: Twisted pair (UTP, STP), coaxial cable, fibre optic.

  • Twisted pair: Category 5e/6/6a for Ethernet. Bandwidth up to 10 Gbps (Cat 6a, 100 m).
  • Fibre optic: Single-mode (long distance, laser) and multi-mode (shorter distance, LED). Bandwidth up to 100+ Gbps.

Unguided media: Radio waves, microwaves, infrared. Subject to attenuation, interference, and Line-of-sight constraints.

Analog vs. Digital. Analog signals vary continuously; digital signals are discrete.

  • Bandwidth: Range of frequencies a channel can carry, measured in Hz.
  • Bit rate: Number of bits transmitted per second (bps).
  • Nyquist theorem: For a noiseless channel of bandwidth HH Hz with VV discrete signal levels:

C=2Hlog2V  bpsC = 2H \log_2 V \;\mathrm{bps}

Theorem 2.1 (Nyquist—Shannon Sampling Theorem). A bandlimited signal of bandwidth HH Hz can Be perfectly reconstructed from samples taken at a rate of at least 2H2H samples per second.

Proof. Let x(t)x(t) be a signal with Fourier transform X(f)X(f) such that X(f)=0X(f) = 0 for f>H\lvert f \rvert \gt H. Sampling at rate fsf_s produces xs(t)=x(t)n=δ(tnTs)x_s(t) = x(t) \cdot \sum_{n=-\infty}^{\infty} \delta(t - nT_s) Where Ts=1/fsT_s = 1/f_s. In the frequency domain, Xs(f)=fsk=X(fkfs)X_s(f) = f_s \sum_{k=-\infty}^{\infty} X(f - kf_s). When fs2Hf_s \geq 2HThe spectral copies do not overlap, and x(t)x(t) can be recovered by an ideal Lowpass filter with cutoff HH. When fs<2Hf_s \lt 2HAliasing occurs and perfect recovery is Impossible. \blacksquare

  • Shannon capacity: For a noisy channel with signal-to-noise ratio SNR\mathrm{SNR}:

C=Hlog2(1+SNR)  bpsC = H \log_2(1 + \mathrm{SNR}) \;\mathrm{bps}

Theorem 2.2 (Shannon—Hartley Theorem). The channel capacity CC is the maximum error-free data Rate achievable on a channel of bandwidth HH with signal-to-noise ratio SNR\mathrm{SNR}.

Proof. For a bandlimited AWGN channel, the number of distinguishable signal levels is constrained By the noise power. Let SNR=S/N\mathrm{SNR} = S/N where SS is signal power and N=N0HN = N_0 H is noise Power. The number of distinguishable amplitude levels is proportional to 1+SNR\sqrt{1 + \mathrm{SNR}}. With log2\log_2 levels per signal element and 2H2H signal elements per second (Nyquist), the maximum Error-free rate is C=2H12log2(1+SNR)=Hlog2(1+SNR)C = 2H \cdot \tfrac{1}{2}\log_2(1 + \mathrm{SNR}) = H \log_2(1 + \mathrm{SNR}). \blacksquare

Example. A telephone line has H=3100H = 3100 Hz and SNR=3162\mathrm{SNR} = 3162 (35 dB). Shannon limit: C=3100×log2(3163)34860C = 3100 \times \log_2(3163) \approx 34860 bps.

Worked Example: Nyquist Bit Rate

A noiseless channel has a bandwidth of 4000 Hz. How many signal levels are needed to achieve a data Rate of 56000 bps?

Using Nyquist”s formula: C=2Hlog2VC = 2H \log_2 V 56000=2×4000×log2V56000 = 2 \times 4000 \times \log_2 V log2V=560008000=7\log_2 V = \frac{56000}{8000} = 7 V=27=128V = 2^7 = 128

Answer: 128 signal levels are required.

Worked Example: Shannon Channel Capacity

A satellite channel has a bandwidth of 36 MHz and an SNR of 30 dB. Find the maximum data rate.

First convert SNR from dB to linear: \mathrm{SNR_}{\mathrm{linear} = 10^{30/10} = 1000}

Apply Shannon’s formula: C=Hlog2(1+SNR)=36×106×log2(1001)C = H \log_2(1 + \mathrm{SNR}) = 36 \times 10^6 \times \log_2(1001) log2(1001)=ln(1001)ln(2)9.967\log_2(1001) = \frac{\ln(1001)}{\ln(2)} \approx 9.967 C=36×106×9.967358.8×106  bps358.8  MbpsC = 36 \times 10^6 \times 9.967 \approx 358.8 \times 10^6 \;\mathrm{bps} \approx 358.8\;\mathrm{Mbps}

Answer: The maximum achievable data rate is approximately 358.8 Mbps. Any attempt to exceed This rate will result in an unacceptable error rate regardless of the modulation scheme used.

Worked Example: Comparing Nyquist and Shannon Limits

A channel has H=6000H = 6000 Hz and SNR=1023\mathrm{SNR} = 1023 (30 dB).

Shannon limit: C=6000×log2(1024)=6000×10=60000  bpsC = 6000 \times \log_2(1024) = 6000 \times 10 = 60000\;\mathrm{bps}

Nyquist limit with V=8V = 8: C=2×6000×log2(8)=12000×3=36000  bpsC = 2 \times 6000 \times \log_2(8) = 12000 \times 3 = 36000\;\mathrm{bps}

The Nyquist limit (36 kbps) is below the Shannon limit (60 kbps), so 8 signal levels are Achievable. With V=64V = 64: C=12000×6=72000  bpsC = 12000 \times 6 = 72000\;\mathrm{bps}

This exceeds Shannon’s limit of 60 kbps, meaning 64 levels would produce errors. The maximum Number of levels consistent with Shannon: CShannon=2Hlog2V    60000=12000×log2V    V=32C_{\mathrm{Shannon} = 2H \log_2 V \implies 60000 = 12000 \times \log_2 V \implies V = 32}

Answer: At most 32 signal levels can be used reliably on this channel.

Confusing bandwidth with bit rate: Bandwidth is the range of frequencies a channel can carry. Bit rate is the number of bits transmitted per second. They’re related but different concepts.

Forgetting that noise limits channel capacity: Shannon’s theorem shows that even with perfect encoding, noise limits the maximum reliable bit rate. Don’t assume infinite capacity is possible.

Mixing up guided with unguided media: Guided media use physical cables (twisted pair, fibre). Unguided media use wireless (radio, microwave). Don’t confuse the two categories.