{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 13: Radio Communication" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.10: Frequency_and_deviation_ratio.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.10\n", "clc;clear;close;\n", "format('v',6);\n", "//Part (a)\n", "ft=88.8;//MHz\n", "N1N2N3=20;//frequency multiplication\n", "fc=ft/N1N2N3;//MHz\n", "disp(fc,'(a) Master oscillator center frequency(MHz)');\n", "delta_ft=75;//kHz\n", "delta_f=delta_ft*1000/N1N2N3;//Hz\n", "disp(delta_f,'(b) Frequency deviation at the output(Hz)');\n", "fm=15;//kHz\n", "DR=delta_f/1000/fm;//Deviation ratio at output\n", "disp(DR,'(c) Deviation ratio at the output');\n", "DR=DR*N1N2N3;//Deviation ratio at antenna\n", "disp(DR,'(d) Deviation ratio at the antenna');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.11: Reduction_in_frequency_drift.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.11\n", "clc;clear;close;\n", "format('v',11);\n", "VCO=200;//ppm(VCO stability)\n", "fc=5.1;//MHz\n", "ft_old=91.8;//MHz\n", "k0=10;//kHz/V\n", "kd=2;//V/kHz\n", "f2=30.6;//MHz\n", "fc=fc*10^6+(VCO*10^-6*fc*10^6);//Hz(with feedback loop open)\n", "N1=2;N2=3;\n", "f2_new=N1*N2*fc;//Hz\n", "df2=f2_new-f2*10^6;//Hz(Frequency drift)\n", "ft=N2*f2_new/10^6;//MHz(Transmit frequency)\n", "df2_reduced=df2/(1+N1*N2*kd*k0);//Hz(reduced frequency drift)\n", "df2_reduced=round(df2_reduced);//Hz\n", "disp(df2_reduced,'Reduced frequency drift(Hz)');\n", "f2dash=f2*10^6+df2_reduced;//Hz(New transmit frequency of antenna)\n", "ftnew=f2dash*N2;//Hz\n", "disp(ftnew,'New transmit frequency of antenna(Hz)')\n", "old_drift=ft*10^6-ft_old*10^6;//Hz\n", "new_drift=ftnew-ft_old*10^6;//Hz\n", "disp('The frequency drift at the antenna has been reduced from '+string(old_drift)+' Hz to '+string(new_drift)+' Hz. This fulfill the FCC requirements.')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.1: Frequency_Limits_and_Bandwidth.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.1\n", "clc;clear;close;\n", "format('v',6);\n", "fc=100;//kHz\n", "fm=5;//kHz\n", "LSB=[fc-fm fc];//kHz\n", "USB=[fc fc+fm];//kHz\n", "disp('Part (a)');\n", "disp('Lower sideband is from '+string(LSB(1))+' kHz to '+string(LSB(2))+' kHz');\n", "disp('Upper sideband is from '+string(USB(1))+' kHz to '+string(USB(2))+' kHz');\n", "B=2*fm;//kHz\n", "disp(B,'(b) Bandwidth(kHz)');\n", "disp('part (c)');\n", "fm=3;//kHz\n", "f_usf=fc+fm;//kHz\n", "disp(f_usf,'Upper side frequency(kHz)');\n", "f_lsf=fc-fm;//kHz\n", "disp(f_lsf,'Lower side frequency(kHz)');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.2: Frequency_and_modulation_coefficient.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.2\n", "clc;clear;close;\n", "format('v',6);\n", "fc=500;//kHz\n", "fm=10;//kHz\n", "//Am=7.5*Vp & Ac=20*Vc\n", "Em=7.5;//times of Vp\n", "Ec=20;//times of Vp(unmodulated carrier)\n", "disp('Part (a)');\n", "f_usf=fc+fm;//kHz\n", "disp(f_usf,'Upper side frequency(kHz)');\n", "f_lsf=fc-fm;//kHz\n", "disp(f_lsf,'Lower side frequency(kHz)');\n", "disp('Part (b)');\n", "m=Em/Ec;//modulation coefficient\n", "disp(m,'Modulation coefficient');\n", "M=100*m;//% modulation\n", "disp(M,'% Modulation');\n", "disp('Part (c)');\n", "Ec1=Ec;//times of Vp(modulated carrier)\n", "Eusf=m*Ec/2;//times of Vp\n", "Elsf=m*Ec/2;//times of Vp\n", "disp('Peak amplitude of modulated carrier is '+string(Ec1)+'*Vp');\n", "disp('Upper & lower side frequency voltages, Eusf = Elsf = '+string(Eusf)+'*Vp');\n", "disp('Part (d)');\n", "Vmax=Ec+Em;//times of Vp\n", "Vmin=Ec-Em;//times of Vp\n", "disp('Maximum amplitude of envelope is '+string(Vmax)+'*Vp');\n", "disp('Minimum amplitude of envelope is '+string(Vmin)+'*Vp');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.3: Power_and_voltage.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.3\n", "clc;clear;close;\n", "format('v',6);\n", "fc=1;//MHz\n", "fm=5;//kHz\n", "m=60/100;//Modulation\n", "Pc=6;//kW\n", "RL=50;//W\n", "Pavg=Pc*(1+m^2/2);//kW(Average power delivered to load)\n", "disp('Part(a)');\n", "disp(Pavg,'Average power of modulated signal(kW)');\n", "PdB=10*log10(Pavg*1000);//dB\n", "disp(PdB,'Average power of modulated signal(dB)');\n", "PdBm=10*log10(Pavg*10^6);//dBm\n", "disp(PdBm,'Average power of modulated signal(dBm)');\n", "disp('Part(b)');\n", "VS_RMS=sqrt(2*RL*Pavg*1000)/1000;//kV\n", "disp(VS_RMS,'RMS voltage of modulated signal(kV)');\n", "Vp=sqrt(2)*VS_RMS;//V\n", "disp(Vp,'Peak value of modulated signal(kV)');\n", "//Answer is wrong in the book." ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.4: Determine_power.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.4\n", "clc;clear;close;\n", "format('v',7);\n", "Vc=10;//times of Vp\n", "RL=10;//ohm\n", "m=1;//modulation coefficient\n", "Pc=Vc^2/2/RL;//W\n", "Pusb=m^2*Pc/4;//W\n", "Plsb=m^2*Pc/4;//W\n", "disp('Part(a)');\n", "disp(Pc,'Carrier power(W)');\n", "disp(Pusb,'Upper side band power(W)');\n", "disp(Plsb,'Lower side band power(W)');\n", "disp('Part(b)');\n", "Psbt=m^2*Pc/2;//W\n", "disp(Psbt,'Total side band power(W)');\n", "disp('Part(c)');\n", "Pt=Pc*(1+m^2/2);//W\n", "disp(Pt,'Total power of modulated wave(W)');\n", "disp('Part(e)');\n", "m=0.5;//modulation coefficient\n", "Pusb=m^2*Pc/4;//W\n", "Plsb=m^2*Pc/4;//W\n", "disp(Pc,'Carrier power(W)');\n", "disp(Pusb,'Upper side band power(W)');\n", "disp(Plsb,'Lower side band power(W)');\n", "Psbt=m^2*Pc/2;//W\n", "disp(Psbt,'Total side band power(W)');\n", "Pt=Pc*(1+m^2/2);//W\n", "disp(Pt,'Total power of modulated wave(W)');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.5: Noise_Figure_improvement.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.5\n", "clc;clear;close;\n", "format('v',3);\n", "RF=200;//kHz\n", "IF=10;//kHz\n", "BI=RF/IF;//unitless(Bandwidth Improvement)\n", "NF=10*log10(BI);//dB\n", "disp(NF,'Noise Figure improvement(dB)');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.6: Peak_frequency_and_phase_deviation.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.6\n", "clc;clear;close;;\n", "format('v',6)\n", "//Part (a)\n", "K1=5;//kHz/V\n", "//vm(t)=2*cos(2*p*2000*t);\n", "Vm=2;//V\n", "fm=2000;//Hz\n", "delta_f=K1*Vm;//kHz\n", "disp(delta_f,'(a) Pak frequency deviation(kHz)');\n", "m=delta_f*1000/fm;//modulation index\n", "disp(m,'(a) Modulation index');\n", "//Part (b)\n", "K=2.5;//rad/V\n", "//vm(t)=-cos(2*p*2000*t);\n", "fm=2000;//Hz\n", "m=K*Vm;//rad(Peak phase shift)\n", "disp(m,'(b) Peak phase shift(rad)');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.7: Frequency_Modulation_Index.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.7\n", "clc;clear;close;\n", "format('v',5);\n", "//v(t)=20*sin(6.28*10^6*t+10*sin(6.28*10^3*t));\n", "//Comparing with VPM(t)=A*sin(omega_c*t+mp*sin(omega_m*t))\n", "A=20;\n", "omega_c=6.28*10^6;//rad\n", "omega_m=6.28*10^3;//rad\n", "fc=omega_c/2/%pi/10^6;//MHz\n", "fm=omega_m/2/%pi/10^3;//kHz\n", "mp=10;//modulation index\n", "delta_theta=mp;//radians\n", "disp(fc,'(a) Carrier freuency(MHz)');\n", "disp(fm,'(b) Modulating freuency(kHz)');\n", "disp(mp,'(c) Modulation index(mp)');\n", "disp(delta_theta,'(d) Peak phase deviation(radians)');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.8: Minimum_Bandwidth.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.8\n", "clc;clear;close;\n", "format('v',5);\n", "delta_f=10;//kHz\n", "fm=10;//kHz\n", "Vc=10;//V\n", "fc=500;//kHz\n", "m=delta_f/fm;//modulation index\n", "//For m=1 we have 3 sidebands\n", "B=2*(3*fm);//kHz\n", "disp(B,'(a) Actual minimum bandwidh(kHz)');\n", "B=2*(fm+delta_f);//kHz\n", "disp(B,'(b) Approximate minimum bandwidh(kHz)');\n", "A0=0.77*fm;//V\n", "A1=0.44*fm;//V\n", "A2=0.11*fm;//V\n", "A3=0.02*fm;//V\n", "//For frequency spectrum\n", "A=[A3 A2 A1 A0 A1 A2 A3];//V(Amplitudes)\n", "f=[fc+3*fm fc+2*fm fc+fm fc fc+fm fc+2*fm fc+3*fm];//kHz\n", "plot(f,A);\n", "title('Output frequency spectrum');\n", "xlabel('Frequency(kHz)');\n", "ylabel('Amplitudes(V)');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.9: Deviation_ratio_and_bandwidth.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Ex 4.9\n", "clc;clear;close;\n", "format('v',6)\n", "//Part (a)\n", "delta_f=75;//kHz\n", "fm=15;//kHz\n", "DR=delta_f/fm;//Deviation ratio\n", "disp(DR,'(a) Deviation ratio');\n", "//For m or DR=5 we have 8 sidebands\n", "B=2*(8*fm);//kHz\n", "disp(B,'(a) Bandwidh for worst case(kHz)');\n", "//Part (b)\n", "delta_f=75/2;//kHz\n", "fm=15/2;//kHz\n", "DR=delta_f/fm;//Deviation ratio\n", "disp(DR,'(b) Deviation ratio or modulation index');\n", "//For m or DR=5 we have 8 sidebands\n", "B=2*(8*fm);//kHz\n", "disp(B,'(b) Bandwidh for worst case(kHz)');" ] } ], "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 }