Comp 346/488: Intro to Telecommunications

Tuesdays 4:15-6:45, Lewis Towers 412

Class 4, Feb 7

Reading (7th -- 9th editions)
10.1, 10.2, 10.3
Chapter 1: 1.3, 1.4
Chapter 2, 2.1-2.6, especially 2.3 on TCP/IP

Chapter 3 readings (7th-9th editions):
    3.1: Concepts
    3.2: Analog & Digital
    3.3: Transmission impairments
    3.4: Channel Capacity


Homework 1, due Mar 2
problem numbers from 9th edition, which is the same as the 7th and 8th editions unless noted.
3.12 (see §3.2 for video info)
3.15
3.16
3.18a (not in 7th edition)
Given the narrow (usable) audio bandwidth of a telephone transmission facility, a nominal SNR of 56 dB (400,000), and a certain level of distortion, (a) What is the theoretical maximum channel capacity (kbps) of traditional telephone lines?

3.20 (second 3.19 in 8th edition? Not in 7th edition)
Consider a channel with a 1-mHz capacity and an SNR of 63.
(a). What is sthe upper limit to the data rate that the channel can carry?
(b). The result of part (a) is the upper limit. However, as a practical matter, better error performance will be achieved at a lower data rate. Assume we choose a data rate of 2/3 of the maximum theoretical limit. How many signal levels are needed to achieve this data rate?

3.22. This is also 3.22 in the 8th edition, but 3.20 in the seventh. Note: power in Asin(ft) is A2/2.

4.2
4.3: use Fig 4.3: Attenuation of Typical Guided Media (Fig number from 9th ed)



Digital Signal Processing

(was: Transformations on waveforms)

How can we treat sound as data?

For many purposes, we just encode the sound and leave it at that until it reaches the receiving end. But sometimes we want to "tweak" the sound; the classic example is to run it through a highpass, lowpass, or bandpass filter, to eliminate frequencies that are too low, too high, or not in the middle. Another example is to try to filter out some of the noise (this works best if the noise is not purely random).

We will assume that the waveform data has been digitized and is available as an array of values A[n].

One way to think of the Fourier series is as a set of averaging operations: the sequence A[n] is "averaged against" a sine (or cosine) wave sin(2πFn), where f is the "frequency" in units of the sampling rate.

Averaging two waveforms, in two arrays A and B, amounts to getting the following sum:
    double sum = 0.0
    for (i = 0; i < whatever; i++) sum += A[i]*B[i]

If we're averaging against a sine wave, with frequency 2πf, we might have something like this:
    for (n=0; n<len; n++) sum+=A[n]*sin(2*Pi*f*n);

If you're familiar with calculus, this more-or-less corresponds to ∫ A(x) sin(2πfx) dx

Digitized sound makes these sums easy to do, though; no calculus is needed.

Any linear transformation of the input signal can be expressed this way, though some may need lots and lots of coefficients and finding the coefficients might in some cases be difficult.

However, there are some shortcuts to the find-the-coefficients problem. If we know what we want in the frequency domain, we can apply some of the math above to find the corresponding coefficients for a corresponding moving average in the time domain.  For example, suppose we want to create a "lowpass filter", to cut off the higher frequency signals. This is an easy point-by-point thing to express, in the frequency domain:

(1, 1, 1, ...., 1, 0, 0, 0, ...)
                ^cutoff

Apply this to a sequence of frequency amplitudes (a1, a2, a3, a4, a5, a6, a7, a8) (representing respective amplitudes, say, of sin(x), sin(2x), ..., sin(8x)). Assume the cutoff is at position 4, and multiply corresponding values. We get
    (1*a1, 1*a2, 1*a3, 1*a4, 0*a5, 0*a6, 0*a7, 0*a8)
    = (a1, a2, a3, a4, 0, 0, 0, 0)

Point-by-point multiplication in the frequency domain corresponds to a specific moving average in the time domain, and we can calculate that in a relatively straightforward way (although it does involve some calculus).

In this particular case of a frequency-domain cutoff, above, it turns out that the time-domain moving average we need is the "sinc" function (with a "c", pronounced "sink"):

sinc(x) = sin(x)/x    (sinc(0) = 1)

Moving averages of this sort are sometimes called convolution. The function you are averaging against (eg sinc(x)) is sometimes called a "kernel", not to be confused with the OS use of that term. The new signal after filtering is array B[], where

    B[n] = sum (A[t+n]*sinc(2πf * t) / 2πf           -M ≤ t ≤ M

This is defined for M ≤ n ≤ A.length - M

Other common kernels:
Almost all modification of sound files uses this kind of "averaging against a kernel". (Echo cancellation is a harder problem that can't easily be done this way.)

Associativity: bandpass kernel: applying a lowpass filter L and then a highpass filter H is equivalent to convolving L and H together (L*H) and then applying that: (Signal*L)*H = Signal*(L*H)

Note that sinc() goes to infinity in both directions. In practical terms, we have to truncate, generally at a point where sinc(x)=0 (that's what M was, above), and we should also taper off as we approach ħM. The other practical problem is that convolution with sinc(x) involves some knowledge of the "future" sound, that is, to get B[n] we need to know A up to A[n+M]. If n represents the time, then we need to know values of A[i] M units into the future. One solution is to just accept that B is delayed by M units.

Demo: sincfilter.ods: spreadsheet where we average sinc(f1x) (the lowpass filter with cutoff f1) against cos(f2x). We expect that if f2<f1 then there is little change, but if f2>f1 then the result is close to zero.

In the spreadsheet, we average just for x>0. Symmetric averaging about the origin with sin(x) is always exactly 0; cos(x) is the "worst case". Any sine wave in the real world has a phase, referring to its relative starting position d: Asin(fx + d). This can also be expressed as Bsin(fx) + C cos(fx) (it's a trig identities thing) and, as noted, all we have to worry about is the cos(fx) part.

To use the spreadsheet, you supply a filter frequency (f1 above) (it should be relatively small, compared to 1000), and a second, “input”, frequency (f2). If the second frequency is higher than the filter frequency, the reduction will be substantial; otherwise, the reduction factor will be close to 1 (no change). The waveforms tabulated are of the form sin(2πfx), so the wavelength is 1/f. Tabulation goes from 0 to 1 by steps of .001, so if f is 20 a wavelength of 1/20 is 50 “ticks” out of 1000, and there are 20 full cycles in the sum. To compare performance, we also calculate the attenuation after just 500 ticks. The ideal sinc filter would extend to infinity. Attenuation is normalized, so 100% means no attenuation. We use a cosine wave for the input frequency, as that is the “worst case”; strictly speaking, the attenuation really should be the average attenuation as the phase of the second, input signal varies from that of sin(x) to that of cos(x).

Note that frequencies can be fractional, eg f1 = 20 and f2 = 20.5.

Demo: play cantdo.wav subject to various highpass and lowpass filters.

Demo: look at the spectrograms for some .wav files



Some terminology


spectrum: range of frequencies from fmin to fmax
bandwidth: width, = fmax - fmin
effective bandwidth: frequencies you actually need
DC component

major point: in Frequency-division multiplexing, each channel is assigned a very specific "bandwidth"

Note: standard electronic circuits can extract "bands", hence the practical importance of this notion

Note that this is a different use of "bandwidth" from "data rate"

There is some relation, however: the narrower the analog band width, the less room there is for multiple frequencies and modulation, and the less data capacity.

discussion of benefits of Fourier analysis:
what if distortion is linear, but:
what if we want to understand bandpass filtering




Example on pp 71-72 (9th ed) (65-66 in 7th ed) on data rate ("bandwidth" in the digital sense) versus bandwidth
Note dependence on notion of what waveform is "good enough"

Situation: transmitting a square wave assumed to be carrying data at a rate of 2 bits/cycle.

Case 1: transmit using an approximated square wave with base frequency 1 MHz, sine component frequencies: 1MHz, 3MHz, 5MHz
analog band width: 5MHz - 1MHz = 4MHz, data rate: 2Mbps

Case 2: double those to frequencies 2 MHz, 6 MHz, 10 MHz; band width 8MHz, data rate 4Mbps.

Case 3: decide in the second case that we do not need the 10 MHz component, due to a more accurate receiver. Base frequency 2MHz, frequencies 2MHz, 6MHz, bandwidth: 6MHz - 2MHz = 4MHz, data rate: 4Mbps

Note that we're really not carrying data in a meaningful sense; we can't send an arbitrary sequence of 0's and 1's this way. However, that's done mostly to simplify things.

Note also the implicit dependence on bandwidth of the fact that we're decomposing into sinusoidal waves.

Voice transmission: frequency bandwidth ~ 3-4kHz  (eg 300 Hz to 3300 Hz)
64Kbps encoding (8 bits sampled 8000 times a second)


Note: we're looking at DISCRETE frequency spectrum (periodic signals). CONTINUOUS frequency spectrum also makes mathematical sense, but is kind of technical

Note that frequency-domain notion depends on fundamental theorem of Fourier analysis that every periodic function can be expressed as sum of sines & cosines (all with period an integral multiple of original)



Bandwidth of voice: <=4 kHz

quite different meaning from digitization: 64kbps

But if we wanted to encode the digitized voice back into a voice bandwidth, we'd have to encode 16 bits per cycle (Hertz), which is a little tricky.



Amplitude modulation & bandwidth (§5.4)
Note that AM modulation (ALL modulation, in fact) requires a "bandwidth"; ie range of frequencies. This will be very important for cellular.

AM:amplitude = [1+data(t)]*sin(2πft)
f is "carrier" high frequency; eg 100,000


If data(t) = sin(2πgt), g a much lower frequency (eg 1000)
Then sin(2πft)*sin(2πgt) = 0.5 cos(2π(f-g)t) - 0.5 cos(2π(f+g)t)

band of frequencies: (f-g) to (f+g)
band width: 2g


3.2: Transmission

It's not that technical; read it.
There's a calculation there of TV analog band width

On the other hand 3.1 is technical and there are lots of details there that we'll never use. Know what the frequency-domain view is, and spectrum, and (frequency) bandwidth versus bitrate, and know the importance of sin. That is, know that

analog transmission: needs amplifiers to overcome attenuation
digital transmission: store-and-forward (or cut-through) switches?
Switches do signal regeneration, not amplification; noise is NOT added. BUT: we need them a lot more often.


data may need some form of encoding: analog may (eg AM modulation), or equalization.

Digital encoding: NRZ is basic (1=on, 0=off), but isn't good in real life. Table 3.1.

Table 3.1 on page 82 (9th ed) (p 85 in 8th ed)

Data: the original data format
Signal: the signal actually transmitted
Transmission: how we handle that signal on the wire.

analog v data v (encoding | transmission)

Note analog data / analog signal is an odd case.


Signals v Transmission:

Normally these should match. Note special case of analog signal / digital transmission, which is taken to mean that the analog signal encodes a digital signal in a way that the repeater can decode and re-encode.




Section 3.3: Transmission impairments



Attenuation

1. need strength for reception
    Ethernet problem with detecting collisions
2. need strength above noise level
3. attenuation increases with frequency, leading to distortion

"loading coils" in voice telephony: cut off frequencies outside of a desired range; tremendous out-of-band attenuation

attenuation measured in dB; dB per unit distance
p 85 (9th edition), fig 3.15a: relative attenuation in voice range

brief review of decibels: logarithmic scale of relative power:
db = 10 log10 (P/Pbaseline)

1 & 2 can be addressed with amplification.
3rd problem introduces fundamental distortion; digitization solves this but analog equalization can work too.

Audio: see top graph of Fig 3.15; note use of equalization to make up for high-frequency loss

Digital: high-frequency attenuation => signal degradation

Attenuation: leads to distortion of relative frequency strengths



Delay Distortion (like differential frequency attenuation, but different): different (sine) frequencies travel at different speeds.
Again, this leads to digital signal degradation, and some audio distortion.

Noise

Thermal noise:
N (watts) = kTB, B=bandwidth, T=temp, k=Boltzmann's constant (small!). Thermal noise is relevant for satellite transmission, but other sources of noise are usually more important for terrestrial transmission.
Note that thermal noise is proportional to the analog bandwidth; ie, it affects all frequencies identically.

Example 3.2
Discuss dBW

Intermodulation noise
Brief discussion on why it isn't universal.
Intermodulation noise requires some nonlinear interaction between the signals!
A linear combination of frequencies f1 and f2 (ie just transmitting them side-by-side in space) does not produce energy at f1+f2.

Crosstalk

Impulse noise
Interference (a form of impulse noise, from sharers of your frequency range)
Somebody else is using your frequency. Perhaps to make microwave popcorn. (Or perhaps you are simply driving around in the country listening to the radio.)

Other sources of noise:



3.4: Channel capacity

Nyquist: max binary signal rate = 2 × band width

Hard to realize in practice.

Signal rate v data rate: if we send L bits per signal element, then the data rate is L*signal_rate. One way to do this is to use M=2L distinct signal values (eg distinct amplitudes, etc)

Signal rate is sometimes called "modulation rate".
Traditionally measured in baud. Note that for a 56k "baud" modem, it's the data rate that is 56kbps; the signaling rate is 8000/sec.

Compare Nyquist to the Sampling Theorem, which says that a frequency of B can be exactly reproduced if it is sampled at a rate of 2B. (Note: the sampling theorem allows for exact reproduction only if the sampled values are exact. In real life, the sampled values are digitized, and thus "rounded off"; this is called quantizing error.)

Basis of Nyquist's theorem: fundamental mathematics applied to individual sine waves.
signal rate, also known as data rate, is measured in bits per second, and is sometimes called "bandwidth" in non-analog settings.

The Nyquist limit does not take noise into account.

Compare with example at end of section 3.1, where the best case was
    data rate = bandwidth

Note that if we are talking about a single sin(x), then analog band width = 0! sin(x) does not carry any useful information.

This is a special case for binary transmission; here is the extension for multi-level encoding. We can consider a signal of, say;, 1000 transitions per second, but with multiple levels (M many). Then max data rate = 2B*log2(M). (For binary signals, M=2 and log2(M)=1, so we just get the formula above.). Log2(M) is the number of bits needed to encode M.

Example: M=8, log2(M) = 3

Nyquist example: binary data rate = 2B. With M levels, we can carry log2(M) bits where we used to only carry 1 bit.

Why can't we just increase the bits per signal indefinitely?
Answer: noise.

Shannon: considers noise.
Define the signal-to-noise ratio, SNR or S/N. Often measured in dB.
Then:
    C ≤ B log2(SNR + 1)
B = bandwidth
C = max channel capacity

Example: 3000Hz voice bandwidth, s/n = 30 dB. or a ratio of 1000.

    C = 3000*log2(1000) = 3000*10 = 30kbps

Note that increasing signal strength does tend to increase noise as well. Also, increasing bandwidth increases noise more or less in proportion. So: increasing B does lead to more thermal noise, and thus by Nyquist's formula SNR will decrease.

equate the two:
C = 2B log2(M) ≤ B log2(SNR+1)
M2 ≤ SNR+1
Example on page 85: SNR = 251; combine with Nyquist to infer M≤16


56kbps modem: C=56kbps, B=3100Hz. C/B = 18
18 = log2(1 + SNR); SNR ~ 218 = 260,000 = 54 dB

Nyquist and 56Kbps modem: B=4kHz; 128 = 27 levels
Shannon and 28/56Kbps modems


Eb/N0

noise is proportional to bandwidth; let N0 = noise power per Hertz.
Eb = energy per bit of signal  (eg wattage of signal × time-length of bit; this decreases with increased signaling rate (shorter time)).
Ratio is Eb/N0

Note that this is a dimensionless quantity, though as a ratio of energy levels it is often expressed in dB.

bit error rate decreases as this increases; significant for optical fiber designers

Examples in the book assume N0 is all thermal noise, equated to kB, but the notion makes sense when there is other noise too.
Figures in the book (9th edition) involving BER v Eb/N0:
    Figure 5.4: for various digital encoding schemes
    Figure 5.13: for multilevel FSK v PSK
    Figure 6.8: illustrating how error-correcting codes affect this



chapter 4: transmission media


EM spectrum: Figure 4.1

Table 4.1: Attenuation of various media

consider attenuation & interference for the following.
Note: attenuation measured in dB/km! implications!

coax    7dB/km at 10mHz (fat coax); as in fig 4.3b (seems low)
    2 dB/km at 1mHz
   
twisted pair
    fig 4.3a on twisted-pair attenuation in db/km as a function of frequency
    voice-grade v cat-5 25 to 12 dB/km
   
    1kHz: 0.2dB/km (with coils), 3dB/km (without coils)
   
    jumps to 10-25dB/km at 1mHz.
    Slow ethernet: 10-20mHz
   
    At 16 mHz, attenuation per tenth of a km:
        13 dB (cat 3)
         8 dB (cat 5)  (80 dB/km)
   
    Why is it TWISTED??
   
summary: Coax has less attenuation, much less crosstalk/interference, but is $$


fiber
fiber modes: fig 4.4 (7-9 editions)
light source: lasers or LEDs (the latter is cheaper)


ADSL issues:
Table 4.2, page 100: 2.6dB/100m!! (at 1 mHz)
Over the maximum run of 5 km, this works out to an incredible 90dB loss!
384Kbps: 17,000 feet
1.5mbps: 12,000 feet
ADSL must deal with tremendous signal attenuation!
Thermal noise becomes very serious!