Week Three Blog

This week, we talked about all those files and compression in our computer.

Representing Text (ASCII and Unicode)

Last week, we learnt about how to present numbers in binary. This week, we expanded our range to text, through two techniques: ASCII and Unicode. ASCII starts for American Standard Code for Information Interchange. It represent computer commands, numbers and letters. At first, it used 7 bits to represent 128 item; then expended ASCII used 8 bits to represent more items. However, as more languages were supported by computing system, extended ASCII was not enough to represent all those international characters, so Unicode, which use 16 bits to represent a character, was introduced. 

Unicode封面-01
Presentation we did last year regarding to Unicode.

Data Compression

In a computer, there are only finite space, but people want to store infinite files. In order to store more files, people introduced a technique called compression. There are two types of compression: lossless and lossy. 

Lossless: use a symbol to represent repeating patterns. The compressed file can be decoded into the original file without losing any information. When we use compression applications (WinRAR, for example) to save space, we do not lose any information. 

Lossy: abandon certain details that human eyes may not detect. It save a large amount of space, but some original information would be lost. When photos are uploaded onto Instagram, they will be compressed into a 1080*1080 pixel photo. Other pixels would be abandoned. 

When we compress text files, we don’t want to lose any characters in the original file, so we use lossless compression. 3 types of text compression were introduced in class. The first one is keyword encoding. It simply means find out the most frequently appeared words and replace them with a shorter symbol. When decoding, computer uses a dictionary that record all the original terms and representative symbols. We have to make sure that the symbols are not used in the original text. In the following example, compression ratio reaches 89.4%. 

Original Passage

There are two kinds of experiments: laboratory experiment, field experiment and natural experiment. The first one is carried out in an artificial environment. Researchers manipulate the IVs and observe how DVs change, while every confounding variables are controlled. However, it lacks ecological validity, that is this situation is unlikely to happen in real world. In addition, the results may be biased, because of demand characteristics (participants know they are in an experiment and that may influence their behavior). In a field experiment, researchers do not strictly control all the extraneous variables, so it is closer to real-life situation. However, collecting accurate data is harder, and ethical concerns like informed consent and invasion of privacy may happen. In a natural experiment, on the other hand, researchers just record possible effects of an IV on a DV. No cause-and-effect relationship is possible to be conducted in this type, because no confounding variable is excluded. Ethical concerns may also happen. 

Dictionary

Experiment: #

Researchers: $

is: %

And: &

In: <

Compressed Passage

There are two kinds of experiments: laboratory #, field # & natural #. The first one % carried out < an artificial environment. $ manipulate the IVs & observe how DVs change, while every confounding variables are controlled. However, it lacks ecological validity, that % this situation % unlikely to happen < real world. < addition, the results may be biased, because of demand characteristics (participants know they are < an # & that may influence their behavior). < a field #, $ do not strictly control all the extraneous variables, so it % closer to real-life situation. However, collecting accurate data % harder, & ethical concerns like informed consent & invasion of privacy may happen. < a natural #, on the other hand, $ just record possible effects of an IV on a DV. No cause-&-effect relationship % possible to be conducted < this type, because no confounding variable % excluded. Ethical concerns may also happen. 

IMG_2137
Class activity: text compression

The second way of text compression is run length encoding. In a run length encoding, we use a flag to indicate the starting of a repeating phrase; then the repeated value, then the repeating time. For example, “*k6*64rr” means “kkkkkk6666rr”.

The third way of text compression is Huffman Encoding.

For encoding:

  1. Pick out the most frequently appeared letters and line then up.
  2. Give the most frequently appeared one shortest code, second-most frequently appeared one the second-shortest code, so on and so forth.
Screen Shot 2018-09-26 at 22.07.31
Notice: new letters could only be added to one side chain to avoid misinterpret.

For decoding:

  1. Look for match from left to right from dictionary.
  2. Replace codes with letter when a match is found.

Data Representation

In our computer, all kinds of files are represented by binary. This week, we learnt some information about how images, videos and audios are presented. 

Image

There are two types of image: Bitmap (or raster, composed of pixels, which are colorful dots) and vector (images are consisted of mathematical formulas). Photos taken by cameras are all bitmaps. Color depth means how many digits are used to store color information for each pixel. The default color depth in PhotoShop is 8 bits; however, to better represent colors, designers (I) usually use 16 bits when editing photos and creating works. Resolution means how many dots (or pixels) are there in an inch area. The resolution of our screen is around 300 dpi. Metadata shows the properties of image files. 

WechatIMG459
Class activity: bitmaps

Audio

There are four factors in audio representation. 

  • Sample rate: number of samples captured per second.
  • Bit depth: number of bits per second. 
  • Bit rate: number of bits per second. 
  • Codecs: a device to decode or encode digital data stream or signal. 

There are three procedures to convert analog audio signal into digital signal: 

  • Sampling: process of attaining number of sample per second. 
  • Quantization: convert a continuous range of value into finite range of value.
  • Encoding: convert information or instruction into another form. 

Video

  • Frame rate: number of still images per second.
  • Analog video signal: luminance, brightness and chrominance.
  • Aspect ratio: describe proportional of width & height of each frame.

HL: Control System Exercises Presentation

Screen Shot 2018-09-26 at 19.24.04.png
Cover of our presentation.

On Friday (which was the day that Mr. Pete received his new phone), we presented our High-level presentation about sensors. Our scene was the elevator. In a elevator, there may be proximity sensor (which floor it is at), pressure sensor (overload and button), Motion sensor (anything between the door) and smoke sensor. Other hardware may be speaker, motor, light and screen. The following picture shows the steps of control system when a elevator is called by pressing a button.

image.do
Steps when calling a elevator.

Interruption means electrical signal that cause immediate attention to a control system. It may happen at following conditions: when the elevator is overloaded, when someone is standing between the doors, someone is pressing the open button in the elevator or someone is pressing any button outside of the elevator.