Communication lab manual

Embed Size (px)

DESCRIPTION

matlab programs

Citation preview

  • 5/21/2018 Communication lab manual

    1/13

    Communications (CE00038-2)

    Simulink Modulation Lab

    Dr Alison Griffiths & Dr Mohammad Patwary{a.l.griffiths, m.n.patwary}@staffs.ac.uk

    Communications (CE00038-2)Introduction 1 06/10/06

  • 5/21/2018 Communication lab manual

    2/13

    Simulink Amplitude ModulationObjective AM Modulation

    The objective of this lab is to help you become familiar with Simulink

    To investigate AM modulation

    To observe and measure the waveforms and spectra for Double sideband AM(DSBAM), DSB Diminished Carrier and DSB Suppressed Carrier (DSBSC).

    To measure the power in DSB amplitude modulation.

    Theory AM Modulation

    The signal generator at 50 kHz represents the message signal, vm(t) = Vmcosmt.The signal generator at 500 kHz represents the carrier, vc(t)=cosct.

    The output modulated signal may be represented by:

    vS(t) = (VDC + vm(t)) cosct

    = VDC cosct + vm(t)cosct

    Communications (CE00038-2)2

    This is represented by the following block diagram:

    Carriercomponent

    Upper and Lower Sidebands

    Alternatively, with m(t) = Vmcosmt,

    vS(t) = (VDC + Vmcosmt) cosct

    vS(t) = VDC cosct + Vmcosmt cosct

    A trigonometric identity is:

    cos A cos B = cos (A+B) + cos (A - B)

  • 5/21/2018 Communication lab manual

    3/13

    ie ( ) ( )tcos2

    Vtcos

    2

    VtcosV)t(v mc

    mmc

    mcDCS +++=

    Communications (CE00038-2)3

    Carrier component at fcHz. LSB at (fc- fm)USB at (fc+ fm)

    Modulation depth in AM is defined as m =DC

    m

    V

    V, hence changing the DC offset (VDC), is

    one way of changing the modulation depth. Change the DC offset and observe theeffect on the waveforms and the output spectrum.

    Procedure AM Modulation

    1. Start up Matlab.

    2. Start up Simulink by clicking the Simulink icon in the Matlab toolbar or bytyping

    >> simulink

    at the Matlab prompt. You should see the Simulink Block Library window asshown below.

  • 5/21/2018 Communication lab manual

    4/13

    3. From thefile menu, select new model. A Model window should open as shownbelow.

    Communications (CE00038-2)4

  • 5/21/2018 Communication lab manual

    5/13

    4. We will start by building and testing an AM-DSB/SC modulator.

    5. Open the Signal Processing Blockset window in the Simulink LibraryBrowser window. This will open the Signal Processing Blockset Library windowwhich looks like this

    6. Right click on the Signal Processing Sources blockin the Signal ProcessingBlock Library windowand then choose Open the 'Souces' Library. The

    Sources Block Library should open as shown below.

    Communications (CE00038-2)5

  • 5/21/2018 Communication lab manual

    6/13

    7. Drag and drop two Sine Wave blocks from the Sources Library to the Modelwindow.

    8. Drag and Drop a DSP Constant block from the Sources Library to the Modelwindow.

    9. Open the Math Operations blockin the Simulink Block Library window. TheMath Block Library window looks like this:

    Communications (CE00038-2)6

  • 5/21/2018 Communication lab manual

    7/13

    10. Drag and drop one Product block and one Add block onto the Model window.

    11. Open the Sinks blockin the Simulink Block Library window. The Sinks BlockLibrary window should open as shown below.

    Communications (CE00038-2)7

  • 5/21/2018 Communication lab manual

    8/13

    12. Drag and drop a Scope blockonto the Model window. To obtain more than onechannel on your scope, Choose the scope parameters icon (2ndfrom left) andchange the Number of axes to the desired amount:

    13. Search for a Spectrum Scope and drop it into the Model Window. You can

    search for any block using the search tool in the Simulink Library Browserwindow.

    Communications (CE00038-2)8

  • 5/21/2018 Communication lab manual

    9/13

    14. You will want several of these scopes to view the signals and spectra. Makesure you buffer the input of the Spectrum scope, by ticking the input as shown:

    15. Connect the blocks with signal flow lines to represent an AM modulator (find theblock diagram from your notes!). You can re-name blocks by clicking on theiroriginal name.

    16. The Model window should now look like this:

    Communications (CE00038-2)9

  • 5/21/2018 Communication lab manual

    10/13

    17. Add additional scopes and spectrum scopes to display all the required signals.

    18. The simulation will be carried out at a sample rate of 1000,000 Hertz.

    19. Define the sampling period as 1000,000 Hertz by typing the following in Matlabcommand window.

    >> fs = 10^6;

    20. The sinusoidal carrier will have a frequency of 50kHz and the message signalwill one of 500kHz. Open vc(t) and vm(t) and set the following values:

    21. Save your model by selecting Save as... in the File menu in the Model window.Call this model lab_1.mdl.

    22. Bring up the Simulation Configuration parameters... dialogue from the Simulationmenu in the Model window.

    23. Under Simulation time, change the Stop time to 0.0002.

    24. Under Solver options, change the Type to Fixed-step.

    25. The Simulation Parameters window should look something like this.

    Communications (CE00038-2)10

  • 5/21/2018 Communication lab manual

    11/13

    26. Set the values by clicking OK.

    27. Next select Start from the Simulation menu in the Model window.

    28. Open the Scope displays by double clicking on the scope. Then you should seesomething like this:

    Communications (CE00038-2)11

  • 5/21/2018 Communication lab manual

    12/13

    Communications (CE00038-2)12

  • 5/21/2018 Communication lab manual

    13/13

    To get the pictures above, you will need to modify the plot properties of thescope.

    29. Keeping Vm

    constant, set the modulation depth to m = 0.5, m = 1, m = 2 and m =

    infinity by varying the value of vdcand observe the different waveforms.

    30. Reduce the sampling period as 100,000 Hertz by typing the following in Matlabcommand window.

    >> fs = 10^5;

    31. Re-run the simulations for the different values of m and observe the output onthe Spectrum Scopes. Are the values what you expect from theory?

    32. For each setting of modulation depth, m, observe and record the DSB waveformand spectrum, including the voltage amplitude in each component. For each

    value of modulation depth, measure the total power at the output on the powermeter provided.Note how the waveforms, spectrum and power relate to modulation depth. Notewhen m > 1, the phase of the DSB envelope alternates between 0 and 180degrees.

    Compare your results with what you would expect from theory, i.e. for thewaveform, spectra and power.

    Communications (CE00038-2)13