chapter8 digital media1 some type of digital files –text files (all ascii encoded) –audio files...
Post on 21-Dec-2015
231 views
TRANSCRIPT
Chapter8 Digital Media 1
• Some type of digital files– Text files (all ASCII encoded)– Audio files (bits encode height of sound
samples)– Image files (picture elements are encoded)– Video files– Compressed files (any data type can be
compressed)
• Tools that manipulate digital data– Ex: snipper; paint; photoshop; etc.
Utilizing digital media files
What types of files are on your computer?
• Click on libraries in the task bar– View documents; video; music; pictures
• Check on the file type and the size of the file
• Perhaps play a sample tune or show a video
Chapter8 Digital Media 2
Application Layer Chapt 7 3
Audio Basics
• Acoustic (pressure) wave to input device (ear)• Humans can hear within the 20Hz –20kHz range
– Can distinguish about 1M distinct levels– Sensitive to changes in a few msec
• Analog phone lines limit bandwidth to 4 kHz band– 8000 samples/sec sufficient to capture all information
in that band– 128-256 levels chosen; these introduce quantizing noise– The above would require about 64kbps data rate
• Less used because data is compressed (lossy compression)
Application Layer Chapt 7 4
Audio CDs
• 44100 samples/sec for a 22kHz band• 16 bit samples to encode 65k levels• Requires a 705.6 kbps data rate (1.4Mbps for
stereo) for continual transmission (without compression)
• Uncompressed files require about 10 MB for one minute and 450 MB for 45 minutes, which is how long a typical album runs
Sound Synthesizing
• MIDI standard for musical synthesizers– Standard includes connector, cable, etc.– Encoding for different types of instruments– Event (foot pedal, key)
• Parameters (note’s pitch, amplitude, length)
• Digital audio files contain digitized actual sound patterns
• MIDI (.mid, .cmf, .rol) is synthesized – plays “sound” from instructions
Chapter8 Digital Media 5
MIDI (continued)
• Advantages– files are much smaller (10KB instead of 30MB)– Simple background for budding musicians– Prints sheet music
• Disadvantages– Not as good – Lacks tonal qualities– Vocals are particularly poor
Chapter8 Digital Media 6
Identifying sound files
• Sound files can be identified by extension– .aac, m4p, mp4, (iTunes- good quality)– .mp3 (compressed) – common for Web streaming
because of its comparatively smaller size – .wav, .aif – uncompressed; large files
• .wav is also popular for streaming audio since file is played as it is downloaded (with a small buffer to prevent jitter)
• You can use a .wav file on an HTML tag– <bgsound src=“mymusic.wav”>
Chapter8 Digital Media 7
Hardware for audio data• Sound card, speakers, microphone,
headphone– Sound card may be plugged into expansion slot – Sound card circuitry may be built into the
system board • Saves space
• Sound card sends output to speakers or headphones, input from microphone – Uses digital signal processing
Chapter8 Digital Media 8
Digital Signal Processing
• Digital signal processing transforms between digital pulses representing bits into analog sound waves for output to humans
• Transforms sound waves to digital pulses for storage on digital devices
• May also handle compression and decompression
Chapter8 Digital Media 9
Software for audio data
• Specific software “understands” specific audio formats
• Windows Media Player can interpret– Wav, WMA, MP3 and other formats
• SmartPhones –Apps, etc.• http://supportforums.blackberry.com/t5/Java-
Development/Record-Audio-on-a-BlackBerry-smartphone/ta-p/445153
Chapter8 Digital Media 10
Bitmap graphics
• Grid of dots (grid implemented as an array)– Each cell is called a pixel (picture element)– The color of each pixel (or black/white) is
stored as a binary number• rgb encoding (typically 8 bits each)
• fun thing to try with web pages– Browser may not support all colors (saves bits – colors
that are supported are called a palette)
Chapter8 Digital Media 11
Scanners
• Scanners convert printed image into a bitmap graphic
• You could also take a picture of the page with a digital camera– Camera stores data on memory card– Not volatile– Can be erased and reused– Some of these pictures requires MBs storage
Chapter8 Digital Media 12
Image resolution
• Image resolution is expressed in terms of pixels per row and column
• 150 x 100 pixels means that there are 150 columns of pixels (horizontal) and 100 rows of pixels (vertical)
• 150 x 100 is considered low resolution
• 3888 x 2592 (high end camera) is high res– About 10.1 megapixels
Chapter8 Digital Media 13
Bitmaps
• Bitmaps do not change their resolution even if you stretch (or shrink) the image– If you stretch it enough, lines will start looking
jagged– You can start to see the boxes of the pixels
Chapter8 Digital Media 14
Outputting Images• Printers have a specified dpi (dots per inch)
– If your image’s resolution is less than that, the printer will “fill in” the print grid
– Make the resolution of your image greater than your printer’s dpi, but not much greater
• Similarly on your computer– Right click on your desktop; pick screen
resolution: 1440 x 900 recommended– A larger image would require scrolling
Chapter8 Digital Media 15
File size
• You should reduce large file sizes of images for web attachments; possibly even for emails
• You can crop your picture– Snipping tool – Paint and other tools allow cropping– Paint allows you to change resolution or save in
compressed form
Chapter8 Digital Media 16
Color Depth• Typically each pixel encodes 3 colors (rgb)
– 8 bits for each color is called True Color bitmap
• A 3.1 megapixel file with 32-bit color encoding needs 10MB of storage
• You can redefine your color palette – Perhaps limit the existing one or add to the
existing (limited) palette– Colors in html <body bgcolor=“ffffff”>
Chapter8 Digital Media 17
Image compression
• Lossless compression– Let’s look at Run-length encoding
• Example: assume that a 256-color bitmap encodes each pixel in 8 bits of 1 (11111111).
• Suppose an image has 167 consecutive white pixels (ordinarily this would require 167 bytes)
• It could be encoded in 2 bytes (167 in binary followed by 11111111 for the color white
• What happens if each pixel is a different color?
Chapter8 Digital Media 18
Image compression
• Lossy compression– Example: JPEG encoding
• Preprocesses adjacent pixels of similar values to be represented by the same value
• Then uses run length encoding
– I tried saving a jpeg file as a gif file (worst quality compression) and could not see a difference in quality nor much in size
Chapter8 Digital Media 19
File compression in general• Shareware compression programs
– Ultimatezip, PKZIP and WinZip
• WinRAR trial usage available at http://rarsoft.com/download.htm – supports Zip plus compression – supports UNIX utilities (tar, gz)
• Don’t use them if file is already compressed
Chapter8 Digital Media 20
Compression with WinZip
• Right click file icon– Choose send to
• Choose compressed (zipped) folder
– Windows will automatically decompress these folders on the receiving end when they are selected
– Note .zip extension
Chapter8 Digital Media 21
Vector Graphics• Files with .wmf, .ai, .dxf, .eps extensions
are images stored in vector graphics– Instructions rather than bitmaps– Less storage space– Generally poorer quality than bit maps
• Shading is limited
– Scalable!!! Easier to change; delete portions– Good for web browsers
– Adobe’s Flash software uses vector graphics
Chapter8 Digital Media 22
Digital Video• .wmv, .flv, .bdmv, .mov, .mpg extensions
– To change an analog movie to digital we use a video capture device through the USB port
• Webcams can capture a series of still photos in digital form; store in your computer
• Digital video camera transfers digital video to your computer; better quality than webcams
Chapter8 Digital Media 23
Video editing software
• Video editing software helps you cut out portions (and rearrange, if required) and also to synchronize audio tracks onto video data
Chapter8 Digital Media 24
Digital Data convenience tools
• Time shifting– Allows hearing, viewing data later
• Place shifting– Allows hearing, viewing data somewhere else
• Format shifting – Allows using data on different devices
Chapter8 Digital Media 25
Digital Rights Management
• How to prevent copyright infringement– Protected data can be “captured” by
• Capturing wireless signals– Cracking encryption
• Filming videos as they are played
• Recording music as it is played
• Copying disks or computer files
• Analog data copyrights are routinely violated by copying – but it is harder
Chapter8 Digital Media 26
Digital Rights Mgmt Techniques• Signal scrambling to protect your rights
– Basically this is encryption– Useful for satellite TV
• Digital watermarks– Pattern of bits inserted (typically multiple
times) in a data stream used to track, identify, limit use
– Broadcast flags – can prevent copy, decrypt, even fast forwarding (over ads)
Chapter8 Digital Media 27
Computer generated film content
• CGI Animation– Specifically for generating incremental (in-
between) images within scenes– Rendering
• Converting 2-dimensional images into 3-dimensions
• Insertion of dead movie actors into ads
• How to distinguish what is real?
Chapter8 Digital Media 28