IT Project Par 1
IT Project Par 1
Students:
Amr Khaled Mahmoud 19P8679
Mina Emad Maurice 19P
1. Code Sections:
In this section we extracted the symbols out of the text files, the variable
‘Content’ is used to store the content of the text file in characters.
The unique function extracts the unique symbols ( in our case is the
characters) out of the text files so every unique character is counted as a
symbol.
In order to calculate probabilities first we define the vector to store it, then in
the later for-loop we found the no of occurrences of each letter in the text
file then we divided it by the total number of characters in order to get each
symbol probability, ismember function marks every occurrence of the
symbol then the combination of length and find is used to calculate the
number of occurrences.
1.2. The second Section
In this section we are encoding the trial.txt file with our generated code
The shown for loop loops for the length of the characters of the trial file and
compares each character to symbols in the created dictionary , once it finds
the character is equal to the symbol it inserts its code instead. Then we use
the combination of string and strjoin to combine the codes as a string with
no spaces, then we print it into a text file called ‘Tx.txt’
1.5. Section five
Info:
Efficiency:
Compression Ratio:
Entropy
2.4. Section four
Transmitted Bit stream as a string:
2.5. Section five
Retrieved (Decoded) File:
Comparison Value: