This week we covered very little content and focused mainly on activities and posters. By doing these practices and activities I was able to review the things that I’ve learned and gain a better understanding of data representation and compression.
(Part of the information required for this blog post have already been presented on the previous post so I am just copy & pasting them here)
ASCII and Unicode
Apart from numbers, characters and alphabets are also important for daily communication. Character Sets are series of standardized codes used to represent texts. In 1967, ASCII (American Standardized Code for Information Interchange) was born. It used 7 bits to represent 128 unique characters including alphabets, punctuations, and math symbols. Later it advanced into 8 bits. The first 32 bits were not used for representing characters, instead, it was reserved for other commands like “enter” or “space”.
However, 8 bits are far from enough. In the 1980s, Unicode was invented. It has up to 16 bits, and it serves as an extension of ASCII. It included characters from countless regions and cultures, including Chinese and Russian. Now Unicode had been upgraded to 32 bits, including emoji representations. With Unicode, people from all over the world were able to type more conveniently.
Data compression
There are two types of compression in general: lossy and lossless. Lossy compression means to reduce the file size by deleting some unimportant information (usually in pictures) while lossless compression uses other approaches to decrease the size of files without deleting any information (often applied in text compression). In this class we mainly discussed three types of lossless compression.
Keyword Encoding

In keyword encoding, the frequently repeated words are replaced by a single character (usually symbols). Since symbols take less storage space than words, this method could be extremely useful when the information contains many repeating words. The downside of keyword encoding is that the symbols representing the words would be invalid if they have already appeared in the original text. The exercise example is given on the left.
(The compression ratio should be 0.386 and I forgot to correct it)
Run-length Encoding


Run-length encoding means replacing sequences of repeated characters with a flag sign (“*”), the single character, and the number of repetition. This method is useful for picture encoding, because often groups of color pixels all contained the same value.
Huffman Coding
Huffman coding is an example of prefix coding, which means no character’s bit code is the prefix of any other character’s code string. To use this method of encoding, we have to count the numbers of each character that appeared in the text and list them all out based on their frequency of appearance in the file (from most frequent to least frequent). After that, we have to draw a Huffman tree (shown on the left) which branches out 1s and 0s from the starting point. Each character should only be presented at the end of the branch, so based on this we could write out a character set which assigned the binary code for each character. The exercise example is shown in the picture.
Bitmap Activity
In order to better understand exactly how computers transfer images into binary codes, we did a bitmap activity that simulates the process of computers. After filling in pixels in the 8*8 grid, we convert each line into binary code and hexadecimal codes, then deliver the hexadecimal code to a partner and let them recreate the picture. This activity helped me to become more familiarized with conversions between different numerical systems.

Apart from the bitmap activity, we also completed another compression worksheet in class. This activity gave us a better sense of how compression works and how exactly it could reduce file sizes.
Image Representation
In general, there are two types of graphics: raster and vector. Normal pictures in JPEG or PNG were in raster form, which means they are all composed of numerous pixels. The resolution of a picture (measured in dpi/dots per inch) refers to the density of pixels in an image. The quality of the picture would increase as the number of pixels increase. On the contrary, vector images were created using functions rather than pixels, so no matter how much you zoom in, the quality of the image would still be the same. The size of vector images is very large, so it is usually used to make logos for companies or other simple graphic designs.

Color depth refers to the number of bits used to represent the color in each pixel. A greater color depth means greater variety of colors, therefore better quality of the pictures.

Apart from information of each single pixels, meta-data is also an important part of information about pictures. It means “data that provides information for other data”. Before the series of 0s and 1s representing contents of the picture, there are a series of extra digits which represents other essential details of the image, such as dimensions, color depth, etc. These information would be useful when users wanted to know additional information about the files.
Audio Representation
As we all know, sound is a type of analog data, and in order to transfer it into digital signals so that the computers could store them, we needed to divide the audio into many small parts and capture separate samples which could be combined together to resemble the original sound (as shown in the picture).
Basically, there are 4 key terms in audio representation. The first term is sample rate, which refers to the numbers of audio samples captured every second. A higher sample rate means more samples captured overall, therefore higher quality of the audio. Another important definition is bit rate, meaning the numbers of bits that is available for each second. Bit rate could also be represented using the formula “bit rate = frequency * bit depth * channels”. In this case, bit depth means the number of bits available for the whole clip.
Normal sound waves are analog data, meaning that they are continuous and can be break down into infinite parts. In order to store audio information in finite computers, we needed a way to convert analog information into digital data. This process is known as audio encoding.
The method of representing analog signals digitally is called Pulse-Code Modulation (PCM). Then we needed sampling to acquire the number of samples per second, and quantization to transform continuous range of values into finite and discrete values. The final process is encoding, meaning that the audio is converted into a digital form.
Video Representation
Video representation is similar to a combination of image and audio representation. The audio data in videos are represented in the same way as mentioned above, while image representation is slightly different. Scientific research shows that when 24 frames of picture are shown in 1 second, for the human eye it would seem like the pictures are moving. When this speed reaches approximately 52 fps (frames per second), the movements in the video would seem natural for us.
In order to store so many images, videos usually applies two types of compression methods: temporal compression and spatial compression.

Temporal compression is used for scenes that contains little movement for has a still background. By analyzing the differences between consecutive frames, there would be a key frame that acts as a basis for comparation. Other frames that contain changes are known as delta frames. In this way, we could only store the section that is moving, therefore save the storage space of those repeating scenes that are static.
Spatial compression aims to combine groups of pixels that have the same value together and only present one of the values and the coordinates of those pixels. This mechanism is very similar to image representation (or in run-length encoding).
Codecs are programs that encode data into usable files for computers (like images or videos), and compression codecs are specifically designed to remove some data without losing the quality of the file.
Control Systems
For class presentation, we created a zoho slide in order to explain the control systems in elevators. In our presentation, we discussed about the sensors and hardware being used , the process in elevators when someone pressed a button, and possible situations of interruption, like when someone is standing between the doors. To know more information, please click the picture below to view the full presentation.

After the presentation, we read the answers provided on the text books. Luckily we got most of the answers correct, except for some small flaws like ignoring the existence of proximity sensors. After this activity I gained more knowledge on the operations of elevators, and also, control systems in general.
Poster preparation
On Thursday’s class, we prepared for the group poster presentation about text and characters. We planned to make the central theme of the poster related to TOEFL (because in that way we could incorporate alphabets, Chinese characters, integers, and float-point numbers together.) We have already assigned the work to each group member, and hopefully after this project we would be able to better comprehend the process of data representation and compression.

In conclusion, though we spend most of the time on preparation for posters and presentation, I still learned many useful information in this week’s class. For example, learning different ways of encoding text messages and representation of different forms of data allowed me to better understand the mechanisms of computers, while analyzing the control system in elevators helped me to realize that even a seemingly simple machine can have complex structures and process of execution. After this lesson, I would probably be more patient when waiting for elevators.