1 SECTION C Digital Data Representation Data Representation Basics Representing Numbers, Text, and Pictures Quantifying Bits and Bytes Circuits and Chips Chapter 1: Computers and Digital Basics 1 1 Data vs. Information Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information? T. S. Eliot,"The Rock", Faber & Faber 1934. 1 Data Representation – DIKW Distinction between: Data—raw, unformatted information Example: 5433333353 Information—data that is transformed to have a meaning Example: (543) 333-3353 Knowledge—body of governing procedures used to organize or manipulate data Wisdom—accumulated knowledge Chapter 1: Computers and Digital Basics 3 1 DIKW Pyramid Chapter 1: Computers and Digital Basics 4 1 Data vs. Information Data: 51007 Information: – 5/10/07 The date of your final exam. – $51,007 The average starting salary of an accounting major. – 51007 Zip code of Bronson Iowa. 1 Data vs. Information 6.34 6.45 6.39 6.62 6.57 6.64 6.71 6.82 7.12 7.06 Information SIRIUS SATELLITE RADIO INC. $7.20 $7.00 $6.80 Stock Price Data $6.60 $6.40 $6.20 $6.00 $5.80 1 2 3 4 5 6 Last 10 Days 7 8 9 10 1 Data Information Knowledge Data Summarizing the data Averaging the data Selecting part of the data Graphing the data Adding context Adding value Information 1 Data Information Knowledge Information How is the info tied to outcomes? Are there any patterns in the info? What info is relevant to the problem? How does this info effect the system? What is the best way to use the info? How can we add more value to the info? Knowledge 1 What is an analog signal? Most of the signals sensed by humans are analog signals. Everyday examples include sound, light and temperature. voltage An analog signal may have any value within a continuous range. An analog signal can be converted into an electrical signal. This graph shows how the voltage of an analog signal varies with time. time 1 What is a digital signal? Unlike analog, a digital signal does not vary smoothly, and so is described as being a discontinuous signal. current Modern communication systems carry information from analog signals as digital signals, which have two values: ‘0’ (off) and ‘1’ (on). These are used to encode analog information. time Digital signals can be sent as electrical signals, radio waves or as pulses of light through optical fibers. 1 Digital Media The process of taking analog data, such as a human voice, and turning it into a data file on a disk is called digitizing. Digital media collectively refers to digital copies of any form of media. The main advantage of digital media vs. analog data is that it can be reproduced an infinite number of times with no degradation of quality. 1 Data Representation Data representation refers to the form in which data is stored, processed, and transmitted Digital devices work with distinct and separate data (discrete, on/off) using electronic switches Analog devices work with continuous data Which is which? Chapter 1: Computers and Digital Basics 12 1 Representing, Storing, and Processing Multimedia Numeric & Character data – Binary number system – ASCII, Extended ASCII, EBCDIC, and Unicode Bit = Binary Digit – on or off, 1 or 0 Media: texts, sounds, images, videos,.. What is Binary_BrainPop Chapter 1: Computers and Digital Basics 13 1 Data Representation Extended ASCII (total 256 8-bit representation of each character) American Standard Code for Information Interchange Chapter 1: Computers and Digital Basics 14 1 Place Value in a Binary Number Binary works the same way except that the place values are successive powers of 2 powers of 10 powers of 2 11-15 1 Place Value in a Binary Number Given binary representation, we can find the decimal equivalent value by multiplying the digit times the place value and adding the results Decimal Binary Place value Place value 11-16 1 Place Value in a Binary Number Given binary representation, we can find the decimal equivalent value by multiplying the digit times the place value and adding the results 11-17 1 Question - 1 1. How do digital machines use and store data? A. B. C. D. With words With binary numbers With long, drawn out stories With symbols Chapter 1: Computers and Digital Basics 18 1 Question - 2 2. What two symbols are generally used in binary code? A. B. C. D. x and y Upside-down and right-side-up 0 and 1 Left side-down and right-side-up Chapter 1: Computers and Digital Basics 19 1 Question - 3 3. Humans do math using a base-10 system, while computers do math using ? A. A base-3 system B. A base-2 system C. A base-1 system Chapter 1: Computers and Digital Basics 20 1 Question - 4 4. How would you write the number two in binary? A. B. C. D. 1001 0000 0010 0001 Chapter 1: Computers and Digital Basics 21 1 Question - 5 5. How high can you count in binary? A. B. C. D. As high as you want Up to 2 Up to 10 Up to 1 million Chapter 1: Computers and Digital Basics 22 1 Question - 6 6. What type of test is most similar to binary? A. B. C. D. Writing an essay Fill-in-the-blank Multiple choice True or false Chapter 1: Computers and Digital Basics 23 1 Question - 7 7. Your computer's code for the letter A is 01000001. Can you guess what the letter B would be? A. 10010000 B. 01010110 C. 01000010 Chapter 1: Computers and Digital Basics 24 1 Question - 8 8. Why do humans use a base-10 numerical system? A. Because 10 is a round number B. Because we have 10 fingers and 10 toes C. Because there are 10 planets Chapter 1: Computers and Digital Basics 25 1 Question - 9 9. Which of the following devices uses binary code? A B Chapter 1: Computers and Digital Basics C D 26 1 Question - 10 10. What is the main function of binary code? A. B. C. D. Turning switches on and off Allowing computers to represent and store data Providing a gateway into higher mathematics Allowing computers to interact with humans Chapter 1: Computers and Digital Basics 27 1 Bits and bytes Bits are rarely seen alone in computers. They are almost always bundled together into 8-bit collections, and these collections are called bytes. With 8 bits in a byte, you can represent 256 values ranging from 0 to 255, as shown here: 0 = 00000000 1 = 00000001 2 = 00000010 ... 254 = 11111110 255 = 11111111 1 Data Representation Extended ASCII (total 256 8-bit representation of each character) American Standard Code for Information Interchange Chapter 1: Computers and Digital Basics 29 1 Number of possible values = 2(number of bits) More bits can encode more information. More bits require more computer storage. We want to keep the list small enough to use fewer bits, but we don't want to leave out critical characters 1 Quick Quiz How many bits are there in a byte? A. B. C. D. 2. 4. 6. 8. 1 Quick Quiz When you shop for digital devices, their capabilities are often touted in terms of speed and capacity. Suppose you’re shopping for a USB Flash drive. A friend recommends one that’s 64 GB. What does that mean? A. B. C. D. It operates at 64 gigabits per second. It holds 64 billion bytes of data. It holds 64 million 0s and 1s to represent data. It uses 64-bit ASCII code to hold data. 1 Section A: Digital Sound Digital Audio Basics Digital Audio File Formats MIDI Music Speech Recognition and Synthesis Chapter 8: Digital Media 34 1 Bridging Analog and Digital We need a sound card that contains Analog-to-Digital Converter (ADC) Digital-to-Analog Converter (DAC) CPU-DSP 1 Digital Audio Basics Sampling a sound wave – Amplitude of each the sound is stored as a binary number Chapter 8: Digital Media 38 1 Digital Audio Basics Sampling rate refers to number of times per second that a sound is measured during the recording process. In other words, how often you take a data. Chapter 8: Digital Media 39 1 Digital Audio Basics Sampling Rate (vertical slice) Low sample rate High sample rate In the image above, the left half has a low sample rate, and the right half has a high sample rate (i.e., high resolution). Chapter 8: Digital Media 40 1 Digital Audio Basics Sampling Format (Dynamic Range, Bit Depth) Usually measured by the number of computer bits used to represent each sample. The more bits that are used, the more precise the representation of each sample. Bit depth refers to the number of allowable levels you map (or round) the values to. Increasing the number of bits also increases the maximum dynamic range of the audio recording, in other words the difference in volume between the loudest and softest possible sounds that can be represented. Chapter 8: Digital Media 41 1 Digital Audio Basics Sampling Format (horizontal slice) Fewer Bits More Bits In the image above, the left half has a sample format with few bits, and the right half has a sample format with more bits. Chapter 8: Digital Media 42 1 Sampling Factors Sampling Size (precision) Number of Steps Number of Measurements for Per Second Sampling Rate http://www.scribd.com/doc/10732516/introduction-to-digital-technology; http://electronics.howstuffworks.com/analog-digital3.htm 1 Examples Increasing sampling rate and size Better Quality http://www.scribd.com/doc/10732516/introduction-to-digital-technology; http://electronics.howstuffworks.com/analog-digital3.htm 1 Bits and bytes in Audio CD uses 2 bytes, or 16 bits, per sample per channel. That gives each sample a range from 0 to 65,535, like this: 0 = 0000000000000000 1 = 0000000000000001 2 = 0000000000000010 ... 65534 = 1111111111111110 65535 = 1111111111111111 216 = 65536 1 Digital Audio File Formats The most popular digital audio formats include WAV (Uncompressed, de facto standard for sound on PCs), and lossy formats including AAC, MP3, Ogg Vorbis (free), and WMA (Windows Media Audio) Audio or media player software allows you to play digital audio files You can embed digital audio files into a Web page using the HTML5 <audio> tag Introduction to digital sound Chapter 8: Digital Media 46 1 CD Storage Capacity Without compression, a CD can store up to 74minutes (650 Megabytes) of music. With compression, in forms like MP3, about 10 times as many minutes can be stored in a CD-R. 1 What is Streaming? Process of delivering audio, video and other multimedia over a network The network could be a LAN, Intranet or Internet for example Streaming ensures no download wait No files to take up space on your hard disk. It could be audio or video streaming It is getting more popular as broadband access becomes widespread 1 Section B: Bitmap Graphics Bitmap Basics Scanners and Cameras Image Resolution Color Depth and Palettes Image Compression Chapter 8: Digital Media 50 1 Digital Image Basics You can capture images using certain devices connected to the computer, such as a digital camera, scanner, or screenshot of the display. You can also create images on the computer using painting and drawing programs and using a mouse, a digital pen or stylus. Chapter 8: Digital Media 51 1 Scanners and Cameras Chapter 8: Digital Media 52 1 Scanners and Cameras The CCD (Charge Coupled Device) is an image sensor and the camera’s “film.” It captures the light falling on it and convert it into electrical signals. The CCD surface is divided like a grid, into small pixels. Each pixel represents one pixel in the captured image. Area CCD Chapter 8: Digital Media Line CCD 53 1 CCD The CCD (Charge Coupled Device) is an image sensor made of semiconductor – the same kind of materials as computer chips – to capture light and turn it into an electric signal. The inventors, Willard Boyle and George E. Smith, were awarded the 2009 Nobel Prize in physics. Chapter 8: Digital Media 54 1 Pixels All captured images are called bitmap images. If you take a close look you will see that an image is made up of pixels. Pixels (short for picture elements) are the small sections of color and/or tone that together form a digital image. 1 Bitmap/Raster Graphics Basics Composed of a grid of dots/pixels – Color of each dot/pixel is stored as a binary number (commonly 24 bits) You use your smartphone to take a photo. Which camera – front or back – gives you a better quality photo? Chapter 8: Digital Media 58 1 Bits and Bytes in Graphics A pixel in an image file is a piece of data. It is the smallest unit of picture that can be represented or controlled. Similar to sound, each pixel is a sample of an original image; more samples typically provide more accurate representations of the original. It could be represented in 1 bit, 1 byte, or 3 bytes How many colors can you represent if a pixel is 1 bit: 1 byte: 3 bytes: 21 = 2 colors (monochrome) 28 = 256 colors (GIF file) 224 = ~16 million colors ("Truecolor") True Color bitmap (24-bit=3×8-bit channels (RGB)) 1 Bitmap Formats for Photo BMP RAW TIFF Chapter 8: Digital Media 62 1 Bitmap Formats for Web JPG GIF PNG Chapter 8: Digital Media 63 1 Image Resolution (Bitmap) Expressed as the number of horizontal and vertical pixels, for instance “1520 (width) x 1280 (height)”. – Higher resolutions contain more data (larger file size) and are higher quality Bitmaps do not have a fixed physical size Chapter 8: Digital Media 65 1 Higher or Lower Resolution Bitmap images are measured in pixels per inch, otherwise known as ppi. The ppi of the image is called the resolution. An image with lots of ppi is a high resolution image and vice versa. Bitmap images are resolution dependent; meaning that if you scale up a bitmap, the pixels will become more visible and the quality of the graphic compromised. 1 Higher or Lower Resolution For a given image, the higher the ppi, the better quality (more details) the image. Which one looks more like a circle? 1 Image Resolution (Bitmap) Image Resolution (“ppi”): as the pixel count per inch drops, the individual pixels will begin to show, and the image will appear "pixelated" (jagged, blurry, and/or chunky), as shown in the example pictures above. A high resolution image will still be clear when scaled up. Chapter 8: Digital Media 69 1 Image Resolution (Bitmap) Simulated image resolution (ppi) examples 300 ppi 72 ppi magazine web standard 10 ppi Desktop monitors pixel density have exceeded 200 ppi and contemporary small-screen mobile devices often exceed 300 ppi to over 400ppi (1080p) for some smartphones. Chapter 8: Digital Media 70 1 Bitmap Basics – Color Depth A bitmap image is a collection of color dots called pixels, arranged in rows and columns. A pixel is the smallest picture element that can be shown on a display. The number of colors can be displayed in a pixel is determined by the number of bits used to represent the pixel (know as color depth). The larger the color depth, the larger the number of colors can be displayed. Remember bit depth for sound? Chapter 8: Digital Media 78 1 Color Depth and Palettes Color depth is the number of colors available for use in an image – Monochrome bitmap Increasing color depth increases file size Color palettes are used to control color depth – Grayscale palette – System palette – Web palette Chapter 8: Digital Media 79 1 Color – On the Computer & Internet The systems that are used to create websites, usually have a video card capable of displaying 64 thousand (16-bit) or 16.7 millions (24-bit) colors. The average visitor of a website is capable of viewing web-safe 256 (=28) colors (8-bit). Nowadays most computer monitors can display 16-bit or more colors. 1 Color Value Color Color HEX #000000 Color RGB rgb(0,0,0) #0000FF Gray rgb(255,0,0) R rgb(0,255,0) G rgb(0,0,255) B #FFFF00 rgb(255,255,0) #00FFFF rgb(0,255,255) #FF00FF rgb(255,0,255) #C0C0C0 rgb(192,192,192) Gray #FFFFFF rgb(255,255,255) Gray #FF0000 #00FF00 The lowest value that can be given to one of the light sources is 0 (hex 00). The highest value is 255 (hex FF). 81 1 Color Value 82 1 Section C: Vector and 3-D Graphics Vector Graphics Basics Vector-to-Bitmap Conversion Vector Graphics on the Web 3-D Graphics Vector VS Bitmap Chapter 8: Digital Media 84 1 Vector Graphic Basics The other type of images are vector images. These images are created in special drawing programs. Vector images are made up of lines and shapes. These can be grouped together to make up another shape. When images are made bigger the quality remains the same. 1 Vector Graphic Basics Contain instructions (mathematical formula) for re-creating a picture SVG (Scalable Vector Graphics) and Flash are two vector graphics formats that can be used on the Web Most fonts font formats are based on vectors. WMF (Windows MetaFile) files can contain both vector and bitmap. image. Chapter 8: Digital Media information. 86 1 Vector Graphic Basics Vector graphics resize better than bitmaps Vector graphics are resolution independent Vector graphics usually require less storage space than bitmaps Vector graphics are not usually as realistic as bitmap images It is easier to edit an object in a vector graphic than an object in a bitmap graphic Chapter 8: Digital Media 88 1 Courier, MS Sans Serif, MS Serif, Small, Symbol Bitmapped or raster fonts TrueType, OpenType, PostScript Vector fonts 1 3-D Graphics Stored as a set of instructions – Contain locations and lengths of lines forming a wireframe Rendering covers a wireframe with surface color and texture, which makes 3-D vectors look more realistic Ray tracing adds light and shadows to a 3-D image to simulate the eye's perception of those objects Chapter 8: Digital Media 91 1 3-D Graphics – Wireframe Chapter 8: Digital Media 92 1 3-D Graphics – Modeling Simple 3D objects can be modeled using mathematical equations operating in the 3-dimensional Cartesian coordinate system. Example: the equation x2 + y2 + z2 = r2 is a model of a perfect sphere with radius r. Chapter 8: Digital Media 93 1 3-D Graphics – Rendering The process of taking the mathematical model of the world and producing the output image. The core of the rendering process involves projecting the 3D models onto a 2D image plane. Chapter 8: Digital Media 94 1 3-D Graphics – Rendering Chapter 8: Digital Media 95 1 Bitmap vs. Vector Graphics Bitmap images are, with a few exceptions, the standard for internet graphics, as well as Windows icons and backgrounds. Bitmaps are also the standard format for images captured by scanners and digital cameras. Rather than being comprised of pixels, the vector image is made up of various “objects,” a term which essentially means lines and shapes. Photo-Realism, Scalability, Shape, File Size are some factors to consider to choose one over the other. Chapter 8: Digital Media 96 1 Question 082300 2-D vectors don’t look very realistic, whereas 3-D vectors tend to look very realistic. Why is this the case? – A. 3-D images use a more realistic color palette than 2-D images. – B. 3-D images constructed using a wireframe can be rendered with surface textures and lighted with realistic ray tracing. – C. 3-D images can be enlarged or shrunk more realistically than 2-D images. – D. 3-D images can be animated, whereas 2-D images cannot. Chapter 8: Digital Media 97 1 Section D: Digital Video Digital Video Basics Producing Video Footage Video Transfer Video Editing Video Output Web Video DVD-Video Chapter 8: Digital Media 98 1 Digital Video Basics Uses bits to store color and brightness data for each video frame The color for each pixel is represented by a binary number Footage for digital videos can be supplied from a digital source, or from an analog source that requires conversion Chapter 8: Digital Media 99 1 Digital Video Basics Bitrate – the amount of data (bits) used to encode video or audio Frame rate (FPS) – also known as frame frequency, is the frequency (rate) at which an imaging device displays consecutive images called frames. The higher the frame rate, the better the optical illusion. 24 fps is the standard for film and 30 and 25 fps is for TV based on NTSC and PAL, respectively. Chapter 8: Digital Media 100 1 Video Output In general, a higher bitrate will accommodate higher image quality in the video output. Chapter 8: Digital Media 102 1 Question 082400 YouTube is a popular video site. Which one of the following statements is NOT true about these videos? – A. YouTube supports streaming video. – B. Users can flag content they feel is inappropriate. – C. YouTube videos have a low compression ratio and a high bitrate. – D. Each YouTube video has a unique URL. Chapter 8: Digital Media 103 1 Image Compression Chapter 8: Digital Media 104 1 Strategies to Reduce Digital Media File Size Reduce the sampling rate Reduce the bit depth Apply file compression 1 1. Reduce Sampling Rate Recall the weighing puppy scenario If you weigh the puppy more frequently, it will take more paper. For digital media files, higher sampling rate means more data to store. In other words, lower sample rate will produce less data, i.e. smaller file size. 1 2. Reduce Bit Depth Bit depth refers to the number of allowable levels you can map the data For digital media files, lower bit depth means less data to store. 1 3. Compression Efficient Storage (small file size) Streaming Interactive Multimedia Applications Two categories in terms of whether the data get lost during the compression: – lossy compression – lossless compression 1 Compression Goals Reduced bandwidth Make decoded signal sound as close as possible to original signal Lowest Implementation Complexity Robust Scalable 1 Audio Compression Removing bits that represent extraneous noise Removing sounds that are beyond the frequencies of normal hearing 1 Lossy Compression Some data will be lost and cannot be recovered Examples: – JPEG compression for images – MP3 for audio – most compressors for videos 1 Lossy Compression A lossy codec is one that discards certain portions of the signal in order to achieve a smaller file size without resulting in a perceived loss of quality of the sound to make the file smaller. Avoid using lossy compression (if possible) when you want to keep the file for further editing. Video files are generally so large that it is inevitable to save them with lossy compression. 1 Lossless Compression A lossless codec is one that achieves smaller file sizes through means other than removing data. This can include using a variable bit rate which would use fewer bits to encode silences as compared to an active section of music. 1 Image Compression Any technique that recodes data in an image file so that it contains fewer bits – Lossless compression – Lossy compression Run-length encoding File compression utility Chapter 8: Digital Media 114 1 Image Compression Chapter 8: Digital Media 115 1 At a loss? File formats come in two types: lossy and lossless. Lossy formats lose some of the image colours when the file is saved (those not usually seen by the naked eye!). While the quality of the image may not be the best possible, lossy formats are useful as they do not take up a lot of memory. Lossless formats save the image as it is – this ensures that the quality remains the same. However, they take up more memory than a lossy format. 1 File .tiff Quality Memory used Benefits lossless high Very good quality images. Ideal for printing. .bmp lossless high Very good quality images. Ideal for printing. .gif low Used for images with less than 256 colours. Ideal for animations, text and line drawings, and web site animations. Has transparency feature. .jpeg lossy low Good images with up to 16 million colours. Not first choice for printing. Very good for web site photographs. .png Very low Images of any quality, printed or not. Very good for images on a web site. lossless lossless 1 Trade-offs of Reducing File Size Data will be lost or altered when you apply these strategies: – reduce sampling rate – reduce bit depth – apply lossy compression When data is lost or altered, you sacrifice the exactness of the media original information. This affects the quality of the media. 1 Weighing the Trade-offs Depend on projects and intended use of the files Weigh the file size (storage requirement and speed of transfer and processing of the file) against the quality of the digital media files Losing data vs. "perceivable" quality – Sometimes it may be acceptable if losing data does not cause "perceivable" deterioration in quality 1 Question 082200 Bitmap files are typically quite large and so it is handy to compress them before FTPing or e-mailing them. However, some bitmap files don’t seem to shrink very much when you use a compression utility, such as WinZip. Why? – A. The files are already as small as they can get. – B. Compression utilities use lossless compression, which won’t allow you shrink the size of a file without losing data. – C. Some types of files are already in compressed format, which can’t be further compressed. – D. The files have a small color palette that doesn’t allow compression. Chapter 8: Digital Media 121 1 FastPoll True/False Questions Answer A for True and B for False 080100 Audio is digitized by dividing a sound wave into samples and storing the numbers that represent the height of each sample. 080200 A higher sampling rate produces higher quality sound than lower sampling rates. 080300 MP3 and BMP are examples of two popular digital music formats. 080400 WAV is a format for synthesized sound. 080500 Software with speech synthesis capabilities can convert your spoken dictation into a digital document. Chapter 8: Digital Media 122 1 FastPoll True/False Questions Answer A for True and B for False 080600 RAW, PNG, TIFF, and JPEG formats store graphics as bitmaps. 080700 Bitmap graphics are resolution dependent. 080800 When bitmaps are enlarged, pixel interpolation can result in the graphic becoming pixilated. 080900 Images that have been compressed with lossless compression can be reconstituted to their original appearance without any data loss. 081000 Vector graphics maintain their quality better than bitmaps when resized. Chapter 8: Digital Media 123 1 FastPoll True/False Questions Answer A for True and B for False 081100 The technique for adding light and shadows to a 3-D graphic is called rasterizing. 081200 Videos with a low compression rate tend to be small, low-quality files. 081300 A video with a bitrate of 340 will have less compression and better quality than a video with a bitrate of 150. 081400 Recording a television show to watch at a later time is an example of digital rights management. 081500 Digital watermarks, HDCP, and broadcast flags rely on compliant hardware devices to protect content. Chapter 8: Digital Media 124