summaryrefslogtreecommitdiff
path: root/Digital_Communications/ChapterNo9.ipynb
diff options
context:
space:
mode:
authorThomas Stephen Lee2015-09-04 22:04:10 +0530
committerThomas Stephen Lee2015-09-04 22:04:10 +0530
commit41f1f72e9502f5c3de6ca16b303803dfcf1df594 (patch)
treef4bf726a3e3ce5d7d9ee3781cbacfe3116115a2c /Digital_Communications/ChapterNo9.ipynb
parent9c9779ba21b9bedde88e1e8216f9e3b4f8650b0e (diff)
downloadPython-Textbook-Companions-41f1f72e9502f5c3de6ca16b303803dfcf1df594.tar.gz
Python-Textbook-Companions-41f1f72e9502f5c3de6ca16b303803dfcf1df594.tar.bz2
Python-Textbook-Companions-41f1f72e9502f5c3de6ca16b303803dfcf1df594.zip
add/remove/update books
Diffstat (limited to 'Digital_Communications/ChapterNo9.ipynb')
-rwxr-xr-xDigital_Communications/ChapterNo9.ipynb182
1 files changed, 0 insertions, 182 deletions
diff --git a/Digital_Communications/ChapterNo9.ipynb b/Digital_Communications/ChapterNo9.ipynb
deleted file mode 100755
index 8062105c..00000000
--- a/Digital_Communications/ChapterNo9.ipynb
+++ /dev/null
@@ -1,182 +0,0 @@
-{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "<h1> Chpater No 9: ERROR CONTROL CODING<h1>"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 9.4, Page No 540"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Find detected errors,corrected errors\n",
- "\n",
- "#initialisation of variables\n",
- "dmin=5.0\n",
- "#(s+1)<= dmin number errors can be detected(s)\n",
- " \n",
- "#CALCULATIONS\n",
- "s=dmin-1\n",
- "\n",
- "#RESULTS\n",
- "print(' i)Number of detected errors s <= %.f ' %s)\n",
- "#(2t+1)<=dmin number errors can be corrected(t)\n",
- "t=(dmin-1)/2.0\n",
- "print('ii) Number of corrected errors t<= %.f ' %t)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " i)Number of detected errors s <= 4 \n",
- "ii) Number of corrected errors t<= 2 \n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 9.17, Page No 569"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Determine all possible code vectors \n",
- "\n",
- "m3=1\n",
- "m2=0\n",
- "m1=1\n",
- "m0=0\n",
- "#M=Message Matrix\n",
- "#G=Generator Matrix\n",
- "G=[[1, 0, 1, 1, 0, 0, 0],[0, 1, 0, 1, 1, 0, 0],[0, 0, 1, 0, 1, 1, 0],[0, 0, 0, 1, 0, 1, 1]]\n",
- "M=[[m3,m2,m1,m0]]\n",
- "X = [[0, 0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0, 0]]\n",
- "\n",
- "for i in range(len(G)):\n",
- " # iterate through columns of PXd\n",
- " for j in range(len(M[0])):\n",
- " # iterate through rows of PYX\n",
- " for k in range(len(M)):\n",
- " X[i][j] += G[i][k] * M[k][j]\n",
- "print('The required code word')\n",
- "for r in range(0,7):\n",
- " print(X[0][r])"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The required code word\n",
- "1\n",
- "0\n",
- "1\n",
- "0\n",
- "0\n",
- "0\n",
- "0\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 9.19, Page No 572"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#Determine code word \n",
- "m3=1\n",
- "m2=0\n",
- "m1=1\n",
- "m0=0\n",
- "#M=Message Matrix\n",
- "#G=Generator Matrix\n",
- "G=[[1, 0, 0, 0, 1, 0, 1],[0, 1, 0, 0, 1, 1, 1],[0, 0, 1, 0, 1, 1, 0],[0, 0, 0, 1, 0, 1, 1]]\n",
- "M=[[m3,m2,m1,m0]]\n",
- "X = [[0, 0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0, 0]]\n",
- "\n",
- "\n",
- "for i in range(len(G)):\n",
- " # iterate through columns of PXd\n",
- " for j in range(len(M[0])):\n",
- " # iterate through rows of PYX\n",
- " for k in range(len(M)):\n",
- " X[i][j] += G[i][k] * M[k][j]\n",
- "print('The required code word')\n",
- "for r in range(0,7):\n",
- " print(X[0][r] )\n",
- " \n",
- "\n",
- "print('The code in the book is wrong')\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The required code word\n",
- "1\n",
- "0\n",
- "1\n",
- "0\n",
- "0\n",
- "0\n",
- "0\n",
- "The code in the book is wrong\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [],
- "language": "python",
- "metadata": {},
- "outputs": []
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file