Introduction to Simulink Assignment Companion Document

Similar documents
ENSC327 Communication Systems Fall 2011 Assignment #1 Due Wednesday, Sept. 28, 4:00 pm

Memorial University of Newfoundland Faculty of Engineering and Applied Science. Lab Manual

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

Introduction to Simulink

Experiment 1 Introduction to Simulink

Use of the LTI Viewer and MUX Block in Simulink

ES442 Final Project AM & FM De/Modulation Using SIMULINK

Lab 1: Simulating Control Systems with Simulink and MATLAB

Experiment 1 Introduction to MATLAB and Simulink

COMMUNICATION LABORATORY

Lab 1: First Order CT Systems, Blockdiagrams, Introduction

EXPERIMENT 4 INTRODUCTION TO AMPLITUDE MODULATION SUBMITTED BY

Figure C-1 (p. 907) MATLAB window showing how to access Simulink. The Simulink Library Browser button is shown circled.

Simulink Implementation of Amplitude Modulation Technique using Matlab

Introduction to Modeling of Switched Mode Power Converters Using MATLAB and Simulink

Measuring Modulations

Quick Start for Autodesk Inventor

ET 304A Laboratory Tutorial-Circuitmaker For Transient and Frequency Analysis

ECE411 - Laboratory Exercise #1

Engineering 3821 Fall Pspice TUTORIAL 1. Prepared by: J. Tobin (Class of 2005) B. Jeyasurya E. Gill

Excel Tool: Plots of Data Sets

Lab 12 Laboratory 12 Data Acquisition Required Special Equipment: 12.1 Objectives 12.2 Introduction 12.3 A/D basics

Grid-Connected Full-Bridge Inverter Based on a Novel ZVS SPWM Scheme

SolidWorks Tutorial 1. Axis

Lab 2: Introduction to Real Time Workshop

EE 210 Lab Exercise #3 Introduction to PSPICE

Page 1/10 Digilent Analog Discovery (DAD) Tutorial 6-Aug-15. Figure 2: DAD pin configuration

ArbStudio Triggers. Using Both Input & Output Trigger With ArbStudio APPLICATION BRIEF LAB912

BER Performance with GNU Radio

Excel Lab 2: Plots of Data Sets

About the DSR Dropout, Surge, Ripple Simulator and AC/DC Voltage Source

LTSpice Basic Tutorial

TSKS01 Digital Communication

E x p e r i m e n t 2 S i m u l a t i o n a n d R e a l - t i m e I m p l e m e n t a t i o n o f a S w i t c h - m o d e D C C o n v e r t e r

ECEGR Lab #8: Introduction to Simulink

When you complete this assignment you will:

IX Feb Operation Guide. Sequence Creation and Control Software SD011-PCR-LE. Wavy for PCR-LE. Ver. 5.5x

Engineering Technology

RF Blockset For Use with Simulink

Lab #2 First Order RC Circuits Week of 27 January 2015

Pull Down Menu View Toolbar Design Toolbar

Introduction to Parametric Modeling AEROPLANE. Design & Communication Graphics 1

Radial dimension objects are available for placement in the PCB Editor only. Use one of the following methods to access a placement command:

Implementation of QAM Modulation Demodulation Based on. Simulink

Assignment 12 CAD Mechanical Part 2

High Point Communications Authorized dealer for USA Fleet Services

Working With Drawing Views-I

Tutorial 1 getting started with the CNCSimulator Pro

INTRODUCTION TO AGILENT VEE

ELG3311: EXPERIMENT 2 Simulation of a Transformer Performance

AutoCAD 2018 Fundamentals

ECG Analysis using the Offline Averaging Mode

Personalize Your Napkins

Embroidery Gatherings

Revit Structure 2013 Basics

Applications of satellite and airborne image data to coastal management. Part 2

New Sketch Editing/Adding

Drawing Bode Plots (The Last Bode Plot You Will Ever Make) Charles Nippert

User Guide V10 SP1 Addendum

ACAD-BAU TUTORIAL For BricsCAD platform

Input of Precise Geometric Data

Revit Structure 2014 Basics

Appendix R5 6. Engineering Drafting. Broken View

Magnitude and Phase Measurements. Analog Discovery

LAB II. INTRODUCTION TO LABVIEW

Experiment 8: An AC Circuit

Try what you learned (and some new things too)

Alibre Design Tutorial: Loft, Extrude, & Revolve Cut Loft-Tube-1

Activity P52: LRC Circuit (Voltage Sensor)

Tutorials. OptiSys_Design. Optical Communication System Design Software. Version 1.0 for Windows 98/Me/2000 and Windows NT TM

LAB EXERCISE 3 FET Amplifier Design and Linear Analysis

Introduction to Autodesk Inventor for F1 in Schools (Australian Version)

Lab 3 Introduction to SolidWorks I Silas Bernardoni 10/9/2008

Laboratory Experiment #1 Introduction to Spectral Analysis

Autodesk AutoCAD 2012: Fundamentals. Elise Moss. autodesk authorized publisher SDC PUBLICATIONS

Secondary Math Amplitude, Midline, and Period of Waves

Alibre Design Tutorial - Simple Extrude Step-Pyramid-1

K-band Waveguide BPF Design using Agilent EMPro Anurag Bhargava Application Consultant Agilent EEsof EDA

Importing and processing gel images

EXERCISE 1: CREATE LINE SPARKLINES

AutoCAD 2D. Table of Contents. Lesson 1 Getting Started

Sheet Metal Punch ifeatures

AutoCAD 2020 Fundamentals

Ansoft Designer Tutorial ECE 584 October, 2004

Getting Started. Before You Begin, make sure you customized the following settings:

Ball Valve Assembly. On completion of the assembly, we will create the exploded view as shown on the right.

Importing an Image into LaserWorks

Using LTSPICE to Analyze Circuits

Lesson 6 2D Sketch Panel Tools

Tutorial 2: Setting up the Drawing Environment

C.8 Comb filters 462 APPENDIX C. LABORATORY EXERCISES

Lab 1: Analog Modulations

Drawing a Plan of a Paper Airplane. Open a Plan of a Paper Airplane

Lab 1B LabVIEW Filter Signal

Module 1G: Creating a Circle-Based Cylindrical Sheet-metal Lateral Piece with an Overlaying Lateral Edge Seam And Dove-Tail Seams on the Top Edge

Getting Started. with Easy Blue Print

Introduction to Circular Pattern Flower Pot

Existing and Design Profiles

Experiment # 4. Frequency Modulation

Inventor-Parts-Tutorial By: Dor Ashur

Transcription:

Introduction to Simulink Assignment Companion Document Implementing a DSB-SC AM Modulator in Simulink The purpose of this exercise is to explore SIMULINK by implementing a DSB-SC AM modulator. DSB-SC AM stands for Double Sideband Suppressed Carrier Amplitude Modulation. The Problem Create an amplitude modulated signal of the form s(t) = m(t) cos(2πf c t) where m(t) is the modulating waveform and F c is the carrier frequency. Use a carrier frequency of 0.2 Hz. Display both m(t) and s(t) on a single input scope, also display them individually on a dual input scope. Starting Simulink 1. Start MATLAB. The MATLAB command window (MATLAB 7 is used here), shown in Figure 1, will appear on the screen. In the MATLAB command window, type simulink or select the SIMULINK icon, circled in Figure 1, to bring up the SIMULINK Library browser, which can be seen in Figure 2. Figure 1: MATLAB Command Window

Figure 2: Simulink Library Browser 2. The library browser, shown in Figure 2, contains the Simulink library and various toolbox libraries, which are licensed for your system. In the Windows release of Simulink, there is a lower right window that displays the current library contents as shown in Figure 2 for the Simulink library. In either of the lower windows selecting the symbol with the left mouse button or double-clicking the left mouse button on the name will open that library (or sublibrary). This will display various sub-libraries or Simulink blocks depending on what level you are at. An example of this is given in Figure 3. Figure 3: Example of an Opened SIMULINK Library

3. An icon based representation of the Simulink libraries, displayed in a separate window, can be generated by right clicking on any of the library names (such as Simulink or Continuous) in the browser and then selecting the displayed item. These icon-based libraries can be opened by double-clicking on the icons. An example of an icon window for the Simulink library is given in Figure 4. Figure 4: Example of the Simulink Icon Library 4. An icon-based representation of each library contained in the Simulink library window in Figure 4 is generated by double-clicking on the icon. Figure 5 shows the Continuous sublibrary. Figure 5: Icon-Based DSP Blockset Library

Creating a New Model 1. Left click on the Create New Model icon, which is circled in Figure 6, to open an untitled design window. Figure 6: Create New Model Icon 2. The untitled design window is shown in Figure 7. This window will now be used to construct the AM Modulator model. Figure 7: Untitled Design Window

Constructing the Model You are going to construct a Simulink model of an AM (DSB-SC) modulator. The final model is shown in Figure 8 and the following steps describe how that model is constructed. A. Generating the Modulating Signal, m(t) Figure 8: AM Modulator Model 1. If the Simulink library is not already open, open it by left clicking on the symbol by the word Simulink on the left side of the Simulink Library Browser (Figure 2 shows the Library Browser with an opened Simulink library. 2. Open the Sources sub-library (within the Simulink library) by clicking on the name. Copy the From Workspace item, shown in Figure 9, onto the untitled design window by selecting Figure 9: Sources Sub-Library

the From Workspace item, with the left mouse button, holding the button down and dragging the block onto the untitled design window. Your window should now look like Figure 10. Figure 10: Untitled Design Window with From Workspace 3. The next step is to configure the From Workspace block specifying the workspace variable to be used as input (ie. m(t)). Open the Block Parameter window by double left-clicking on the From Workspace block. In the Data field enter the 1-D signal m. Leave the default entries in the other fields as shown in Figure 11. Select OK to close the Block Parameter window. Note that you must place m in the workspace prior to simulating this model. Figure 11: Block Parameters For m(t)

B. Generating the Carrier Sequence 1. The Sine Wave block can be used to generate the carrier cosine sequence. The location of blocks, such as the Sine Wave block, will be indicated using the following notation, Simulink Sources Sine Wave. This notation states that the Sine Wave block can be located by first expanding the Simulink library in the Simulink Library Browser and then expanding the Sources library, which contains the Sine Wave block. (Note that you can also search for blocks using the search field near the top of the library browser by typing in the block name, for example sine wave.) Drag the Sine Wave block onto the design window. The design window with the Sine Wave block is shown in Figure 12. Figure 12: Untitled Design Window Showing the Sine Wave Block 2. The Sine Wave block must be configured to generate the carrier cosine sequence. First open the Block Parameter window by double left-clicking on the Sine Wave block. In the Frequency field enter 2*pi*Fc. This is the radian frequency of the sinusoid. In the Phase field enter pi/2. This will phase shift the sine wave by 90 degrees resulting in a cosine. Leave the default values in the other fields. Select OK to close the Block Parameter window. The finished Block Parameter window is shown in Figure 13. Note that you must generate Fc, the continuous-time frequency in cycles/second, using the MATLAB command window to put these variables in the workspace so SIMULINK can access them. This will be done prior to simulating this model.

C. Generating the Modulated Sequence Figure 13: Parameters to Generate Carrier Signal 1. The product of the modulating sequence and carrier sequence is generated using the Product block located at Simulink Math Operations Product. Drag the Product block onto the design window. The design window with the Product block is shown in Figure 14. No modifications are required for the Product block parameters. But you should open the Parameter block and note that this block can be used for division or multiple inputs.

D. Completing the Model Figure 14: Untitled Design Window Showing Product Block 1. The blocks in the design window must now be connected to complete the model. This is simply done by using a line to connect an Output Port to an Input Port, which are both defined in Figure 15. Figure 15: Port Definition 2. Connecting the ports involves moving the arrow cursor over the Output Port of the From Workspace block (observe that the arrow changes into a cross-hair), then click and hold the left mouse button and drag the line to the Input Port of the Product block and release the left mouse button. Perform the same operation to connect the Sine Wave block to the Product block. The result is shown in Figure 16.

Figure 16: Connected Blocks 3. You can label or annotate the model by double clicking the left mouse button at the desired location in the design window and then typing the label (to label a signal line double click on the line). Label the model as shown in Figure 17. Figure 17: Design Window Showing Annotated Model E. Simulating the Model 1. The final step in designing the modulator is to test that the SIMULINK model is working properly by doing a simulation. Obviously, to test the model you must be able to display the generated signal. This can be done using a Scope block. The following items will step you through the process of setting up a display.

a. Drag the Scope block (Simulink Sinks Scope) on to your design window, placing it to the right of the Product block. b. Double-left click on the Scope block to display the Scope figure window. Select the Parameters icon,, which will display the Scope parameters window. Change the Number of axes field to 2, then select OK. This will put two graphs on the Scope figure window and two inputs on the Scope block in the design window. The parameters window is shown in Figure 18. Figure 18: Scope Parameters Window c. In the design window connect the Output Port on the Product block to the bottom Input Port on the Scope block. The next step is to connect the output of From Workspace block to the top Input Port on the Scope block. To do this move the arrow cursor over the line connecting the From Workspace block to the Product block, hold down the Ctrl key on the keyboard, select and hold the left mouse button, which will change the cursor into a cross hair. Drag the resulting line to the Input Port of the Scope. (Note that this can also be done using the right mouse button, move the mouse over the line and right click and hold, drag the resulting line to the Input Port.) The resulting design window is shown in Figure 19.

Figure 19: Design Window Showing Two Input Scope e. The next step is to add a scope with one input that displays both waveforms. This can be done using the Mux block located in Simulink Signal Routing. Place the Mux block and the scope as shown in Figure 20. Finally, save the model as am_mod.mdl in a directory of your choice (use the File menu and select Save). f. Figure 20: Design Window Showing Completed Simulation Model g. The various workspace variables must now be defined. Execute the following instructions in the MATLAB command window or place them in an m-file script and execute the script. Fc = 0.2; %carrier frequency a = [3*ones(1,50), -1*ones(1,50), zeros(1,50)]; t = 1:length(a); m=[t.,a. ]; %modulating signal

h. The simulation parameters must now be set. First select the Simulation menu in the am_mod design window and from this menu select Configuration Parameters, which will open a Configuration Parameters window. Change the Stop time field to 150 seconds, which is the total length of m. Leave the default values in the other fields. Note that the stop time could also be changed in the am_mod design window near the upper right corner (You should see a 10 in the text field) i. Select Apply, and then OK to save these values. The resulting Configuration Parameters window is shown in Figure 21. Figure 21: Configuration Parameters Window j. Now you are ready to start the simulation by opening the Simulation menu in the am_mod design window and selecting Start (or select the arrow head in the toolbar of the am_mod design window). The Scope windows will display the resulting signals. (If a Scope window is not visible, double-click on the Scope window block.) The resulting bottom Scope window is shown in Figure 22. (Ignore the warning message displayed in the MATLAB Command window).

Figure 22: Scope Window k. Figure 22 does not display the expected results. The reason is that the Solver step size is too large. (A discussion on Solvers may be presented later in the class.) Try changing the Max step size in the Configuration Parameter dialog box to 0.5 as shown in Figure 23. Select Apply, then OK. Figure 23: Max step size Modification

l. Running another simulation will produce a scope output as shown in Figure 24. Figure 24: Scope with Correct Display m. The top scope produces a display as shown in Figure 25. Figure 25: Top Scope n. The y-axis scales for Figure 25 can be modified to vary the size of the signals. This is done by right-clicking on the graph in the Scope window and selecting Axes properties, which will open another window. In this window change the Y-min field to 4 and the Y-max field to 4, and then select OK. The axis properties dialog box is shown in Figure 26. The resulting Scope window is shown in Figure 27.

Figure 26: Axis Properties Dialog Box Figure 27: Scope Window with Modified Y Axes