Data Communication · Lecture 2

Data and Signals I

Sine waves, spectra and bandwidth: what actually travels on the wire

Md Mahbub E Noor · Assistant Professor, Department of CSE, University of Barishal

Course: Data Communication · 2nd Year, 2nd Semester

From bits to signals: today's goals

  • Distinguish analog and digital data and signals, periodic and aperiodic
  • Describe a sine wave by amplitude, frequency, phase and wavelength
  • Read a signal in the time domain and the frequency domain
  • Explain composite signals and calculate bandwidth
  • Relate bit rate, bit length and the bandwidth a digital signal needs

Lecture 1

Data is stored and processed as bits.


Today

Bits cannot travel as bits. They travel as signals: changing voltage on a wire, light in a fibre, or radio waves in the air.

Reading: Forouzan, Data Communications and Networking, Sections 3.1 to 3.3

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

2 / 33

To travel, data must become a signal

  • Analog data is continuous: voice, temperature, light level
  • Digital data is discrete: text, numbers, files stored as bits
  • A signal is the electromagnetic form of data that can travel through a medium
  • Both data and signals can be analog or digital, giving four combinations (right)

Analog → digital

Voice becomes bits (PCM)

Lecture 5

Digital → digital

Bits on an Ethernet cable

Lecture 6

Digital → analog

Bits on a Wi-Fi radio wave

Lecture 7

Analog → analog

Voice on FM radio

Lecture 8

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

3 / 33

Analog and digital signals

  • An analog signal changes smoothly and can take infinitely many values in a range
  • A digital signal has a limited number of values, often just two
  • Flat lines: the value is held; vertical lines: an instant jump to a new level
  • Example: a microphone's output voltage is analog; the data line of a USB cable is digital

Analog: smooth, infinitely many values

Digital: a few fixed levels, instant jumps

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

4 / 33

Periodic and aperiodic signals

  • Periodic: completes a pattern in a time called the period, then repeats it exactly
  • Aperiodic (nonperiodic): changes without any repeating pattern
  • Data communication typically uses periodic analog signals as carriers and aperiodic digital signals for data
  • Examples: Bangladesh mains electricity (periodic) and your speech (aperiodic)

Periodic: the same pattern repeats every period T (dashed lines)

Aperiodic: no pattern repeats, like real data

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

5 / 33

Checkpoint 1 · 3 minutes

Check your understanding

Q1

A thermometer's reading changes smoothly all day. Is this analog or digital data?

Q2

Your phone sends a text message over 4G. Which data-to-signal combination is that?

Q3

A tuning fork's note and your speech: which is periodic and which is aperiodic?

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

6 / 33

The sine wave: the simplest signal

  • Equation: s(t) = A sin(2πft + φ)
  • It cannot be split into simpler signals; every other signal is built from sine waves
  • Three numbers describe it completely: peak amplitude A, frequency f (or period T) and phase φ
  • Animation: the circle's radius is A, its turning speed is f, and its starting angle is φ

A point turning on a circle, seen from the side, traces a sine wave

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

7 / 33

Amplitude: how strong the signal is

  • Peak amplitude: the largest absolute value the signal reaches
  • Measured in volts, amperes or watts, depending on the signal
  • Changing amplitude changes only the height, not the timing
  • A 1.5 V battery gives a constant voltage: amplitude 1.5 V, frequency 0 Hz

Same frequency, different amplitude: orange peaks twice as high as blue

Bangladesh mains: 220 V at 50 Hz. The 220 V is an average-type (rms) value; the peak is 220 × √2 ≈ 311 V.

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

8 / 33

Period and frequency: f = 1 / T

  • Period T: the time for one complete cycle, in seconds
  • Frequency f: the number of cycles per second, in hertz (Hz)
  • They are inverses: f = 1 / T and T = 1 / f
  • Fast change means high frequency; no change means 0 Hz; an instant jump means infinite frequency
Period TFrequency fExample
1 s1 HzOne cycle per second
20 ms50 HzBangladesh mains
1 ms1 kHzA clear audio tone
10 ns100 MHzFM radio carrier
0.417 ns2.4 GHzWi-Fi

Units go together: seconds ↔ Hz, ms ↔ kHz, µs ↔ MHz, ns ↔ GHz, ps ↔ THz

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

9 / 33

Worked example: from period to frequency and back

  • Problem 1: a sine wave completes one cycle in 100 ms. Find f.
  • 100 ms = 0.1 s, so f = 1 / 0.1 = 10 Hz
  • Problem 2: what is the period of a 2.4 GHz Wi-Fi signal?
  • T = 1 / (2.4 × 10⁹) = 4.17 × 10⁻¹⁰ s = 0.417 ns

Problem 1 · T = 100 ms

10 Hz

f = 1 / 0.1 s

Problem 2 · f = 2.4 GHz

0.417 ns

T = 1 / (2.4 × 10⁹) s

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

10 / 33

Phase: where the cycle starts

  • Phase: the position of the waveform relative to time zero
  • Measured in degrees or radians: one full cycle = 360° = 2π rad
  • A shift of 1/4 cycle = 90° = π/2 rad; 1/2 cycle = 180° = π rad
  • Phase changes where the wave starts, not its height or frequency
  • Example: a shift of 1/6 cycle = 60° = π/3 rad

0°: starts at zero, rising

90°: starts at the peak

180°: starts at zero, falling

270°: starts at the bottom

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

11 / 33

Wavelength: the distance one cycle travels

  • Wavelength λ: how far the signal travels during one period
  • λ = propagation speed × T = c / f
  • Speed in air or vacuum c ≈ 3 × 10⁸ m/s; in copper or fibre about 2 × 10⁸ m/s
  • Higher frequency means shorter wavelength
SignalFrequencyWavelength in air
FM radio100 MHz3 m
Wi-Fi2.4 GHz12.5 cm
Wi-Fi5 GHz6 cm

A common antenna is about λ/4 long: 2.4 GHz Wi-Fi needs only about 3 cm, small enough to hide inside a phone.

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

12 / 33

Checkpoint 2 · 3 minutes

Check your understanding

Q1

A signal has a period of 0.5 ms. What is its frequency?

Q2

Convert a phase shift of 90° to radians.

Q3

What is the wavelength of a 5 GHz Wi-Fi signal in air?

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

13 / 33

Time domain and frequency domain

  • Time-domain plot: amplitude against time, what an oscilloscope shows
  • Frequency-domain plot: peak amplitude against frequency, what a spectrum analyser shows
  • A sine wave becomes a single spike: its height is A, its position is f
  • The frequency view is compact and shows directly how much bandwidth a signal needs

Time domain

Frequency domain (0 to 20 Hz)

DC, 5 V

8 Hz, peak 5 V

16 Hz, peak 5 V

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

14 / 33

Try it: one sine wave, two views

Interactive

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

15 / 33

Composite signals: sine waves added together

  • Fourier: any signal can be written as a sum of sine waves with different A, f and φ
  • A periodic composite signal has discrete spikes (Fourier series)
  • An aperiodic composite signal has a continuous spectrum (Fourier transform)
  • Analogy: a prism splits white light into its colours; Fourier splits a signal into its frequencies

10 V DC + 7 V sine at 6 Hz

Time domain: swings between 3 V and 17 V

Frequency domain: a spike of 10 at 0 Hz and a spike of 7 at 6 Hz

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

16 / 33

Building a square wave from harmonics

  • A square wave = f + 3f + 5f + … : the odd harmonics of the fundamental f = 1/T
  • Harmonic n has amplitude proportional to 1/n, so higher harmonics are weaker
  • Each extra harmonic sharpens the edges (animation, right)
  • A perfect square wave needs infinitely many harmonics, so infinite bandwidth

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

17 / 33

Try it: build a square wave from sines

Interactive

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

18 / 33

Try it yourself: Signal Lab

  • 1 · Sine wave: change A, f and φ; watch both domains
  • 2 · Square wave: add harmonics until the edges are sharp
  • 3 · Bits through a channel: shrink the bandwidth until bits break
  • 4 · Calculators: period ↔ frequency, wavelength, bit length
QR code linking to the Signal Lab

Scan to open the lab on your phone

Open Signal Lab ↗

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

19 / 33

Bandwidth: the width of the spectrum

  • The spectrum of a signal is the set of all frequencies it contains
  • Bandwidth B = highest frequency − lowest frequency, in hertz
  • Signals have a bandwidth, and so do channels: the range of frequencies a channel passes
  • Example: a telephone voice channel passes about 300 to 3,400 Hz, so B ≈ 3,100 Hz

1,000 Hz

5,000 Hz

B = 5,000 − 1,000 = 4,000 Hz

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

20 / 33

Worked examples: calculating bandwidth

  • (a) A periodic signal contains 100, 300, 500, 700 and 900 Hz. B = 900 − 100 = 800 Hz
  • (b) B = 20 Hz and the highest frequency is 60 Hz. Lowest = 60 − 20 = 40 Hz
  • (c) An AM station uses a 10 kHz band centred on 1,000 kHz: it spans 995 to 1,005 kHz

Example (a)

100

300

500

700

900 Hz

B = 900 − 100 = 800 Hz

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

21 / 33

Two meanings of “bandwidth”

  • Engineers use “bandwidth” for two related but different quantities
  • Hertz describes the width of the frequency range
  • Bits per second describes the data capacity
  • More hertz allows more bits per second, but how many also depends on signal levels and noise (Nyquist and Shannon, Lecture 3)

Bandwidth in hertz

The range of frequencies a signal contains or a channel passes

Example: a telephone line passes about 4 kHz

Bandwidth in bits per second

How many bits per second a link can carry: its capacity

Example: “100 Mbps Ethernet”, “50 Mbps broadband plan”

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

22 / 33

Digital signals: levels and bits per level

  • A digital signal uses a fixed number of voltage levels L
  • Each level carries log₂ L bits: 2 levels → 1 bit, 4 → 2 bits, 8 → 3 bits
  • More levels send more bits in the same time
  • But levels sit closer together, so noise confuses them more easily

2 levels → 1 bit per level

1 0 1 1 0 0 0 1

4 levels → 2 bits per level

11 10 01 00 10 11 00 01

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

23 / 33

Bit rate, bit interval and bit length

  • Bit rate: bits sent per second (bps); for digital signals it replaces frequency
  • Bit interval = 1 / bit rate: the time one bit lasts (replaces period)
  • Bit length = propagation speed × bit interval: the distance one bit occupies (replaces wavelength)
  • Units: kbps = 10³, Mbps = 10⁶, Gbps = 10⁹ bits per second

1 0 1 1 0 0 0 1

8 bits in 1 second: bit rate = 8 bps, bit interval = 1/8 s = 0.125 s

Fast Ethernet, 100 Mbps: each bit lasts 10 ns and occupies 2 m of cable (at 2 × 10⁸ m/s).

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

24 / 33

Worked examples: how many bits per second?

  • Text: 100 pages/s, 24 lines × 80 characters per page, 8 bits per character
  • HD video: 1920 × 1080 pixels, 30 frames/s, 24 bits per pixel
  • Voice (from Lecture 1): 8,000 samples/s, 8 bits per sample
  • Method: multiply everything sent per second down to bits

Text: 100 pages per second

100 × 24 × 80 × 8

1.536 Mbps

HD video, uncompressed

1920 × 1080 × 30 × 24

≈ 1.5 Gbps

Phone-quality voice

8,000 × 8

64 kbps

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

25 / 33

A digital signal is a composite signal

  • A digital signal is a sum of many harmonics, so its exact spectrum is infinitely wide
  • We only need to send its significant spectrum: enough harmonics to read the bits
  • If a channel's bandwidth is too narrow, harmonics are lost and the shape blurs
  • Too much blurring and the receiver can no longer tell 0 from 1

Sent: sharp edges, many harmonics

Wide channel (keeps f, 3f, 5f): rounded but readable

Narrow channel (keeps only f): the edges are gone

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

26 / 33

How much bandwidth does a bit rate need?

  • Worst case: alternating bits 0101… form a square wave with f = N/2 (one cycle per 2 bits)
  • Keeping only the first harmonic needs at least B ≈ N/2
  • Keeping more harmonics gives cleaner edges but needs 3N/2, 5N/2 …
  • This applies to baseband transmission over a low-pass channel
Harmonics keptBandwidth neededFor N = 1 Mbps
1st onlyB ≈ N/2500 kHz
1st and 3rdB ≈ 3N/21.5 MHz
1st, 3rd and 5thB ≈ 5N/22.5 MHz

Double the bit rate and the bandwidth needed doubles too: bandwidth is proportional to bit rate.

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

27 / 33

Try it: squeeze bits through a channel

Interactive

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

28 / 33

Baseband and broadband transmission

  • Baseband: send the digital signal directly; needs a channel that passes frequencies from 0 Hz upwards
  • Broadband (band-pass): modulate the signal onto a carrier so it fits a band away from 0 Hz
  • Broadband lets many users share one medium, each in its own band
  • Coming up: line coding for baseband (Lecture 6), modulation for broadband (Lecture 7)

Baseband

Digital signal sent as is over a low-pass channel starting at 0 Hz

Ethernet cable between a PC and a switch

Broadband

Signal shifted onto a carrier, into a band-pass channel

Wi-Fi, 4G, cable modem, DSL

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

29 / 33

See it in action: signals, spectra and bandwidth

  • Watch amplitude, frequency and phase change one at a time
  • See every sine wave become a spike in the spectrum
  • Watch harmonics build a square wave, then a narrow channel take them away
  • When a “Pause & predict” card appears, answer before the video moves on

Click the video to play or pause · Press → for full screen

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

30 / 33

Checkpoint 3 · 3 minutes

Check your understanding

Q1

A signal contains 200, 400, 600 and 800 Hz. What is its bandwidth?

Q2

What is the bit interval at 2 Mbps?

Q3

Using only the first harmonic, what minimum bandwidth does 10 Mbps need?

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

32 / 33

Key takeaways

  • Data travels as signals; both can be analog or digital
  • A sine wave is described by amplitude, frequency (f = 1/T), phase and wavelength (λ = c/f)
  • Any signal is a sum of sine waves; its spectrum shows which ones
  • Bandwidth = highest − lowest frequency; channels have bandwidth too
  • Digital signals need bandwidth in proportion to bit rate: at least about N/2

Next lecture

Lecture 3 · Data and Signals II

What weakens and corrupts a signal (attenuation, distortion, noise), how fast a channel can possibly go (Nyquist, Shannon), and how we measure network performance.

Reading: Forouzan, Sections 3.4 to 3.6 · Practise in Signal Lab, tab 3

Md Mahbub E Noor

Lecture 2: Data and Signals I

University of Barishal

33 / 33