Title: What Is Digital? (Part 2)
1What Is Digital?(Part 2)
CS1103 ????????
- Prof. Chung-Ta King
- Department of Computer Science
- National Tsing Hua University
(Contents from MIT EECS 6.01/6.02, Wikipedia, U.
of Indiana K361, www.arrl.org, www.sounderpro.com.
tw/Digital)
2????????????
????????? ??????,????????
3Outline
- Continuous versus discrete
- Problems with continuous
- Going into discrete/digital
- Building digital devices
- IC to digital logic to computing devices
- Transforming analog inputs into digital
- Transforming digital to analog outputs
4????????
??????????
5?????????Sampling???
- Digital representations of analog waveforms
Continuous time Continuous values
Discrete time Discrete values
6Sampling
- The value of the analog signal is measured at
certain intervals in time. Each measurement is
referred to as a sample.
A series of snapshots
7Sampling in Space
8Terminologies in Sampling
- Sampling rate
- How often analog signal is measured samples per
second, Hz, e.g. 44,100 Hz - Sampling resolution
- Number of bits to represent each sample sample
word length, bit depth, e.g. 16 bit
4 Samples/cycle
16 Samples/cycle
8 Samples/cycle
9Note Sampling Used Widely
- ????
- ????????????
- ?????????
- ?? (24?/?)
- CD???? (44.1 Khz)
10Problem with Sampling
- The analog signal is sampled at discrete
intervals of time - The digital output is an incomplete picture of
the behavior of the input - There is no way of knowing, by looking at the
output, what the input was doing between one
sampling instant and the next
11How Many Samples Are Enough?
- Reconstruction Is it possible to reconstruct
the original waveform using only the discrete
time samples?
12Shannon-Nyquist Sampling Theorem
- How many samples are necessary to preserve the
information contained in the signal? - If signal contains high frequency components,
need to sample at even higher rate to avoid
losing information in the signal ? How much
faster? - Sampling Theorem A signal can be exactly
reproduced if it is sampled at a frequency that
is greater than twice max. frequency in the signal
http//www2.egr.uh.edu/glover/applets/Sampling/Sa
mpling.html
13Sampling at Same Frequency
14Sampling at Twice Frequency
15Implications
- ??????????20 Hz 20 KHz
- ????? 40 kHz ?????? (sampling rate) ??????? 20
kHz ????? - ???????8kHz???
- 8kHz telephone quality
- 44.1kHz CD quality
- 48kHz radio/TV broadcast, DV, DVD video
- ???,????????????????,??????????????????????
16Aliasing
- If sampling rate not high enough
- New frequencies appear in reconstructed signals
- Need circuits to eliminate (anti-aliasing filter)
A high frequency signal
sampled at a lower rate
looks like
a lower frequency signal
17Encoding of Discrete Signals
- If we use N bits to encode the magnitude of one
of the discrete-time samples, we can capture 2N
possible values
183-bit Quantization
- A 3-bit binary number has 23 8 values
Amplitude
Time measure amplitude at each tick of sample
clock
194-bit Quantization
- A 4-bit binary number has 24 16 values
Amplitude
Time measure amplitude at each tick of sample
clock
20The Digital Audio Stream
- A series of sample numbers, to be interpreted as
instantaneous amplitudes, one for every tick of
the sample clock. - This is what appears in a sound file, along with
a header that indicates the sampling rate, bit
depth and other things.
11 13 15 13 10 9 6 1 4 9 15 11 13 9
21Audio File Size
- CD characteristics
- Sampling rate
- 44,100 samples per second (44.1 kHz)
- Sample word length
- 16 bits (i.e., 2 bytes) per sample
- Number of channels
- 2 (stereo)
- How big is a 5-minute CD-quality sound file?
22Quantization Error
- When we quantize the scaled sample values, we may
be off by up to 1/2 step from the true sampled
values - Round-off error difference between actual signal
and quantization to integer values
Random errors sounds like low-amplitude noise
23Sampling Rate and Encoding Bits
24Resolution Trade-offs
25Analog to Digital Recording Chain
ADC
Microphone converts acoustic to electrical
energy. Its a transducer.
Continuously varying electrical energy is an
analog of the sound pressure wave.
ADC (Analog to Digital Converter) converts analog
to digital electrical signal.
Digital signal transmits binary numbers.
DAC (Digital to Analog Converter) converts
digital signal in computer to analog for your
headphones.
26ADC and DAC
http//www.dspguide.com/ch3/4.htm
27ADC in Digital Camera
http//www.tasi.ac.uk/advice/creating/camera.html
28Converting Analog into Digital
- The simplest form of ADCuses a resistance
ladderto switch in the appropriatenumber of
resistors in seriesto create the desiredvoltage
that is compared to the input(unknown) voltage
29Converting Analog into Digital
- The resistance ladder changes its configuration
systematically and the output voltage is compared
to the analog voltage in a comparator - When there is a match, the digital equivalent
(switch configuration) is captured
30How? Binary Search
- Initial conditions
- Expected high 5 volts
- Expected low 0 volts
- 5 volts ? 256
- 0 volts ? 0
- Voltage to be converted
- 3.42 volts
- Equates to 175
Analog
Digital
256
5-volts
Unknown (175)
3.42-volts
2.5-volts
128
0
0-volts
31What to Do with Digital Signals?
- ?????,?????????????????
- ????????????????????????????
- ????????,??????85???90??
32???????
- ??
- ??????????????,????????????????????????
33??????
????????? Eco
???????? Eco
?????? 2G ????? 0.1G ?????
?????? 2G ????? 0.05G ?????
Eco Ethernet Base Station
34??????
The World Smallest
Wireless Sensing
Platform,
Eco Node
35??????
Top View
Bottom View
36????????
????? ???????
37Summary
- Digitization of analog signals by sampling
- Sampling rate and resolution
- Problems with sampling aliasing, quantization
errors - Analog to digital conversion
- Analysis of digital signals FFT