"cells": [
{
"cell_type": "code",
- "execution_count": 22,
+ "execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
- "Source entropy: 3.752113900074267\n",
- "A 100 0.11124094587747317\n",
- "G 011 0.10871437801707752\n",
- "J 010 0.10387210756270529\n",
- "N 000 0.10117027679041204\n",
- "D 0011 0.05197115173264662\n",
- "H 1011 0.06917828453811696\n",
- "I 0010 0.05068162249832686\n",
- "K 1100 0.06944726813123069\n",
- "L 1111 0.09883293392076788\n",
- "O 1101 0.08712441679935146\n",
- "F 10101 0.03078339099377846\n",
- "P 11101 0.04731352894459562\n",
- "B 101000 0.013013334609193211\n",
- "C 101001 0.014536815467673516\n",
- "E 111001 0.022193047647813914\n",
- "M 111000 0.019926496468836808\n",
- "decoded: JGGAKLPM\n",
+ "A 010 0.10889628583541382\n",
+ "C 001 0.09152888714794946\n",
+ "G 000 0.08903984849793534\n",
+ "B 1011 0.07059353601667875\n",
+ "E 1001 0.07001353988551143\n",
+ "H 1111 0.08826797559046656\n",
+ "J 1101 0.07422403331445343\n",
+ "K 0111 0.05648000917065521\n",
+ "L 1110 0.08784093309263273\n",
+ "N 0110 0.05289972255448987\n",
+ "O 1100 0.07110861095979067\n",
+ "P 1010 0.07018129978231921\n",
+ "F 10000 0.024254244476492406\n",
+ "D 100011 0.022376076316506087\n",
+ "I 1000100 0.006899547136273925\n",
+ "M 1000101 0.015395450222431209\n",
+ "\n",
+ "encoded: 01001101110011001111111011110000\n",
+ "decoded: ANLNKHKF\n",
+ "\n",
+ "Source entropy: 3.802902958392826\n",
"Average codeword length: 4.375\n"
]
}
"letters = [chr(i+65) for i in range(num_of_letters)]\n",
"random_probs = [random.random() for _ in range(num_of_letters)]\n",
"total_prob = sum(random_probs)\n",
- "# cannot be 1 / 256\n",
"probabilities = {letters[i]: random_probs[i] / total_prob for i in range(16)}\n",
"\n",
+ "# Probability cannot be 1 / 256\n",
"while True:\n",
" for i in range(16):\n",
" if list(probabilities.values())[i] <= (1 / 256):\n",
- " print(\"false\")\n",
" continue\n",
" break\n",
"\n",
- "\n",
- "source_entropy = -1*sum([p * math.log2(p) for l, p in probabilities.items()])\n",
- "print(\"Source entropy: \", source_entropy)\n",
- "\n",
"def huffman_coding(probabilities):\n",
" heap = [[weight, [symbol, \"\"]] for symbol, weight in probabilities.items()]\n",
" heapify(heap)\n",
"encoded_string=\"01001101110011001111111011110000\"\n",
"decoded_symbols = huffman_decoding(encoded_string, code_dict)\n",
"\n",
- "print(f\"decoded: {decoded_symbols}\")\n",
+ "print()\n",
+ "print(f\"encoded: {encoded_string}\\ndecoded: {decoded_symbols}\")\n",
+ "print()\n",
+ "\n",
+ "source_entropy = -1*sum([p * math.log2(p) for l, p in probabilities.items()])\n",
+ "print(\"Source entropy: \", source_entropy)\n",
"\n",
"average_len = sum([len(code) for l, code in code_dict.items()]) / len(code_dict)\n",
- "print(\"Average codeword length: \", average_len)\n"
+ "print(\"Average codeword length: \", average_len)"
]
},
{
\gdef\HyperFirstAtBeginDocument#1{#1}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}
-\@writefile{toc}{\contentsline {section}{\numberline {0.1}Laboratory Exercise 2}{1}{section.0.1}\protected@file@percent }
-\@writefile{toc}{\contentsline {section}{\numberline {0.2}Laboratory Exercise 3}{1}{section.0.2}\protected@file@percent }
-\@writefile{toc}{\contentsline {section}{\numberline {0.3}Laboratory Exercise 4}{1}{section.0.3}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {0.3.1}Student task 1: Generation of constellations}{1}{subsection.0.3.1}\protected@file@percent }
-\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces 8-PAM constellation}}{2}{figure.0.1}\protected@file@percent }
-\newlabel{fig:pam8}{{1}{2}{8-PAM constellation}{figure.0.1}{}}
-\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces QPSK constellation}}{2}{figure.0.2}\protected@file@percent }
-\newlabel{fig:qpsk}{{2}{2}{QPSK constellation}{figure.0.2}{}}
-\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces 8-PSK constellation}}{3}{figure.0.3}\protected@file@percent }
-\newlabel{fig:psk8}{{3}{3}{8-PSK constellation}{figure.0.3}{}}
-\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces 16-QAM constellation}}{3}{figure.0.4}\protected@file@percent }
-\newlabel{fig:qam16}{{4}{3}{16-QAM constellation}{figure.0.4}{}}
-\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Reception of 8-PAM modulated symbols through an AWGN channel.}}{4}{figure.0.5}\protected@file@percent }
-\newlabel{fig:pam8_recv}{{5}{4}{Reception of 8-PAM modulated symbols through an AWGN channel}{figure.0.5}{}}
-\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Reception of QPSK modulated symbols through an AWGN channel.}}{4}{figure.0.6}\protected@file@percent }
-\newlabel{fig:qpsk_recv}{{6}{4}{Reception of QPSK modulated symbols through an AWGN channel}{figure.0.6}{}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {0.3.2}Student task 2: Signal transmission through AWGN channel}{4}{subsection.0.3.2}\protected@file@percent }
-\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Reception of 8-PSK modulated symbols through an AWGN channel.}}{5}{figure.0.7}\protected@file@percent }
-\newlabel{fig:psk8_recv}{{7}{5}{Reception of 8-PSK modulated symbols through an AWGN channel}{figure.0.7}{}}
-\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces Reception of 16-QAM modulated symbols through an AWGN channel.}}{5}{figure.0.8}\protected@file@percent }
-\newlabel{fig:qam16_recv}{{8}{5}{Reception of 16-QAM modulated symbols through an AWGN channel}{figure.0.8}{}}
-\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces Symbol and bit error rate of 8-PAM modulated symbols through an AWGN channel for different SNR values.}}{6}{figure.0.9}\protected@file@percent }
-\newlabel{fig:pam8_error}{{9}{6}{Symbol and bit error rate of 8-PAM modulated symbols through an AWGN channel for different SNR values}{figure.0.9}{}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {0.3.3}Student task 3: Channel coding}{6}{subsection.0.3.3}\protected@file@percent }
-\@writefile{lof}{\contentsline {figure}{\numberline {10}{\ignorespaces Symbol and bit error rate of QPSK modulated symbols through an AWGN channel for different SNR values.}}{7}{figure.0.10}\protected@file@percent }
-\newlabel{fig:qpsk_error}{{10}{7}{Symbol and bit error rate of QPSK modulated symbols through an AWGN channel for different SNR values}{figure.0.10}{}}
-\@writefile{lof}{\contentsline {figure}{\numberline {11}{\ignorespaces Symbol and bit error rate of 8-PSK modulated symbols through an AWGN channel for different SNR values.}}{7}{figure.0.11}\protected@file@percent }
-\newlabel{fig:psk8_error}{{11}{7}{Symbol and bit error rate of 8-PSK modulated symbols through an AWGN channel for different SNR values}{figure.0.11}{}}
-\@writefile{lof}{\contentsline {figure}{\numberline {12}{\ignorespaces Symbol and bit error rate of 16-QAM modulated symbols through an AWGN channel for different SNR values.}}{8}{figure.0.12}\protected@file@percent }
-\newlabel{fig:qam16_error}{{12}{8}{Symbol and bit error rate of 16-QAM modulated symbols through an AWGN channel for different SNR values}{figure.0.12}{}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {0.3.4}Report Questions}{8}{subsection.0.3.4}\protected@file@percent }
-\@writefile{lof}{\contentsline {figure}{\numberline {13}{\ignorespaces Bit error rate of QPSK modulated symbols with and without Hamming code (7, 4) across different SNR values. }}{9}{figure.0.13}\protected@file@percent }
-\newlabel{fig:qpsk_hamming}{{13}{9}{Bit error rate of QPSK modulated symbols with and without Hamming code (7, 4) across different SNR values}{figure.0.13}{}}
-\@writefile{toc}{\contentsline {section}{\numberline {.1}Code for Laboratory Exercise 4}{9}{section.Alph0.1}\protected@file@percent }
-\newlabel{app:code_lab4}{{.1}{9}{Code for Laboratory Exercise 4}{section.Alph0.1}{}}
-\gdef \@abspage@last{23}
+\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{2}{section.1}\protected@file@percent }
+\@writefile{toc}{\contentsline {section}{\numberline {2}Laboratory exercise 2}{3}{section.2}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Student tasks}{3}{subsection.2.1}\protected@file@percent }
+\@writefile{tdo}{\contentsline {todo}{}{3}{section*.2}\protected@file@percent }
+\pgfsyspdfmark {pgfid1}{31668851}{38970899}
+\pgfsyspdfmark {pgfid4}{34440478}{38984355}
+\pgfsyspdfmark {pgfid5}{36357406}{38739169}
+\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Report questions}{3}{subsection.2.2}\protected@file@percent }
+\@writefile{tdo}{\contentsline {todo}{{\@@par }}{3}{section*.3}\protected@file@percent }
+\pgfsyspdfmark {pgfid6}{16003597}{25441873}
+\pgfsyspdfmark {pgfid9}{34440478}{25455329}
+\pgfsyspdfmark {pgfid10}{36357406}{25210143}
+\@writefile{toc}{\contentsline {section}{\numberline {3}Laboratory exercise 3}{3}{section.3}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Student tasks}{3}{subsection.3.1}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Report questions}{4}{subsection.3.2}\protected@file@percent }
+\@writefile{tdo}{\contentsline {todo}{{\@@par }}{5}{section*.4}\protected@file@percent }
+\pgfsyspdfmark {pgfid11}{16003597}{43072613}
+\pgfsyspdfmark {pgfid14}{34440478}{43064305}
+\pgfsyspdfmark {pgfid15}{36357406}{42819119}
+\@writefile{toc}{\contentsline {section}{\numberline {4}Laboratory exercise 4}{5}{section.4}\protected@file@percent }
+\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces 8-PAM constellation}}{6}{figure.1}\protected@file@percent }
+\newlabel{fig:pam8}{{1}{6}{8-PAM constellation}{figure.1}{}}
+\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Student task 1: Generation of constellations}{6}{subsection.4.1}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Student task 2: Signal transmission through an AWGN channel}{6}{subsection.4.2}\protected@file@percent }
+\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces QPSK constellation}}{7}{figure.2}\protected@file@percent }
+\newlabel{fig:qpsk}{{2}{7}{QPSK constellation}{figure.2}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces 8-PSK constellation}}{7}{figure.3}\protected@file@percent }
+\newlabel{fig:psk8}{{3}{7}{8-PSK constellation}{figure.3}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces 16-QAM constellation}}{8}{figure.4}\protected@file@percent }
+\newlabel{fig:qam16}{{4}{8}{16-QAM constellation}{figure.4}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Reception of 8-PAM modulated symbols through an AWGN channel.}}{8}{figure.5}\protected@file@percent }
+\newlabel{fig:pam8_recv}{{5}{8}{Reception of 8-PAM modulated symbols through an AWGN channel}{figure.5}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Reception of QPSK modulated symbols through an AWGN channel.}}{9}{figure.6}\protected@file@percent }
+\newlabel{fig:qpsk_recv}{{6}{9}{Reception of QPSK modulated symbols through an AWGN channel}{figure.6}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Reception of 8-PSK modulated symbols through an AWGN channel.}}{9}{figure.7}\protected@file@percent }
+\newlabel{fig:psk8_recv}{{7}{9}{Reception of 8-PSK modulated symbols through an AWGN channel}{figure.7}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces Reception of 16-QAM modulated symbols through an AWGN channel.}}{10}{figure.8}\protected@file@percent }
+\newlabel{fig:qam16_recv}{{8}{10}{Reception of 16-QAM modulated symbols through an AWGN channel}{figure.8}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces Symbol and bit error rate of 8-PAM modulated symbols through an AWGN channel for different SNR values.}}{10}{figure.9}\protected@file@percent }
+\newlabel{fig:pam8_error}{{9}{10}{Symbol and bit error rate of 8-PAM modulated symbols through an AWGN channel for different SNR values}{figure.9}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {10}{\ignorespaces Symbol and bit error rate of QPSK modulated symbols through an AWGN channel for different SNR values.}}{11}{figure.10}\protected@file@percent }
+\newlabel{fig:qpsk_error}{{10}{11}{Symbol and bit error rate of QPSK modulated symbols through an AWGN channel for different SNR values}{figure.10}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {11}{\ignorespaces Symbol and bit error rate of 8-PSK modulated symbols through an AWGN channel for different SNR values.}}{11}{figure.11}\protected@file@percent }
+\newlabel{fig:psk8_error}{{11}{11}{Symbol and bit error rate of 8-PSK modulated symbols through an AWGN channel for different SNR values}{figure.11}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {12}{\ignorespaces Symbol and bit error rate of 16-QAM modulated symbols through an AWGN channel for different SNR values.}}{12}{figure.12}\protected@file@percent }
+\newlabel{fig:qam16_error}{{12}{12}{Symbol and bit error rate of 16-QAM modulated symbols through an AWGN channel for different SNR values}{figure.12}{}}
+\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}Student task 3: Channel coding}{12}{subsection.4.3}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {4.4}Report questions}{12}{subsection.4.4}\protected@file@percent }
+\@writefile{lof}{\contentsline {figure}{\numberline {13}{\ignorespaces Bit error rate of QPSK modulated symbols with and without Hamming code (7, 4) across different SNR values. }}{13}{figure.13}\protected@file@percent }
+\newlabel{fig:qpsk_hamming}{{13}{13}{Bit error rate of QPSK modulated symbols with and without Hamming code (7, 4) across different SNR values}{figure.13}{}}
+\@writefile{tdo}{\contentsline {todo}{{\@@par }}{13}{section*.5}\protected@file@percent }
+\pgfsyspdfmark {pgfid16}{16003597}{21933911}
+\pgfsyspdfmark {pgfid19}{34440478}{21947367}
+\pgfsyspdfmark {pgfid20}{36357406}{21702181}
+\@writefile{toc}{\contentsline {section}{\numberline {A}Python-code: Laboratory exercise 2}{14}{appendix.A}\protected@file@percent }
+\newlabel{app:code_lab2}{{A}{14}{Python-code: Laboratory exercise 2}{appendix.A}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {B}Python-code: Laboratory exercise 3}{14}{appendix.B}\protected@file@percent }
+\newlabel{app:code_lab3}{{B}{14}{Python-code: Laboratory exercise 3}{appendix.B}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {C}Python-code: Laboratory exercise 4}{15}{appendix.C}\protected@file@percent }
+\newlabel{app:code_lab4}{{C}{15}{Python-code: Laboratory exercise 4}{appendix.C}{}}
+\gdef \@abspage@last{28}
# Fdb version 3
-["pdflatex"] 1733965317 "/home/nils/kurser/TSKS35/report/main.tex" "main.pdf" "main" 1733965318
+["pdflatex"] 1733970737 "/home/nils/kurser/TSKS35/report/main.tex" "main.pdf" "main" 1733970739
"/etc/texmf/web2c/texmf.cnf" 1718133671 475 c0e671620eb5563b2130f56340a5fde8 ""
"/home/nils/.texlive2021/texmf-var/fonts/pk/ljfour/jknappen/ec/tcrm1095.600pk" 1733953238 12644 f6a09bfc9317d07418ad465c0e240344 ""
- "/home/nils/kurser/TSKS35/report/main.tex" 1733965317 27099 cea90a61dcbf70472bf973707bdfd655 ""
+ "/home/nils/kurser/TSKS35/report/main.tex" 1733970737 33434 948c3b9dffa912aa6517edf8b028059f ""
"/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1577235249 3524 cb3e574dea2d1052e39280babc910dc8 ""
"/usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/tcrm1095.tfm" 1136768653 1536 02c06700a42be0f5a28664c7273f82e7 ""
"/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm" 1136768653 1328 c834bbb027764024c09d3d2bf908b5f0 ""
"/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm" 1136768653 1124 6c73e740cf17375f03eec0ee63599741 ""
"/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy6.tfm" 1136768653 1116 933a60c408fc0a863a92debe84b2d294 ""
"/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy8.tfm" 1136768653 1120 8b7d695260f3cff42e636090a8002094 ""
+ "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmti10.tfm" 1136768653 1480 aa8e34af0eb6a2941b776984cf1dfdc4 ""
"/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmtt10.tfm" 1136768653 768 1321e9409b4137d6fb428ac9dc956269 ""
"/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmtt9.tfm" 1136768653 764 c98a2af25c99b73a368cf7336e255190 ""
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb" 1248133631 34811 78b52f49e893bcba91bd7581cdc144c0 ""
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb" 1248133631 32362 179c33bbf43f19adbb3825bb4e36e57a ""
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb" 1248133631 32726 0a1aea6fcd6468ee2cf64d891f5c43c8 ""
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb" 1248133631 32569 5e5ddc8df908dea60932f3c484a54c0d ""
+ "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb" 1248133631 37944 359e864bd06cde3b1cf57bb20757fb06 ""
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt9.pfb" 1248133631 29078 718ea4567ceff944262b0f5b0800e1d9 ""
"/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii" 1461363279 71627 94eb9990bed73c364d7f53f960cc8c5b ""
"/usr/share/texlive/texmf-dist/tex/generic/atbegshi/atbegshi.sty" 1575674566 24708 5584a51a7101caf7e6bbf1fc27d8f7b1 ""
"/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex" 1605910342 7677 cf3e6aa6a8d444f55327f61df80bfa0c ""
"/usr/share/texlive/texmf-dist/tex/latex/atveryend/atveryend.sty" 1576191570 19336 ce7ae9438967282886b3b036cfad1e4d ""
"/usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty" 1576625391 3935 57aa3c3e203a5c2effb4d2bd2efbc323 ""
+ "/usr/share/texlive/texmf-dist/tex/latex/base/article.cls" 1636758526 20144 8a7de377ae7a11ee924a7499611f5a9d ""
"/usr/share/texlive/texmf-dist/tex/latex/base/atbegshi-ltx.sty" 1636758526 3034 3bfb87122e6fa8758225c0dd3cbaceba ""
"/usr/share/texlive/texmf-dist/tex/latex/base/atveryend-ltx.sty" 1636758526 2462 754d6b31b2ab5a09bb72c348ace2ec75 ""
"/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty" 1622581934 5157 f308c7c04889e16c588e78aa42599fae ""
- "/usr/share/texlive/texmf-dist/tex/latex/base/report.cls" 1636758526 23203 8fbc410e29d3fd675970d5f9698c9c11 ""
"/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo" 1636758526 8464 74db94825c407b51399ca17d9bd38a3d ""
"/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty" 1579991033 13886 d1306dcf79a944f6988e688c1785f9ce ""
"/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg" 1459978653 1213 620bba36b25224fa9b7e1ccb4ecb76fd ""
"images/QPSK_error.png" 1733952020 23473 3f431725e4102b382eb06a9205d0f440 ""
"images/QPSK_hamming.png" 1733963822 37846 8faca096f539d658c9a532496ab98348 ""
"images/QPSK_recv.png" 1733952001 23547 430c6871cfaeb5ccadb4f39f665b3fc0 ""
- "main.aux" 1733965318 5634 1e7702ec1b36d8e6683fb60d549e50a6 "pdflatex"
- "main.out" 1733965318 1704 776428b4b8c14b8a493168b6bf03206d "pdflatex"
- "main.tex" 1733965317 27099 cea90a61dcbf70472bf973707bdfd655 ""
+ "main.aux" 1733970738 7481 73c798c02da178dd935efd0eafb2891e "pdflatex"
+ "main.out" 1733970738 2797 be7c769fba06f65e854600e6c0dd8812 "pdflatex"
+ "main.tex" 1733970737 33434 948c3b9dffa912aa6517edf8b028059f ""
+ "main.toc" 1733970738 1312 e9f0bc23a7c75e9c330c76b2aab70134 "pdflatex"
(generated)
"main.aux"
"main.log"
"main.out"
"main.pdf"
+ "main.toc"
INPUT /var/lib/texmf/web2c/pdftex/pdflatex.fmt
INPUT /home/nils/kurser/TSKS35/report/main.tex
OUTPUT main.log
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size11.clo
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size11.clo
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size11.clo
INPUT /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm
-INPUT /usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/tcrm1095.tfm
+INPUT ./main.toc
+INPUT main.toc
+INPUT main.toc
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi10.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm
+OUTPUT main.toc
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/tcrm1095.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmtt10.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmtt9.tfm
+INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmti10.tfm
INPUT ./images/PAM8.png
INPUT ./images/PAM8.png
INPUT images/PAM8.png
INPUT images/QAM16.png
INPUT ./images/QAM16.png
INPUT ./images/QAM16.png
-INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi10.tfm
-INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm
INPUT ./images/PAM8_recv.png
INPUT ./images/PAM8_recv.png
INPUT images/PAM8_recv.png
INPUT images/QPSK_hamming.png
INPUT ./images/QPSK_hamming.png
INPUT ./images/QPSK_hamming.png
-INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm
INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty
INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty
INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty
INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty
-INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmtt10.tfm
-INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmtt9.tfm
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr9.tfm
INPUT main.aux
INPUT ./main.out
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb
+INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt9.pfb
-This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) (preloaded format=pdflatex 2024.6.15) 12 DEC 2024 02:01
+This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) (preloaded format=pdflatex 2024.6.15) 12 DEC 2024 03:32
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
**/home/nils/kurser/TSKS35/report/main.tex
(/home/nils/kurser/TSKS35/report/main.tex
LaTeX2e <2021-11-15> patch level 1
-L3 programming layer <2022-01-21> (/usr/share/texlive/texmf-dist/tex/latex/base/report.cls
-Document Class: report 2021/10/04 v1.4n Standard LaTeX document class
+L3 programming layer <2022-01-21> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo
File: size11.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
-\c@chapter=\count186
-\c@section=\count187
-\c@subsection=\count188
-\c@subsubsection=\count189
-\c@paragraph=\count190
-\c@subparagraph=\count191
-\c@figure=\count192
-\c@table=\count193
+\c@section=\count186
+\c@subsection=\count187
+\c@subsubsection=\count188
+\c@paragraph=\count189
+\c@subparagraph=\count190
+\c@figure=\count191
+\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
\Gin@req@height=\dimen139
\Gin@req@width=\dimen140
) (/usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty
-\lst@mode=\count194
+\lst@mode=\count193
\lst@gtempboxa=\box50
\lst@token=\toks17
-\lst@length=\count195
+\lst@length=\count194
\lst@currlwidth=\dimen141
-\lst@column=\count196
-\lst@pos=\count197
+\lst@column=\count195
+\lst@pos=\count196
\lst@lostspace=\dimen142
\lst@width=\dimen143
-\lst@newlines=\count198
-\lst@lineno=\count199
+\lst@newlines=\count197
+\lst@lineno=\count198
\lst@maxwidth=\dimen144
(/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty
File: lstmisc.sty 2020/03/24 1.8d (Carsten Heinz)
-\c@lstnumber=\count266
-\lst@skipnumbers=\count267
+\c@lstnumber=\count199
+\lst@skipnumbers=\count266
\lst@framebox=\box51
) (/usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg
File: listings.cfg 2020/03/24 1.8d listings configuration
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)
)
\@linkdim=\dimen145
-\Hy@linkcounter=\count268
-\Hy@pagecounter=\count269
+\Hy@linkcounter=\count267
+\Hy@pagecounter=\count268
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def
File: pd1enc.def 2021-06-07 v7.00m Hyperref: PDFDocEncoding definition (HO)
Now handling font encoding PD1 ...
) (/usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)
-\Hy@SavedSpaceFactor=\count270
+\Hy@SavedSpaceFactor=\count269
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def
File: puenc.def 2021-06-07 v7.00m Hyperref: PDF Unicode definition (HO)
Now handling font encoding PU ...
Package hyperref Info: Backreferencing OFF on input line 4212.
Package hyperref Info: Implicit mode ON; LaTeX internals redefined.
Package hyperref Info: Bookmarks ON on input line 4445.
-\c@Hy@tempcnt=\count271
+\c@Hy@tempcnt=\count270
(/usr/share/texlive/texmf-dist/tex/latex/url/url.sty
\Urlmuskip=\muskip16
Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc.
(/usr/share/texlive/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty
Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO)
))
-\Fld@menulength=\count272
+\Fld@menulength=\count271
\Field@Width=\dimen147
\Fld@charsize=\dimen148
Package hyperref Info: Hyper figures OFF on input line 6076.
Package: atbegshi-ltx 2021/01/10 v1.0c Emulation of the original atbegshi
package with kernel methods
)
-\Hy@abspage=\count273
-\c@Item=\count274
-\c@Hfootnote=\count275
+\Hy@abspage=\count272
+\c@Item=\count273
+\c@Hfootnote=\count274
)
Package hyperref Info: Driver (autodetected): hpdftex.
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def
Package: atveryend-ltx 2020/08/19 v1.0a Emulation of the original atveryend package
with kernel methods
)
-\Fld@listcount=\count276
-\c@bookmark@seq@number=\count277
+\Fld@listcount=\count275
+\c@bookmark@seq@number=\count276
(/usr/share/texlive/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty
Package: rerunfilecheck 2019/12/05 v1.9 Rerun checks for auxiliary files (HO)
(/usr/share/texlive/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty
\XKV@toks=\toks18
\XKV@tempa@toks=\toks19
)
-\XKV@depth=\count278
+\XKV@depth=\count277
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
)) (/usr/share/texlive/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
\pgfutil@everybye=\toks20
\pgf@yd=\dimen160
\w@pgf@writea=\write3
\r@pgf@reada=\read2
-\c@pgf@counta=\count279
-\c@pgf@countb=\count280
-\c@pgf@countc=\count281
-\c@pgf@countd=\count282
+\c@pgf@counta=\count278
+\c@pgf@countb=\count279
+\c@pgf@countc=\count280
+\c@pgf@countd=\count281
\t@pgf@toka=\toks24
\t@pgf@tokb=\toks25
\t@pgf@tokc=\toks26
-\pgf@sys@id@count=\count283
+\pgf@sys@id@count=\count282
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
File: pgf.cfg 2021/05/15 v3.1.9a (3.1.9a)
)
File: pgfsys-common-pdf.def 2021/05/15 v3.1.9a (3.1.9a)
))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
File: pgfsyssoftpath.code.tex 2021/05/15 v3.1.9a (3.1.9a)
-\pgfsyssoftpath@smallbuffer@items=\count284
-\pgfsyssoftpath@bigbuffer@items=\count285
+\pgfsyssoftpath@smallbuffer@items=\count283
+\pgfsyssoftpath@bigbuffer@items=\count284
) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
File: pgfsysprotocol.code.tex 2021/05/15 v3.1.9a (3.1.9a)
)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
Package: pgfcore 2021/05/15 v3.1.9a (3.1.9a)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
\pgfmath@dimen=\dimen161
-\pgfmath@count=\count286
+\pgfmath@count=\count285
\pgfmath@box=\box53
\pgfmath@toks=\toks27
\pgfmath@stack@operand=\toks28
\pgfmath@stack@operation=\toks29
) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
-\c@pgfmathroundto@lastzeros=\count287
+\c@pgfmathroundto@lastzeros=\count286
)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfint.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
File: pgfcorepoints.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgf@picminx=\dimen162
\pgfpic=\box54
\pgf@hbox=\box55
\pgf@layerbox@main=\box56
-\pgf@picture@serial@count=\count288
+\pgf@picture@serial@count=\count287
) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
File: pgfcoregraphicstate.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgflinewidth=\dimen180
) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
File: pgfcoreshade.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgf@max=\dimen185
-\pgf@sys@shading@range@num=\count289
-\pgf@shadingcount=\count290
+\pgf@sys@shading@range@num=\count288
+\pgf@shadingcount=\count289
) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
File: pgfcoreimage.code.tex 2021/05/15 v3.1.9a (3.1.9a)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
Package: tikz 2021/05/15 v3.1.9a (3.1.9a)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex
File: pgflibraryplothandlers.code.tex 2021/05/15 v3.1.9a (3.1.9a)
-\pgf@plot@mark@count=\count291
+\pgf@plot@mark@count=\count290
\pgfplotmarksize=\dimen190
)
\tikz@lastx=\dimen191
\tikz@figbox@bg=\box60
\tikz@tempbox=\box61
\tikz@tempbox@bg=\box62
-\tikztreelevel=\count292
-\tikznumberofchildren=\count293
-\tikznumberofcurrentchild=\count294
-\tikz@fig@count=\count295
+\tikztreelevel=\count291
+\tikznumberofchildren=\count292
+\tikznumberofcurrentchild=\count293
+\tikz@fig@count=\count294
(/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
File: pgfmodulematrix.code.tex 2021/05/15 v3.1.9a (3.1.9a)
-\pgfmatrixcurrentrow=\count296
-\pgfmatrixcurrentcolumn=\count297
-\pgf@matrix@numberofcolumns=\count298
+\pgfmatrixcurrentrow=\count295
+\pgfmatrixcurrentcolumn=\count296
+\pgf@matrix@numberofcolumns=\count297
)
-\tikz@expandcount=\count299
+\tikz@expandcount=\count298
(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
File: tikzlibrarytopaths.code.tex 2021/05/15 v3.1.9a (3.1.9a)
))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex
File: tikzlibrarypositioning.code.tex 2021/05/15 v3.1.9a (3.1.9a)
) (/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty
Package: calc 2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
-\calc@Acount=\count300
-\calc@Bcount=\count301
+\calc@Acount=\count299
+\calc@Bcount=\count300
\calc@Adimen=\dimen199
\calc@Bdimen=\dimen256
\calc@Askip=\skip50
\calc@Bskip=\skip51
LaTeX Info: Redefining \setlength on input line 80.
LaTeX Info: Redefining \addtolength on input line 81.
-\calc@Ccount=\count302
+\calc@Ccount=\count301
\calc@Cskip=\skip52
)
-\c@@todonotes@numberoftodonotes=\count303
+\c@@todonotes@numberoftodonotes=\count302
) (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2022-01-12 L3 backend support: PDF output (pdfTeX)
-\l__color_backend_stack_int=\count304
+\l__color_backend_stack_int=\count303
\l__pdf_internal_box=\box63
) (./main.aux)
\openout1 = `main.aux'.
LaTeX Font Info: ... okay on input line 38.
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
-\scratchcounter=\count305
+\scratchcounter=\count304
\scratchdimen=\dimen257
\scratchbox=\box64
-\nofMPsegments=\count306
-\nofMParguments=\count307
+\nofMPsegments=\count305
+\nofMParguments=\count306
\everyMPshowfont=\toks32
-\MPscratchCnt=\count308
+\MPscratchCnt=\count307
\MPscratchDim=\dimen258
-\MPnumerator=\count309
-\makeMPintoPDFobject=\count310
+\MPnumerator=\count308
+\makeMPintoPDFobject=\count309
\everyMPtoPDFconversion=\toks33
) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
))
-\c@lstlisting=\count311
+\c@lstlisting=\count310
Package hyperref Info: Link coloring OFF on input line 38.
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
Package: nameref 2021-04-02 v2.47 Cross-referencing by name of section
) (/usr/share/texlive/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty
Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO)
)
-\c@section@level=\count312
+\c@section@level=\count311
)
LaTeX Info: Redefining \ref on input line 38.
LaTeX Info: Redefining \pageref on input line 38.
(Font) <6> on input line 40.
[1
-{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
-<images/PAM8.png, id=51, 247.1634pt x 103.3461pt>
+{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./main.toc
+LaTeX Font Info: External font `cmex10' loaded for size
+(Font) <10.95> on input line 3.
+)
+\tf@toc=\write5
+\openout5 = `main.toc'.
+
+Package hyperref Info: bookmark level for unknown todo defaults to 0 on input line 53.
+ [2] [3] [4]
+
+LaTeX Warning: Marginpar on page 5 moved.
+
+[5]
+<images/PAM8.png, id=153, 247.1634pt x 103.3461pt>
File: images/PAM8.png Graphic file (type png)
<use images/PAM8.png>
-Package pdftex.def Info: images/PAM8.png used on input line 67.
+Package pdftex.def Info: images/PAM8.png used on input line 181.
(pdftex.def) Requested size: 216.0022pt x 90.3188pt.
-<images/QPSK.png, id=53, 262.3401pt x 270.2898pt>
+<images/QPSK.png, id=155, 262.3401pt x 270.2898pt>
File: images/QPSK.png Graphic file (type png)
<use images/QPSK.png>
-Package pdftex.def Info: images/QPSK.png used on input line 73.
+Package pdftex.def Info: images/QPSK.png used on input line 187.
(pdftex.def) Requested size: 216.0022pt x 222.55466pt.
-<images/PSK8.png, id=54, 291.2481pt x 293.4162pt>
+<images/PSK8.png, id=156, 291.2481pt x 293.4162pt>
File: images/PSK8.png Graphic file (type png)
<use images/PSK8.png>
-Package pdftex.def Info: images/PSK8.png used on input line 79.
+Package pdftex.def Info: images/PSK8.png used on input line 193.
(pdftex.def) Requested size: 216.0022pt x 217.61707pt.
-<images/QAM16.png, id=55, 275.3487pt x 270.2898pt>
+<images/QAM16.png, id=157, 275.3487pt x 270.2898pt>
File: images/QAM16.png Graphic file (type png)
<use images/QAM16.png>
-Package pdftex.def Info: images/QAM16.png used on input line 85.
+Package pdftex.def Info: images/QAM16.png used on input line 199.
(pdftex.def) Requested size: 216.0022pt x 212.0336pt.
-LaTeX Font Info: External font `cmex10' loaded for size
-(Font) <10.95> on input line 91.
-pdfTeX warning (ext4): destination with the same identifier (name{page.1}) has been already used, duplicate ignored
-<to be read again>
- \relax
-l.95
- [1] [2 <./images/PAM8.png> <./images/QPSK.png>] [3 <./images/PSK8.png> <./images/QAM16.png>]
-<images/PAM8_recv.png, id=82, 331.7193pt x 103.3461pt>
+<images/PAM8_recv.png, id=162, 331.7193pt x 103.3461pt>
File: images/PAM8_recv.png Graphic file (type png)
<use images/PAM8_recv.png>
-Package pdftex.def Info: images/PAM8_recv.png used on input line 101.
+Package pdftex.def Info: images/PAM8_recv.png used on input line 215.
(pdftex.def) Requested size: 216.0022pt x 67.29716pt.
-<images/QPSK_recv.png, id=83, 326.6604pt x 277.5168pt>
+<images/QPSK_recv.png, id=163, 326.6604pt x 277.5168pt>
File: images/QPSK_recv.png Graphic file (type png)
<use images/QPSK_recv.png>
-Package pdftex.def Info: images/QPSK_recv.png used on input line 107.
+Package pdftex.def Info: images/QPSK_recv.png used on input line 221.
(pdftex.def) Requested size: 216.0022pt x 183.50464pt.
-<images/PSK8_recv.png, id=84, 328.1058pt x 293.4162pt>
+<images/PSK8_recv.png, id=164, 328.1058pt x 293.4162pt>
File: images/PSK8_recv.png Graphic file (type png)
<use images/PSK8_recv.png>
-Package pdftex.def Info: images/PSK8_recv.png used on input line 113.
+Package pdftex.def Info: images/PSK8_recv.png used on input line 227.
(pdftex.def) Requested size: 216.0022pt x 193.16727pt.
-<images/QAM16_recv.png, id=85, 341.8371pt x 270.2898pt>
+<images/QAM16_recv.png, id=165, 341.8371pt x 270.2898pt>
File: images/QAM16_recv.png Graphic file (type png)
<use images/QAM16_recv.png>
-Package pdftex.def Info: images/QAM16_recv.png used on input line 119.
+Package pdftex.def Info: images/QAM16_recv.png used on input line 233.
(pdftex.def) Requested size: 216.0022pt x 170.79488pt.
- [4 <./images/PAM8_recv.png> <./images/QPSK_recv.png>] [5 <./images/PSK8_recv.png> <./images/QAM16_recv.png>]
-<images/PAM8_error.png, id=107, 275.3487pt x 284.0211pt>
+<images/PAM8_error.png, id=170, 275.3487pt x 284.0211pt>
File: images/PAM8_error.png Graphic file (type png)
<use images/PAM8_error.png>
-Package pdftex.def Info: images/PAM8_error.png used on input line 129.
+Package pdftex.def Info: images/PAM8_error.png used on input line 243.
(pdftex.def) Requested size: 216.0022pt x 222.80536pt.
-<images/QPSK_error.png, id=108, 275.3487pt x 284.0211pt>
+<images/QPSK_error.png, id=171, 275.3487pt x 284.0211pt>
File: images/QPSK_error.png Graphic file (type png)
<use images/QPSK_error.png>
-Package pdftex.def Info: images/QPSK_error.png used on input line 135.
+Package pdftex.def Info: images/QPSK_error.png used on input line 249.
(pdftex.def) Requested size: 216.0022pt x 222.80536pt.
-<images/PSK8_error.png, id=109, 275.3487pt x 284.0211pt>
+<images/PSK8_error.png, id=172, 275.3487pt x 284.0211pt>
File: images/PSK8_error.png Graphic file (type png)
<use images/PSK8_error.png>
-Package pdftex.def Info: images/PSK8_error.png used on input line 141.
+Package pdftex.def Info: images/PSK8_error.png used on input line 255.
(pdftex.def) Requested size: 216.0022pt x 222.80536pt.
-<images/QAM16_error.png, id=110, 281.853pt x 284.0211pt>
+<images/QAM16_error.png, id=173, 281.853pt x 284.0211pt>
File: images/QAM16_error.png Graphic file (type png)
<use images/QAM16_error.png>
-Package pdftex.def Info: images/QAM16_error.png used on input line 147.
+Package pdftex.def Info: images/QAM16_error.png used on input line 261.
(pdftex.def) Requested size: 216.0022pt x 217.6698pt.
-<images/QPSK_hamming.png, id=112, 435.7881pt x 328.8285pt>
+ [6 <./images/PAM8.png>] [7 <./images/QPSK.png> <./images/PSK8.png>] [8 <./images/QAM16.png> <./images/PAM8_recv.png>] [9 <./images/QPSK_recv.png> <./images/PSK8_recv.png>] [10 <./images/QAM16_recv.png> <./images/PAM8_error.png>] [11 <./images/QPSK_error.png> <./images/PSK8_error.png>]
+<images/QPSK_hamming.png, id=224, 435.7881pt x 328.8285pt>
File: images/QPSK_hamming.png Graphic file (type png)
<use images/QPSK_hamming.png>
-Package pdftex.def Info: images/QPSK_hamming.png used on input line 165.
+Package pdftex.def Info: images/QPSK_hamming.png used on input line 279.
(pdftex.def) Requested size: 288.0011pt x 217.31348pt.
- [6 <./images/PAM8_error.png>] [7 <./images/QPSK_error.png> <./images/PSK8_error.png>] [8 <./images/QAM16_error.png>] (/usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty
+ [12 <./images/QAM16_error.png>] (/usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty
File: lstlang1.sty 2020/03/24 1.8d listings language file
-) [9 <./images/QPSK_hamming.png>] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] (./main.aux)
+) [13 <./images/QPSK_hamming.png>] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] (./main.aux)
Package rerunfilecheck Info: File `main.out' has not changed.
-(rerunfilecheck) Checksum: 776428B4B8C14B8A493168B6BF03206D;1704.
+(rerunfilecheck) Checksum: BE7C769FBA06F65E854600E6C0DD8812;2797.
)
Here is how much of TeX's memory you used:
- 21868 strings out of 479647
- 403500 string characters out of 5878802
- 1272714 words of memory out of 5000000
- 38878 multiletter control sequences out of 15000+600000
- 475405 words of font info for 49 fonts, out of 8000000 for 9000
+ 22166 strings out of 479647
+ 408670 string characters out of 5878802
+ 1258892 words of memory out of 5000000
+ 39048 multiletter control sequences out of 15000+600000
+ 475751 words of font info for 50 fonts, out of 8000000 for 9000
350 hyphenation exceptions out of 8191
- 99i,7n,94p,446b,2067s stack positions out of 5000i,500n,10000p,200000b,80000s
- </home/nils/.texlive2021/texmf-var/fonts/pk/ljfour/jknappen/ec/tcrm1095.600pk></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt9.pfb>
-Output written on main.pdf (23 pages, 391247 bytes).
+ 99i,9n,94p,453b,1939s stack positions out of 5000i,500n,10000p,200000b,80000s
+ </home/nils/.texlive2021/texmf-var/fonts/pk/ljfour/jknappen/ec/tcrm1095.600pk></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt9.pfb>
+Output written on main.pdf (28 pages, 422744 bytes).
PDF statistics:
- 955 PDF objects out of 1000 (max. 8388607)
- 878 compressed objects within 9 object streams
- 626 named destinations out of 1000 (max. 500000)
- 142 words of extra memory for PDF output out of 10000 (max. 10000000)
+ 1163 PDF objects out of 1200 (max. 8388607)
+ 1077 compressed objects within 11 object streams
+ 750 named destinations out of 1000 (max. 500000)
+ 198 words of extra memory for PDF output out of 10000 (max. 10000000)
-\BOOKMARK [1][-]{section.0.1}{\376\377\000L\000a\000b\000o\000r\000a\000t\000o\000r\000y\000\040\000E\000x\000e\000r\000c\000i\000s\000e\000\040\0002}{}% 1
-\BOOKMARK [1][-]{section.0.2}{\376\377\000L\000a\000b\000o\000r\000a\000t\000o\000r\000y\000\040\000E\000x\000e\000r\000c\000i\000s\000e\000\040\0003}{}% 2
-\BOOKMARK [1][-]{section.0.3}{\376\377\000L\000a\000b\000o\000r\000a\000t\000o\000r\000y\000\040\000E\000x\000e\000r\000c\000i\000s\000e\000\040\0004}{}% 3
-\BOOKMARK [2][-]{subsection.0.3.1}{\376\377\000S\000t\000u\000d\000e\000n\000t\000\040\000t\000a\000s\000k\000\040\0001\000:\000\040\000G\000e\000n\000e\000r\000a\000t\000i\000o\000n\000\040\000o\000f\000\040\000c\000o\000n\000s\000t\000e\000l\000l\000a\000t\000i\000o\000n\000s}{section.0.3}% 4
-\BOOKMARK [2][-]{subsection.0.3.2}{\376\377\000S\000t\000u\000d\000e\000n\000t\000\040\000t\000a\000s\000k\000\040\0002\000:\000\040\000S\000i\000g\000n\000a\000l\000\040\000t\000r\000a\000n\000s\000m\000i\000s\000s\000i\000o\000n\000\040\000t\000h\000r\000o\000u\000g\000h\000\040\000A\000W\000G\000N\000\040\000c\000h\000a\000n\000n\000e\000l}{section.0.3}% 5
-\BOOKMARK [2][-]{subsection.0.3.3}{\376\377\000S\000t\000u\000d\000e\000n\000t\000\040\000t\000a\000s\000k\000\040\0003\000:\000\040\000C\000h\000a\000n\000n\000e\000l\000\040\000c\000o\000d\000i\000n\000g}{section.0.3}% 6
-\BOOKMARK [2][-]{subsection.0.3.4}{\376\377\000R\000e\000p\000o\000r\000t\000\040\000Q\000u\000e\000s\000t\000i\000o\000n\000s}{section.0.3}% 7
-\BOOKMARK [1][-]{section.Alph0.1}{\376\377\000C\000o\000d\000e\000\040\000f\000o\000r\000\040\000L\000a\000b\000o\000r\000a\000t\000o\000r\000y\000\040\000E\000x\000e\000r\000c\000i\000s\000e\000\040\0004}{}% 8
+\BOOKMARK [1][-]{section.1}{\376\377\000I\000n\000t\000r\000o\000d\000u\000c\000t\000i\000o\000n}{}% 1
+\BOOKMARK [1][-]{section.2}{\376\377\000L\000a\000b\000o\000r\000a\000t\000o\000r\000y\000\040\000e\000x\000e\000r\000c\000i\000s\000e\000\040\0002}{}% 2
+\BOOKMARK [2][-]{subsection.2.1}{\376\377\000S\000t\000u\000d\000e\000n\000t\000\040\000t\000a\000s\000k\000s}{section.2}% 3
+\BOOKMARK [2][-]{subsection.2.2}{\376\377\000R\000e\000p\000o\000r\000t\000\040\000q\000u\000e\000s\000t\000i\000o\000n\000s}{section.2}% 4
+\BOOKMARK [1][-]{section.3}{\376\377\000L\000a\000b\000o\000r\000a\000t\000o\000r\000y\000\040\000e\000x\000e\000r\000c\000i\000s\000e\000\040\0003}{}% 5
+\BOOKMARK [2][-]{subsection.3.1}{\376\377\000S\000t\000u\000d\000e\000n\000t\000\040\000t\000a\000s\000k\000s}{section.3}% 6
+\BOOKMARK [2][-]{subsection.3.2}{\376\377\000R\000e\000p\000o\000r\000t\000\040\000q\000u\000e\000s\000t\000i\000o\000n\000s}{section.3}% 7
+\BOOKMARK [1][-]{section.4}{\376\377\000L\000a\000b\000o\000r\000a\000t\000o\000r\000y\000\040\000e\000x\000e\000r\000c\000i\000s\000e\000\040\0004}{}% 8
+\BOOKMARK [2][-]{subsection.4.1}{\376\377\000S\000t\000u\000d\000e\000n\000t\000\040\000t\000a\000s\000k\000\040\0001\000:\000\040\000G\000e\000n\000e\000r\000a\000t\000i\000o\000n\000\040\000o\000f\000\040\000c\000o\000n\000s\000t\000e\000l\000l\000a\000t\000i\000o\000n\000s}{section.4}% 9
+\BOOKMARK [2][-]{subsection.4.2}{\376\377\000S\000t\000u\000d\000e\000n\000t\000\040\000t\000a\000s\000k\000\040\0002\000:\000\040\000S\000i\000g\000n\000a\000l\000\040\000t\000r\000a\000n\000s\000m\000i\000s\000s\000i\000o\000n\000\040\000t\000h\000r\000o\000u\000g\000h\000\040\000a\000n\000\040\000A\000W\000G\000N\000\040\000c\000h\000a\000n\000n\000e\000l}{section.4}% 10
+\BOOKMARK [2][-]{subsection.4.3}{\376\377\000S\000t\000u\000d\000e\000n\000t\000\040\000t\000a\000s\000k\000\040\0003\000:\000\040\000C\000h\000a\000n\000n\000e\000l\000\040\000c\000o\000d\000i\000n\000g}{section.4}% 11
+\BOOKMARK [2][-]{subsection.4.4}{\376\377\000R\000e\000p\000o\000r\000t\000\040\000q\000u\000e\000s\000t\000i\000o\000n\000s}{section.4}% 12
+\BOOKMARK [1][-]{appendix.A}{\376\377\000P\000y\000t\000h\000o\000n\000-\000c\000o\000d\000e\000:\000\040\000L\000a\000b\000o\000r\000a\000t\000o\000r\000y\000\040\000e\000x\000e\000r\000c\000i\000s\000e\000\040\0002}{}% 13
+\BOOKMARK [1][-]{appendix.B}{\376\377\000P\000y\000t\000h\000o\000n\000-\000c\000o\000d\000e\000:\000\040\000L\000a\000b\000o\000r\000a\000t\000o\000r\000y\000\040\000e\000x\000e\000r\000c\000i\000s\000e\000\040\0003}{}% 14
+\BOOKMARK [1][-]{appendix.C}{\376\377\000P\000y\000t\000h\000o\000n\000-\000c\000o\000d\000e\000:\000\040\000L\000a\000b\000o\000r\000a\000t\000o\000r\000y\000\040\000e\000x\000e\000r\000c\000i\000s\000e\000\040\0004}{}% 15
-\documentclass[11pt]{report}
+\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{listings}
\begin{document}
\maketitle
-\section{Laboratory Exercise 2}
-\section{Laboratory Exercise 3}
-\section{Laboratory Exercise 4}
+\newpage
+\tableofcontents
+\section{Introduction}
+
+This lab report covers the student tasks and report questions from the laboratory exercises
+2, 3 and 4 in the course TSKS35, Information and Communications
+Engineering. The tasks and results from laboratory 1 is not included in this report.
+
+\section{Laboratory exercise 2}
+
+\subsection{Student tasks}
+
+Exercise 2 is made up of three student tasks covering the following topics:
+\todo{}.
+\begin{itemize}
+ \item This is a topic
+
+ \item This is another topic
+\end{itemize}
+
+\subsection{Report questions}
+
+Answers for the report questions of Laboratory Exercise 2.
+
+\begin{enumerate}
+ \item \textbf{Explain what is an energy- and power-type signal and their
+ characteristics. Is the signal from Student Task 1 a power- or energy-type signal?
+ Why is it called time-average autocorrelation function, and what is the power
+ spectrum?}
+
+ This is my answer \todo
+
+ \item \textbf{What happen at different sampling rates in Student Task 2?
+ What is the aliasing distortion?}
+
+ This is my answer
+
+ \item \textbf{3. What is the lowpass representation of a
+ bandpass signal?}
+
+ This is my answer
+
+\end{enumerate}
+
+\section{Laboratory exercise 3}
+
+Exercise 3 is also made up of three student tasks, although the results are better summarized in a single section.
+
+\subsection{Student tasks}
+
+The first task was to create an alphabet of 16 symbols, each encoded using at most 8 bits for Huffman coding.
+After the alphabet was generated the given, incomplete, Huffman encoding algorithm was to be finalized.
+The final task was similarly to finish a Huffman decoding algorithm and verify the functionality of the algorithms created.
+
+The resulting Python-code is included in the appendix\nobreakspace\ref{app:code_lab3} and the resulting output (an example) from the code is shown below:
+
+\begin{lstlisting}
+ A 010 0.10889628583541382
+ C 001 0.09152888714794946
+ G 000 0.08903984849793534
+ B 1011 0.07059353601667875
+ E 1001 0.07001353988551143
+ H 1111 0.08826797559046656
+ J 1101 0.07422403331445343
+ K 0111 0.05648000917065521
+ L 1110 0.08784093309263273
+ N 0110 0.05289972255448987
+ O 1100 0.07110861095979067
+ P 1010 0.07018129978231921
+ F 10000 0.024254244476492406
+ D 100011 0.022376076316506087
+ I 1000100 0.006899547136273925
+ M 1000101 0.015395450222431209
+
+ encoded: 01001101110011001111111011110000
+ decoded: ANLNKHKF
+
+ Source entropy: 3.802902958392826
+ Average codeword length: 4.375
+\end{lstlisting}
+
+In the output the alphabet is first listed in the format: \textit{symbol Huffman-code probability}.
+The probabilities are all randomly generated. Shown below the alphabet is the bitstring to be decoded and
+the resulting string of symbols obtained when decoding the bitstring using the generated alphabet. Finally
+the entropy and the average codeword length of the source, the generated alphabet, is calculated and displayed.
+
+\subsection{Report questions}
+
+Answers for the report questions of Laboratory Exercise 3.
+
+\begin{enumerate}
+ \item \textbf{What is the difference between lossless and lossy compression? What type of compression is done with Huffman coding?}
+
+ This is my answer \todo
+
+ \item \textbf{Why Huffman source code is called fixed to variable-length coding?}
+
+ This is my answer
+
+ \item \textbf{What is the prefix condition?}
+
+ This is my answer
+
+ \item \textbf{Why Huffman codes are said to be instantaneous?}
+
+ This is my answer
+
+ \item \textbf{Calculate the entropy of the source in Student task 1 and
+ the average length of the corresponding Huffman code in Student task 2.
+ Comment on your results and relate it to the source-coding theorem.}
+
+ This is my answer
+
+\end{enumerate}
+
+\section{Laboratory exercise 4}
+
+Exercise 4 is also made up of three student tasks covering the following topics:
-Exercise 4 is made up of 3 parts, student tasks, covering the following topics:
\begin{itemize}
\item Generation of different constellations representing symbols to be used by a transmitter.
\item Assigning gray codes to the symbols.
\item Transmission and reception of the symbols through an AWGN (Additive White Gaussian Noise) channel.
\item Comparison of the symbol/bit error rates of the different constellations.
- \item Transmission and reception of encoded data using the Hamming code (7, 4) and comparison
- of the symbol/bit error rates of the different constellations.
+ \item Transmission and reception of encoded data across an AWGN channel using the Hamming code (7, 4) and
+ comparison of the symbol/bit error rate of a channel using this code to a channel without any coding.
\end{itemize}
-The code used to solve the tasks and generate all figures is included in the appendix\nobreakspace\ref{app:code_lab4}
+The python-code used to solve the tasks and generate all figures is included in the appendix\nobreakspace\ref{app:code_lab4}
\subsection{Student task 1: Generation of constellations}
\caption{16-QAM constellation}\label{fig:qam16}
\end{figure}
-\subsection{Student task 2: Signal transmission through AWGN channel}
+\subsection{Student task 2: Signal transmission through an AWGN channel}
The second task was to generate $10^6$ randomized symbols using the constellations from
student task 1 and transmit them through an AWGN channel. The received symbols were then
\caption{Bit error rate of QPSK modulated symbols with and without Hamming code (7, 4) across different SNR values. }\label{fig:qpsk_hamming}
\end{figure}
-\subsection{Report Questions}
+\subsection{Report questions}
-Answers for the report-questions of Laboratory Exercise 4.
+Answers for the report questions of Laboratory Exercise 4.
-\begin{itemize}
+\begin{enumerate}
\item \textbf{What are the difference between one- and two-dimensional constellations?
What is the difference between amplitude and phase modulations?
Observe and describe the constellations.}
- This is my answer
+ This is my answer \todo
+
\item \textbf{What is the purpose of Gray encoding? What is the difference between symbol
error rate and bit error rate after applying Gray coding?}
\item \textbf{Comment on the difference on the symbol error rate for different modulation
schemes, what are the advantages and disadvantages of those?}
- This is my answer
+ This is my answer
\item \textbf{What is the purpose of channel coding?}
This is my answer
-\end{itemize}
+
+\end{enumerate}
\appendix
-\section{Code for Laboratory Exercise 4}\label{app:code_lab4}
+\section{Python-code: Laboratory exercise 2}\label{app:code_lab2}
+\begin{lstlisting}[language=Python]
+
+\end{lstlisting}
+\section{Python-code: Laboratory exercise 3}\label{app:code_lab3}
+\begin{lstlisting}[language=Python]
+ # %%
+ import random
+ from heapq import heappush, heappop, heapify
+ from collections import defaultdict
+ import math
+
+ num_of_letters = 16
+
+ letters = [chr(i+65) for i in range(num_of_letters)]
+ random_probs = [random.random() for _ in range(num_of_letters)]
+ total_prob = sum(random_probs)
+ probabilities = {letters[i]: random_probs[i] / total_prob for i in range(16)}
+
+ # Probability cannot be 1 / 256
+ while True:
+ for i in range(16):
+ if list(probabilities.values())[i] <= (1 / 256):
+ continue
+ break
+
+ def huffman_coding(probabilities):
+ heap = [[weight, [symbol, ""]] for symbol, weight in probabilities.items()]
+ heapify(heap)
+
+ while len(heap) > 1:
+ lo = heappop(heap)
+ hi = heappop(heap)
+ for elm in lo[1:]:
+ elm[1] = "0" + elm[1]
+ for elm in hi[1:]:
+ elm[1] = "1" + elm[1]
+
+ heappush(heap, [lo[0] + hi[0]] + lo[1:] + hi[1:])
+
+ return sorted(heappop(heap)[1:], key=lambda p: (len(p[1]), p))
+
+ def huffman_decoding(encoded_string, codes):
+ reverse_codes = {v: k for k, v in codes.items()}
+
+ acc = ""
+ output = ""
+
+ for bit in encoded_string:
+ acc += bit
+ if acc in reverse_codes.keys():
+ output += reverse_codes[acc]
+ acc = ""
+
+ return output
+
+ codes = huffman_coding(probabilities)
+
+ code_dict = {item[0]: item[1] for item in codes}
+
+ for letter, code in code_dict.items():
+ print(letter, code, probabilities[letter])
+
+ encoded_string="01001101110011001111111011110000"
+ decoded_symbols = huffman_decoding(encoded_string, code_dict)
+
+ print()
+ print(f"encoded: {encoded_string}\ndecoded: {decoded_symbols}")
+ print()
+
+ source_entropy = -1*sum([p * math.log2(p) for l, p in probabilities.items()])
+ print("Source entropy: ", source_entropy)
+
+ average_len = sum([len(code) for l, code in code_dict.items()]) / len(code_dict)
+ print("Average codeword length: ", average_len)
+\end{lstlisting}
+\section{Python-code: Laboratory exercise 4}\label{app:code_lab4}
\begin{lstlisting}[language=Python]
# %%
import numpy as np
--- /dev/null
+\contentsline {section}{\numberline {1}Introduction}{2}{section.1}%
+\contentsline {section}{\numberline {2}Laboratory exercise 2}{3}{section.2}%
+\contentsline {subsection}{\numberline {2.1}Student tasks}{3}{subsection.2.1}%
+\contentsline {subsection}{\numberline {2.2}Report questions}{3}{subsection.2.2}%
+\contentsline {section}{\numberline {3}Laboratory exercise 3}{3}{section.3}%
+\contentsline {subsection}{\numberline {3.1}Student tasks}{3}{subsection.3.1}%
+\contentsline {subsection}{\numberline {3.2}Report questions}{4}{subsection.3.2}%
+\contentsline {section}{\numberline {4}Laboratory exercise 4}{5}{section.4}%
+\contentsline {subsection}{\numberline {4.1}Student task 1: Generation of constellations}{6}{subsection.4.1}%
+\contentsline {subsection}{\numberline {4.2}Student task 2: Signal transmission through an AWGN channel}{6}{subsection.4.2}%
+\contentsline {subsection}{\numberline {4.3}Student task 3: Channel coding}{12}{subsection.4.3}%
+\contentsline {subsection}{\numberline {4.4}Report questions}{12}{subsection.4.4}%
+\contentsline {section}{\numberline {A}Python-code: Laboratory exercise 2}{14}{appendix.A}%
+\contentsline {section}{\numberline {B}Python-code: Laboratory exercise 3}{14}{appendix.B}%
+\contentsline {section}{\numberline {C}Python-code: Laboratory exercise 4}{15}{appendix.C}%