02 2 CH8
02 2 CH8
Representation
(Chapter 8)
CS170
Computer Applications for Business
1
2
Multimedia Data
Representation • Digitizing Sound
• Analog to Digital
(Chapter 8)
• Sampling process
• Digitizing Color • Sampling rate
• RGB lights • Nyquist rule
• Black and White colors • Bit depth
• Intensities • Digitizing Images and Video
• Lighten Up: Changing • Compression terms
Colors
• lossless
• Increasing Intensities • Run-length encoding
• Increasing Brightness • lossy
• Changing Contrast • luminance
• Adding Color to a Black and • chrominance 3
White picture
CS 170 - Trees 4
CS 170 - Trees 5
Color Encoding
https://www.rapidtables.com/web/color/RGB_Color.html
• Examples:
• Red Eye Removal
• Photo Corrections
• Color Changes
• Artistic Effects
9
Brightness and Contrast
• The values of the pixels can be
represented in a Levels graph
• Brightness refers to how close to white the
pixels are
• Contrast is the size of difference between
the darkest and lightest portions of the
image
10
Brightness
• We want all the pixels to
be closer to intense
white, but to keep their
relative relationships
• Add 14 to each pixel
A pixel which is
RGB (195, 195, 195)
becomes
RGB (209, 209, 209)
RGB (22, 23, 24)
becomes 11
• Highlights
• Midrange
15
Digitizing Sound
• An object creates sound by vibrating in a
medium (such as air)
• Vibrations push the air causing pressure
waves to emanate from the object, which
in turn vibrate our eardrums
• Vibrations are then transmitted by three
tiny bones to the fine hairs of our cochlea,
stimulating nerves that allow us to sense
the waves and “hear” them as sound
16
Sampling
17
Nyquist Rule for Sampling
•If the sampling were too slow, sound waves
could “fit between” the samples and you would
miss important segments of the sound
• The Nyquist rule says that a sampling rate must
be at least twice as fast as the highest frequency
• Because humans can hear sound up to roughly
20,000 Hz, a 40,000 Hz sampling rate fulfills the
Nyquist rule for digital audio recording
• For technical reasons, a somewhat faster-than-
two-times sampling rate was chosen for digital
audio (44,100 Hz)
18
How Many Bits per Sample?
• To make the samples perfectly accurate,
you need an unlimited number of bits for each
sample, which is impossible
• The more bits there that are used, the more
accurate the measurement is
• Bit Depth - the number of bits used to
represent each sample
• Audio digital representation typically uses 16
bits
19
Digitizing Process
• The digitizing process works as follows:
– Sound is picked up by a microphone (transducer)
– Signal is fed into an analog-to-digital converter (ADC),
which takes the continuous wave and samples it at
regular intervals, outputting for each sample a binary
number to be written to memory
– To listen, process is reversed
20
Advantages of Digital Sound
• A key advantage of digital information is
the ability to compute on the
representation
• Remove waves too high or too low for
humans to hear
• Overlay small errors (coughing)
• Change the pitch
• Auto Tune
21
Digital Images and Video
• An image is a long sequence of RGB pixels
• The picture is two dimensional, but think of
the pixels stretched out one row after another
in memory
22
A video???
ZIP
ALAC-audio
PNG-image
JPEG-image
MPEG-video
MP3-audio
24
Audio Compression
• Removing sounds that are too high
or low to hear
Video/Picture Compression
• Humans are quite sensitive to small
changes in brightness (luminance)
• Brightness levels of a photo must be
preserved between uncompressed and
compressed versions
• People are not sensitive to small
differences in color (chrominance)
25
MPEG Compression
26
Everything is bits!
What does a number mean?
• The same byte with a 65 in it (01000001) might be
interpreted as…
• The character 'A'
• A very small piece of sound (e.g., 1/44100-th of a
second)
• The amount of redness in a single dot in a larger
picture RGB (65, 200, 12)
• The amount of redness in a single dot in a larger
picture which is a single frame in a full-length motion
picture
Bits Are a Bias-Free
Universal Medium
28
Online Multimedia Challenges
• The challenge of Latency
• Latency is the time it takes for information to be created
or delivered
• The challenge of Bandwidth
• Bandwidth is the amount of data that can be
transmitted per unit of time
• Throughput is the actual amount of data that is
transmitted
• Ideally, we want HIGH BANDWIDTH and LOW
LATENCY.
29
CHECK
30
CHECK
31
CHECK
32
CHECK
• What is latency?
33
Multimedia Data
Representation • Digitizing Sound
• Analog to Digital
(Chapter 8)
• Sampling process
• Digitizing Color • Sampling rate
• RGB lights • Nyquist rule
• Black and White colors • Bit depth
• Intensities • Digitizing Images and Video
• Lighten Up: Changing • Compression terms
Colors
• lossless
• Increasing Intensities • Run-length encoding
• Increasing Brightness • lossy
• Changing Contrast • luminance
• Adding Color to a Black and • chrominance 34
White picture