{ "metadata": { "name": "", "signature": "sha256:b47d42851a95b239c1a54b9b998eec602c81d678d0f92705fab117d580600a10" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 18: Information Theory, Coding And Data Communication" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 18.1, page no. 591" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variable Declaration\n", "SNR_dB = 32.00 # Signal to Noise ratio (dB)\n", "f1 = 300.00 # Lower Limit of Voice Frequency (Hz)\n", "f2 = 3400.0 # Upper Limit of Voice Frequency (Hz)\n", "\n", "# Calculation\n", "import math # Math Library\n", "SNR = pow(10,SNR_dB/10) # Signal to Noise Ratio\n", "C = (f2-f1)*math.log(1+SNR,2) # Capacity of Telephone Channel (bps)\n", "\n", "# Result\n", "print \"The capacity of a standard 4 kHz telephone channel with 32 dB SNR is C =\",round(C,1),\"bits per second.\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The capacity of a standard 4 kHz telephone channel with 32 dB SNR is C = 32956.3 bits per second.\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 18.2, page no. 591" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# Variable Declaration\n", "SNR_dB = 28.00 \t # Signal to Noise ratio (dB)\n", "BW1 = 4.00*pow(10,3) # System Bandwidth 1 (Hz)\n", "BW2 = 8.00*pow(10,3) # System Bandwidth 2 (Hz)\n", "\n", "# Calculation\n", "import math # Math Library\n", "SNR1 = pow(10,SNR_dB/10) # Signal to Noise Ratio 1\n", "C1 = BW1*math.log(1+SNR1,2) # Information Carrying Capacity (bps)\n", "SNR2 = pow(10,SNR_dB/10)/2 # Signal to Noise Ratio 2\n", "C2 = BW2*math.log(1+SNR2,2) # Information Carrying Capacity (bps)\n", "\n", "# Result\n", "print \"(a) The information carrying capacity of a standard 4 kHz telephone channel with 28 dB SNR is C1 =\",round(C1),\"bits per second.\"\n", "print \"(b) The information carrying capacity of a standard 8 kHz telephone channel with same signal power as in (a) is C2 =\",round(C2),\"bits per second.\"\n", "print \" Also the ratio of the two quantities, C2/C1 =\",round(C2/C1,3)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a) The information carrying capacity of a standard 4 kHz telephone channel with 28 dB SNR is C1 = 37215.0 bits per second.\n", "(b) The information carrying capacity of a standard 8 kHz telephone channel with same signal power as in (a) is C2 = 66448.0 bits per second.\n", " Also the ratio of the two quantities, C2/C1 = 1.786\n" ] } ], "prompt_number": 5 } ], "metadata": {} } ] }