CS 101 – Sept. 11 Review linear vs. non-linear representations. Text representation Compression techniques Image representation –grayscale –File size issues.

Slides:



Advertisements
Similar presentations
CREATING a HUFFMAN CODE EVERY EGG IS GREEN E ///// V/V/ R // Y/Y/ I/I/ S/S/ N/N/ Sp /// V/V/ Y/Y/ I/I/ S/S/ N/N/ R // Sp /// G /// E /////
Advertisements

Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
Review Ch.1,Ch.4,Ch.7. Review of tags covered various header tags Img tag Style, attributes and values alt.
Text Compression 1 Assigning 16 bits to each character in a document uses too much file space We need ways to store and transmit text efficiently Text.
Trees Chapter 8.
Fall 2007CS 2251 Trees Chapter 8. Fall 2007CS 2252 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information.
Trees Chapter 8. Chapter 8: Trees2 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information To learn how.
Trees Chapter 8. Chapter 8: Trees2 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information To learn how.
CSCI 3 Chapter 1.8 Data Compression. Chapter 1.8 Data Compression  For the purpose of storing or transferring data, it is often helpful to reduce the.
Compression JPG compression, Source: Original 10:1 Compression 45:1 Compression.
A Data Compression Algorithm: Huffman Compression
Is ASCII the only way? For computers to do anything (besides sit on a desk and collect dust) they need two things: 1. PROGRAMS 2. DATA A program is a.
Computer Science 335 Data Compression.
Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,
Chapter 8_2 Bits and the "Why" of Bytes: Representing Information Digitally.
CS 206 Introduction to Computer Science II 04 / 29 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 12 / 10 / 2008 Instructor: Michael Eckmann.
Data Representation CS105. Data Representation Types of data: – Numbers – Text – Audio – Images & Graphics – Video.
Expression. Arithmetic Operators +, -, *, /, ^, ( ) Evaluating an expression –Examples: – * 3 3 – 4 / 2 8 / 4 * 2 2 * 3 ^ 2 (2 * 3) + 2.
Lossless Compression in Multimedia Data Representation Hao Jiang Computer Science Department Sept. 20, 2007.
Data Compression Gabriel Laden CS146 – Dr. Sin-Min Lee Spring 2004.
Spring 2015 Mathematics in Management Science Binary Linear Codes Two Examples.
CHARACTERS Data Representation. Using binary to represent characters Computers can only process binary numbers (1’s and 0’s) so a system was developed.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Dale & Lewis Chapter 3 Data Representation
Chapter 2 Source Coding (part 2)
Working with text ASCII and UNICODE.   
MA/CSSE 473 Day 31 Student questions Data Compression Minimal Spanning Tree Intro.
Chapter 2 Computer Hardware
Huffman Encoding Veronica Morales.
1 Analysis of Algorithms Chapter - 08 Data Compression.
Data Representation and Storage Lecture 5. Representations A number value can be represented in many ways: 5 Five V IIIII Cinq Hold up my hand.
Lecture Objectives  To learn how to use a Huffman tree to encode characters using fewer bytes than ASCII or Unicode, resulting in smaller files and reduced.
CS-2852 Data Structures LECTURE 13B Andrew J. Wozniewicz Image copyright © 2010 andyjphoto.com.
 The amount of data we deal with is getting larger  Not only do larger files require more disk space, they take longer to transmit  Many times files.
Compsci Today’s topics l Binary Numbers  Brookshear l Slides from Prof. Marti Hearst of UC Berkeley SIMS l Upcoming  Networks Interactive.
Trees Chapter 8. Chapter 8: Trees2 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information To learn how.
Spring 2010CS 2251 Trees Chapter 6. Spring 2010CS 2252 Chapter Objectives Learn to use a tree to represent a hierarchical organization of information.
1 i206: Lecture 2: Computer Architecture, Binary Encodings, and Data Representation Marti Hearst Spring 2012.
CS 111 – Sept. 10 Quiz Data compression –text –images –sounds Commitment: –Please read rest of chapter 1. –Department picnic next Wednesday.
CMSC 100 Storing Data: Huffman Codes and Image Representation Professor Marie desJardins Tuesday, September 18, 2012 Tue 9/18/12 1CMSC Data Compression.
Huffman Coding. Huffman codes can be used to compress information –Like WinZip – although WinZip doesn’t use the Huffman algorithm –JPEGs do use Huffman.
COMPRESSION. Compression in General: Why Compress? So Many Bits, So Little Time (Space) CD audio rate: 2 * 2 * 8 * = 1,411,200 bps CD audio storage:
Quiz # 1 Chapters 1,2, & 3.
SEC (1.4) Representing Information as bit patterns.
CS 111 – Sept. 3 More data representation Review hex notation Text –ASCII and Unicode Sound and images Commitment: –For Wednesday: Please read pp
CS 111 – Sept. 1 Intro to data representation Binary numbers –Convert binary  decimal –Convert decimal  binary Text –ASCII and Unicode Commitment: –For.
Representation of Characters
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
CS 101 – Sept. 14 Review Huffman code Image representation –B/W and color schemes –File size issues.
Chapter 3 Data Representation. 2 Compressing Files.
Comp 335 File Structures Data Compression. Why Study Data Compression? Conserves storage space Files can be transmitted faster because there are less.
1 Problem Solving using Computers “Data....Representation, and Storage.
Representing Characters in a Computer System Representation of Data in Computer Systems.
Huffman code and Lossless Decomposition Prof. Sin-Min Lee Department of Computer Science.
Data Compression: Huffman Coding in Weiss (p.389)
1.4 Representation of data in computer systems Character.
Design & Analysis of Algorithm Huffman Coding
Expression Tree The inner nodes contain operators while leaf nodes contain operands. a c + b g * d e f Start of lecture 25.
INTERNATIONALIZATION
Representing Information as bit patterns
Data Encoding Characters.
Data Compression If you’ve ever sent a large file to a friend, you may have compressed it into a zip archive like the one on this slide before doing so.
The Huffman Algorithm We use Huffman algorithm to encode a long message as a long bit string - by assigning a bit string code to each symbol of the alphabet.
Ch2: Data Representation
Advanced Algorithms Analysis and Design
Huffman Encoding Huffman code is method for the compression for standard text documents. It makes use of a binary tree to develop codes of varying lengths.
Data Representation Chapter 2 Computer HW (Von Neumann Model) Program
File Compression Even though disks have gotten bigger, we are still running short on disk space A common technique is to compress files so that they take.
Huffman Coding Greedy Algorithm
Presentation transcript:

CS 101 – Sept. 11 Review linear vs. non-linear representations. Text representation Compression techniques Image representation –grayscale –File size issues –(Later, we’ll look at color)

Representing data Linear: text, image, audio, video Non-linear: networks or hierarchies –Examples: road system, genealogy, arithmetic expr. For expressions, it’s convenient to be able to express in linear/text format. –Postfix notation: eliminates the need for parentheses –Note that there’s one more number than operator: 5 6 * * 4 – 1 +

The joy of text ASCII code: –Contiguous (makes it easy to alphabetize) –Case sensitive –One byte per character ASCII table (p. 67) –‘A’ = 65 ‘a’ = 97 ‘0’ = 48 –Try this example: “Dog”

Unicode An extension of ASCII Incorporated into the Java language. Uses 16 bits instead of 8. Supports foreign alphabets; symbols (examples on p. 68)

Text Compression Goal is for a document to take up less space. Techniques –Keyword encoding: replace common words by special symbols like δ ↕ ╞ –Run-length encoding: replace repetitions with a number: “pppppppppppppp”  [14p] Also works well for compressing images, sound. –Huffman code: common letters should take up fewer bits.

Huffman code example Suppose you want to send a message and you know the only letters you need are A,D,E,L,N,P,S. A Huffman code might look like this table: ADELNPS

How to create code In CS we often use “trees” to help us solve problems. We’re given set of letters used in message, and their frequencies. –Ex. A=5, B=10, C=20, D=25, E=30 –Ex. P=5, N=10, D=10, L=15, A=20, S=20, E=30 Arrange frequencies in order Group the letters in pairs, always looking for the smallest sum of frequences  Create a tree!