diff options
Diffstat (limited to 'Analog_Communication_by_V_Chandrasekar/3-Amplitude_Modulation.ipynb')
-rw-r--r-- | Analog_Communication_by_V_Chandrasekar/3-Amplitude_Modulation.ipynb | 488 |
1 files changed, 488 insertions, 0 deletions
diff --git a/Analog_Communication_by_V_Chandrasekar/3-Amplitude_Modulation.ipynb b/Analog_Communication_by_V_Chandrasekar/3-Amplitude_Modulation.ipynb new file mode 100644 index 0000000..40610a5 --- /dev/null +++ b/Analog_Communication_by_V_Chandrasekar/3-Amplitude_Modulation.ipynb @@ -0,0 +1,488 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: Amplitude Modulation" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1_A: AM_Sidebands.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"Fc=500;//carrier frequency in kHz\n", +"Fm=1;// message signal frequency in kHz\n", +"//a)\n", +"\n", +"USB=Fc+Fm;\n", +"LSB=Fc-Fm;\n", +"disp(USB,'USBI(in kHZ)=');\n", +"disp(LSB,'LSB(in kHz)=');\n", +"\n", +"//b)\n", +"\n", +"Bandwidth=USB-LSB;\n", +"disp(Bandwidth,'Bandwidth(in kHZ)=')\n", +"//c)\n", +"\n", +"Fm=1.5;//message signal frequency in kHz\n", +"\n", +"USB1=Fc+Fm;\n", +"LSB1=Fc-Fm;\n", +"disp(USB1,'USB(in kHz)=');\n", +"disp(LSB1,'LSB(in kHZ)=');\n", +"\n", +"\n", +"//d)\n", +"\n", +"Amplitude=[0 0 0 0 0 0 0 0 0 5 10 5 0]; //sample values as denoted in textbook\n", +"frequency=490:1:502;\n", +"\n", +" plot2d3(frequency,Amplitude); \n", +"xlabel('Frequency(in kHZ)');\n", +"ylabel('Amplitude(in V)');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1: amplitude_modulatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"Vm=3;// amplitude of message signal in V\n", +"Vc=5;//amplitude of carrier signal in V\n", +"m=Vm/Vc; //modulation index\n", +"disp('modulation index');\n", +"disp(m,'=');\n", +"disp('Upper Sideband Frequency(in MHz)');\n", +"Fm=4;//Frequency in KHz\n", +"Fc=5;//Frequency in MHz\n", +"disp(Fc+(Fm*10^(-3)),'=');\n", +"disp('Lower Sideband Frequency(in MHz)');\n", +"disp(Fc-(Fm*10^(-3)),'=');\n", +"disp('AMplitude of each Sideband(in V)');\n", +"disp(m*Vc/2,'=');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2_A: Amplitude_Modulatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clear;\n", +"clc;\n", +"\n", +"\n", +"Fm=3; //frequency of message signal\n", +"Fc=8; //frequency of carrier signal\n", +"Ea=5;\n", +"Eb=10;\n", +"m=Ea/Eb; //modulation index\n", +"\n", +"disp(m,'m=');\n", +"USf=Fc+Fm*10^(-3);//Upper Sideband frequency\n", +"LSf=Fc-Fm*10^(-3);//Lower sideband frequency\n", +"disp(USf,'USf(Mhz)=');\n", +"disp(LSf,'LSf(Mhz)=');\n", +"Amp=m*Eb/2;// amplitude of each sideband\n", +"disp(Amp,'amp(v)=');\n", +"\n", +"\n", +"\n", +"function[x,Vm,Vc]=ampmod(Ea,Eb,m,Fc,Fm)\n", +" t=0:0.005:5;\n", +" \n", +" Vm = Ea*sin(2*%pi*Fm*t);\n", +" Vc = Eb*sin(2*%pi*Fc*t);\n", +" \n", +" x = ((Eb+Ea*sin(2*%pi*Fm*t))).*(sin(2*%pi*Fc*t));\n", +" \n", +" subplot(3,1,2);\n", +" plot2d(t,x);\n", +" title('Amplitude Modulated Signal');\n", +"endfunction\n", +"\n", +"ampmod(Ea,Eb,m,Fc,Fm)//amplitude modulation" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2: Total_power_of_AM_wave.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"Pc=300;// Power of the carrier in W\n", +"m=0.6// modulation index\n", +"Pt=Pc*(1+(m^2)/2); //total power\n", +"disp('Total power in the modulated wave(in W) is');\n", +"disp(Pt);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3_A: Efficiency_of_DSBFC.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"disp('efficiency(n)=(useful power/total power)*100%');\n", +"disp(' =total sideband power/(total sideband power+carrier power)*100%');\n", +"\n", +"syms m Pc\n", +"N=[((m^2)*Pc/2)/(Pc*(1+(m^2)/2))];\n", +"disp('*100% ',N);\n", +"\n", +"disp('----------------------------------------------------------------');\n", +"m=0.7 //modulation index\n", +"\n", +"\n", +"n=[m^2/(m^2+2)]*100; //efficiency\n", +"disp(n,'the percentage of useful power is ');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3: Modulation_index.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"Pt=11.5;//Total power in kW\n", +"Pc=10;// Carrier power in kW\n", +"//a)\n", +"\n", +"m_square=2*((Pt/Pc)-1);\n", +"m=sqrt(m_square);//modulation index\n", +"\n", +"//b)\n", +"m2=0.5;\n", +"mt=sqrt(m^2 +m2^2); \n", +"Pt=Pc*(1+mt^2/2); //total power in kW\n", +"\n", +"disp(m,'modulation index is ');\n", +"disp(Pt,'Total carrier power(in kW) ');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4_A: DSBFC.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"Vc=8;// carrier signal voltage in V\n", +"m=1;//modulation index\n", +"R=8;//resistance in ohms\n", +"//a)\n", +"\n", +"Pc=Vc^2/(2*R); \n", +"disp(Pc,'power of the carrier(in W) is');\n", +"Ps=m^2*Pc/4;\n", +"disp(Ps,'Power in each Side-Bands(in W)');\n", +"\n", +"//b)\n", +"disp(2*Ps,'Total sideband Power(in W)');\n", +"\n", +"//c)\n", +"disp(Pc+2*Ps,'Total Power of Modulated wave(in W)');\n", +"\n", +"//d)\n", +"disp(2*Ps/(Pc+2*Ps)*100,'Efficiency Percentage');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4: Modulation_index_and_power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"m1=0.3;\n", +"m2=0.4;\n", +"m3=0.5;\n", +"m4=0.6; //modulation indices\n", +"Pc=150;//power of carrier in Watts\n", +"\n", +"mt=sqrt(m1^2+m2^2+m3^2+m4^2); //total modulation index\n", +"\n", +"Pt=Pc*(1+mt^2/2);//Total transmitted power in Watts\n", +"\n", +"Ps=(mt^2)*Pc/4; //Sideband Power in Watts\n", +"\n", +"disp(mt,'Total Modulation index');\n", +"\n", +"disp(Pt,'Total Transmitted Power (in W)');\n", +"\n", +"//change in answer as compared to book ,due to approximation error..\n", +"disp(Ps,'Sideband Power(in W)')\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5_A: Amplitude_Modulatio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"m1=0.3;\n", +"m2=0.4;\n", +"m3=0.5;\n", +"m4=0.6; //modulation indices\n", +"Pc=80;// Power in carrier signal \n", +"\n", +"mt=sqrt(m1^2+m2^2+m3^2+m4^2);\n", +"\n", +"//a)\n", +"disp(mt,'Total Coefficient of Modulation ');\n", +"\n", +"//calculation error in book\n", +"\n", +"//b)\n", +"Ps=(mt^2)*Pc/2;\n", +"disp(Ps,'Sideband powers(in W) ');\n", +"\n", +"//c)\n", +"disp(Pc+2*Ps,'Total Transmitted Power(in W)');\n", +"\n", +"//d)\n", +"disp((Ps/(Pc+2*Ps))*100,'Efficiency Percentage');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5: Peak_Envelope_Power_and_average_power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"fLSB1=395;\n", +"fLSB22=397.5;// Two LSB frequencies in kHz\n", +"E1=4;\n", +"E2=3;//peak voltages of modulating signal in V\n", +"R=60;//resistor in ohms\n", +"\n", +"Et=sqrt(E1^2+E2^2);\n", +"\n", +"Erms=Et*0.707;\n", +"\n", +"PEP=((Et*0.707)^2)/R; //Pak Envelope Power in W\n", +"\n", +"Avg_Power=PEP/2;\n", +"\n", +"disp(PEP,'Peak Envelope Power(in W)');\n", +"disp(Avg_Power,'Average Power(in W)');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7_A: Diagonal_Clipping.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"Fc=10;//carrier Frequency in kHz\n", +"R=15;//Resistance in Kohms\n", +"C=660;//Capacitance in pF\n", +"a=1/R;\n", +"b=2*%pi*Fc*10^(3)*C*10^(-12);\n", +"Y=a+%i*b;\n", +"Z=1/abs(Y);\n", +"//after rounding off\n", +"Z=12.83//Impedence in Kohms\n", +"m=Z/(R);//modulation index\n", +"disp(m,'MAximum modulation index to avoid diagonal clipping is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8_A: Sideband_Frequencies.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"clc;\n", +"clear;\n", +"\n", +"\n", +"syms Ec Fc Fm pi t\n", +"\n", +"Wave=Ec*cos(2*pi*Fm*t)*cos(2*pi*Fc*t)+Ec*sin(2*pi*Fm*t)*sin(2*pi*Fc*t);\n", +" disp('when the wave is');\n", +" disp(Wave);\n", +"\n", +"f_upper=Ec*cos(2*pi*(Fc+Fm)*t); \n", +"disp('We get the upper sideband as');\n", +"disp(f_upper);\n", +"\n", +"\n", +"f_lower=Ec*cos(2*pi*(Fc-Fm)*t); \n", +"disp('We get the lower sideband as');\n", +"disp(f_lower);\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +], +"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 +} |