diff options
Diffstat (limited to 'Electronic_Communication_by_D_Roddy/12-DIGITAL_COMMUNICATIONS.ipynb')
-rw-r--r-- | Electronic_Communication_by_D_Roddy/12-DIGITAL_COMMUNICATIONS.ipynb | 269 |
1 files changed, 269 insertions, 0 deletions
diff --git a/Electronic_Communication_by_D_Roddy/12-DIGITAL_COMMUNICATIONS.ipynb b/Electronic_Communication_by_D_Roddy/12-DIGITAL_COMMUNICATIONS.ipynb new file mode 100644 index 0000000..d9bba36 --- /dev/null +++ b/Electronic_Communication_by_D_Roddy/12-DIGITAL_COMMUNICATIONS.ipynb @@ -0,0 +1,269 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: DIGITAL COMMUNICATIONS" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.13_1: example_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"//page no 451\n", +"//problem no 12.13.1\n", +"//A 8 bit codewords\n", +"Pbec=0.01;n=8;i=3;\n", +"Pi=(Pbec^i)*((1-(Pbec))^(n-i));\n", +"Cin=(factorial(n))/(factorial(i)*factorial(n-i));\n", +"Pin=Cin*Pi;\n", +"P_in=Cin*Pbec^i\n", +"disp(Pin,'Pin=','The probability of a received codeword');\n", +"disp(P_in,'P_in');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.13_3: example_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"//page no 454\n", +"//problem no 12.13.3\n", +"SN_dB=9;\n", +"SNR=10^(SN_dB/10);\n", +"PbeU=1/2 * (1-erf(sqrt(SNR)));\n", +"BERu=PbeU;\n", +"disp(BERu,'a)The bit error probability');\n", +"n=10;k=n-1;\n", +"r=k/n;\n", +"SNR1=r*SNR;\n", +"PbeC=1/2 * (1-erf(sqrt(SNR1)));\n", +"BERc=(n-1)*PbeC^2;\n", +"disp(BERc,'b)The bit error probability');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.13_4: example_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"//page no 457\n", +"//problem no 12.13.4\n", +"//Tx link \n", +"SN_dB=8;\n", +"SNR=10^(SN_dB/10);\n", +"//a)Determination of bit error rate\n", +"PbeU=0.5*(1-erf(sqrt(SNR)));\n", +"BER_U=PbeU;\n", +"disp(BER_U,'a)The bit-error rate is');\n", +"//b)new bit error rate\n", +"n=15;k=11;t=1;r=k/n;\n", +"SNR_n=r*SNR;\n", +"PbeC=0.5*(1-erf(sqrt(SNR_n)));\n", +"BER_C=((factorial(n-1))*PbeC^(t+1))/((factorial(t))*(factorial(n-t-1)));\n", +"disp(BER_C,'The new bit error rate is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4_1: example_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"//page no 419\n", +"// problem no 12.4.1\n", +"//a binary polar waveform with following specifications are given\n", +"Vs_Vn=4;//SNVR\n", +"a=erf(4/sqrt(2));\n", +"b=erfc(4/sqrt(2));\n", +"Pbe=1/2 * b;// bit error probability\n", +"disp(a);\n", +"disp(b);\n", +"disp(Pbe,'The bit error probability');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4_2: example_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"//page no 420\n", +"//problem no 12.4.2\n", +"//a binary unipolar waveform with following specifications are given\n", +"A=4;//max value of received signal voltage\n", +"Vn=0.5;//rms noise voltage\n", +"Vth=2;//Threshold voltage for the comparator\n", +"Pbe=1/2 * b;// bit error probability\n", +"disp(Pbe,'The bit error probability');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4_3: example_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"//page no 421\n", +"//problem no 12.4.3\n", +"SNR=9;//SNR in dB\n", +"//conversion of dB to power ratio\n", +"p=10^(9/10);\n", +"// for Polar\n", +"Pbe1=1/2 * erfc(sqrt(7.94/2));\n", +"disp(Pbe1);\n", +"// for Unipolar\n", +"Pbe2=1/2 * erfc(sqrt(7.94)/2);\n", +"disp(Pbe2);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5_1: exampple_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"//page no 423\n", +"//problem no 12.5.1\n", +"// binary unipolar signal is given\n", +"Pavg=6*10^-12;//in W\n", +"d=0.02*10^-6;//pulse duration in sec\n", +"T=550;//equivalent noise temp in K\n", +"Eb=Pavg*d;//avg energy per pulse\n", +"No=1.38*10^-23 *T;\n", +"r=Eb/No;\n", +"//Bit error probability is \n", +"Pbe=1/2 * erfc(sqrt(r/2));\n", +"disp(Pbe,'The bit error probability');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.9_1: example_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"//page no 435\n", +"//problem no 12.9.1\n", +"ENR=10;// energy to noise density ratio\n", +"Pbe1=1/2 * erfc(sqrt(ENR/2));\n", +"disp(Pbe1,'a)The bit error probability');\n", +"Pbe2=1/2 * %e^-(ENR/2);\n", +"disp(Pbe2,'b)The bit error probability');" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |