Professor Laurence S. Dooley School of Computing and Communications Milton Keynes, UK
The Song of the Talking Wire 1904 Henry Farny painting
Communications
It s an analogue world Our world is continuous Sound, temperature, pressure, gravitational force, light. Need to transform into electrical signals Sensors: convert one type of energy to another (IoT) Electro-mechanical, photonic, magnetic Examples: Microphone/speakers Thermocouples Accelerometers
Digital Communications PCM: Pulse Code Modulation
PCM Digitising an analogue signal involves: i. Sampling ii. Quantisation iii. Encoding
Positives Digital signals can be faithfully stored & copied Allow numeric processing by computers (DSP) More robust to noise Improved signal-to-noise ratio (SNR) Lossy & lossless compression possible Can represent physically unrealisable systems Negatives Why bother? Cannot exactly reconstruct source signal Require higher bandwidth (uncompressed data) Transmitting 1 & 0 involves special techniques
PCM Encoder Pulse Amplitude Modulation (PAM)
Sampling Process of converting a continuous analogue time signal into a discrete time representation
3 PCM Sampling Methods T s is the sampling interval f s = 1 T s Also known as Sample & Hold
Idea of Sampling Analogue Audio Recording Continuous modulated magnetic tape Cut a groove in a record Signals have infinite number of amplitude values Digital Audio Recording Binary numbers only Signals have finite number of amplitude values
Sampling - Is it lossless? The clock analogy shows how sampling differentiates digital and analog signals Analogue: Time flows continuously with the clock hands covering ALL TIME Digital: Also display time but at discrete values SAMPLED TIME
Some doubts? How many samples are required to represent the original signal? What happens between samples? Do we lose any information between samples?
Basic Signal Processing Continuous Signal t Sampled Signal t Quantized Signal t
Idea of Sampling ~ h ( t) = h( t) δ ( t T ) = h( T ) δ ( t T ) = h(t) 1 h( T ) T where T is the sampling period t
Idea of Sampling h ~ ( t) h(t) is sampled by a sequence of unit impulses, so each amplitude is the h(t) value at the time instant of each impulse t
The Puzzle h ~ ( t) How many samples are needed? T << h ~ ( t) t T >> t
Sampling Theorem Uniquely relates signal bandwidth to the sampling frequency f s If the maximum signal bandwidth is f max, there is NO loss of information between the original and sampled signals, if and only if the input is sampled at least twice f max
Sampling Theorem The Digital typical Telephone bandwidth Networks: of speech use 8 is bits/sample, 300 3.4kHz the data so rate f s = 8kHz 64 kbps Audio signal bandwidth ranges from 0 20kHz so f s = 40kHz (T s =25µs) Audio For a CD CD: fuse s = 44.1kHz 16 bits/sample so f max so also the commonly data rate referred for stereo to = 1.411 as the Mbps. Nyquist frequency = 22.05kHz
Typical Sampling Rates 8kHz Telephone, speech audio,.au files 22.05kHz Medium-quality computer audio 32kHz Broadcast audio 44.1kHz CD, DAT, high-quality audio 48kHz Professional audio 96kHz High-end audio 13.5MHz Digital TV broadcasting Rec.601
44.1kHz Strange Number To store digital audio at a B/W 1Mbps/channel was difficult so video recorders were used Audio samples stored as a pseudo-video signal of black and white levels on active video lines Monochrome recorder at 2 video standards 525 lines @ 60Hz and 625 lines @ 50Hz
44.1kHz Strange Number Aim: Seek a common f s so either system has an integer number of samples stored on each video picture line in the field (interlaced). 60 Hz: there are 35 blanked lines and 490 lines/frame 245 lines per field so f s = 60 * 245 * 3 = 44100 Hz 50 Hz: there are 37 blanked lines and 588 lines/frame 294 lines per field so f s = 50 * 294 *3 = 44100 Hz CD has no video circuitry and yet f s = 44.1KHz Interestin g fact = 44100 = f s 2 2 *3 2 *5 2 *7 2
REMEMBER If you obey the Sampling Theory, a sampled representation is a perfect representation
But if you don t? If f s >> than needs be then this is OVERSAMPLING If f s < than needs be this is called ALIASING
Different Sampling Rates Aliased Signal
The Clock Analogy T = 60s Sampling at Nyquist rate: T s =0.5T = 30s (f s =2f max ) Oversampling (above Nyquist rate): T s =0.25T = 15s (f s =4f max ) Undersampling (below Nyquist rate): T s =0.75T = 45s (f s =4/3f max ) http://www.michaelbach.de/ot/mot-wagonwheel/index.html
How do we know f max? Use an anti-aliasing (LP) filter to remove all frequencies above the Nyquist f max x( t) f = max? anti-aliasing filter f x ( t) max = f p analogueto-digital converter x(nt ) f s 2f p DSP 1 Amplitude 0 f s /2 f s Frequency f p
Analogue to Digital Conversion q u a n t i z i n g e r r o r u ( t ) t analogue signal u s ( t ) sampled signal t u s ( t ) 5 4 3 2 1 0 quantized signal t 101 100 011 010 001 000 010 001 001 010 100 101 100 010... digital bitstream
Quantisation Relates to ADC sampling errors Consider analogue and digital meters A good analogue meter and sharp eye needle reads 2.25V Cheap digital meter will read 2.5V. More expensive meters may read 2.25V and 4D meters could read 2.263V!!
Quantisation 1 bit 2 possible values 2 bits 4 possible values 3 bits 8 possible values... 8 bits 256 possible values 16 bits 65356 possible values. : n bits 2 n possible values } Quantization noise (error)
Quantisation Quantisation noise is the difference between the analog signal and its digital representation. This error is inherent. N bits => 2 N levels
Quantisation Bits Levels 3 8 4 16 5 32 8 256 16 65536 By increasing the bit levels, the digital representation of the analog signal improves in fidelity and the quantisation noise is reduced
Relationship between Sampling and Quantisation Quantization 6 5 4 3 2 1 0 0 t t 1 t 2 t N-1 t N Sampling
Relationship between Sampling and Quantisation Sampling band-limited signals is LOSSLESS Quantising sample amplitudes is LOSSY SNR measures strength of a signal to noise level Useful rule 1 bit 6dbs SNR 8 bit samples SNR 48dbs Noise very audible. CDs use 16 bit samples SNR 96dbs.
PCM Revisited 0100 0011 0010 0001 0000 1001 1010 1011 1100 PCM Demo
Types of Quantisation How can 2 n quantised levels be distributed? Linear (PCM) Perceptual (µ-law) Differential (DPCM) Adaptive (ADPCM)
Linear µ-law quantisation Divide amplitude range into N evenlyspaced steps log 2 N bit quantisation Amplitude values are now logarithmically mapped over the N quantization units 300 Quantization Index 250 200 150 100 50 0 0 50 100 150 200 250 300 Amplitude Value
Predictive Coding u(t) Current Sample Predicted Value Next Sample error ε Encoder & decoder predict next sample from history Prediction is the same at both ends Encoder then ONLY transmits the error ε between the predicted and next sample values. ε is quantised and coded basis of DPCM t
Differential PCM Difference between the predicted and next sample values ε n = f n f n 220, 218, 221, 219, 220, 221, 222, 219. Difference sequence: 220, -2, 3, -2, 1, 1, 1, -3 PCM coded sequence: 8 bits/sample Differential coding: 1 x 8 bit sample + 3 bits/sample
PCM Advantages DPCM Summary Excellent voice quality Good SNR Easy implementation Disadvantage High bit-rates Lower bit-rates exploits inter-sample correlations More complex implementation
http://xgmt.open.ac.uk/laurence_dooley