Transcript Lecture 3

ECE 101
An Introduction to Information
Technology
Analog to Digital Conversion
Information Path
Source of
Information
Information
Display
Digital
Sensor
Information
Processor
& Transmitter
Transmission
Medium
Information
Receiver and
Processor
Sinusoidal functions
• Key in all of EE!
• f(t) = A sin(t+), where A is the
amplitude,  =2f, f = frequency = 1/T, T =
period,  = phase,  = circumference /
diameter of a circle = 3.14
• f(t) repeats itself when the argument (t+)
increases by 2 
• A pure tone has a single frequency
Sampling time waveforms
• Ts= Sampling Period (seconds/sample)
• fs= Sampling Rate = 1/ Ts (Hertz or Cycles
per second)
Sampling images
• Images must be sampled in 2 dimensions
• Use square grid Ts units per side (length per
sample) (perhaps Ls units is more
descriptive)
• fs= Sampling Rate = 1/ Ts (samples per
length)
• 3 dimensions > movies
Arbitrary Signals as Sinusoids
• Any analog signal can be constructed by
using sinusoidal components with different
frequencies and amplitudes
• Spectrum provides the relative amplitudes
of the frequency components in a waveform
• Power of a frequency component = ½ the
square of its amplitude
• Harmonics occur at multiples of a
fundamental frequency
• Frequency range = bandwidth
Time (sec)
F(t) = sin (2t)
Time (sec)
F(t) = sin (2t) -1/2 sin (4t) + 1/3 sin (6t)
Time (sec)
f(t) = sin (2t) -½ sin (4t) + 1/3 sin (6t) – ¼ sin (8t) + 1/5 sin (10t)
Nyquist Sampling Criterion
• Must identify the highest frequency
component in a waveform, fmax.
• In order to ensure that no information is lost
in the sampling process, we must sample
the signal at a frequency, fs>2 fmax.
• If fs<2 fmax, then aliasing may occur with
one or more false frequencies appearing.
Aliasing Error
• If sampling frequency is less than two times
the maximum frequency, then a new alias
frequency may appear.
• If a single (hence max.) frequency, fo, exists,
fmax = fo and the sampling fs < 2fo, then the
alias frequency, fa = |fs- fo | = |fo- fs |
Cos 4t
f0 = 2 Hz
fs = 16 Hz
Examples
3.12 and
fs = 2.5 Hz
3.13
from Kuc
fs =1.5 Hz
Severe Undersampling
If f s  2f o, then an aliasing occurs, and an alias
frequency results, f a  f s  f o  f s/ 2
But, if f s is very small this may not be the case, hence we
must repeat the process to get the alias frequency.
As before let f o  2 Hz but let f s  0.8 Hz (Ts  1.25 sec.)
then f a  f s  f o  0.8  2  1.2 f s/ 2  0.4 Hz (problem)

so f a  f s  f a  0.8  1.2  0.4 f s/ 2 (so, ok, barely)
Number Representations
Base 10
764 =764(10)=7x102 + 6x101 + 4x100, where in
the base 10, digits 0,1,2,…7,8,9 are permissible
(NOT 10). Note 100 = 1
In 764 the 7 is the most significant digit (MSD)
and 4 is the least significant digit (LSD)
Can use any Base n. Since digital work
largely deals with two signals we select n=2
Information in Bits
• Binary digits (bit) form the basis for the
information technology language.
• Computers have codes of them for numbers,
sound, images, anything else represented by
a computer.
• They use 1’s and 0’s only, hence base 2
• 4-bit word 24 = 16 different messages
• n-bit word 2n different messages
Binary Number Representations
 Base 2
 1(10)=001(2)= or 0x22 + 0x21 + 1x20, where 20=1
 2(10)=010(2)= or 0x22 + 1x21 + 0x20
 3(10)=011(2)= or 0x22 + 1x21 + 1x20
 4(10)=100(2)= or 1x22 + 0x21 + 0x20
 10(10)=1010(2)= or 1x23 + 0x22 + 1x21 + 0x20
 29(10)= 11101(2)= or 1x24+1x23+1x22+0x21+1x20

or 16 + 8 + 4 + 0 + 1
 In 110010(2) the MSB=1 and LSD =0
Methods for Finding the Binary
Form of a Decimal Number
#1- Repeatedly divide the decimal number by 2 and
retain the remainder as the LSB.
• Find 29(10)
• 29/2 = 14 rem 1, LSB = 1
• 14/2 = 7 rem 0, next bit = 0
• 7/2 = 3 rem 1, next bit = 1
• 3/2 = 1 rem 1, next bit = 1
• 1/2 = 0 rem 1, MSB = 1
• So, 29(10) = 11101
Methods for Finding the Binary
Form of a Decimal Number
#2- Find the largest power of 2 less than the number.
That becomes the MSD. Subtract these numbers
and repeat the process.
• Find 29(10)
• 24 = 16, (MSB), 29-16 = 13,
• 23 = 8, 13-8=5,
• 22 = 4, 5-4=1,
• 20 = 1, LSB
• Therefore 29(10) = 11101
Binary Numbers
• 8 bits = 1 byte
– 1 byte can represent 28 = 256 different
messages
•
•
•
•
•
4 bits = a nibble (less frequently used)
1 kilobyte = 210 = 1,024 bytes = 8,192 bits
1 Megabyte = 220 = 1,048,576 bytes
1 Gigabyte = 230 = 1,073,741,824 bytes
1 Terabyte = 240 = 1,099,511,627,776 bytes
Bits and Bytes
• Bits
– Often used for data rate or speed of information
flow
– 56 kilobit per second modem (56kbps)
– A T-1 Communication line is 1.544 Megabits
per second (1.544 Mbps)
• Bytes
– Often used for storage or capacity (computer
memories are organized in terms of 8 bit words
– 256 Megabyte (MB) of RAM
– 40 Gigabyte (GB) Hard disk
Quantizer Concept
• To properly represent an Analog signal we
need to depict discrete sample levels or
“quantize” the signal.
• Key is the step size to generate a stair step
pattern of values
• Each step then takes on a binary number
value
Quantizer Design
• A quantizer producing b-bits has a staircase
with the number of steps equal to Nsteps=2b
• The first step has the value of Vmin. The
staircase has 2b –1 steps remaining each of a
size 
• The maximum value is Vmax=Vmin+(2b –1) 
• 2 types of errors:
– step size Δ being too large and that is related to
the number of bits in the quantizer
– inadequate quantizer range limits that causes
clipping
Quantizer Range
• Assume that the limits of Vmax and Vmin are
not known such as in an audio system.
• Measure the audio signal strength with a
meter that indicates the root-mean-square
(rms) voltage value.
• The rms voltage value of a signal produces
the same power as a battery with a constant
voltage of the same value.
• Adjust the quantizer until Vmax =4 Xrms and
Vmin = -4 Xrms and the step size is =8 Xrms/
(2b –1)
Signal-to-Noise Ratio
• An important measure of the performance
of a system is evaluation of the signal-tonoise ratio (S/N or SNR) that divides the
signal power by the noise power.
• Signal power is s2 = Xrms2
• Noise power level n2 = 2/12
• SNRdB = 10 log10 s2/ n2
Review of Logarithms
• Why logarithms: simplify multiplying &
dividing and use in both signal to noise
ratios and information theory
• Decimal system in powers of 10:
–
–
–
–
–
100 = 1
101 = 10
102 = 100
103 = 1000
104 = 10000
• The exponent (=number of zeroes) is the
logarithm
Logarithms Between 1 and 10
• If the log101 = 0 and log1010 = 1; what is
the log10 of a number between 1 and 10?
• log103 = x or 10x = 3 (recall logs are
exponents)
• Result: 100.4771 = 3; therefore, x = 0.4771 or
• log103 = 0.4771
Logarithms
• Log A x B = log A + log B
• Recall exponents add in multiplication
– 1000 x 10000 = 103 x 104 = 107 = 10,000,000
– 297 x 4735 = 1,406,295
– 102.4728 x 103.6753 = 106.1481 =1,406,294.998
Decibels – Application of Logs
• Decibel (dB) – 1/10 of a Bel (named for
Alexander Graham Bell)
– Logarithmic expression of the ratio of 2 signals
• Power
dB = 10 log P2 / P1
Voltage or Current
dB = 20 log (V2 / V1)
dB = 20 log (I2 / I1)
Signal-to-Noise Ratio
• An important measure of the performance
of a system is evaluation of the signal-tonoise ratio (S/N or SNR) that divides the
signal power by the noise power.
• Signal power is s2 = Xrms2
• Noise power level n2 = 2/12
• SNRdB = 10 log10 s2/ n2
Base n
•
•
•
•
•
Binary – 2
Octal – 8
Decimal – 10
Hexadecimal – 16
When dealing with collection of bits like binary
words representing text characters using the ASCII
(American Standard Code for Information
Interchange) code – it is inconvenient to deal with
each individual bit
• So may use octal (3 bit) words or hexadecimal (4
bit) words
Octal - Base 8
• Base 8, using first 8 numerals: 0, 1, 2, 3, 4,
5, 6, 7
• Because 8 is a power of 2, can use octal
numbers to represent a group of 3 bits
• Example:
• 1001112 = 1+2+4+32 = 3910
• 478 = 4x8 + 7 = 3910
Hexadecimal - Base 16
• Base 16, using first 16 numerals including 6
letters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D,
E, F
• Because 16 is a power of 2, can use octal
numbers to represent a group of 4 bits
• Example:
• 001111102 = 21 + 22 + 23 + 24 + 25 =
•
2 + 4 + 8 + 16 + 32 = 6210
• 3E16 = 3x16 + 14 = 6210