Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please provide full Java source code for the task along with step-by-step explanation. Use Java for the task How are pictures sent from the Mariner
Please provide full Java source code for the task along with step-by-step explanation.
Use Java for the task How are pictures sent from the Mariner spacecraft back to earth? The spacecraft records the image internally as a sequence of 0's and 1's, and then sends the information back to earth. Even at the speed of light, the data may take several minutes to reach earth, and during its journey the signal gets somewhat garbled. By building redundancy into the signal, scientists back on earth can recover the original image free of any errors. Error correcting codes are one technique for building in the appropriate redundancy. Your goal is to write a program to correct errors in a transmission using the Hadamard error correction code. Each pixel of the image is represented by one of 32 possible gray-scale levels from 0 (white) to 31 (black). Later in the assignment, we'll deal with the case where each pixel is represented by three RGB color values, each in the range from 0 to 255 . We could represent each pixel in binary, using 5 bits. For example, if the spacecraft observed the gray-scale level of a pixel to be 13 , it could send the signal: Instead, for reasons that will become clear, we'll use the less parsimonious 32 bit encoding: When the pattern arrives at the telemetry receiving station on earth, the bit pattern might have been mangled to: where the asterisks denote errors that have occurred during transmission. Because we encode each gray scale value with 32 bits instead of 5 , there is some hope of identifying the errors and recovering the original message intact. A little bit of mathematical magic is needed. Hadamard code. The NN Hadamard matrix is an NN table of 0s and 1 's with a very special property: every two rows differ in exactly N/2 places. The Hadamard matrices for N=1,2,4,8, 16 , and N=32 are shown below, where white represents 0 and black represents 1 . Note that row 13 (start counting from 0 as usual) of the order 32 Hadamard matrix is which explains why we chose that encoding for gray-scale level 13 above. In general, the 2N2N Hadamard matrix is constructed by aligning 4 copies of the NN Hadamard matrix in the form of a large square, and then inverting all of the entries in the lower right NN copy. H1H2 H16 Now, when a 32 bit codeword is received on earth, it is compared with each of the rows of the 32x 32 Hadamard matrix until a "match" is found. If no errors were made in transmission, then the codeword will perfectly match (exactly) one of the rows. Otherwise, we choose the row in the Hadamard matrix that it most closely resembles, i.e., the number of bits the two have in common. If there was one error made in transmission, then the codeword will differ from one of the Hadamard rows in exactly one place. It will differ from every other row in at least 15 places, so there is no mistaking a match! Why? The Hadamard property guarantees that every two rows of the matrix differ in at least 16 places, so if the codeword is one bit away from one row, it must be 15 (or more) away from every other row. A similar thing happens if there are two, three, or even seven errors. However, if 8 errors occur, then the codeword may be 8 places away from an "incorrect" rowStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started