Lecture2 Basic Fall13
Lecture2 Basic Fall13
Patrice Koehl
Computer Science
UC Davis
Digital Data
Example:
1 7 3 2 digits
1000 100 10 1
1x1000+7x100+3x10+2x1 = 1732
Number representation
Computers use a different system: base 2:
1024 512 256 128 64 32 16 8 4 2 1
210 29 28 27 26 25 24 23 22 21 20
Example:
1 1 0 1 1 0 0 0 1 0 0 bits
1024 512 256 128 64 32 16 8 4 2 1
1x1024+1x512+0x256+1x128+1x64+0x32+ 0x16+ 0x8 + 1x4 + 0x2 + 0x1 = 1732
Number representation
Base 10 Base 2
0 0
1 1
2 10
3 11
4 100
5 101
6 110
… …
253 11111101
254 11111110
255 11111111
… …
Conversion
From base 2 to base 10:
1 1 1 0 1 0 1 0 1 0 0
1024 512 256 128 64 32 16 8 4 2 1
1x1024+1x512+1x256+0x128+1x64+0x32+ 1x16+ 0x8 + 1x4 + 0x2 + 0x1 = 1876
-1 byte = 8 bits
-1 KB = 1 kilobyte = 210 bytes = 1024 bytes (≈1 thousand bytes)
-1 MB = 1 Megabyte = 220 bytes = 1,048,580 bytes (≈ 1 million bytes)
-1 GB = 1 Gigabyte = 230 bytes = 1,073,741,824 bytes (≈1 billion bytes)
-1 TB = 1 Tetabyte = 240 bytes = 1,099,511,627,776 bytes (≈ 1 trillion bytes)
-A byte can represent numbers up to 255: 11111111 (base 2) = 255 (base 10)
-The largest number represented by a binary number of size N is 2N - 1
Big Data: Volume
256 16 1
6 C 4
Step 4: regroup:
6C4
Example: 4FD
Step 1: split:
4 F D
Step 4: regroup:
10011111101
A-Z: 65-90
a-z: 97-122
0-9: 48-57
UNICODE
A higher sampling rate usually allows for a better representation of the original sound
wave. However, when the sampling rate is set to twice the highest frequency in the
signal, the original sound wave can be reconstructed without loss from the samples.
This is known as the Nyquist theorem.
Quantization
Quantization is the process of limiting the value of a sample of a continuous
function to one of a predetermined number of allowed values,
which can then be represented by a finite number of bits.
Quantization
The number of bits used to store each intensity defines the accuracy of
the digital sound:
The human ear can hear sound up to 20,000 Hz: a sampling rate of
40,000 Hz is therefore sufficient. The standard for digital audio is
44,100 Hz.
Quantization:
The current standard for the digital representation of audio sound is to use
16 bits (i.e 65536 levels, half positive and half negative)
www.atpm.com/6.02/digitalaudio.shtml
DIGITAL RECORDING
DAC
-Can be processed
- compression (MP3) www.atpm.com/6.02/digitalaudio.shtml