Monday, January 27, 2020

Lossless predictive coding

Lossless predictive coding Objective of the project Generating Huffman codeword using Huffman Coding to be transmitted to the decoder. Compare and analyze quality of 7 linear, fixed different Differential pulse code modulation (DPCM) predictors to find out which one achieves the best compression ratio. Compare and derive the compressed image against the original image to ensure our result has lossless compression. Introduction As we know, there is strong correlation or connection between spatially adjacent pixels. The aim of the predictive coding is to remove redundancy between consecutive pixels to facilitate the encoding of only the residual portion between actual and predicated (only new information). In other way, a pixel is coded as the difference between its actual value and a predicted value, which was computed from previously decoded values. As a result of that, compression ratio depends on the variance of the image, level of quantization of the difference values and quality of the prediction. After predictive coding, we can start to compress the original file size by using Differential pulse code modulation (DPCM) encoding and make a Huffman entropy codebook before transmitting the image. The decoder uses the Huffman codebook to first decode the Huffman entropy and followed by decoding Differential pulse code modulation (DPCM) to derive the constructed image.. Experimental result Differential Pulse Code Modulation (DPCM) Encoding Encode original Lena512.pgm image to DPCM values using 7 linear and fixed different Predictor methods: A (A + C)/2 (A + B + C)/3 A+B-C A+(B-C)/2 B+(A-C)/2 (A+B)/2 According to 7 above formulas, we can compute the difference between the previous pixel and current one. The predictor code table result will be sent to the next step, entropy encoder. The results show that the DPCM predictor B + (A -C)/2 achieves the best compression Ratio Entropy encoder (Huffman coding): Below part shows how the approach of Huffman coding is generated: Step 1: Retrieve the output of DPCM encoding. Step 2: Each value from DPCM encoding will be generated according to each occurrence probability in descending order. Step 3: Assign the Huffman codeword for each computed probability value For example: Each child probabilities is added to create the parent. The adding of probabilities continues until the root with final probability 1.0 as shown above. Hence, the Huffman Coding Table is formed. A bit is assigned to every node. The 0 bit is assigned to every left sub-tree of every node and the 1 bit is assigned to every right sub-tree of every node. Average length per symbol = 10.6+20.2+30.1+30.1= 1.6 bits/symbol In our experiment, since the optimal predictor is B + (A -C)/2, the codebook is generated according to this predictor. The DPCM values ranges from [-75, 87]. The table below shows the first 8 values among 162 DPCM values in Huffman codebook. RESULT DISCUSSIONS: (Optimal Predictor B + (A -C)/2, Encoding Part) Average bit/pixel=Compressed Size (Bits) / (columns x rows) =Compressed Size/ (512 x 512) After generating 162 codewords we are able to achieve 902428 bits. The derived average bit/pixel is approximately 3.442 bits/pixel. Compression Ratio= Original image size / Compressed image size Compression Ratio= 8 bits / (Average bit/pixel) (image resolution: 8 bits per pixel) The original image (Lena512.pgm picture) is a fixed 8 bits/pixel. Therefore, the compression ratio is 8/3.442=2.3239 by using Huffman codes. In order to write a file into binary bit format, the 8 binary adjacent bits is read and converted an integer. For Huffman decoding, the integers are written into a file. Entropy decoder (Huffman Decoding): The Huffman decoder uses the compressed image to regenerate the DPCM table. The compressed file integers are read and converted into a set of binary bits. If the binary code is not a prefix of any code, read each and every bit in the codebook to find a match. If no match is found, continue the search till a match is found in the codebook. Retreive the corresponding DPCM value for the binary code set. Step 2 is repeated until the binary set is exhausted. A DPCM table is generated and this is called the DPCM decoding process. For example: After converting integers into a set of binary bits, we have encoded bit stream of the first few pixels: 110111001101110011011101 According to Huffman lookup table, the corresponding DPCM values are: 87 87 86 DPCM Decoding: After decoding DPCM, the reconstructed image is retrieved. According to the above images, it can be concluded that the compression is a lossless one. There is no difference between original image and compressed one, as above images shown in reality or DPCM values encoded and decoded in theory. Project Discussion Analyzing Different Predictors for Lena.pgm Through above diagram, we can see the compression ratio of using one neighboring pixel (Predictor 1: A) for prediction is lower than using two or three neighboring pixels. And predictors which use 2 neighboring pixels have lower compression ratio than ones with 3 neighboring pixels Analyzing Different Predictors for other images: To further evaluate performance of the predictors, 4 different images were chosen to compute the effects the performance of the predictors. From the above diagrams, compression ratio of methods from 3 to 6 (They are: (A + B + C)/3, A+B-C, A+ (B-C)/2, B+ (A-C)/2 ) is higher than the rest. As there is strong connection between adjacent pixels, any predictor which can utilize connection between adjacent pixels produces good compression ratio As a result of that, the methods which use 1 or 2 neighboring pixels can not utilize this connection well. For example: Predictor A is used (only 1 pixel is used) for the first method. The encoded values are dependent on the previous value of the same row. Thus, the first columns values cannot be predicted or this predictor does not use connection between neighboring pixels appropriately. On the other hand, the images that fall at the center region have a lower compression ratio than ones which spreads over the entire white-grey-black scale.. Since the conducted experiments pertain only on .pgm format images (Black-And-White image), it is unable to determine compression ratio of colored images (RGB, YCbCr, HSV color bases) Conclusion According to all above experiments and diagrams, we can assert that there is no one definite predictor for every image to achieve best compression ratio because different images need different predictors to achieve better compression results. In general, since there is strong correlation between spatially adjacent pixels, any predictor which can utilize connection between adjacent pixels produces good compression ratio. In our experiment compression method from 3 to 6 will produce better compression than the rest. In reality, Static Huffman Coding is popular and easy to implement but does not obtain theoretically optimum number of bits to encode symbols because of condition: Huffman codeword must be an integer number of bits long, e.g. if probability of 1 symbol is 0.9, the optimum code word size should be 0.15 bits but in Huffman Coding, it is 1 bit. Moreover, if symbol probabilities are unknown or not stable (source changes), Dynamic Huffman coding should be chosen but the implementation is very complicated. On the other hand, so as to achieve non-integer length coding and probability derived in real-time, Arithmetic coding is a good alternative. However, the implementation of Arithmetic coding is slow due to many multiplications (in some cases, divisions).

Sunday, January 19, 2020

How Charlotte Bronte Uses the Different Houses in Jane Eyre Essay

How Charlotte Bronte Uses the Different Houses in Jane Eyre In the novel Jane Eyre, Charlotte Bronte uses different locations in particular different houses to produce a structural base for the story and to provide a basis for Jane’s progression through life and the changes she experiences. The houses are a background to the plot of Jane Eyre that is the evolution of Jane from lonely orphan at Gateshead into an established and well-developed character at Ferndean who is Mr Rochester’s equal. Throughout the story Jane lives in many houses all that are different in certain aspects but in some aspects they are similar. One such aspect is that all the houses have a dominant male in Gateshead it is John Read in Lowood it is Mr Brocklehurst and at Thornfield even though she is equal to Mr Rochester when they are alone when guests are present she must then observe the social hierarchy which means Mr Rochester is dominant over Jane. Another similarity is that in each of different and contrasting houses there is always an over all feeling of Jane being trapped and constrained inside their walls. Jane is always fighting against the dominant males in the houses as seen when she encounters John Reed and calls him a murderer. She always rebels against the dominant male in the household until she meets Rochester who is not only the dominant male but also a kind and loving person. Apart from the dominant male in each house there is also a kind guide such as Bessie in Gateshead and Miss Temple in Lowood. There is one exception and this is in Thornfield where Mr Rochester is both the dominant male and kind presence in the house. In Jane Eyre houses play an important part in shaping and forming the structure of the nov... ...gainst the mystery of Grace Poole and her connection to Mr Rochester. Unlike her stay at Gateshead she is allowed both a social position as a governess and respect member of the house her personal situation with Mr Rochester. Since Jane is a governess and is not of the higher class that Mr Rochester is from. She cannot appear to be involved with him but this only when outsiders arrive. This also represents that Jane is not rebelling against the hypocrisy with Mr Rochester because if she were then she would not observe the social hierarchy. Like all the places Jane has lived in so far Thornfield does supply the amount of freedom that Jane would like. She is still trapped in to certain degree and she longs for something more. She wants just a bit more freedom but she cannot get that at Thornfield at the time she is there. The only place in Thornfield

Saturday, January 11, 2020

Toothpaste Out of Baking Soda

Chapter I The Problem and its Background Introduction Many people nowadays are urged to be aggressive, to get ahead of the rest and to be number one. We are pulled by media toward self-centered pleasures. So many commercials show us a lifestyle of pleasure and according to them can makes us happy. We are most of the time driven by their promises of making us comfortable and beautiful. The products they are advertising may have bad effects on our health that they may not spill out to us for the reason that their products may not be sold. These products may contain harmful ingredients and chemicals that may lead to diseases and abnormalities in our bodies. An example is the commercial toothpaste. Commercial toothpastes are full of chemicals and some of the ones that you see on your shelves have been shown to contain harmful ingredients. Research has proven that sodium lauryl sulfate or (SLS) found in most toothpastes have a tendency to dry out the lining of your mouth and gums. This can cause gum damage and sores in the mouth because of the acidity in foods and drinks that the lining would normally protect against. Statement of the Problem The study aims to discover the advantages of making your own lemon-flavored toothpaste out of baking soda instead of buying from the market. The study seeks to answer the following questions: 1. What are the advantages that we can get from making toothpaste out of baking soda? 2. What are the effects of making your own toothpaste to those who will be using it? 3. What ingredients or materials help whiten and polish teeth? 4. What are the other possible flavors that can be added to the toothpaste aside from lemon zest? Scope and Limitation The study focuses on the advantages of making your own toothpaste out of baking soda. It is confined on what are the benefits the user can get from making their own toothpaste and how it will affect their teeth health. It does not include the research on the other ways of making your own toothpaste aside from baking soda. Significance of the Study This study will benefit the following: The ordinary people. For them to be informed of the effects of using comm ercial toothpastes. The parents. For them to save money in times they become short and to be sure of the ingredients that go in to their toothpaste. The teenagers. For them to develop their creativity in making their own toothpaste and for them to know what materials actually help the teeth become healthy. Definition of Terms Toothpaste is a substance for cleaning the teeth in the form of paste. Baking soda or bicarbonate of soda, is a leavening agent used in baked goods like cookies or quick breads. Lemon zest are  tiny bits of lemon peel Glycerin is a clear, colorless, syrupy  liquid  that occurs extensively in nature and is naturally found in the  cells of  plants,  animals and humans. Hydrogen peroxide is a colorless, heavy, strongly oxidizing liquid, H2O2, capable of reacting explosively with combustibles and used principally in aqueous solution as a mild antiseptic, a bleaching agent, an oxidizing agent, and a laboratory reagent. Chapter IV Summary, Findings, Conclusions and Recommendation Summary The study aims to discover the advantages of making your own lemon-flavored toothpaste out of baking soda instead of buying from the market. Toothpaste  is a paste or  gel  dentifrice  used with a  toothbrush  as an accessory to clean and maintain the aesthetics and health of  teeth. Most of the commercial toothpastes that can be bought from the market contain harmful ingredients. This can be avoided by making your own toothpaste. To make your own lemon-flavored toothpaste, we will just mix everything up. To make the lemon zest, you will just grate the peel of a lemon by rubbing the lemon on the grater. In adding up the lemon zest, you can experiment on it. It’s the part where you can have fun. We observed that our final product, the lemon flavored toothpaste out of baking soda, became color yellow. After we have tried it, we felt freshness in our teeth. Also, based on our research, baking soda does really help whiten teeth and in fact, it is an element of most toothpaste and have been approved by the American Dental Association to be a component of most toothpaste. Findings The advantages that we can get from making toothpaste out of baking soda are that, you can know that you are using an all-natural product. These are a more natural alternative and they do a wonderful job at cleaning the m outh. Making your own toothpaste will help you save money and you will have the benefit of knowing the exact ingredients that go into your own toothpaste. Your toothpaste will not have any artificial ingredients that color it and flavor it. You will be able to avoid sweeteners, artificial ingredients and preservatives simply by making your own toothpaste. The people who would be using their homemade toothpaste will have a chance to show their creativity and personalize their toothpaste. They would be able to know the ingredients that are needed to help whiten teeth. Baking soda and hydrogen peroxide are the ingredients or materials which help whiten and polish teeth. Baking soda has a natural cleansing ability and can even be found in some commercial toothpaste. It's non-toxic and will help polish your teeth. Hydrogen peroxide naturally disinfects your mouth and will also help whiten your teeth. Aside from lemon-flavored toothpaste, you can also have any other fruit flavor you may like for your toothpaste. You can also have mint-flavored toothpaste by adding peppermint oil or cinnamon. Conclusion As we are making this project we can conclude that making your own toothpaste have a variety of advantages to the person using it. The user will have the experience of having fun experimenting what is the best flavor for a toothpaste. Though the taste may not be that desirable, but it do a brilliant job of cleaning and whitening your teeth. We can also conclude that making your own to othpaste can help avoid the harmful ingredients being added to commercial toothpaste. The person who will be using it will be developing a sense of awareness of how baking soda and hydrogen peroxide do such a wonderful job at whitening teeth and polishing teeth. They will also be able to save money and at the same time have fun experimenting. Recommendation We recommend you to try and make your own toothpaste whenever you run out of it. You can try making other flavors of toothpaste and personalize it. With the many advantages of making your own toothpaste, you will surely benefit from it. We also recommend that you encourage others to make their own toothpaste and have fun experimenting different flavors for their toothpaste. They may even discover many combinations of flavors that they will be energized to brush their teeth!

Friday, January 3, 2020

Reflection Questions On Fences - 1187 Words

Questions for Reflection 1. I do not relate much to the characters in Wilson’s play because my family dynamics are quite different from the characters in Fences. I have faced little opposition in my career choices from my parents, unlike Troy’s opposition to Cory’s wanting to play football. Also, unlike Cory, I am an only child. We do, however, have family friends drop in regularly like Bono does. 2. He first establishes the time period and its effects on the characters through a description of how Troy’s boss will not promote him from garbage collector due to the color of his skin. Wilson then differentiates the relationship between the various characters through starkly different conversation styles. He writes casual conversation and†¦show more content†¦Another reference is when Troy refers to the white man as the devil. When talking about how he has to pay the ten dollars rent every month, Troy says the man who came to tell him about the rent was the devil, to which Rose responds â€Å"Anything you cant understand, you want to call it the devil.† This illustrates that Troy associates whatever comes in his way with the devil because it weighs him down from what he could have done. His association of the white man with the devil also stems from his not being able to play baseball in his youth because he is black. 4. Wilson makes his characters believable by giving each character vividly different personality traits as well as showing the strengths and faults of each character. From the beginning, Wilson describes Bono as a jovial and loyal yet calm friend contrasted to the more boisterous, animated, and leading personality of Troy. The aspect that makes all the characters very realistic is that they are not perfect, and their mistakes do not go unpunished. Troy, the character who drives most of the play’s action, has the most obvious strengths and flaws, his strengths being that he is a strong-willed, energetic man who works hard. His major flaws are that he is defensive and does not take a good suggestion, lies to get what he wants, cannot see others getting the success he failed to achieve, and is unfaithful. When Bono remindsShow MoreRelatedThe Laramie Project, By Moses Kaufman Essay1583 Words   |  7 Pagesartistic group of Kaufman s, traveled to Laramie to find out more about th e horrific incidence. The main aim of the whole project was to find the emotions, reactions, and reflections that the people of Laramie manifested concerning the beating and subsequent death of a twenty-three-year-old college student (Gale, 2016). A lot of questions were raised concerning the death as people had different point of views. Some thought it was a hate crime, others thought it was just a brutal assault or a form of robberyRead MoreAdd Maths Project Work1182 Words   |  5 PagesExploration | | |7 |Conclusion | | |8 |Reflection | | |9 |Reference | | |10 Read MoreThe Mending Wall by Robert Frost Essay1226 Words   |  5 Pageswhose works epitomized the Modernist literary movement, and in turn represented the mood and minds of a nation. Frost remains emblematic of a specific time in our country. Through the words of the poet, readers of his day could see a real-time reflection of themselves - visible in Frosts verses were the hopes and apprehensions that marked the first half of the twentieth- century. However, in his ability to express this unlikely mixture of cynicism and sentiment, Frost did more than captureRead MoreOutline And Evaluate A Particular Scenario From Your Own Ministerial Experience1491 Words   |  6 Pagesincident which has been subject to theological reflection. Underlying each heading will be a four-part process which: 1. Obtains the data. 2. Evaluates the facts. 3. Draws a conclusion following a logical process. 4. Interrogates the conclusion. It begins by setting the background into context, before moving on to a description of the incident under scrutiny. Thereafter the incident is outlined and evaluated in the light of a spiral model of reflection. In order to measure effectiveness, the sameRead MoreSocial, Political, And Family Issues On August Wilson s Fences1596 Words   |  7 PagesSocial, Political, and Family Issues in August Wilson’s Fences August Wilson’s Fences depicts life in the 1950s for a typical African American family. The play touches upon racism, shifting family dynamics, and the politics of war. While racism plays an important and vital role in the play, instead of lamenting the issue, Wilson uses the characters as a weapon against the rampant racism of the time. In the same fashion, the relationship between Troy, Rose, and Cory demonstrates the shifting culturalRead MoreThe Rain Of The Snow1467 Words   |  6 Pages and a fence made out of trees on the right. In the distance is a figure with a long shadow, a person. The person doesn t have a negative presence, but he does stick out. Farther in the distance and above the trees is a tower with a red light. The whole scene is a mystery. The person in the image is just standing there, not interacting with the environment at all. The location of this scene is unknown. The tower in the distance looks like a radio tower. The image is just one big question m ark. Read MoreAnylizing Concepts of Justice in to Kill a Mockingbird1660 Words   |  7 PagesAnalyzing the Concept of Justice in To Kill a Mockingbird Through the study this term of the central text, To Kill a Mockingbird by Harper Lee, and related texts, films Rabbit Proof Fence by Phillip Noyce and In the Name of the Father by Jim Sheridan, my understanding of the concept of justice, or what constitutes justice, has altered considerably. We all think we know what justice is, or what it should be. In Australian colloquial terms, it is the principle of a â€Å"fair go† for everyone. In a perfectRead MoreAnalysis Of The Newspaper I Really Mean Essay1308 Words   |  6 Pagesresembled a uniform- or, a uniform which resembled a gray suit. In this clothes, his image corresponded to the one I had vaguely drawn in my mind of Etienne Duboulet, the Baron’s valet. He was surprised, and alarmed to see Sanvergogne. From behind the fence, he asked my friend to state his business. His shaky voice reveals an uneasiness that he tried to hide behind the solemnity of his demeanor. Sanvergogne in a flashy gesture, pulled out a calli ng card, which, in his huge hand, looked like a confettiRead MoreIts Not Finished,, , but My Speech on Reflect Upon How Your Understanding of Representation, History and Memory Has Been Shaped by This Elective1173 Words   |  5 PagesSpeech – Reflection on History and Memory Throughout time, perspectives of history and memory have changed. They have been moulded by the events of our time as well as the texts and we read. The question of what is history and memory is being raised. Is it a scholarly discipline that claims to record the truth vs. a cognitive faculty coloured by trauma and emotion? To me history is represented as official memory of the winning side. As a result, it is very subjective, selective, bias and with multipleRead MoreEssay about Biography of Robert Frost1222 Words   |  5 Pageswhen he is in England. This poem is a reflection of the days when he is living on his farm in New Hampshire. This poem is about two neighbors who every year fix the stone wall that separates their property. What makes the poem somewhat ironic is that the neighbors really dont speak to each other or for that matter even like each other very much. Yet every year the two neighbors fix the wall together. One of the famous lines in this poem is Good fences make good neighbors. To me that line