sampling rate

Download Report

Transcript sampling rate

Computer
Some basic concepts
Binary number




Why binary?
Look at a decimal number: 3511
Look at a binary number: 1011
counting
decimal
0
1
2
3
4
binary
0
1
10
11
100
5
6
7
8
9
Binary number

Maximum possible
8
bits:
 40 bits:
 N bits:

What is the number after 10111?
Hexadecimal
Decimal: base 10
 Binary: base 2
 Hexadecimal: base 16
 But works the same way
 Translate F1C:
 Where do you see it?

decimal binary hexadecimal
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
Size
1 byte = 8 bits
 1KB = 2^10 bytes
 1MB = 2^20 bytes
 1GB = 2^30 bytes
 1TB = 2^40 bytes

ASCII




ASCII (American Standard Code for Information
Interchange)
How to represent a keyboard character as a
number?
Assigns a unique number (0-127) to each
keyboard character.
Examples:
 a - 97
 A to Z:
65-90
 a to z: 97-122
 0 to 9: 48-57
Unicode
127 is not enough
 Other languages
 Same principle
 More characters

Digitizing the world
Example: Digitizing Sound

An object creates sound by vibrating in a
medium such as air
 Vibrations
push the air
 Pressure
waves emanate from the object and vibrate
our eardrums
 The
force, or intensity of the push determines
the volume
 The
frequency (number of waves per second) is the
pitch
Analog to Digital

To convert continuous information, convert
it to bits

From zero line on graph, record with
binary number the amount by which the
wave is above or below it (positive or
negative sound pressure)

At what points do we measure? We can't
record every position of the wave
Sampling


Take measurements
at regular intervals
Number of samples in
a second is
the sampling rate
 The
faster the rate, the
more accurate the
recording
How Fast to Sample?

Sampling rate should be related to the
wave's frequency
 Too
slow rate could allow waves to fit between
the samples; we'd miss segments of sound
 Guideline
is Nyquist Rule: Sampling rate must be at
least twice as fast as the fastest frequency

Human perception can hear sound up to 20,000 Hz, so
40,000 Hz sampling rate is enough.

Standard for digital audio is 44,100 Hz
How Many Bits per Sample?

How accurate must the samples be?
 Bits
must represent both positive and
negative values
 The
more bits, the more accurate
the measurement
 The
digital representation of audio CDs uses
16 bits (records 65,536 levels, half above and
half below the zero line)
How large is one-minute music?

One-minute digital audio?
 60
seconds
 44,100 samples
 16 bits each
 Times 2 for stereo
 60*44,100*2(Bytes)*2=10.5 MB!

An hour is 635MB!
ADC, DAC

Digitizing Process:
 Sound
is picked up by a microphone
(called a transducer)
 The
signal is fed into an analog-to-digital converter
(ADC), which samples it at regular intervals and
outputs binary numbers to memory
 To


play the sound, the process is reversed
Numbers are read from memory into digital-to-analog
converter (DAC), which creates an electrical wave by filling in
between the digital values
Electrical signal is output to speaker, which converts it to a
sound wave
Advantages
of
Digital
Sound
(MP3) Compression


One computation is to compress the digital audio
(reduce number of bits needed)
 Remove waves that are outside range of human hearing
 Teen-only ringtone
 MP3 usually gets a compression rate of 10:1


Reproducing the Sound Recording





Lower bandwidth requirements, popular for
Internet transmission
Bit file can be copied without losing any information
Original and copy are exactly the same
Vinyl recording is analog, it wears out.
Easy “transportation”
We can compute the representation


Enhance, manipulate
Synthetic voice