454
OptSim User Guide RSoft Design Group, Inc. Physical Layer Division 400 Executive Boulevard, Suite 100 Ossining, NY 10562 Phone: 914-923-2164 Fax: 914-923-2169 E-mail: [email protected] Web: www.rsoftdesign.com

39865643 Optsim Guide

  • Upload
    raju-pal

  • View
    1.866

  • Download
    51

Embed Size (px)

Citation preview

Page 1: 39865643 Optsim Guide

OptSim User Guide

RSoft Design Group, Inc.

Physical Layer Division 400 Executive Boulevard, Suite 100

Ossining, NY 10562

Phone: 914-923-2164 Fax: 914-923-2169

E-mail: [email protected]

Web: www.rsoftdesign.com

Page 2: 39865643 Optsim Guide

OptSim 1989 – 2009 RSoft Design Group. – All rights reserved.

www.rsoftdesign.com

Build OS0510709

This manual contains confidential and proprietary information regarding products of RSoft Design Group. The manual is intended solely for use by authorized OptSim users, who have in effect a License for the OptSim product (under the License Agreement conditions) and the information contained herein may not be used or disclosed to others except by written permission of RSoft Design Group. No part of this document may be reproduced or transmitted in any form or by any means, mechanical or electronic, including photocopying and recording, for any purpose, without the express written permission of RSoft Design Group.

Information in this document is subject to change without notice and does not represent a commitment on the part of RSoft Design Group. The software described in this document is furnished under a License Agreement and may be used or copied only in accordance with the terms of the agreement. Software copying is against the law except as specifically allowed in the license agreement.

Trademarks Artifex, OptSim, ModeSYS, NetworkDesigner are trademarks of RSoft Design Group and its subsidiaries.

All other products and companies mentioned herein are trademarks of their respective owners.

Page 3: 39865643 Optsim Guide

OptSim User Guide Contents •••• iii

Contents

Preface 1 Twin Simulation Engines...........................................................................................................1 Results Analysis and Post Processing........................................................................................2 Best Fit Laser Toolkit and SPICE Model Generator™..............................................................2 ModeSYS™ Multimode Simulation Platform...........................................................................3 Extending OptSim .....................................................................................................................3 CAD Environment .....................................................................................................................3 Simulation and Analysis ............................................................................................................4 References .................................................................................................................................5 Notices .......................................................................................................................................6

Limited Warranty ........................................................................................................6 Copyright Notice .........................................................................................................6 RSoft Design Group™ Trademarks ............................................................................6 Acknowledgments .......................................................................................................6 System Requirements ..................................................................................................6

Chapter 1: Using OptSim GUI 7 1.1 The OptSim Window...........................................................................................................7 1.2 Menu Bar .............................................................................................................................9

1.2.1 File Menu ...........................................................................................................9 1.2.2 Edit Menu .........................................................................................................12 1.2.3 View Menu .......................................................................................................16 1.2.4 Options Menu ...................................................................................................16 1.2.5 Run Menu .........................................................................................................17 1.2.6 Graph Menu......................................................................................................18 1.2.7 Logging Menu ..................................................................................................18 1.2.8 Utilities Menu...................................................................................................19 1.2.9 Connect Menu ..................................................................................................19 1.2.10 Window Menu ................................................................................................20 1.2.11 Help Menu......................................................................................................20

1.3 Tool Bars ...........................................................................................................................20 1.3.1 Main Toolbar ....................................................................................................20 1.3.2 Run Tools Bar...................................................................................................22 1.3.3 Toolbox ............................................................................................................23

1.4 Explorer .............................................................................................................................25 1.4.1 All Models........................................................................................................25 1.4.2 Model Palettes ..................................................................................................26 1.4.3 Favorite Schematics..........................................................................................27 1.4.4 Recent Models ..................................................................................................29 1.4.5 Panner...............................................................................................................29

1.5 Drawing a Link Schematic ................................................................................................30 1.5.1 Design Area / Layout Pane / Schematic Capture Window ...............................30 1.5.2 Add Component................................................................................................30 1.5.3 Select ................................................................................................................31

Page 4: 39865643 Optsim Guide

iv •••• Contents OptSim User Guide

1.5.4 Draw Connection..............................................................................................31 1.5.5 Changing the Number of Component I/O Ports ...............................................32 1.5.6 Move.................................................................................................................33 1.5.7 Zoom ................................................................................................................33 1.5.8 Edit Global Variables (Symbol Table) .............................................................33 1.5.9 Edit Component Parameters .............................................................................34 1.5.10 Encrypted Component Parameters .................................................................35 1.5.11 Naming and Renaming Components ..............................................................35 1.5.12 Viewing Plots Generated by Simulation – Block Mode Simulations .............36

1.6 Creating Compound Components (Hierarchies) ................................................................36 1.6.1 Starting with a new Blank Schematic ...............................................................36 1.6.2 Starting with an Empty Compound Component...............................................37 1.6.3 From a Subset of an Existing Schematic ..........................................................38 1.6.4 Loading a CC From Disk..................................................................................38

1.7 Creating Higher-Order Composites (HOC) .......................................................................39 1.7.1 Example of an HOC Topology.........................................................................41 1.7.2 The ‘instance’ parameter of the HOC Instance block.......................................44

1.8 Parameter Expressions .......................................................................................................44 1.8.2 Symbol Table Expressions ...............................................................................48 1.8.3 User Defined Functions ....................................................................................48

1.9 String Parameters...............................................................................................................48 1.10 Advanced Features...........................................................................................................49

1.10.1 Changing Icons...............................................................................................49 1.10.2 Design Properties............................................................................................51 1.10.3 User Libraries Organizer ................................................................................52 1.10.4 Directories Preferences...................................................................................53 1.10.5 Encrypting Model Data Files..........................................................................54 1.10.6 Adding Texts to the Projects...........................................................................54 1.10.7 Adding Record Keeping Attributes to the Projects.........................................56 1.10.8 Generation of Project Reports ........................................................................57 1.10.9 Decorative Elements.......................................................................................60

Chapter 2: Getting Started with Sample Mode Simulations 67 2.1 Introduction........................................................................................................................67

2.1.1 The System to be Simulated .............................................................................67 2.1.2 Sample Mode Simulation Strategies.................................................................68

2.2 Setting Up Your First Simulation ......................................................................................69 2.2.1 Starting OptSim................................................................................................69 2.2.2 Initialization of Settings....................................................................................70 2.2.3 Creating a new Project......................................................................................71 2.2.4 Sample Mode Simulation Parameters...............................................................73 2.2.5 Drawing the Schematic.....................................................................................75 2.2.6 Simulation ........................................................................................................85 2.2.7 VBS Simulation................................................................................................90 2.2.8 Using the Data Display.....................................................................................92

2.3 Overview of other OptSim Features ..................................................................................96 2.3.1 Setting up Parameter Scans ..............................................................................96 2.3.2 Iterated Components.......................................................................................103 2.3.3 Compound Components .................................................................................107 2.3.4 Correlation Diagrams .....................................................................................112

2.4 A more Complex Example ..............................................................................................122 2.5 Conclusions......................................................................................................................126

Chapter 3: Sample Mode Simulation Techniques and Features 127

Page 5: 39865643 Optsim Guide

OptSim User Guide Contents •••• v

3.1 Simulation Techniques ....................................................................................................127 3.1.1 Spectral Propagation Technique (SPT) ..........................................................128 3.1.2 Variable Bandwidth Simulation Technique (VBS) ........................................128

3.2 Simulation Strategies .......................................................................................................130 3.3 Sample Mode Simulation Parameters ..............................................................................131

3.3.1 The Simulation Parameters Dialog Window ..................................................132 3.4 How to Setup a Simulation ..............................................................................................139

3.4.1 Forbidden Topologies.....................................................................................142 3.4.2 Simulation Messages ......................................................................................143 3.4.3 The Simulation Log Window .........................................................................143 3.4.4 Expressions in Component Parameters ..........................................................144 3.4.5 The Scan Setup Dialog Window.....................................................................146

3.5 OptSim Conventions........................................................................................................147 3.5.1 Signal Units and Representation.....................................................................147 3.5.2 Conventions about Parameter Units ...............................................................149

3.6 Best Fit Laser Toolkit ......................................................................................................150 3.6.1 Functioning.....................................................................................................150 3.6.2 Best-Fit Laser Toolkit Window......................................................................150 3.6.3 The Menu Bar.................................................................................................151 3.6.4 The Tool Bar...................................................................................................152 3.6.5 Window Parameters........................................................................................153

3.7 Using the Best-Fit Laser Toolkit......................................................................................155 3.7.1 Launching the Best-Fit Laser Toolkit.............................................................155 3.7.2 Defining the Parameters .................................................................................155 3.7.3 Starting the Fitting Procedure.........................................................................156 3.7.4 Using the Results ............................................................................................156

3.9 References........................................................................................................................157 3.10 Appendix: Application Notes and White Papers ...........................................................157 3.10.1 TDSS: Time Domain Split-step ..................................................................................157 3.10.2 Spurious Tones in Amplitude Modulators ..................................................................161 3.10.3 On the Accuracy of BER and Q-factor Estimation in Optical System Simulations....167 3.10.4 Report on Phase Noise Issues in OptSim....................................................................174 3.10.5 References...................................................................................................................179

Chapter 4: Sample Mode Data Post-Processing and Display 181 4.1 The Data Display Tool.....................................................................................................181

4.1.1 How to Display the Results ............................................................................182 4.2 Simulation Results ...........................................................................................................183

4.2.1 OptSim Components ......................................................................................183 4.2.2 How to Export Simulation Results .................................................................187

4.3 The Measurement List Window.......................................................................................190 4.3.1 The Menu Bar.................................................................................................191 4.3.2 The Tool Bar...................................................................................................191 4.3.3 The Hierarchies ..............................................................................................192 4.3.4 Displaying and Superimposing Diagrams ......................................................194 4.3.5 Correlation Diagrams .....................................................................................194 4.3.6 Data Display Options .....................................................................................200

4.4 The Measurement Window..............................................................................................201 4.4.1 The Menu Bar.................................................................................................202 4.4.2 The Tool Bar...................................................................................................203 4.4.3 The Legend Window ......................................................................................205 4.4.4 The Display ....................................................................................................205 4.4.5 The Measurement Area ..................................................................................208 4.4.6 The Markers ...................................................................................................208 4.4.7 Operations on the Measurement Window ......................................................210

Page 6: 39865643 Optsim Guide

vi •••• Contents OptSim User Guide

4.5 Instantaneous Optical Power Diagram.............................................................................213 4.5.1 Measurements.................................................................................................214 4.5.2 Post-Processing Operations ............................................................................214

4.6 Instantaneous Phase Deviation Diagram..........................................................................215 4.6.1 Measurements.................................................................................................216 4.6.2 Post-Processing Operations ............................................................................217

4.7 Instantaneous Optical Frequency Deviation Diagram .....................................................217 4.7.1 Measurements.................................................................................................218 4.7.2 Post-Processing Operations ............................................................................218

4.8 Instantaneous Stokes Parameters Diagram ......................................................................219 4.8.1 Measurements.................................................................................................219 4.8.2 Post-Processing Operations ............................................................................219

4.9 Optical Spectrum Diagram ..............................................................................................219 4.9.1 Measurements.................................................................................................220 4.9.2 Post-Processing Operations ............................................................................221 4.9.3 OSNR vs. Run Diagram .................................................................................225

4.10 Electrical Signal Diagram..............................................................................................226 4.10.1 Measurements...............................................................................................226 4.10.2 Post-Processing Operations ..........................................................................226

4.11 Eye Diagram ..................................................................................................................227 4.11.1 Measurements...............................................................................................227 4.11.2 Post-Processing Operations ..........................................................................227

4.12 Histogram on Eye Diagram ...........................................................................................230 4.12.1 Measurements...............................................................................................231 4.12.2 Post-Processing Operations ..........................................................................231

4.13 Histogram on Electrical Signal Diagram .......................................................................232 4.13.1 Measurements...............................................................................................233 4.13.2 Post-Processing Operations ..........................................................................233

4.14 Electrical Spectrum Diagram.........................................................................................234 4.14.1 Measurements...............................................................................................234 4.14.2 Post-Processing Operations ..........................................................................235

4.15 XY Diagram...................................................................................................................236 4.15.1 Measurements...............................................................................................238 4.15.2 Post-Processing Operations ..........................................................................238

4.16 Logical Signal Amplitude Diagram ...............................................................................238 4.17 Scattering Diagram ........................................................................................................238 4.18 File Grammars ...............................................................................................................239

4.18.1 Electrical Signal File ....................................................................................239 4.18.2 Optical Signal File ........................................................................................240 4.18.3 Logical Signal File .......................................................................................241 4.18.4 Spectrum File................................................................................................241 4.18.5 XY Diagram File ..........................................................................................242 4.18.6 Diagram File .................................................................................................243 4.18.7 OSNR Values File ........................................................................................247

4.19 SPT Data Display Toolkit..............................................................................................248 4.19.1 Plot Types.....................................................................................................248 4.19.2 SPT Data Display Window...........................................................................249 4.19.3 Project Conditions ........................................................................................251 4.19.4 Getting Started..............................................................................................251

4.20 Q Surfaces Toolkit .........................................................................................................257 4.20.1 Functioning...................................................................................................257 4.20.2 Plot Types.....................................................................................................257 4.20.3 Project Conditions ........................................................................................258 4.20.4 Getting Started..............................................................................................259

4.21 References......................................................................................................................264 4.22 Appendix: Frequently Asked Questions ........................................................................264

Page 7: 39865643 Optsim Guide

OptSim User Guide Contents •••• vii

4.22.1 FAQ on Fiber Properties and Models .........................................................................265 4.22.2 FAQ on Optical Components......................................................................................265 4.22.3 FAQ on Electrical and Digital Components ...............................................................266 4.22.4 FAQ on Measurement Components............................................................................266 4.22.5 FAQ on other Miscellaneous Problems ......................................................................267

Chapter 5: Sample Mode User Models 269 5.1 The Custom Component Executable................................................................................269

5.1.1 CCE Types .....................................................................................................270 5.2 Using a CCE ....................................................................................................................271 5.3 Creating a CCE ................................................................................................................272

5.3.1 How the CCE is Invoked by OptSim..............................................................274 5.4 Executable Behavior During the Simulation ...................................................................275

5.4.1 SPT Behavior..................................................................................................275 5.4.2 VBS Behavior.................................................................................................276 5.4.3 Note on Measurement Components................................................................277 5.4.4 Note on Power Spectra ...................................................................................277 5.4.5 Management of Custom Output .....................................................................277

5.5 CCE VBS Behavior Examples.........................................................................................278 5.5.1 Case 1: one input/output with no Group Delay ..............................................278 5.5.2 Case 2: one input/output Introducing Group Delay........................................281 5.5.3 Case 3: More input/output Introducing Group Delay .....................................282

5.6 OptSim Files Grammar....................................................................................................284 5.6.1 CCE Component Description .........................................................................284 5.6.2 Simulation Parameters for CCE (OptSimBlParS_1) ......................................286 5.6.3 Component Parameters for CCE (OptSimBlParC_1).....................................288 5.6.4 Output Simulation Parameters from CCE (OptSimBlParO_1).......................289 5.6.5 Optical and Electrical Time Sample Files ......................................................290 5.6.6 Optical Power Spectrum Files (OptSimPS_1)................................................292 5.6.7 Charts Index ...................................................................................................293

Chapter 6: MATLAB Cosimulation in Sample Mode 295 6.1 Custom Component for MATLAB® ................................................................................295 6.2 Using a CCM ...................................................................................................................296

6.2.1 Notes on the Console Mode............................................................................297 6.3 Creating a CCM...............................................................................................................298

6.3.1 Custom Component for MATLAB Wizard ....................................................298 6.3.2 The Skeleton MATLAB m-files.....................................................................302

6.4 CCM Example .................................................................................................................306 6.4.1 The Linear Amplitude Modulator CCM.........................................................306 6.4.2 Setting up the OptSim Project ........................................................................307 6.4.3 Using the CCM Wizard ..................................................................................308 6.4.4 Customizing MATLAB m-files and Help File ...............................................310 6.4.5 Using the CCM...............................................................................................312 6.4.6 Simulating the Project ....................................................................................313

6.5 Exchanging Signals by Files............................................................................................316 6.5.1 How to Exchange Data with MATLAB® .......................................................316

Chapter 7: SPICE Cosimulation in Sample-Mode 317 7.1 The Custom Component for using with SPICE .............................................................317

7.1.1 CCS Component Description .........................................................................318 7.1.2 Guidelines for Writing SPICE Circuit Files ...................................................321

7.2 Using a CCS ....................................................................................................................321

Page 8: 39865643 Optsim Guide

viii •••• Contents OptSim User Guide

7.3 Appendix .........................................................................................................................323 7.3.1 Overview.......................................................................................................................323 7.3.2 Analysis at Different Temperatures ..............................................................................323 7.3.3 General Structure and Conventions ..............................................................................325

Comments................................................................................................................326 Device Models.........................................................................................................326 Subcircuits ...............................................................................................................327 .ENDS ......................................................................................................................327 Subcircuit Calls ..................................................................................................328 Combining Files: .INCLUDE Lines ........................................................................328

7.3.4 Components ..................................................................................................................328 Elementary Devices.................................................................................................328

7.3.5 Voltage and Current Sources ........................................................................................332 7.3.6 Transmission Lines.........................................................................................339 7.3.7 Transistors and Diodes ...................................................................................343

Chapter 8: Getting Started with Block Mode and Transient Simulations358 8.1 The tour............................................................................................................................358

8.1.1 Laying out the Design Topology ....................................................................358 8.1.2 Parameter Scan Dialog Window: Setting up Parameter Scans .......................362 8.1.3 Simulation Run Dialog Window: Setting up a Single Simulation Run ..........364 8.1.4 Viewing Simulated Signal Summaries ...........................................................367 8.1.5 Viewing Plots Generated by Simulation.........................................................368

Chapter 9: Block Mode Simulations: Signal Types and Representations369 9.1 Discrete Representations of Signals.................................................................................369

9.1.1 Time and Frequency Domain Representations ...............................................371 9.2 Fundamental Signal Types...............................................................................................376

9.2.1 Binary Signals ................................................................................................376 9.2.2 Electrical Signals ............................................................................................377 9.2.3 Optical Signals................................................................................................380

9.3 General Comments ..........................................................................................................387 9.4 Transient Simulations ......................................................................................................388

9.4.1 Background ....................................................................................................388 9.4.2 Time Step and Spectral Bin Size ....................................................................388 9.4.3 Time Step Constraints ....................................................................................389 9.4.4 Signal Summaries for Transient Simulations .................................................389

9.5 References........................................................................................................................389

Chapter 10: Multimode Simulations: Transverse Mode Profiles 391 10.1 Introduction....................................................................................................................391 10.2 Complete Optical Signal Representation .......................................................................391 10.3 Gridded Modes ..............................................................................................................392 10.4 Donut and Spot Modes ..................................................................................................393 10.5 Laguerre-Gaussian Modes .............................................................................................393 10.6 Hermite-Gaussian Modes ..............................................................................................394 10.7 LP Modes.......................................................................................................................395 10.8 Troubleshooting.............................................................................................................397 10.9 Appendix: Color Scales ................................................................................................401

10.9.1 What are Scale Files? ...................................................................................402 10.9.2 Using Color Scales .......................................................................................403 10.9.3 Scale File Format..........................................................................................404 10.9.4 Additional Example......................................................................................405

Page 9: 39865643 Optsim Guide

OptSim User Guide Contents •••• ix

10.10 References....................................................................................................................406

Chapter 11: Block Mode User Models 407 11.1 Overview........................................................................................................................407 11.2 Header/Library Files ......................................................................................................407 11.3 Calling Conventions ......................................................................................................408 11.4 Library Functions...........................................................................................................409 11.5 Parameters......................................................................................................................418 11.6 Signals ...........................................................................................................................418

11.6.1 OpSigExt ......................................................................................................418 11.6.2 ElecSig..........................................................................................................421 11.6.3 BinSig...........................................................................................................422 11.6.4 Working With Signals ..................................................................................422

11.7 Multimode Library Functions ........................................................................................423 11.8 Compiling the Model .....................................................................................................425 11.9 Parameter Definition File...............................................................................................426 11.10 Using Block-Mode User Models .................................................................................429 11.11 Examples......................................................................................................................430

11.11.1 Example 1...................................................................................................430 11.11.2 Example 2...................................................................................................431

Chapter 12: MATLAB Cosimulation in Block Mode 433 12.1 MATLAB User Model Overview..................................................................................433 12.2 Parameters......................................................................................................................433 12.3 Signals ...........................................................................................................................434

12.3.1 Input and Output Nodes................................................................................434 12.3.2 Optical Signal ...............................................................................................434 12.3.3 Electrical Signal............................................................................................436 12.3.4 Binary Signal ................................................................................................437

12.4 MATLAB Cosimulation Parameter Definition File ......................................................437 12.5 Using MATLAB Models ...............................................................................................439

Index 441

Page 10: 39865643 Optsim Guide
Page 11: 39865643 Optsim Guide

OptSim User Guide Preface •••• 1

Preface

OptSim is an advanced optical communication system simulation package designed for professional engineering and cutting-edge research of WDM, DWDM, TDM, CATV, optical LAN, parallel optical bus, and other emerging optical systems in telecom, datacom, and other applications. It can be used to design optical communication systems and simulate them to determine their performance given various component parameters. OptSim is designed to combined the greatest accuracy and modeling power with ease of use on both Windows and UNIX platforms. It includes the most advanced component models and simulation algorithms, validated and used for research documented in numerous peer-reviewed professional publications, to guarantee the highest possible accuracy and real-world results. Many of these publications are listed and available on RSoft Design Group's website at www.rsoftdesign.com from a link on the OptSim page.

OptSim represents an optical communication system as an interconnected set of blocks, with each block representing a component or subsystem in the communication system. As physical signals are passed between components in a real-world communication system, “signal” data is passed between component models in the OptSim simulation. Each block is simulated independently using the parameters specified by the user for that block and the signal information passed into it from other blocks. This is known as a block-oriented simulation methodology. These blocks are graphically represented as icons in OptSim. Internally, they are represented as data structures and sophisticated numerical algorithms.

OptSim includes an extensive component model library of the most commonly used components for the engineering of electro-optical systems. This component library is continuously being expanded through ongoing research and collaboration with world-renowned simulation specialists at major optical technology centers throughout the world. OptSim 4.0 includes models and algorithms developed by and in collaboration with the Polytechnic University of Turin, University of California at Santa Barbara, and University of Illinois at Urbana-Champaign. It incorporates the capabilities of iFROST (illinois FibeR-optic Link Demonstrator) from the University of Illinois at Urbana-Champaign which was licensed by RSoft Design Group, FOLD (Fiber Optic Link Demonstrator) from the University of California at Santa Barbara which was licensed by RSoft, LinkSIM™ which was developed by RSoft Design Group, and OptSim™ version 3.5 which was acquired from ARTIS by RSoft. The GUI and some aspects of the simulation engine are derived from the Ptolemy II and Ptolemy Classic software projects at the University of California at Berkeley. OptSim also includes a large selection of predefined component parameter sets representing a wide array of commercially available components. These can easily be selected in the component model parameter editing window.

In addition to the extensive component library, OptSim 4.0 includes a new sophisticated yet easy-to-use graphical user interface (GUI), plus twin simulation engines, and powerful simulation result analysis and post-processing tools. The user interface provides a hierarchical object-oriented CAD environment for schematic development and system design. It is described in further detail in this documentation.

Twin Simulation Engines The twin simulation engines support two complementary simulation approaches. The block mode simulation engine performs simulations in which the signal data passed between components represents the entire simulated time in one

Page 12: 39865643 Optsim Guide

2 •••• Preface OptSim User Guide

block of data. The advantage of this approach is that component models and algorithms can easily work with the entire signal, transforming it back and forth between the time and frequency domains to operate on the data in the domain most convenient for the simulation algorithm. Nonlinear fiber is simulated using the Split Step Fourier technique in this mode [1]. This simulation approach was used by the LinkSIM, iFROST, and FOLD tools, for example. The sample mode simulation engine performs simulations in which the signal data passed between components represents a single sample or time step at a time. Unlike the block mode simulation approach where one component model may only pass data to another component model once during the course of the simulation, covering the entire simulated time in one block of data, in the sample mode simulation approach a component model will pass new sample data to another component model at each time step in the simulation. One advantage of this approach is that simulations can be performed over an unlimited amount of simulated time covering an unlimited transmitted sequence length. In this mode, signal processing is done completely in the time domain. Nonlinear fiber is simulated using the Time Domain Split Step technique in this mode [2]. The sample mode also provides two types of simulations: a Spectral Propagation Technique (SPT) that performs quick simulations of the optical spectrum including ASE noise, optical amplifications, and optical filtering; and Variable Bandwidth Simulation (VBS) which performs the full time-domain waveform simulation with options to include all effects with or without noise, in a linear or nonlinear simulation. Note that through the flexible user model capabilities provided with OptSim, users can create models that operate on signal data a sample at a time or in large blocks, in either the time domain or frequency domain, for both the block mode and sample mode simulation engines.

OptSim 4.0 also introduces new capabilities for simulation of power transients due to adding and dropping of channels in optical amplifier chains and all-optical gain control techniques. These capabilities make use of new features for Wavelength Domain Simulation [3] and true simulation iterations enabling simulations of feedback paths and fast simulation of large time windows (on the order of seconds) which were not computationally feasible with previous simulation technologies.

Results Analysis and Post Processing Simulation results that are produced by OptSim include signal waveform plots and eye diagrams at any point within the optical communication system, and bit error rate (BER) plots vs. various parameters within the system such as the received optical power. Other simulation results are also available, including signal spectra, frequency chirp, power and dispersion maps, and more. Simulation results may also be plotted against one another and correlated with scanned parameter values. OptSim performs analyses of the effects of noise, crosstalk, jitter, skew, and variations in component parameters using Monte Carlo and quasianalytical methodologies. Several post-processing and simulation results analysis tools are provided including the WinPlot™ and RPlot™ simulation result plotting tools as well as the VirLab™ post-processing and simulation results analysis tool. These tools make it easy to interactively work with the simualtion results to present them in the manner desired and analyze them further.

Best Fit Laser Toolkit and SPICE Model Generator™ OptSim is also the only tool that provides the Best Fit Laser Toolkit™ for quickly and easily producing accurate rate equation laser models that are well-fitted to real-world laser performance characteristics as determined through measurements or data sheets provided by the manufacturer. Accompanying this capability is the SPICE interface that bridges the gap between the electronic circuit and optical system simulation domains. This includes the unique SPICE Model Generator™ that automatically generates a SPICE model deck based on OptSim's rate equation laser models for use in SPICE simulations. Using this capability, the laser's true driving conditions can be accurately modeled in SPICE simulations of the laser driver. Then the laser driver's accurate output waveform can be used to drive the laser model in OptSim to produce the most accurate simulations of the system performance. Because the laser model used in the SPICE simulation of the laser driver and OptSim's system simulation of the optical channel, the results are much more accurate than when the laser's driving conditions are estimated in SPICE simulations with a simple RC circuit, as has been frequently the case. This is an effective aid in the laser driver design optimization as it enables the simulation of the true driving conditions of the laser and enable the designer to explore the effects of different driver design parameters on the laser and system performance. The driver's design directly influences the pulse distortion induced by the laser output due to chromatic dispersion in the fiber. Through this capability, the system impacts of signal integrity and electromagnetic interference in the laser driver can also be investigated.

Page 13: 39865643 Optsim Guide

OptSim User Guide Preface •••• 3

ModeSYS™ Multimode Simulation Platform OptSim can be fully integrated with ModeSYS™, RSoft's multimode simulation platform, for accurate simulation of multimode optical communication systems. With a primary focus on data communication applications, ModeSYS allows users to evaluate both temporal and spatial attributes of optical signal propagation. This capability enables the system-level analysis of standardized communication technologies such as 1 Gb and 10 Gb Ethernet and Fibre Channel, as well as the study of proprietary data communication platforms. ModeSYS is the first commercial tool to address this challenge. Spatially-dependent models included with ModeSYS enable the accurate analysis of a transverse electromagnetic spatial field starting with its generation by an optical source, continuing with its propagation through spatially-dependent components in a multimode optical link such as multimode fiber and connectors, and through to its detection at a photoreceiver. The wide range of multimode analyses that can be performed with ModeSYS include differential mode delay (DMD), encircled flux (EF), effective modal bandwidth (EMB), launch conditions, modal coupling, transverse optical field profiles, and transient analyses. In addition, eye diagrams, signal waveforms, frequency spectra, BER curves, etc. are also provided. ModeSYS performs device-level modeling within a system simulation infrastructure, so extremely detailed spatial field calculations are implemented in a manner that allows a very straightforward system-level analysis. The platform shields the user from much of the complex optical physics that are necessary to analyze multimode systems, making it not only powerful, but easy to use.

Extending OptSim OptSim also provides powerful capabilities for creating user models in both the block mode and sample mode simulation engines. User models may be written in a programming language such as C++ or FORTRAN and linked into the simulation tool utilizing application programming interface (API) provided with OptSim. In addition, OptSim supports MATLAB® interfaces that enable users to write their user models in MATLAB for full co-simulation with OptSim as well as use MATLAB for post-processing analysis of OptSim simulation results.

OptSim also provides interfaces to various device-level simulation tools including RSoft's BeamPROP™, GratingMOD™, and LaserMOD™, as well as third-party tools such as Thin Film Center's Essential MacLeod thin film design software. Also, OptSim provides interfaces to leading laboratory test equipment including Agilent's 86146B-DPC Optical Spectrum Analyzer and Time Resolved Chirp measurement solution and 81910A Photonic All-parameter Analyzer, and Luna Techologies' Optical Vector Analyzer (OVAe).

Following are further details on the features provided by OptSim, organized into related categories:

CAD Environment • OptSim provides a hierarchical object-oriented topology layout environment for straightforward definition

of system topologies. Optical communication system components such as pseudo-random binary sequence generators, lasers, modulators, fibers, multiplexers, optical amplifiers, attenuators, filters, and receivers can easily be selected from a toolbar palette or tree, graphically added to the layout, and connected together using the mouse to produce the desired topology.

• Each component represented by an icon in the topology layout has its own set of parameters which can be accessed with a click of the right mouse button. Parameters may include numerical values such as laser wavelength or fiber diameter, as well as selections among various settings such as filter type.

• The schematics can be customized by turning on and off the gridlines, showing or hiding component names by the icons, changing the icon displayed for different component instances, displaying selected component parameters on the schematic, placing formatted text annotations in the schematic, custom-routing interconnection lines as desired, customizing the placement of the ports on the icons to different sides, etc.

• Arithmetic expressions and user variables are supported. Each numerical component parameter in the link may be specified as an arithmetic expression involving user-defined variables, rather than simply being a constant number.

Page 14: 39865643 Optsim Guide

4 •••• Preface OptSim User Guide

• Component parameters may be tested prior to running a system simulation. This feature allows component parameters to be more easily specified given measured performance characteristics. For example, the L-I curve and small signal frequency response curves of a semiconductor laser are output based on the specified component parameters.

• Components can be grouped together and used to create Compound Components (also known as superblocks) for repeated use or to reduce clutter in the schematic as well as for use in multiple different schematics.

• Component parameter sets may be saved to files or loaded from files directly from the component parameter editing window. This supports the creation and use of component parameter libraries, where different parameter set files can represent different physical components.

• A new customizeable Explorer region of the GUI replaces the model palette of previous versions to enable users to create their own custom palettes, use a tree view for the model selection instead, easily access recently used models, create and use libraries of compound components, and define a collection of "favorite schematics" for easy access.

• The schematic can be zoomed in and out with unlimited zoom levels, and a "panner" is provided in the lower left corner to easily identify and control which portion of the full schematic is visible in the schematic editing window.

• A simulation animation mode is available along with simulation status and log file windows.

• Powerful encryption capabilities are provided to make protecting your schematics and model parameters easier than ever.

• The full user manual is available online, and context-sensitive online help is available for the component models from the component parameter editing window.

Simulation and Analysis • A powerful nested variable scanning mechanism that allows component parameters to be specified as

variables and scanning those variables over user-defined ranges, as well as defining specific variable values for each of a specified number of runs, to see their effect on the link performance are included. Multiple variables may be scanned at the same time, with the scans nested. The scheduling algorithm optimizes the simulation efficiency by only simulating the components in each scan which are affected by the change of the scanned variables, and using previously computed results when possible. This feature permits time-efficient analysis of the effects of parameters which use the scanned variables on the overall system performance, and facilitates parametric studies and design optimization. Using this feature, a family of BER curves vs. received optical power can be generated, for example.

• Statistical variations of component parameters is supported. Numerical component parameters may have their probability distribution and standard deviation individually defined. In concert with the nested variable scanning, a specified number of simulation runs with parameters randomized according to their statistics may be performed in each sweep. The multiple simulation runs can be used to determine the range of expected performance for the link given the statistical variations. This information can be used by the designer to center design parameters, perform aging analyses for the links, study the impact of environmental effects on system performance and reliability, determine system yield given known distributions in component parameters, etc. This can also be used to study parallel optical links, where the variations in component parameters between different channels can be the leading performance degradation mechanism.

• Repetition loops allow portions of a link topology to be specified as being repeated n times such that the simulation will behave as if there were n sets of the groups of component icons within the repetition loop icons attached end to end. Repetition loops may be nested, and may have multiple input and output signals. These are especially useful for defining spans of fibers and amplifiers in long haul systems.

• Network rings may be simulated through initialization and repeated simulations of ring topologies.

Page 15: 39865643 Optsim Guide

OptSim User Guide Preface •••• 5

• New capabilities are added for simulating power transients due to adding and dropping of channels in optical amplifier chains and all-optical gain control techniques, including simulation of feedback through iterations.

• Measured or externally computed signal waveforms may be used to drive the OptSim simulation. This provides flexibility in configuring simulations and allows OptSim to be used in conjunction with experimental results as well as other simulation and analysis programs.

• Signals may be saved during the simulation to be used as driving signals for future simulations, or loaded from files to drive the current simulation.

• Signal summary information for signals at all component ports is available from the topology editor after the signals are generated during the simulation as well as after the simulation is completed.

• Users may develop their own component models and incorporate them into the OptSim environment. These user models can be as sophisticated and powerful as built-in models.

• Users may incorporate optoelectronic components modeled in BeamPROP™, GratingMOD™, LaserMOD™, or another device-level tool in an OptSim simulation. This unique multi-level simulation capability provides the best accuracy and efficiency in link performance analysis involving complex designs.

• Optional integration with ModeSYS™, the industry’s only multimode optical communication system simulation solution that takes into account both spatial and temporal effects.

• Best Fit Laser Toolkit™ makes customizing powerful rate-equation laser model parameters to fit desired performance characteristics easy.

• The SPICE Interface, including the SPICE Model Generator™, bridges the gap between electronic circuit and optical communication system simulation. This unique features makes laser driver circuit design and system modeling easier and more accurate than ever before.

• Powerful MATLAB® interface makes it easy to develop user’s own models and customize and extend the simulation and analysis capabilities.

• Extensive predefined manufacturer component database makes it easy to model commercially available components.

OptSim is continually being enhanced. If there is a feature which you need that is not already included in OptSim, please contact RSoft Design Group to let us know. RSoft Design Group would be happy to provide an estimate of when a desired feature may become available. In addition, RSoft also offers training and consulting services to its customers to meet their specific and unique requirements.

References [1] G. P. Agrawal, Nonlinear Fiber Optics, 2nd Edition, p. 44, p. 323 (Academic Press, San Diego, CA, 1995). [2] A. Carena, V. Curri, R. Gaudino, P. Poggiolini and S. Benedetto, "A time-domain optical transmission system

simulation package accounting for nonlinear and polarization-related effects in fiber," IEEE Journal on Selected Areas in Communications, vol. 15, no. 4, pp. 751-765, May 1997.

[3] I. Roudas et al., “Wavelength-Domain Simulation of Multiwavelength Optical Networks,” IEEE J. Selected Topics in Quantum Electronics, vol. 6, no. 2.

Page 16: 39865643 Optsim Guide

6 •••• Preface OptSim User Guide

Notices

Limited Warranty RSoft Design Group, Inc. warrants that under normal use, the physical media (diskette and documentation) will be free of material defects for a period of thirty days from the date of purchase. Upon written notice, RSoft Design Group, Inc. will replace any defective media. No other warranty of any sort, either expressed or implied, is provided with this software. No liability for damage to equipment or data, or any other liability, is assumed by RSoft Design Group, Inc.

Copyright Notice Copyright © 1993 – 2006 RSoft Design Group, Inc. All Rights Reserved.

Copyright is claimed for both this manual and the software described in it.

RSoft Design Group™ Trademarks RSoft Design Group, RSoft Inc., RSoft, BeamPROP, FullWAVE, GratingMOD, BandSOLVE, DiffractMOD, LaserMOD, LinkSIM, OptSim, ModeSYS, WinPLOT, RPlot, RPLOT, Best Fit Laser Toolkit, and SPICE Model Generator are trademarks of RSoft Design Group, Inc.

Acknowledgments Portions of OptSim are based on Ptolemy II and Ptolemy Classic – copyright by University of California, Berkeley. OptSim includes models and algorithms licensed by RSoft Design Group from two prominent university optical link simulation packages. These are iFROST (illinois FibeR-optic and Optoelectronic Systems Toolkit) from the University of Illinois at Urbana-Champaign, and FOLD (Fiber Optic Link Demonstrator) from the University of California at Santa Barbara. iFROST, in collaboration with IBM, was validated and used for the modeling and simulation of the DARPA-funded Optoelectronic Technology Consortium’s 32 channel 16 Gbps OETC parallel optical bus. FOLD was validated and used for the modeling and simulation of the DARPA-funded WEST (WDM with Electronic Switching Technology) program’s 12 channel 120 Gbps optical communication switch. Portions of OptSim were developed under Navy SBIR contracts N00178-98-C-3045 and N00178-01-C-3061, and NIST ATP contracts 70NANB8H4018 ("PCAD") and 1998-02-0061C ("DataPipe").

IBM is a registered trademark and IBM PC, PS/2, and OS/2 are trademarks of International Business Machines Corporation. Intel is a trademark of Intel Corporation. Microsoft and MS-DOS are registered trademarks and Windows is a trademark of Microsoft Corporation. UNIX and Motif are registered trademarks and X Windows is a trademark of The Open Group. Linux is a registered trademark of Linus Torvalds. XFree86 is a registered trademark of the The XFree86 Project. MATLAB is a regesitered trademark of MathWorks, Inc. All other product names referred to in this document are trademarks or registered trademarks of their respective owners.

System Requirements OptSim will run on an IBM compatible personal computer with an Intel Pentium or higher processor, and 128 MB or more RAM. The Windows versions require Windows 2000/XP. OptSim is not guaranteed to work under Windows 95/98/NT. OptSim will also run under Linux and various UNIX using X Windows or XFree86 and Motif.

Page 17: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 7

Chapter 1: Using OptSim GUI

This chapter describes the OptSim graphical user interface.

1.1 The OptSim Window The OptSim window, shown in the following figure, is composed of a few simple graphical elements.

Figure 1: The OptSim graphical editor

Design Area

Explorer

Status Bar

Title Bar Menu Bar Tool Bar

Toolbox

Run Tools

Page 18: 39865643 Optsim Guide

8 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Below you will find a short description of OptSim GUI elements. Details of each GUI module will be given later in the chapter.

• Title Bar

The title bar at the top of the OptSim window displays the name of the project currently opened. All projects must have filenames, therefore OptSim always asks you for a project to open or a name and location to save a new project when it is created.

• Menu Bar

Directly below the title bar, the menu bar groups most OptSim commands into Windows-style pull-down menus. Clicking on a pull-down menu will display a list of related commands.

• Tool Bar

The tool bar directly below the menu bar groups a set of buttons that serve as shortcuts for the most frequently used commands in the menu bar for editing related functions. Placing the cursor over a tool bar button causes a light-background box (tool tip) to popup with the name of the command executed by the button.

• Explorer

The explorer module provides access to the models library, models palettes, favorite schematics, user library, compound components library, and more. It also allows user to view a list of recent models or to see a panned view of the schematic in the design area.

• Design Area

The design area (layout pane) is the area below the tool bars where you may create the graphical network representing your design (either a compound component or complete OptSim project). The grid shown in the figure may optionally be turned off or on by the user.

• Run Tools Bar

The run tools bar is a set of shortcut buttons for simulation run-related commands. It is located directly above the design area. Placing the cursor over a tool bar button causes a light-background box (tool tip) to pop up with the name of the command executed by the button.

• Toolbox

The toolbox is another set of shortcut buttons to access tools that are used in schematic drawing. These are not accessible from the menu. The toolbox is located on the left side of the design area. Placing the cursor over a tool bar button causes a light-background box (tool tip) to popup with the name of the command executed by the button.

• Status Bar

The status bar at the bottom of the OptSim window is used to provide explanations and context-sensitive information regarding the status of the simulation that is currently running or other general project related information.

You can enlarge or reduce the size of the window by clicking and dragging any side or corner of the window to the desired location. This operation will resize only the design area. The Explorer area may also be collapsed to maximize the Design Area by clicking the left arrow button to the left of the Run Tools. It may then be restored by clicking the right arrow button to the left of the Run Tools.

OptSim is a Multiple Document Inteface (MDI) application. Therefore is has a single main window and supports any number of child of windows that are displayed in the main window. This feature is very useful when copying and pasting parts of a design between windows. Each opened project will be given a button below the design area for easy access when switching between opened projects in the design area.

Page 19: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 9

1.2 Menu Bar The different functions available from the menus are specified in this section.

1.2.1 File Menu • New

Schematic …: Opens the dialog shown in Figure 2. The Document Type can be either Project or Compound Component (CC). The Model Type is automatically set to “None” if the Document Type is set to Compound Component. The user must subsequently select either Sample-Mode or Block_Mode as the Model Type to create the appropriate CC. If the Document Type is set to Project, the user may select either a Sample-Mode (the default) or a Block-Mode model type for the new schematic document. The name of the new document is entered in the File Name field. The current directory is automatically entered for the user. The “Browse” button can be used to select an alternative directory where the new document should be saved.

Figure 1: Dialog window for New Schematic.

Sample-Mode Project: Creates a blank schematic with the Model Type automatically set to Sample-Mode. The project is initialized with the default simulation parameters. Sample-Mode models can be added to the schematic, connected and executed. A shortcut to this action is also provided on the toolbar. The default directory that is used for new projects can be selected using the Preferences dialog.

Block-Mode Project: Creates a blank schematic with the Model Type automatically set to Block-Mode. Block-Mode models can be added to the schematic, connected and executed. A shortcut to this action is provided on the toolbar. The default directory that is used for new projects can be selected using the Preferences dialog.

• Open

This action invokes a File Chooser dialog that can be used to open an existing OptSim document. A shortcut is available on the toolbar. The user will also be able to open the schematic files of previous versions of OptSim (versions 3.6), which have file extentions .opf and .opm, and of previous versions of LinkSIM (versions 3.5 and 3.4). After opening, these files will be converted to the new OptSIM format with extension .moml. The Options->Preferences->View Styles page shown in Figure 3 allows the user to add either a Directory/File Shortcuts Accessory or a File Find Accessory. The former is shown attached to the file chooser in Figure 4 and the latter is shown in Figure 5. The Shortcuts Accessory allows the user to create persistent shortcuts for files and directories that can subsequently be used to quickly select the corresponding files and directories. The File Find Accessory assists the user in searching for particular files on disk. It allows the user to search based on the file name, the modification date, and the file content. The user also has the option to not attach any of these accessories to the file choosers.

Page 20: 39865643 Optsim Guide

10 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Figure 3: View Styles Options->Preferences Dialog

.

Figure 4: File Chooser with Shortcut Accessory.

Page 21: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 11

Figure 5: File Chooser with Find File Accessory.

• Save

This action saves the currently active document. This is normally a schematic document. A shortcut is available on the toolbar.

• Save As

Opens the file selection window so that the user can choose a new location or file name for the schematic and saves it in the selected location and optional new filename. The accessories described in the Open section above are also attached to the save file chooser when they are selected on the corresponding Options page.

• Close

Closes the currently active schematic. If the document that is being closed has other associated documents, such as opened compound components, they will also be closed automatically.

• Close All

Closes all opened schematics. The user will be prompted to save all documents that are in an altered state.

• Properties

This action opens the dialog for setting and editing properties of the currently active schematic document. Detailed description of this item will be given later in the chapter.

• Export Schematic

This action saves an image of the active schematic. JPEG, PNG, and BMP image formats are supported. The size and view of the image is taken from the current size and view of the schematic view window.

• Print

Displays a Print Dialog to set the printer options and to print the currently active schematic.

Page 22: 39865643 Optsim Guide

12 •••• Chapter 1: Using OptSim GUI OptSim User Guide

• Recent Files

This menu item keeps track of the 10 most recently opened schematics. The documents can be opened from the shortcut actions that are provided.

• Exit

Quits the OptSim application window. If changes have been made to the schematics displayed by the windows, a dialog will appear (for each schematic) that queries whether you want to save the changes or not.

1.2.2 Edit Menu • Undo

Undoes the last schematic edit operation. (Also available as an icon on the toolbar.)

• Redo

Redoes the previous undo operation. (Also available as an icon on the toolbar.)

• Cut

Deletes the selected object(s) and puts them in the clipboard. (Also available as an icon on the toolbar.)

• Copy

Copies the selected object(s) to the clipboard. (Also available as an icon on the toolbar.)

• Paste

Pastes the object(s) from the clipboard onto the current design area. The user may right-click the mouse at a location on the canvas where the copied objects are to be pasted. If this is not done, the pasted objects will be placed at a location slightly offset from the location of the original objects (Also available as an icon on the toolbar.)

• Delete

Deletes the selected object(s) without copying to the clipboard.

• Duplicate

Duplicates the selected object(s). The duplicated object(s) are placed at a location slightly offset from the location of the original objects.

• Select All

Selects all objects in the currently active schematic.

• Find Components …

This action invokes the dialog shown in Figure 6. It is used to search the currently active schematic for objects that satisfy the specified search criteria. The options that can be specified in the “As” field are: Object name, Parameter name, Parameter value, Global Symbol, and Object Class Name. The conforming objects are highlighted.

Page 23: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 13

Figure 6: Find Components dialog window

• Multi-Component Parameter Edit

Opens a dialog that allows all the common parameters of all currently selected components to be edited simultaneously. When the OK button of the dialog is pressed, all the values of the parameters in the selected components that are included in the dialog are updated to be the values specified in the dialog. The selected components must be of the same model type for this option. The default parameters are those of the first component that is selected.

• Selective Multi-Component Parameter Edit

Opens a dialog that allows the selected common parameters of all currently selected components to be edited simultaneously. An example dialog is shown in Figure 7 below. The user selects the particular parameters that should be edited from the common set by selecting the corresponding checkbox in the “Apply” column. When the OK button of the dialog is pressed, the values of the selected common parameter of all the selected components are updated to be the values specified in the dialog. Any combination of component model types that have common parameter names may be selected when using this feature.

Page 24: 39865643 Optsim Guide

14 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Figure 7: Selective Mulit-Component Edit dialog window

• Encrypt Component Parameters

Encrypted Parameter files are created using the dialog invoked by this action. The user must first select a model in a schematic for which they wish to create an encrypted parameter file. The values can be edited in the encryption query dialog. The parameters that are to be hidden are selected in the “Encrypt” column. The user may optionally specify a set of white-space separated hardlock keys. If hardlock keys are specified, only a user whose key was included will be able to load the encrypted parameter file. A parameter encryption example is shown in Figure 8 below. When a user loads an encrypted parameter file (with file extension .prm), the parameters that were selected will have their values replaced with the text “Hidden” as shown in the example. The user may also encrypt the parameters of a model in their project without saving an encrypted parameter file. To do this, they simple select the parameters to be encrypted and use the “Apply” button to mark the parameters for encryption. Saving the project before closing it or when prompted to do so, will make the encryption persistent. Please note that there is no way to decrypt parameters.

Page 25: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 15

Figure 8: Encrypt Component Parameter dialog window.

• Sorted Parameters Edit

This action opens a dialog to edit the parameters of the currently selected model. Like the Encrypt Component Parameters dialog, all the parameters are collected under a single tab. However, the parameter names are used to sort the order of the list in lexicographical order.

• Symbols

This action opens a dialog to edit the top-level symbols of the currently active schematic. A shortcut is also provided on the toolbar.

• Send to Back

This action changes the z-order of the currently selected object, sending it to the back (or first in the layered order) of all objects that are alike and have intersecting locations. This action can also be invoked directly from the context sensitive right-click “Appearance” popup submenu. This is particular useful in controlling the layout of decorative objects that are added to a schematic. In most cases it is a good idea to place to decorative objects behind the model blocks so that the Properties of the models can be more easily accessed.

• Bring to Front

This action changes the z-order of the currently selected object, bring it to the front (or last in layered order) of all objects that alike and have intersecting locations. This action can also be invoked directly from the context sensitive right-click “Appearance” popup submenu.

Page 26: 39865643 Optsim Guide

16 •••• Chapter 1: Using OptSim GUI OptSim User Guide

1.2.3 View Menu • Full

Zooms the design area window out so that the full schematic can be viewed. (Also available as a toolbar icon.)

• In

Zooms the design area window in to show more detail. (Also available as a toolbar icon.)

• Out

Zooms the design area window out to show more of the layout area. (Also available as a toolbar icon.)

• Reset

Resets the zoom level to the default model icon sizes.

• Zoom Last

Returns the zoom level to the last value before a zoom operation was performed and toggles between the last two zoom levels. (Also available as a toolbar icon.)

• Layout

These actions allow the user to add/remove some of the OptSim GUI components on request. The menu actions behave like toggle switches. If Options->Preferences->Layout->Remember Layout is set to yes, the layout selections will be remembered between different OptSim sessions.

View Statusbar: This action hides or displays the status bar at the bottom of the OptSim application window.

View Toolbar: This action hides or displays the toolbar below the menu buttons on the OptSim application window.

View Explorer: This action hides or displays the entire Explorer Component Module on the left side of the OptSim application window.

View Toolbox: This action hides or displays the vertical toolbox at the left side of the schematic window.

View Run Tools: This action hides or displays the run tools at the top of the schematic window.

• Source

Source by tree: This allows the user to view the currently active schematic in a tree view style.

Source by xml: This allows the user to view the currently active schematic in an xml text view style.

• Schematic View Style…

Pan: This allows the user to view the details of design area by using the Panner feature of Explorer module. The design area has an unlimited width and length for this option. Therefore, the user can pan to any region of the canvas while operating in this mode.

Scroll: This allows the user to scroll the design area using the available scrollbars. The Panner is synchronized with the scrollbars. However, the panning region is restricted for this option.

1.2.4 Options Menu

• Preferences…

The dialog shown below in Figure 9 is launched from this action. The dialog allows the user to set general preferences for OptSim schematics, view styles, and layouts. The user can also set options that are specific

Page 27: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 17

to the Block-Mode simulation technique and the Sample-Mode simulation technique. Preference changes are persistent, even if no model or schematic is saved before you exit from OptSim.

Figure 9: Options dialog window

1.2.5 Run Menu The functions and settings for simulations are accessed through this menu

• Go …

Starts the non-scanning simulation parameters dialog, from which the simulation run can be started. Depending on whether the schematic is a Sample-Mode or a Block-Mode project, the corresponding simulation run dialog window will be launched. (Also available as an icon in the Run Tools.)

• Pause

Pauses the simulation in process for the currently active project. This feature is only supported for Block-Mode projects. (Also available as an icon in the Run Tools.)

• Stop

Terminates the simulation in process for the currently selected (active) project. The user is asked to verify that this is desired before it is performed. (Also available as an icon in the Run Tools.)

• Scan Variable

Opens a dialog to set the variables to be swept. (Also available as an icon in the Run Tools.)

Page 28: 39865643 Optsim Guide

18 •••• Chapter 1: Using OptSim GUI OptSim User Guide

In the case of Block-Mode schematics, the user will specify start, end, and step parameters for the simulation sweep. The number of statistical simulations to be performed are also specified in this dialog. The sweep simulation is started from this dialog. A scan meta prefix (filename root) is asked for, as well as an iteration meta prefix for each scan. If no scan meta prefix is specified, the default “lstmp” prefix is used. If no variable name is given for one of the scans, then that scan is not performed. If a 0 is given as the number of statistical simulation runs to be performed, then one simulation at each sweep will be performed using the nominal parameter values. If 1 or greater number of statistical simulations runs are specified, the component parameters will be randomized according to their distributions and the specified number of statistical simulations at each sweep will be performed. The iteration meta prefix is used to preface the scan number in the filename for simulation results. If an iteration meta prefix is not given for one of the iterated variables, then no intermediate plot results are shown, and only the scan results are shown (including the BER Tester and Optical Eye Analyzer outputs).

In the case of Sample-Mode schematics, the swept variables will take the values set in the scan setup table. To create or access this table use “Scan Parameters” button or the next menu item Scan Setup.

• Scan Setup

Opens a dialog to set the table of values for variables to be swept. This only applies only to Sample-Mode projects.

• Simulation Parameters

Opens a dialog to edit or view the simulation parameters for the active project. See details later in the chapter.

• Animation (Block-Mode Only)

Enable: This action is used to enable animation during a run that is already in progress.

Disable: This action is used to disable animation during a run that is already in progress.

1.2.6 Graph Menu • View WinPlot Results

Opens a file selection window that allows the user to select and view previously generated WinPlot graphs. These results are generated by Block-Mode projects. (Also available as an icon in the Run Tools.)

• Close All WinPlot Views

Closes all the opened WinPlot graphs. This is useful if you have opened many plot windows and want to close them all at once with a single click of the mouse.

• View VirLab Results

This action launches the VirLab tool to process OptSim results created by a previously executed OptSim project. This applies primarily to Sample-Mode projects, but VirLab may also be used with Block-Mode projects. (Also available as an icon in the Run Tools.)

• Close All VirLab Views

Closes all the opened VirLab graphs. This is useful if you have opened many plot windows and want to close them all at once with a single click of the mouse.

1.2.7 Logging Menu • Open Initialization Log File

Opens a text viewer containing the log file created during the startup and initialization of OptSim.

• Clear Initialization Log File

Clears the initialization log file.

Page 29: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 19

• Open Schematic Log File

Opens a text viewer containing the log file created during the editing of the active OptSim schematic.

• Clear Schematic Log File

Clears the log file creating during the editing of the active schematic.

• Open Simulation Log File

Opens a text viewer containing the log file created during the most recent simulation of the active topology in the current OptSim session.

• Clear Simulation Log File

Clears the simulation log file for the most recent simulation of the active topology in the current OptSim session.

• Open Statistics Log File

Opens a text viewer containing the log file created during the statistical runs for the most recent simulation of the active topology in the current OptSim session. This log file is only generated if the corresponding option in the scan dialog is selected each time a statistical simulation is performed. This feature is currently only supported for Block-Mode projects.

1.2.8 Utilities Menu • User Libraries Organizer

This action launches the OptSim User Library Organizer tool. See the User Libraries Organizer section below.

• Expression Evaluator

This action launches the OptSim Expression Evaluator tool. See the Expression Evaluator section below.

• Reload User Libraries

Reloads all user model files. This is useful when developing new user models so that the user model code can be changed, recompiled, and reloaded into OptSim without exiting OptSim.

• Encrypt Data File

Encrypts data files that are used by the models. See the Advanced Features section for more information.

• Multimode Data Browser (Block-Mode Only)

This action launches RSoft’s Data Browser tool.

• Best-Fit Laser Toolkit (Sample-Mode Only)

This action launches the OptSim Best-Fit Laser Toolkit tool.

• CCM Wizard (Sample-Mode Only)

This action launches the OptSim Custom Component for MATLAB (CCM) Wizard that simplifies the steps in created a MATLAB model that can be co-simulated in OptSim.

• MATLAB Toolkits (Sample-Mode Only)

This action allows the user to select a MATLAB toolkit. The available toolkits are Q_Surfaces and SPT_DataDisplay. See the appropriate sections in this manual for more information.

1.2.9 Connect Menu • Connect Automatically

Performs auto-connections of two selected components. For more details see section further in the chapter.

Page 30: 39865643 Optsim Guide

20 •••• Chapter 1: Using OptSim GUI OptSim User Guide

• Direct Connect

Connects two selected components the same way as “Connect Automatically” option with the restriction that only directly corresponding ports are connected. For more details see section further in the chapter.

1.2.10 Window Menu • Cascade

Cascades the open windows (schematic layouts) in the main window’s display area

• Tile Horizontally

Tiles the open windows (schematic layouts) horizontally in the main window’s display area

• Tile Vertically

Tiles the open windows (schematic layouts) vertically in the main window’s display area

• Close

Closes the selected schematic layout window

• Close All

Closes all schematic layout windows

1.2.11 Help Menu

• Online Help – User Manual

Opens the online help dialog containing the User Guide.

• Online Help – Sample-Mode Model Reference

Opens the online help dialog containing the Sample-Mode Model Reference.

• Online Help – Block-Mode Model Reference

Opens the online help dialog containing the Block-Mode Model Reference.

• Online Help – Application Notes

Opens the online help dialog containing the Application Notes and Tutorials.

• About OptSim

Opens an About Dialog that gives information about the program and vendor, including the version number and your hardware key serial number (always include the version number, platform, hardware key serial number, and relevant topology files with any technical support inquiries sent to RSoft Design Group).

1.3 Tool Bars Three tool bars provide quick access to the most commonly used functions. The toolbar on the top contains functions pertaining to editing the system schematic, the toolbar above the design area, Run Tools, contain run functions, and the toolbar on the left of design area, Toolbox, contains more general functions for schematic. The buttons on the toolbars are listed below.

1.3.1 Main Toolbar The upper toolbar contains buttons for more general editing of the schematic in the Design Area.

Page 31: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 21

New Schematic

Creates a new blank schematic.

New Sample-Mode Project

Creates a new blank Sample-Mode project.

New Block-Mode Project

Creates a new blank Block-Mode project

Open Schematic Button

Opens the file selection window to load previously defined system schematics.

Save Schematic Button

Saves the current schematic in the Design Area into its file.

Print

Prints the currently active schematic.

Undo Last Change

Undoes the last cut or delete in the design editor.

Redo Last Change

Redoes the last cut or delete in the design editor.

Cut Selection

Cuts the selected object(s) and copies them onto the clipboard.

Copy Selection

Copies the selected object(s) onto the clipboard.

Paste Clipboard Contents

Pastes the object(s) from the clipboard onto the layout window. The objects are pasted where the left mouse button was last clicked in the schematic layout window.

Find Matching Components Button

Page 32: 39865643 Optsim Guide

22 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Opens window dialog to search the currently active schematic for objects that satisfy the specified search criteria. See the Edit->Find Components menu item description for more details on this feature.

Zoom to Fit

Zooms the design area window out so that the full schematic can be viewed.

Zoom In

Zooms the design area window in to show more detail.

Zoom Out

Zooms the design area window out to show more of the layout area.

Zoom Reset

Resets the zoom level to the default model sizes logy.

Zoom to Last

Returns the zoom level to the last value before a zoom operation was performed and toggle between the two zoom levels.

Cascade

Cascades the open windows in the main window’s design area. Clicking a second time will restore the full view.

Tile Horizontally

Tiles the open windows horizontally in the main window’s design area.

Tile Vertically

Tiles the open windows vertically in the main window’s design area.

Online Help – User Guide Button

Opens the online help dialog with the user guide.

1.3.2 Run Tools Bar

Perform Simulation

Pressing this button opens the non-scanning simulation parameters dialog, from which the simulation run can be started. See the Run->Go menu item description for more details on this feature.

Page 33: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 23

Pause Simulation

Pressing this button while a simulation is in process in the active workspace opens a dialog asking if the user wishes to pause the current simulation.

Stop Simulation

Pressing this button while a simulation is in process in the active workspace opens a dialog asking if the user wishes to stop the current simulation.

Scan

Opens a dialog to begin the scan simulation. See the Run->Scan menu item description for more details.

Global User Variables (Symbol Table Editor)

Opens a dialog to edit the global user variables for the current workspace. New variables can be added, and values for current variables can be edited

View Plots

Opens a file selection window with a filter to select a previously generated graph to display.

View Results

Shortcut to VirLab tool to process OptSim results from Sample-Mode simulations.

Inline Hierarchy

Shortcut to create an Inline Hierarchy/Compound Components. See section on Compound Components below.

1.3.3 Toolbox

Select and Connect

Opens a file selection window with a filter to select a previously generated graph to display.

Vertex

Used to serve as a connection point between ports on icons. Clicking on this object, and then clicking on the Design Area, drops a vertex (diamond) on the design area. Connections can then be made from ports on icons to this vertex to customize the routing of the link in the Design Area. Several input ports can be connected to the vertex, but only a single output port is allowed. In this configuration the vertex broadcast the output signal to all the connected input ports. To start a connection at the vertex, the control-key must be hold down while clicking on the vertex icon representation.

Page 34: 39865643 Optsim Guide

24 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Input

Input port for Compound Components in Block-Mode.

Output

Output port for Compound Components in Block-Mode.

In-Multi

Input port for Compound Components in Sample-Mode.

Out-Multi

Output port for Compound Components in Sample-Mode.

Sample-Mode Iteration Loop

Shortcut to the Sample-Mode Iteration Loop model from General-Purpose Models folder.

Block-Mode Repeat Loop

Shortcut to the Block-Mode Repeat Loop model from General-Purpose Models folder.

Delay Block

Shortcut to the Delay Block model from General-Purpose Models folder.

Inline CC

Shortcut to create an Inline Compound Component. See the section on Compound Components.

HOC Model

Shortcut to the Higher-Order Composite (HOC) model from General-Purpose Models folder.

Annotation

The tool to add annotations/comments to the schematic. See section 1.9.6 for more information.

Parameter

Page 35: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 25

The tool to add a parameter to the current schematic.

MultiportFork Model

This model is used to fanout signals from a single port. It should be used with Block-Mode Compound Components.

Null Signal Model

This model can be used to provide a dummy signal to models that require connected inputs. It should be used to connect all unused ports of a Block-Mode Compound Component.

Model ID

This is a decorative block that can be placed into a project to indicate the author, contributors, creation date, and the last modification date of the project. See section 1.9.7 for more information.

1.4 Explorer The Explorer Module is located to the left of the design area. User may hide/show the Explorer module by clicking on close/open arrows in upper right corner of the module or by menu item View -> Layout -> View Explorer. The view and functionality of the upper half of Explorer is controlled by three view tabs: All Models, Model Palettes, and Favorite Schematics. The view and functionality of the lower half of Explorer is controlled by two view tabs: Panner and Recent.

1.4.1 All Models Single-clicking on this tab displays the top-level model folders available in OptSim. The models are organized in a tree-like structure with several subfolders for functional grouping. It also presents a Switch View that allows the user to expand and collapse all the contained subfolders. There may be a noticeable delay the first time the folders are expanded. This is because new instances of all the models are created and checked for inconsistencies. All subsequent expand and collapse actions should be almost instantaneous.

• Block-Mode Models: This folder opens up to several other subfolders containing the current set of Block-Mode models. Models can be dragged to the schematic editor window from here.

• Sample-Mode Models: This folder opens up to several other subfolders containing the current Sample-Mode models. Models can be dragged to the schematic editor window from here.

• Compound Components: This folder contains two main folders containing all the predefined Sample-Mode and Block-Mode Compound Components.

• Decorative Elements: A number of decorative blocks are stored in this folder. Th models allow the user to add specific graphical objects and images to their schematics.

• User Libraries: Users can import libraries of components into this folder so that they can be easily dragged and dropped into schematics. The User Libraries Organizer can be used to create new folders, delete folders, add models and remove models from this folder. See the User Libraries Organizer section for more details.

Page 36: 39865643 Optsim Guide

26 •••• Chapter 1: Using OptSim GUI OptSim User Guide

1.4.2 Model Palettes This tab view allows the user to create any number of model palettes, grouped according to their individual preferences. Single-clicking the Organize button displays a Switch View that allows the user to organize models into their own unique palettes. The Organizer is used to create groups, delete groups, and add to / remove models from these groups. The set of possible models are those available from the “All Models” (Tree View) Shade. They are available in their tree-view structure at the left of the Organizer. See Figure 10 below. Once the palettes are created, the user can click on any model on the palette and drop it as many times as needed into a schematic. Figure 11 shows an example of a palette. Note that the cursor mode changes when you are dropping models from the palettes. To revert to the default mode (selection mode), the user should select the arrow at the very top of the vertical toolbox at the left of the schematic editor window, or simply press the Escape key (Esc).

Figure 10: Model Palettes Organizer

Page 37: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 27

Figure 11: Palette Models

1.4.3 Favorite Schematics The Favorite Schematics tab allows the user to create shortcuts to open their schematics that are used very often. To use this feature the user first has to create groups and add the schematics to the groups. The “Organize” button will open the dialog shown in Figure 12 (initially the list of schematics will be empty). The dialog is used to add and delete groups. Schematics can be added by using the “Import Schematics” link. This allows the user to browse their file system for the schematics that they wish to add. Alternatively, the user can use the organizer to create the groups, close the dialog and subsequently use the Add button (available when you single click the Favorite Schematics tab) to add the currently active schematic to any of the groups that were created. Figure 13 shows the view for schematics that were added to a group that was named Block-Mode. Double-clicking any of the names shown in a group will open the corresponding schematic. Please note that there are no new files created. The list of schematic names are just references to schematics that can also be opened using the file chooser. The user can use any desirable name to refer to a schematic. The Projects and Examples button allow the user to open a file chooser that goes directly to the default “Projects” and “Examples” directories. The application will attempt to find a default based on the currently active schematic. If the schematic is a Sample-Mode project the corresponding sample-mode directories will be used and likewise for Block-Mode projects.

Page 38: 39865643 Optsim Guide

28 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Figure 12: Favorite Schematics Organizer.

Figure 13: Schematic in Block-Mode Group.

Page 39: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 29

1.4.4 Recent Models At the bottom of the Explorer Module there are two switch tabs. The Recent tab allows the user to access their 15 unique most recently used models. The Recent Models List gives the user quick access to the models that they use the most during an OptSim session. The design is based on a FIFO queue of size 15. Each time the user drops a new model from the tree view or the model palettes, it is added to the queue or placed at the end of the queue if it is already in the list. The models can be dragged and dropped from this list instead of searching for them in the model folders or palettes. The Recent Models List is persistent between OptSim sessions. A right-click action in the recent models area allows the user to either delete the currently selected models or delete the entire list of models. An example of a list is shown in Figure 14.

Figure 14: Models added to the Recent Models List. The models can be dragged and dropped from here.

1.4.5 Panner Panning of a schematic is accomplished by clicking on the Panner tab in the lower left corner of the Explorer Module. The panning display area always shows the entire schematic. The view is centered on the clicked point or the center of the red rectangle. The panning region gives the user access to all parts of their schematic irrespective of the current zoom level. It is most useful when used in conjunction with the zooming feature. The box with red outline represents the panner that is used to access different parts of the schematic. This is extremely useful when the zoom level forces some parts of the schematic to be outside the bounds of the schematic editor window. The current view in the schematic editor window is exactly that which is contained within the boundaries of the red outline of the panner in the panning region. As the user zooms in, the panner (red boxed outline) reduces its area, as the entire schematic remains visible within the panning region. The user can pan to the desired region of their schematic and edit it at a very high resolution in the schematic editor window. An example of a model in the pan region is shown in Figure 15. The position of the panner, the grid size, and the zoom level of a schematic are remembered when the user reopens a previously saved schematic.

Page 40: 39865643 Optsim Guide

30 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Figure 15: Panning Region.

1.5 Drawing a Link Schematic

1.5.1 Design Area / Layout Pane / Schematic Capture Window This is the window that is used to draw the link topology. The user places icons representing components and lines representing interconnections between components on this drawing area. By default the left side of the icon is where signals come into the component, and the right side of the icon is where signals leave the component. However, the user can change the location of ports (see below Place Ports). The user interacts with the drawing area with the mouse. The actions of the mouse buttons are determined by what mode the mouse is in (as set by the buttons on the Toolbox to the left of the Design Area) and where the mouse is pointing when the buttons are pressed. The user actions associated directly with this drawing area are listed below. See the above sections describing the toolbar buttons and menu options also.

1.5.2 Add Component There are two ways to add components to a schematic. When Explorer is in All Models mode the user can left-click on the desired component and hold and drag it to a location in the design area. After releasing the mouse button, the component will be inserted at that location. When Explorer is in Model Palettes mode, the user can left-click once on the component icon in the Palette desired to use. That will highlight the selected component icon and the mouse pointer will transform to the component’s icon. To place the component in a specific location on the schematic, just point at it and left-click.

Page 41: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 31

For components which may have varying numbers of input and/or output ports, the current default number of ports are automatically generated for each component added to the schematic. See below for information on how to change the number of I/O ports.

Components may not be added to a schematic while it is being simulated. Also note that components cannot be added directly on top of existing components; i.e., more than one component cannot occupy the same position in the schematic layout.

1.5.3 Select By default, the design area is in Select Mode; i.e. the Select Mode icon is selected in the Toolbox to the left of the Design Area. Pressing the ESC key while in the other toolbox modes also puts the editor in the Select Mode. In this mode, there are many editing functions that can be performed with the currently active topology editor window. These functions are listed below:

• Clicking the left mouse button on an icon selects it and deselects previously selected icons.

• Clicking the left mouse button on a blank area of the layout pane deselects any previously selected icons and sets the location for a subsequent paste operation to place the pasted icons.

• Clicking the right mouse button on a blank area of the layout pane opens a menu box for the workspace, including the workspace properties.

• Pressing SHIFT while clicking the left mouse button on a component icon in the schematic adds it to the current selection.

• Pressing and holding the left mouse button down while the mouse pointer is over a blank space and dragging creates a rubber-band selection box that selects all component icons it contains when the mouse button is released, and unselects any previously selected components. The mouse pointer should not leave the Design Area of the window.

• Pressing SHIFT while using the rubber-band selection box feature adds the newly selected component icons to the already existing selection.

• Pressing and holding the left mouse button down while over an icon and dragging the mouse moves all the selected icons.

• Pressing the right mouse button while over a component icon opens the pop-up menu for component related commands.

• Double clicking the left mouse button while over one of a component icon opens the component parameter editor window or displays the most recent plots associated with that component in simulation, depending on the settings in the Options->Preferences->General->Schematics dialog.

• Double clicking the left mouse button while over one of a component icon’s input or output ports displays a summary of the signal information at that node as computed in the most recent simulation. (in Block Mode only)

• Clicking the right mouse button while over a link opens a menu box with connection-related commands, including AutoLinks.

• Clicking the right mouse button while over a component port opens a menu box with port-related commands, including naming properties for the port.

• Clicking the left mouse button while over a link selects that link and shows its endpoints as black squares. This is useful to identify where links are attached.

1.5.4 Draw Connection The user can draw connections between components when the Design Area is in Select Mode (i.e. the default mode). In this mode, user can select (left-click) the output port of the first component and hold and drag the mouse pointer to the

Page 42: 39865643 Optsim Guide

32 •••• Chapter 1: Using OptSim GUI OptSim User Guide

input port of the second component. The same connection can be made in opposite order – from input port to the output port. An alternative method is to highlight two components to be connected, in the order of from component (component A) and then to component (component B), and select menu item Connect->Direct Connect. This method is also more efficient if one wants to connect N output ports of component A to N input ports of component B. Connect Automatically may also be used instead.

The color of the ports and the connection line drawn will correspond to the type of signal supported by the connected ports: red for optical, blue for electrical, green for binary, and gray for a measured value that goes to a plot block (“measurand”). A black port indicates that multiple signal types are supported, while a black connection line indicates that the signal type is to be determined during the simulation run based on the component settings. If the preferences are set to show links to plot blocks with dotted lines, then the lines connecting to plot blocks will be dotted while lines connecting to other component icons will be solid.

Links to multi-ports (white filled ports) can be rendered at different connection sites at the port. This allows the user to see the connections more easily. The Options->Preference->Schematic dialog has a setting to control the rendering of multi-port connections. The default setting is to render the multi-port connections at different connection sites, however, this can be changed at the users discretion.

To delete the connection, one has to select first the connection line and then hit Delete on the keyboard or Cut on the tool bar. Connections may not be made or broken in a schematic that is currently being simulated.

1.5.5 Changing the Number of Component I/O Ports If it is desired to change the number of input or output ports for any existing component icon in the schematic, this may be achieved by opening the dialog for component configuration (either by double-clicking, or right-clicking the icon and selecting Properties in the pop-up menu). The tab Ports in this dialog window will have editable fields for number of input and output ports (if the component supports variable number of ports).

Placing Ports The “Appearance” sub-menu provides four port placement actions.

Figure 16: Port Placement Action

The ports can be flipped horizontally, where the ports on the west side of the icon are swapped with those on the east side, flipped vertically, where the ports on the north side of the icon are swapped with those on the south side, rotated clockwise, where all ports are rotated 90 degrees in a clockwise sense, or rotated counterclockwise, where all ports are rotated 90 degrees in a counterclockwise sense.

Ports have a default placement in OptSim. Input ports are placed on the west edge, and output ports default to the east edge of the icon. Port ordering also defaults to the order in which they were added to the model.

Page 43: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 33

1.5.6 Move While in Select mode, pressing the left mouse button while the pointer is over an icon and dragging moves the selected icon(s). Releasing the left mouse button drops the icon(s) in the new location. This operation can be canceled in mid-drag by pressing the right mouse button. When a component is moved, the lines connecting to it are stretched to maintain the connections. After the selected icons are moved, they will retain their selected status and be highlighted for easy identification and subsequent moves should they need to be moved again.

1.5.7 Zoom The drawing area may be zoomed in and out by using the View menu options or Zoom buttons on the main toolbar. This allows the entire schematic to be seen in the screen at one time, or for a smaller portion of the schematic to be seen in more detail. The Panner view of the Explorer is very useful when Zoomed in to a smaller portion of the schematic in the Design Area than the whole schematic. See elsewhere for descriptions on the use of this tool. Other options for navigating the Design Area when zoomed in include the scroll bars along the edge of the Design Area (when active according to user preferences).

1.5.8 Edit Global Variables (Symbol Table) User variables (or symbols) can be defined for a schematic to be used by its various component parameters. The scope of these user variables is the current hierarchical level of the topology and all levels below. A user variable in one level of a hierarchy is not accessible by another level of hierarchy, unless it is passed as a parameter between the hierarchical levels. User variables can be added to the current schematic workspace or edited from the Symbol Table Editor dialog. Current values of existing variables may also be viewed from this dialog. This dialog is opened either by the Edit Symbols icon in the Run Tools bar, or the Symbols… button in the component parameter editor dialog. When a schematic is currently being simulated, the variables may be viewed, but they may not be modified for realtime changes. To add a new variable, press the Add a New Parameter button, type the name of the new variable in the Name field, give the variable a default value in the Value field, and press the OK button. To delete a symbol, select it in the list of parameter (by left-clicking the mouse on it), and then press the Delete button. The OK button applies the newly modified symbol table, while the Cancel button cancels all modifications to the symbol table. Symbols that are currently being referenced by parameters that are in scope cannot be deleted from the Symbol Table until the references are removed.

Right-clicking on the name of a parameter in the Symbol Table produces the popup menu shown in Figure 17. It allows several useful editing tasks: A Symbol Table parameter can be renamed (all usage of the old name will automatically be replaced with the new name), the parameters can be sorted, and a parameter can be made visible or hidden on the schematic canvas. Also, the order of the parameters in the Symbol Table can also be changed: A parameter can be moved up, moved down, moved to first and moved to last by selecting the appropriately named popup menu. The dialog also allows the user to print the currently displayed table.

Figure 17: Symbol Table Parameter Editing

Page 44: 39865643 Optsim Guide

34 •••• Chapter 1: Using OptSim GUI OptSim User Guide

1.5.9 Edit Component Parameters While in Select Mode, pressing the right mouse button while the pointer is over an icon opens up pop-up menu with the top item being Properties. Clicking on Properties will open the component parameter editing dialog to allow the component’s parameters to be edited.

More than one component’s parameters may be edited simultaneously by selecting multiple components whose parameters are desired to be edited together (and set to be equal to one another), and then choosing the Edit->Multi-Component Parameter Edit menu option. All component parameters common to the selected components will be edited simultaneously, and all their values will be set to be equal to the values in the parameter editor dialog when it is closed with the OK button. For this option, all the selected components must be of the same type.

If it is desired to edit more than one component’s parameters simultaneously but the components are of different types or only a selected subset of their component parameters are desired to be edited and set equal to one another, then select the multiple component icons and choose the Edit->Selective Multi-Component Parameter Edit menu option. The dialog that opens allows the user to select which parameters common to the selected components are desired to be edited, and only the chosen parameters are edited and set equal to one another in the selected components. This option allows each parameter that is desired to be edited individually.

The component parameter editing window contains a number of tabbed areas for different component parameter categories. You can change which category of component parameters you are editing by selecting the different tabs with the left mouse button.

For some components, there are more parameters than will fit on the parameter editor dialog screen. To scroll through the list of parameters, click the arrow up and arrow down buttons by the scroll bar at the right of the dialog, or drag the scroll bar to the desired position. The position of the scroll bar shows which portion of the list of parameters you are viewing. The component parameter nominal values, statistical distributions, and standard deviations may be specified in this dialog. Arithmetic expressions involving user-defined variables may be used as component parameter entries. Parameter values can be reset to their default values by pressing the Reset button.

The relevant section of the online help for a component model is readily accessed by pressing the Help button from the edit component parameter window.

The Symbol Table may be conveniently accessed from the parameter editing window by pressing the Symbols… button. This is useful when it is desired for variables to be used as parameter values. Right-clicking on a parameter name produces a popup menu (Export to Symbol Table) that allows the parameter to be easily added to the Symbol Table with a single mouse click. A shortcut is also provided to easily set parameter values using parameters that are defined in the Symbol Table. This is accomplished by right-clicking in the value field of the particular parameter while the Properties dialog of the model is opened. This will provide a popup list of all the parameters that are defined in the Symbol Table of the project. Selecting from the list sets the value of the parameter to reference the selected Symbol Table parameter. Figure 18 shows an example that demonstrates this convenient feature.

Parameter sets may be saved to files, or loaded from files by using the Save and Load functions, respectively. These are available as buttons in the component parameter editing window. This capability allows the creation and use of component libraries where parameter sets corresponding to particular components can be stored for future use. The parameter files should have the extension “.prm” to indicate that they are parameter files. Some components provided with OptSim, such as the nonlinear fiber model, have predefined parameter sets already defined and provided with the software. These can easily be selected from the selection box at the top of the parameter editing window to the left of the Load and Save buttons.

Some components have an additional capability to test the parameters from the component parameter editing window before performing a simulation. If a component has this function available, it will be documented in the relevant section of the component models reference manual and online help. The Test button will also be functional for components which have this capability. If the Test button is grayed out, then this capability is not available for that component.

Pressing Cancel after editing component parameters or using the Test functions will return the component parameter values to their original state prior to opening the component parameter editing window. Pressing OK after editing or

Page 45: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 35

Figure 18: Conveniently using Symbol Table Parameters to set Parameter Values

using the Test functions will accept the changes to the component parameters and apply them in the component in the topology.

Some components have many parameters that are only applicable when the model is set with particular options or enumerated parameter values. To aid the user in determining which parameters need to be set for the desired model options, parameters that are not applicable to currently selected model options are grayed out in the parameter editor. The “Print” button will print a hard copy of the currently selected table of parameters.

Component parameters may not be modified or tested when the workspace topology is in the process of being simulated. Parameters may, however, be viewed during the course of a simulation.

1.5.10 Encrypted Component Parameters Component parameters may be encrypted. For example, EDFA parameter files provided by a vendor may be fully encrypted, except for the fiber length and other user-adjustable values. When a component includes encrypted parameters, their values are hidden from the user in the parameter window, and the component’s Test button is disabled. In addition to encrypted parameter values, some models that take data files as inputs support encrypted formats for these as well. The Physical EDFA model block, for example, supports encrypted gain spectra files. Regardless of whether a block’s parameters or data files are encrypted, in order to use the component in a simulation, the user must have a password file (typically provided by the vendor). This password file should be placed in the same directory as the topology, or in the directory containing the RSoft software license files. See also Menu item Edit -> Encrypt Component Parameters.

1.5.11 Naming and Renaming Components Each component icon in the topology must be given a unique name. Components are automatically given unique names when they are created and added to the topology based on a default base name and a numerical suffix. The numerical suffix for a particular component model type is incremented with each component of that type that is added to the schematic. The user may change the name of any component in the schematic as desired. To change a name, the user opens the dialog window for component properties and edits parameter Model Instance Name in the last tab Naming. The user also has the option to hide or show the component's name in the schematics.

Page 46: 39865643 Optsim Guide

36 •••• Chapter 1: Using OptSim GUI OptSim User Guide

1.5.12 Viewing Plots Generated by Simulation – Block Mode Simulations After plots are generated by plot icons or other component icons that generate plots (e.g., BER Tester, Bi-Directional Fiber, Physical EDFA), they may be accessed from the Design Area window by double-clicking on the desired icon while in Select Mode (depending on user preferences) or by right-clicking the desired icon and selecting View Result from the pop-up menu. The last results that were generated from previously executed projects can also be viewed in a similar way without the need to rerun the project. To access plots generated in other simulation runs beside the most recent simulation run, the View Graphs icon (or Graph->View menu item) may be pressed to open a file selection dialog to locate and select the desired plot file(s).

Note that plotting by plot icons can be configured to save, save and display immediately, or not plot at all. These can be set individually by the plot icons or globally for all plot icons in a topology at the start of a simulation. The global setting at the start of a simulation only applies to the so-called plot icons, not to other icons such as the BER Tester that also generate plots.

1.6 Creating Compound Components (Hierarchies) Users often find, in the course of building a project, that some subset of the models they used forms a logical group. It may be appropriate for this group to be represented by a single icon in the schematic, either so that it can be reused in other schematics or simply to reduce clutter in the original schematic. OptSim supports a number of methods to easily create compound components (also can be referred to as hierarchy, composite actor, or superblock). A compound component (CC) can be thought of as a subsystem that is built from other models and represented in a project as a single entity. There are two varieties of compound components supported by the OptSim framework. The distinction is based on where the CC is defined. A compound component can reference a file saved on disk, or it can be created in-lined (i.e. its definition is contained in the top level model) in a schematic. For the user’s protection, the framework places restrictions on how users interact with a CC that is referenced from a file on disk. In particular, editing and making any form of persistent changes while looking inside these components are not allowed. To make persistent changes, the user must open and edit the master file that defines the component. Changes made to a master file will be reflected in all instances of the compound component used in all projects, not just the one that is currently being edited. The fact that a CC refers to a file on disk is indicated visually by a dotted red outline around the corresponding icon representation. In-lined component components can be saved to a file from the “look inside” view. The new model can then be imported into the User Library using the User Libraries Organizer. Once imported into the User Library, these compound components are no longer in-lined. Because of the way unique names are generated for new instances of models that are added to a schematic, it is highly recommended that users don’t use names that end with a numeric character when saving a CC to disk. We recommend using an underscore character after the numerical character when a numeric character is desirable in the name.

All of the input ports of Block-Mode compound components must be connected. If there are unused ports the user can use the NullSignal model (available on the vertical toolbox) to provide a dummy signal for those ports. The Connect->Connect Automatically feature can be used to expedite this process. The NullSignal model can simultaneously provide a dummy signal for all types of input ports. Also, only a single connection can be made at the output port of a Block-Mode compound component. If the user wishes to fanout connections, the MultiporkFork model (also available on the vertical toolbox) can be used to accomplish this task. The CC output port is connected to the input of the MultiportFork model and any number of connections can be made at the output port of the MultiportFork model.

The following sections describe in some detail the infrastructure for creating and managing compound components in OptSim.

1.6.1 Starting with a new Blank Schematic Use the File menu or toolbar shortcut item “New Schematic Topology”. This will invoke the dialog shown in Figure 19.

Page 47: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 37

Figure 19: Project Selection Dialog

The Document Type can be either a Project or a Compound Component as shown. The Model Type is automatically set to “None” and the user must select the Model type – either Sample-Mode or Block-Mode. The compound component is given a name by filling in the “File Name” field or alternatively, using the “Browse” button to choose a directory and subsequently specifying a file name. The OK button will dismiss the dialog and create a new blank schematic that is ready to accept new models. The user must specify a valid “File Name” if they wish to create the document. A blank entry or a directory without a file name will be rejected. New models can be added from the tree view, the palettes, the recent models list, or any other edit action that creates new models.

A compound component is normally only useful in a schematic if it has external ports. The port objects are available from the vertical toolbox. They can be selected and dropped multiple times into a schematic. Note that different objects are used for input and output ports respectively. The user should draw connections between the component model ports that they wish to be exposed to the outside and the new port objects before saving the CC. The port objects can also be renamed by right-clicking on them and selecting the “Naming Properties” from the popup menu. If a connection is started at the port object, the user must hold down the control key to make the first connection.

The parameters of the compound component are added by clicking on the “Symbols” button on the toolbar or right-clicking on a blank part of the canvas and selecting “Properties” from the popup menu. The “Symbols” properties dialog will be displayed. The “Add” button is used to create new parameters (symbols) for the compound component. The newly defined symbols can be used in expressions to set the values of parameters of the models used in the CC. Symbols can be used in expressions before they are added to the symbol table, but the user will be asked to add and define them in the symbol table immediately. This behavior allows the expression parser to check the validity of the entered expressions and give the user immediate feedback if they violate any programmed constraints.

An icon can be specified for the new CC by invoking the File->Properties menu action. The “Select Icon” button will allow the user to select an icon file that defines an icon based on any of the supported image formats.

The user may save the changes once they are done editing the CC. The new CC can be added to the User Libraries folder in the tree view at this stage. This is done by invoking the User Libraries Organizer. It is opened from Utility->User Libraries Organizer menu action. When the new CC is used in a schematic it will have all restrictions intrinsic to CCs that are referenced from files on disk. The User Libraries Organizer will be described below.

1.6.2 Starting with an Empty Compound Component The user may select an empty compound component from the vertical toolbox bar and drop it into a schematic. This object is located below the port objects on the vertical toolbox (tool tip: Inline CC). The new object can be renamed by opening its properties dialog and selecting the “Naming” tab. The user should look-inside (right click on the icon with the mouse, then select Look Inside from the pop-up menu) and immediately start adding new models. This method bypasses the “Project Selection Dialog” described above and some users may find it more convenient. This is particularly useful if the user is creating a compound component to simply reuse in their current schematic. The resulting CC is actually defined in-lined, since it has no file on disk that contains its definition. Changes made while looking inside these CCs are persistent and do not propagate to any other CC. An icon representation for the CC can be specified by either using the “Set Icon” action of the right-click pop up menu of the CC, or by using the “Select Icon” action of the File-Properites menu action while looking inside. The in-lined CC can be saved to a file while the look-inside view is

Page 48: 39865643 Optsim Guide

38 •••• Chapter 1: Using OptSim GUI OptSim User Guide

opened. It can be added to the User Library using the User Libraries Organizer. Once the model is imported into the User Library, the restrictions placed on CCs that refer to files on disk are in effect.

1.6.3 From a Subset of an Existing Schematic A set of models and links in any OptSim schematic can be converted to a compound component. The user simply clicks and holds the left mouse button over the blank area in the design area and drags the boxed outline to enclose the desired group of models and links. The selected items are highlighted. Additional items may be added to the selection by pressing and holding down the SHIFT key and then selecting them with the left mouse button. Links to a selected model may be selected or not selected as desired; both ends of a selected link are highlighted. Note, however, that to duplicate the function of a group of models all associated links must be selected. Care should be taken to avoid selecting links that are simply passing through the selection box. This may require some repositioning of models on the canvas and, possibly, the addition of broadcast relations (vertex) to the schematic. In this manner, all possible combinations of models and links in a schematic can be selected. The selected aggregate entity can then be made into a compound component by clicking the “Inline Hierarchy” button on the Run Tools bar at the top of the schematic window. Parameters that depend on parameters of the symbol table are automatically added to the CC. This is required by the Sample Mode engine, but is not strictly necessary for Block Mode CCs.

This feature is typically used to reduce clutter in your schematics. The links at the edges will represent the external ports of the compound component. A default name is given to the new compound component, but the user may change it from the Naming tab on the Properties dialog of the CC.

The user may look inside the newly created compound component and make persistent customizations, as the CC is defined in-lined at this stage. The external ports can be renamed while looking inside. New symbols can be added by invoking the “Symbols” button while looking inside. Model parameters may then refer to these symbols through expressions. Also, an icon can be specified by either using the “Set Icons” action or the File->Properties menu action while looking inside. The user may add the compound component to the “User Libraries” folder by invoking the User Libraries Organizer after saving the look inside view to a new file on disk.

1.6.4 Loading a CC From Disk Once a CC is created and saved to a file on disk, it can be added to the User Libraries folder for easy access later. OptSim provides the user with other means of using the CC in a project. This section will describe these additional features.

Section 1.6.2 described how to create a CC by starting with the empty compound component object that is located on the vertical toolbox. This empty CC has some additional capabilities that were not described in that section: When this model is first dropped into a schematic it has two dynamic menu items that allow a CC to be loaded into the schematic without using the User Libraries. After the CC is loaded, the menu items will disappear. Figure 20 below shows these context sensitive menu items. When the “Load Compound Component” menu item is selected, a file chooser is launched that allows the user to select a CC (.moml file) that is saved on disk, and immediately load an instance into the current project at the location of the empty model. The new model will refer to its definition on disk, and therefore, it will have all the restrictions associated with CCs that refer to files on disk. As a result, the user will not be able to look inside and make changes; only the parameters of the CC may be edited. These CCs are easily identified by the presence of a dotted red line around their icon representations.

The editing restrictions that are placed on CCs that refer to a physical file on disk are necessary to prevent unsuspecting users from unintentionally changing model behavior in all projects that use a particular CC. It also facilitates a controlled environment that allows the user to edit the master definition and have all the changes automatically propagated to all projects that use the CC. However, sometimes the user may want the flexibility to be able to edit the internals of a CC for a particular project, without affecting its use in other projects. In this case, OptSim allows the user to load an instance of the CC that is entirely defined in the project rather than deferring its definition to a file on disk. In OptSim, we refer to these models as Inlined CCs. When the “Inline Compound Component” menu item is selected, a file chooser is launched that allows the user to browse, select, and load any CC (.moml class file) that defines an appropriate CC (Block-Mode CCs will not be allowed in Sample-Mode projects and vice-versa). The new CC will be loaded at the location of the empty CC. It will not have the dotted red outline. The user is free to look inside and edit the new CC. Saving the project will also save all the changes that are made to the CC. Saving while looking inside results in a new CC file being saved

Page 49: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 39

to disk and is not a requirement to use the CC. The dynamic menu items will also disappear if the user looks inside the empty CC and add new models rather than using one of the menu items to create the new CC.

Figure 20: Dynamic Compound Component menu items.

1.7 Creating Higher-Order Composites (HOC) The term Higher-Order Composite (HOC) describes a composite, hierarchical block that has the ability to replicate itself a number of times during execution of a schematic model. Currently, this feature is supported in block mode only and is available from the Toolbox. The HOC functionality permits a user to quickly create very large models with many repeating elements in a compact schematic layout. Many simulation topologies, for example WDM schematics, have a large number of similar or identical channels with parallel connections to external blocks.

In OptSim, model blocks representing each channel can be laid out and then replicated using the cut and paste feature. This has three important disadvantages:

• If the blocks are not identical, then manual editing of the schematic is necessary to modify the parameters in the models representing each channel.

• The process leads to very large schematics that are hard to edit and large project files that take time to simulate. • There is no quick way to change the number of channels.

The HOC functionality circumvents all these problems. The schematic in the Fig. 21 represents an eight-channel optical system. The corresponding project file can be found at RSoft\examples\optsim\block_mode\ miscellaneous\Parallel_8.moml

Page 50: 39865643 Optsim Guide

40 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Figure 21: Schematic view of an OptSim project file

The channels in this model happen to be identical, so it would have been possible to build up this schematic using cut-and-paste without further editing. However, the schematic fills the layout area with an eight-channel system. It is also cluttered, making it harder to visualize the connection patterns.

The equivalent topology built using two HOC blocks to represent the repeated elements of the earlier schematic is shown in Fig. 22. The corresponding project file can be found at RSoft\examples\optsim\block_mode\hoc\ Parallel_8_HOC.moml

Page 51: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 41

Figure 22: Schematic view of the equivalent Parallel_8 topology using HOC blocks

1.7.1 Example of an HOC Topology The Figure 23 shows an example topology that uses two HOC blocks. The corresponding project file can be found at RSoft\examples\optsim\block_mode\hoc\sigGen_HOC.moml

Figure 23: Schematic View containing two HOC blocks of different complexity

The block labeled HOC3 is a simple 3-channel source HOC. The block labeled HOC1 is a more complex HOC, with three input/output channels and a single serial channel. The following discussion focuses on HOC1.

The number and type of ports on the HOC block can be configured using the standard parameter editing dialog box for the HOC. That is, you right-click the HOC icon and select Properties from the pull-down menu. The configuration parameters for HOC1 are illustrated in Figure 24.

Page 52: 39865643 Optsim Guide

42 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Figure 24: Configuration parameters for HOC1

The number_port_sets is a parameter used to control the number of times the base set of IO ports is replicated on any block. The edit dialog prevents the user from setting number_port_sets outside the range 1 <= N <= 128. The other three ‘Type’ parameters are string-valued parameters unique to the HOC block. When an HOC block is dragged to the schematic from the Toolbox, it will display no ports. By entering type-code letters into the edit cell for the appropriate string-valued ‘Type’ parameter, the user may configure new ports. The type code specifies the signal data type of each new port. The supported type codes (case-insensitive) are: L (logical), B (binary: same as logical), E (electrical), O (optical), and U (unknown). Any other character is equivalent to U, unknown. Unknown ports usually accept any type of signal. Also, note that any surrounding white space in the ‘Type’ parameter strings is trimmed before the HOC block interprets them. However any internal spaces are interpreted as ‘U’ characters. The serial ports can only appear as a pair of IO ports that are rendered on the top and bottom of the HOC icon. There can only be one serial-port pair per HOC block. Both ports in the pair will have the same type. Note that the serial ports are wired in series through all the Instances. All other ordinary IO ports are wired in parallel, and each port set is wired to one and only one Instance block. If a HOC has only serial ports, the resulting topology is a pure series chained topology. Once the ports of an HOC block are configured, the user uses the ‘Look Inside’ menu item to open a schematic layout window to create or modify the topology within the HOC block. Figure 25 shows the interior of the block HOC1 from Fig. 23. This view is referred to as the master instance block.

Page 53: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 43

Figure 25: Looking Inside the HOC1 of Fig. 23

The input, output, and serial IO ports of the HOC are represented by external ports in this schematic (the large black icons). The user creates the topology and make connections as shown in Fig. 26.

Figure 26: Looking Inside the HOC1 of Fig. 23

The above schematic will be available to each of the three inputs of the HOC1 (or in other words, the above instance will automatically create three instances of itself – one instance for every input port of the HOC).

If internal or external ports are left disconnected, this may lead to problems at execution time. However, there may be no errors, so long as the resulting expanded topology is correct with respect to the type of connections and no input port that requires a signal is left disconnected. It is a good idea to set the number and types of all HOC ports before populating the master Instance block. It is rather complicated to change the types of the HOC ports once they have been created. Therefore, the user is strongly encouraged to anticipate the final layout of the HOC block as much as possible and configure all ports before trying to populate the master instance. The user should also complete the population of the master instance before starting to connect the external HOC ports to other models in the topology. HOC ports can be added to an isolated HOC object without generating type conflict errors, provided the ports are appended to the ‘Type’ parameter string. When you have configured an HOC block and populated the master Instance, you can only save your topology by going back to the highest level of the hierarchy and saving the whole topology. There is no need (or ability) to save the lower levels of the HOC hierarchy as an ordinary MoML file.

Page 54: 39865643 Optsim Guide

44 •••• Chapter 1: Using OptSim GUI OptSim User Guide

1.7.2 The ‘instance’ parameter of the HOC Instance block The master instance block has a single default parameter named ‘instance’. Clicking on the Symbols button while viewing the master instance block (Look Inside view) opens a dialog with this parameter. The user can add more parameters, but they should not edit or remove the ‘instance’ parameter. The ‘instance’ parameter is an integer-valued parameter that has the value ‘1’ for the master Instance and successively higher integer values for any replicated instances. This ‘instance’ parameter can be used to parameterize the blocks within each replicated Instance so they are no longer functionally identical to the master Instance. This is done by specifying ‘instance’ as part of an expression in the configuration of model blocks contained by the master Instance block. This is illustrated in Figure 27, where the wavelength of a DM laser is set using the expression ‘1.55E-6+(1.6E-9*instance)’. The ‘instance’ parameter may be used multiple times in the configuration of parameters within a block or in multiple blocks. It is also possible to use ‘instance’ as an index into an user-specified array-type parameter. This may allow more flexibility than simple mathematical expressions using the parameter.

Figure 27: Example of using the ‘instance’ parameter in the expression for wavelength

1.8 Parameter Expressions As noted elsewhere, virtually any numeric input field in OptSim can accept an analytical expression involving pre-defined and user-defined variables which are defined in the symbol table. In this section, we discuss the form that these expressions can take, the allowed operators, and the most useful built-in functions that are available.

Expressions can contain identifiers thar are references to variables within the scope of the expression. For example, PI*x/2.0

Page 55: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 45

is valid if “x” is a variable in scope. In the Expression Evaluator, the variables that are in scope include built-in constants plus any assignments that have being previously made. In OptSim itself, the variables in scope include all parameters defined at the same level of the hierarchy or higher. So for example, if a model has a parameter named “x” with value 1.0, then another parameter of the same model can have an expression with value “PI*x/2.0”, which will evaluate to π/2. Consider a parameter P in model X which in turn is contained by a compound component model Y. The scope of an expression for P includes all the parameters contained by X and Y, plus those of the container of Y, its container, etc. That is, the scope includes any parameters defined above in the hierarchy.

Expressions are written in the common form accepted by most programming languages (e.g. C or Fortran), and can include numbers, variables, arithmetic operators, and function calls. Numerical values may be entered in scientific notation or as standard integer and floating point notation; e.g. 100, 100.0, 1.0e2. The valid operators are the usual ones, namely:

+ addition

- subtraction

* multiplication

/ division

^ exponentiation

% modulo or remainder

Parentheses can be used as usual to group operations and override precedence. Exponentiation has the highest precedence, then multiplication and division, and finally addition and subtraction.

OptSim expressions support many of the standard function calls found in programming languages, as well as several additional functions. Some of the standard functions are:

• abs(x)

absolute value

• exp(x)

exponential

• log(x)

natural logarithm

• log10(x)

logarithm base 10

• log2(x)

logarithm base 2

• sqrt(x)

square root

• cos(x)

cosine (where x is in units of radians)

• sin(x)

sine (where x is in units of radians)

• tan(x)

tangent (where x is in units of radians)

• cosh(x)

hyperbolic cosine (where x is in units of radians)

Page 56: 39865643 Optsim Guide

46 •••• Chapter 1: Using OptSim GUI OptSim User Guide

• sinh(x)

hyperbolic sine (where x is in units of radians)

• tanh(x)

hyperbolic tangent (where x is in units of radians)

• acos(x)

arc cosine (returns units of radians)

• asin(x)

arc sine (returns units of radians)

• atan(x)

arc tangent (returns units of radians)

• acosh(x)

hyperbolic arc cosine (returns units of radians)

• asinh(x)

hyperbolic arc sine (returns units of radians)

• toDegrees(x)

converts radians to degrees

• toRadians(x)

converts degrees to radians

• erf(x)

error function

• erfc(x)

complementary error function

• random()

returns random number between 0.0 and 1.0

• ceil(x)

ceiling function (rounds to next higher integer)

• floor(x)

floor function (rounds to next lower integer)

• intRound(x)

round function (rounds to nearest integer)

• max(x,x)

the maximum of the two arguments

• min(x,x)

the minimum of the two arguments

• pow(x,x)

first argument to the power of the second

• remainder(x:dobule,x:double)

Page 57: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 47

remainder of division, according to the IEEE 754 floating-point standard

In addition, the following functions are available:

• u(x)

This is the unit step function, defined as u(x) = 0 for x<0, 1 for x>0, and 0.5 for x=0.

• um(x)

This is a variation of u(x), defined identically except at x=0 where um=0.

• up(x)

This is a variation of u(x), defined identically except at x=0 where up=1.

• clip(x)

This function is defined as clip(x) = 0 for x<0, 1 for x>1, and returns its argument x otherwise.

• step(x)

This function is a periodic step function, defined as step(x) = 1 for 0<=x<0.5 and step(x) = 0 for 0.5<=x<1, for x in the semi-open interval [0,1), and is periodically extended outside this range.

• step2(x,a)

This function is a variation of step(x), where the duty cycle can be controlled by the second argument a. It is defined as step2(x,a) = 1 for 0<=x<a and step2(x,a) = 0 for a<=x<1, for x in the semi-open interval [0,1), and is periodically extended outside this range. The parameter a must be between 0 and 1.

• dBm(x)

This function converts x from units of dBm to units of Watts. It is useful when a component parameter expects input in units of Watts, but you prefer to provide it in units of dBm.

Please note that all function names are case-sensitive.

The following numerical constants are also provided by OptSim:

• inf

Infinity

• c

The speed of light in a vacuum (m/s)

• e

The numerical constant e

• pi

The numerical constant π

• true

The value 1

• false

The value 0

• yes

The value 1

• no

The value 0

Page 58: 39865643 Optsim Guide

48 •••• Chapter 1: Using OptSim GUI OptSim User Guide

• NaN

Not a number

Note that if a function required by your application is not listed above, please contact RSoft Design Group and we will attempt to add it to the next release.

The expression language also supports Boolean-valued expressions. These can be used to assign conditional values. The syntax for this is:

x = boolean ? value1 : value2

If the boolean is true, x is value1; otherwise, it is value2.

1.8.2 Symbol Table Expressions The expression language supports integer arithmetic. In the symbol table the parameters are not explicitly typed so the types are inferred from the user input. Numerical values without decimal points such as “10” or “-3” are integers (type int). Numerical values with decimal points, such as “10.0” or “3.14159” are of type double. Numerical values without decimal points followed by the character “l” (el) or “L” are of type long. Unsigned integers followed by “ub” or “UB” are of type unsignedByte, as in “5ub”. In OptSim an unsignedByte has a value between 0 and 255.

Numbers of type int, long, or unsignedByte can be specified in decimal, octal, or hexadecimal. Numbers beginning with a leading “0” are octal numbers. Numbers beginning with a leading “0x” are hexadecimal numbers. For example, “012” and “0xA” are both equal to the integer 10.

The unsignedByte, int and long types can only represent integer numbers. In the symbol table where types are inferred from the values entered by the user, operations on these types are integer operations. This can sometimes lead to unexpected results if one is not careful. For instance, ½ yields 0 if 1 and 2 are integers, whereas 1.0/2.0 yields 0.5. When an operator involves two distinct types, the expression language has to make a decision about which type to use to implement the operation. If one of the two types can be converted without loss into the other, then it will be. For instance, int can be converted losslessly to double, so 1.0/2 will result in 2 being first converted to 2.0, so the result will be 0.5. If one type cannot be losslessly converted to the other an error message will be displayed.

1.8.3 User Defined Functions The expression language supports user definition of functions. This syntax is:

x = function(arg1:Type, arg2:Type….)

function body

where “function” is the keyword for defining a function. The type of an argument can be left unspecified, in which case the expression language will attempt to infer it. The function body gives an expression that defines the return value of the function. The return type is always inferred base on the argument type and the expression. For example:

f = function(x:double) x*5.0

defines a function that takes a double argument, multiplies it by 5.0, and returns a double. The return value is the function itself. If f is a parameter in the global symbol table, another parameter y = f(10) will give the result 50.0 if “f” is in the scope of “y”.

1.9 String Parameters Many components contain string parameters as well as numerical parameters. The value of a string parameter cannot be set with an expression. The value of the string parameter is the literal string, not the string interpreted as an expression.

There is a method by which string parameters can be determined in part by the values of the global user variables. A function “sprintf” may be used in the field of a string parameter in any component to set the string value used during the simulation based on the result of evaluating the sprintf function. In other words, string type component parameters

Page 59: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 49

may be specified in the form of sprintf format commands which may refer to variables in the global symbol table. This feature allows filenames, for example, to be scanned in a parameter scan simulation (see the section on Parameter Scanning Facilities in Using OptSim – Simulation Techniques.) Therefore, it is possible to perform a parameter scan simulation and have a component like a filter use a different custom filter input file for each scan.

An alternative approach is also supported in the expression language. In particular, the expression language supports string concatenation using the “+” operator. Therefore, “str” + “Name” + 2 = “strName2”. If instead of the literal “2” we used a variable that is defined as an integer, we will get the same behavior. If we scan this variable we could also use a different custom filter input file for each run.

As an example, let us say we want to perform a parameter scan over 5 different custom Optical Filter files. To do this, we will perform a parameter scan over a symbol table variable ‘filenum’ from 1 to 5. In the filename string field of the filter, we will write the following: sprintf(“filter_file_%d”, intRound(filenum))

to read in files filter_file_1 to filter_file_5.

We could also set the filename string field to “filter_file_” + filenum to achieve the same thing.

The sprintf command accepts %s %d %f formats, and it supports specification of field widths, e.g. sprintf(“filter_%3d”, filenum).

For further details on the use of this command, please consult a book on the C programming language, or contact RSoft Design Group with any questions you may have on this feature.

1.10 Advanced Features

1.10.1 Changing Icons OptSim users have the ability to enhance the visual representation of the models in their schematics. Icons created by a number of available tools can be imported into OptSim and used to represent an OptSim model.

Two menu items for icon editing are available from the pop-up menu that appears when right-clicking on component in the schematic editor window. The “Set Icon” action is used to change the visual representation of a model instance. This action changes the icon that represents a particular instance of a model in the current schematic, but other instances of the entity remain unchanged.

All models have a default icon. The user can change the icon representation for a model to enhance its visual representation. OptSim supports Scalable Vector Graphics (SVG), GIF, and JPEG image formats. SVG is the preferred format as it produces the most pleasing rendering of the group.

To change the icon used to represent a model, the user right-clicks on the model, bringing up the familiar pop-up menu. The user then selects the “Set Icon” action from the “Appearance sub-menu, which launches the Icon Chooser shown in Figure 28. The Icon Chooser will display all the icons that are located in OptSim’s default icons directory and all icons located in the user’s icons directory. The user’s icons directory is located at “<User Directory>/icons”, where <User Directory> is set using OptSim’s Preferences dialog. The Icon Chooser allows the user to change the viewing size of the icons on the palette. This is accomplished by dragging the slider at the top of the dialog. Icons can be added to the palette using the “Add” button at the bottom of the dialog. The “Browse” button launches a file chooser that provides an alternative means of selecting an icon on disk that may or may not be available on the palette. The file chooser allows the user to navigate the file system, showing only the supported image file formats (SVG, GIF or JPG files). The file chooser has an accessory that provides a preview of the selected icon. The “Refresh” button reloads the icons on the palette. Selecting the desired icon using either the Icon Chooser or the file chooser immediately changes the visual representation for the selected model. If the selected image is a GIF or JPG, OptSim will automatically scale the image to the default model dimensions (40x40 pixels). If the selected image is in SVG format, OptSim will use the dimensions specified in the XML markup that defines the icon. In this way, the user can control the dimensions of model icons in the schematic editor.

Page 60: 39865643 Optsim Guide

50 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Figure 28: Set Icon (top) and File Chooser(bottom) to select icon file.

Page 61: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 51

1.10.2 Design Properties The user can edit the general properties of current schematic properties by a menu item File->Properties or by hotkey F2. This action opens the dialog shown in Figure 29 below. The user can convert a project to a compound component (CC) and vice versa using this dialog. However, it is the responsibility of the user to make sure that the schematic is consistent with the requirements of these document types. For instance, a compound component normally requires external port objects. The dialog does not check for the existence of these ports. If a model type (block- or sample-) is contained by a project that is being converted to a CC, the user is given the opportunity to optionally remove it. Conversely, when a CC is converted to a project, the user is given the opportunity to optionally add a model type that is compatible with the models contained by the CC.

Figure 29: Dialog window for Design Properties

If the schematic document was previously password protected, the dialog will indicate this by showing a pair of string values for the password fields and the “Password Protected” checkbox selected. To change the password the user can simply unselect and reselect the Password Protected checkbox. This will clear the password fields. The user may password protect both projects and CCs using this dialog. The actual encryption takes place the next time the document is saved.

A description of the project or the CC can be entered in the “Description” text area. The description is saved in the schematic file the next time the document is saved.

An icon can be assigned for a CC using the Properties dialog. The Set Icon button will launch the Icon Chooser shown in Figure 28. It can be used to attach an icon to the document. The supported image formats are SVG, GIF and JPEG.

Page 62: 39865643 Optsim Guide

52 •••• Chapter 1: Using OptSim GUI OptSim User Guide

1.10.3 User Libraries Organizer A flexible organizer for models is essential for the OptSim framework for the following reasons:

• A large number of models are distributed with both Block-Mode and Sample-Mode components libraries; much more than the typical user may care about.

• The user should have some control over which models appear in the libraries.

• It allows RSoft to easily customize predefined user libraries for specific simulation tasks. The user will then simply load a library if they have an interest in the contained models or completely ignore it if not.

The User Libraries Organizer can be opened from the Utility->User Libraries Organizer menu. The dialog is shown in Fig. 30 below:

Figure 30: User Libraries Organizer

The “Import Entity” button launches a file browser that allows the user to browse the file system for CCs. The name of the selected model or library of models will be automatically entered into the “Library entity name” field. By convention, we use .xml extension for files that are library files (a folder with a predefined set of models), and .moml extension for files that represent individual compound components. The User Libraries Organizer can be used to create and delete any number of folders and models. The user has total control over where in the tree their models are added. However, they need to select the folder where they wish to add the model before they press the “Add” button. Otherwise, the top level folder (User Libraries) is used. Only CCs that are referenced from a file on disk are allowed in the User Libraries. Except for the special cases of the User Directory and the Workgroup Directory, the actual CC files are not moved. The library is just a list of references to CC files that could be located anywhere on disk.

The User Directory and Workgroup Directory folders are treated special by the User Libraries Organizer. Both of these folders come standard with the OptSim software and the user is not allowed to delete them. These folders are associated with the “User” and “Workgroup” directories that should be specified by the user the first time they use the OptSim software. These can be viewed from the Options->Preferences dialog. If the user imports a CC into the User Libraries and selects the User Directory folder (or subfolders thereof) before adding the model, the CC file is actually copied to the

Page 63: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 53

physical “User” directory if it is not already present. The same is true for the Workgroup folder and directory. This allows some level of portability of projects that use CCs: A project that is created using CCs from the User Directory folder is guaranteed to work on another computer if the user on the receiving end also places the CC files in their “User” directory. The actual path to the User Directory does not have to be the same on both computers. The same reasoning applies to the Workgroup Directory.

1.10.4 Directories Preferences The first time OptSim is launched the user will be asked to initialized some directory settings.

Figure 31: Information message about setting user and workgroup directories

Click “OK”

Figure 32: Setting user and workgroup directories, setting shortcut directories for projects and examples.

Workgroup directory: Please specify the desired workgroup directory. This directory is for sharing custom components and projects with other users in a group.

User directory: This is where the custom components available to the user only will be saved

The user may also set default directories for their “projects” and “examples” directories. The system default is automatically selected. If the user does not have write permission for the default directories they will need to change

Page 64: 39865643 Optsim Guide

54 •••• Chapter 1: Using OptSim GUI OptSim User Guide

these settings. The “User” and “Workgroup” directories can be selected. Selecting “Other” allows the user to choose arbitrary directories for both their projects and examples directories. The examples that are distributed with OptSim are located in the default directory. If an alternative example directory is chosen, the user should copy the content of the default examples directory to the chosen directory. Once these shortcut directories are set, the shortcut menus that create new projects and open the examples directories (included those available on the Favorite Schematics shade) will use the custom settings.

1.10.5 Encrypting Model Data Files OptSim includes the ability to encrypt data files that are used by models. Currently, only the block-mode Physical EDFA model supports such files, but future releases will expand on this feature. To encrypt a data file, select Encrypt Data File from the Utilities menu. The following dialog will be displayed:

Enter the full path to the data file in the Source File field, or click Browse… to find the file on disk. By selecting the Target Key option, you may also specify a set of white-space separated hardlock keys. If hardlock keys are specified, only a user whose key was included will be able to load the encrypted data file. Once you have specified a source file and any hardlock key numbers, select Save… in order to save the source file in encrypted form. A Save dialog will be displayed in which you must specify the name and location of the encrypted file. Upon completion, you will be returned to the Encrypt Data File dialog, where you may continue selecting data files for encryption.

1.10.6 Adding Texts to the Projects The annotation tool from the Toolbox (Section 1.3.3) helps adding and editing text, comments or annotation to the project by selecting and dropping the annotation tool at the desired places within the project. Clicking on the “Select and Connect” tool de-selects the annotation. Right clicking it opens up a dialog window, as shown below.

Page 65: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 55

The user can add text and select font and text color from the menu.

Page 66: 39865643 Optsim Guide

56 •••• Chapter 1: Using OptSim GUI OptSim User Guide

1.10.7 Adding Record Keeping Attributes to the Projects The model ID tool from the Toolbox (Section 1.3.3) is a decorative block that can be placed into a project to indicate the author, contributors, creation date, and the last modification date of the project by selecting and dropping it at the desired place within the project, as shown below. Clicking on the “Select and Connect” tool de-selects the model ID.

Right clicking it opens up a dialog window, as shown below, where the author and the contributors fields can be edited.

Page 67: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 57

1.10.8 Generation of Project Reports OptSim comes with a user-friendly way of web-ready report generation. The report is an HTML file that can be edited in external software like Microsoft Word, can be archived using external software, like WinZip, or can be converted to PDF using external software, like Acrobat. The report can contain screenshot of the project layout, user-entered description, results in form of graphs and tables, parameters used in the project and their numerical values in tabular form, etc.

With the project file open for which a report is to be generated, from the upper-left of the GUI, click on Schematic Reports, and you will see an expanded list of choices as shown in the figure below:

Page 68: 39865643 Optsim Guide

58 •••• Chapter 1: Using OptSim GUI OptSim User Guide

The Generate, Organize, Edit, and Display buttons do their self-explanatory functions. To generate a new report, click on the Generate… button. A dialog box, as shown below, will open up:

The user can write/add a new description in the Description section or an existing description from the File Properties will be included. The Add Graph button allows including desired plot(s) for the project. A sample project report looks like:

Page 69: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 59

The reports can be removed, exported or imported using the Organize… button of the Schematic Reports tab view. The Reports Organizer dialog shown below will be opened when this button is pressed. The “Export Button” will package all the relevant report files into a single zip file that can be sent to another user. The “Import Button” can be used to unpack a report that was packed by the OptSim software. The unpacked report will be added to the selected group for easy editing and viewing.

Page 70: 39865643 Optsim Guide

60 •••• Chapter 1: Using OptSim GUI OptSim User Guide

1.10.9 Decorative Elements OptSim is equipped with a number of features that permit users to graphically present their design schematics in many different ways that are presentation-friendly. The user can access these features via the “Decorative Elements” folder of the left-hand component tree in the explorer module.

Image Dragging and dropping the image element into the drawing area, and right-clicking it allows user to add *.gif or *.jpg graphic images with desired scale factor like the one shown in the following properties box.

Page 71: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 61

This edits a graphic image as shown below:

Page 72: 39865643 Optsim Guide

62 •••• Chapter 1: Using OptSim GUI OptSim User Guide

Ellipse Dragging and dropping the ellipse element into the drawing area, and right-clicking it opens a Properties dialog that allows the user to add an elliptical graphical object with desired attributes like the lineWidth, lineColor, width, height, and fillColor.

The last of the four numbers in the lineColor and fillColor fields determine the opaqueness of the line and fill, 1.0 being completely opaque and 0.0 being completely transparent. The following screenshot illustrates ellipse objects with varying degree of opaqueness.

Page 73: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 63

Line Dragging and dropping the line element into the drawing area, and right-clicking it allows user to add a line graphical object with desired attributes like the lineWidth, lineColor, and position as specified through the x and y values as shown in the following properties box.

The last of the four numbers in the lineColor field determines the opaqueness of the line, 1.0 being completely opaque and 0.0 being completely transparent.

Polygon Dragging and dropping the polygon element into the drawing area, and right-clicking it allows user to add a polygon graphical object with desired attributes like the lineWidth, lineColor, width, height, fillColor and vertices like the one shown in the following properties box.

Page 74: 39865643 Optsim Guide

64 •••• Chapter 1: Using OptSim GUI OptSim User Guide

The last of the four numbers in the lineColor and fillColor fields determine the opaqueness of the line and fill, 1.0 being completely opaque and 0.0 being completely transparent. The parameter vertices can be used to add/drop vertices in order to get the desired polygon - the length of the vertices array should be even as the elements are specified in x,y pairs eg. x1,y1,x2,y2……. The following screenshot shows several polygons as a result of some combinations of these parameters.

Rectangle Dragging and dropping the rectangle element into the drawing area, and right-clicking it allows user to add a rectangle graphical object with desired attributes like the lineWidth, lineColor, width, height, fillColor and rounding like the one shown in the following properties box. The rounding value specifies the radius of the corner arcs.

Page 75: 39865643 Optsim Guide

OptSim User Guide Chapter 1: Using OptSim GUI •••• 65

The last of the four numbers in the lineColor and fillColor fields determine the opaqueness of the line and fill, 1.0 being completely opaque and 0.0 being completely transparent. The parameter rounding can be used to round the angles to get desired rounded rectangular shape. The following screenshot shows several rectangles as a result of some combinations of these parameters.

Page 76: 39865643 Optsim Guide
Page 77: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 67

Chapter 2: Getting Started with Sample Mode Simulations

This chapter describes the step-by-step procedures by which a new OptSim user can rapidly learn the essentials and get started. After having read this chapter, you should be able to open the OptSim sample mode example projects, run simulations, and experiment with changing the various component and simulation parameters.

These step-by-step procedures will guide you in designing new projects from scratch and to use the main OptSim features. However these projects already exist in the example directory (if you have installed the examples during the installation procedure). So, if you want to skip the steps of laying out your design and proper assignment of parameter values, you may copy the example files into your working directory and use them immediately.

The example files are stored in the following directories:

• ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_1\

• ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_2\

• ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_3\

• ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_4\

• ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_5\

• ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_6\

where ProductInstDir is the directory where you installed the OptSim product.

Note We recommend creating a working directory for each new project.

2.1 Introduction

2.1.1 The System to be Simulated This section will guide you step-by-step through the design and simulation of a single-channel OC192 system (10 Gbit/s), over typical terrestrial distances. The system we want to simulate has the following characteristics:

Transmitter Section • bit rate: 9.953 Gbit/s (OC-192)

• modulation format: standard Non-Return-to-Zero (NRZ)

Page 78: 39865643 Optsim Guide

68 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

• optical modulator: external Mach-Zehnder, 12 GHz bandwidth, 5 dB insertion loss

• central frequency: 193.1 THz (ITU-GRID, 1552.52 nm)

• optical transmitter: CW laser (30 MHz spectral width), 5 dBm peak power

Link Section • link type: 150 km, Dispersion Shifted (DS) single mode fiber

• amplification: EDFA placed every 50 Km, Noise Figure 5 dB

• amplifier gain: set to have a constant power (6 dBm) at the input of each fiber span

Receiver Section • receiver sensitivity: -27 dBm at BER=10-9

• receiver filter: 8 GHz, 5-pole Bessel filter We want to measure:

• the optical spectrum after each optical amplifier

• the electrical spectrum at the electrical receiver

• the eye diagram and the Q factor after the receiver filter

2.1.2 Sample Mode Simulation Strategies OptSim offers several different strategies for simulating a given optical system. In order of increasing accuracy and computational effort, these strategies are:

• Spectral Propagation Technique (SPT): signals are propagated in the network as power spectra, taking into account component loss and noise. Spectra, power levels and Optical Signal to Noise Ratio (OSNR) can be evaluated at any point in the network.

• Variable Bandwidth Simulation (VBS): signals are propagated in the network as time-domain samples over a user-selectable bandwidth. VBS simulates the performance of fiber and other optical components. VBS can be used with different fiber models:

• Simplified Fiber Model: VBS takes into account attenuator only (Loss Only Fiber), or attenuation and dispersion (Linear Fiber). In both cases the simulation is strictly linear.

• Full model: VBS takes into account all fiber effects, linear and non-linear. This is the most complete and powerful simulation strategy.

This suite of simulation strategies allows a trade-off between accuracy and simulation speed. This is particularly useful when using OptSim to choose between different design variations of an optical link or network. Often the space of free parameters to be investigated is so large that a complete simulation taking into account all effects would be too time consuming.

Page 79: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 69

SPT Simulation You may first explore the space of all free parameters using the SPT simulation, which is computationally very efficient. From the SPT simulation, one may evaluate OSNR and power levels at any point of the network. In doing so, you may reduce the free parameter space by eliminating all configurations having, for example, an OSNR below a given limit, or a fiber input power greater than a certain level.

VBS Simulation You may then run a simplified VBS simulation, by choosing which effects are to be taken into account for the fiber, and again eliminate all configurations that do not match your predefined criteria. Finally, on this further reduced set of parameters, you may run a full VBS simulation and settle on the configuration that gives the best results.

The VBS Bandwidth

The bandwidth of the VBS simulation can be made smaller than the SPT bandwidth. However any component whose output does not fit into the VBS bandwidth will not be simulated in the time domain. It is however taken into account in the preliminary SPT simulation, in order to accurately determine operating points of all average power sensitive components. Reducing the VBS bandwidth is useful in the simulation of DWDM systems, where you can run multiple simulations covering only some channels. In this way the simulation runs much faster.

Besides being useful for this incremental approach to the design of an optical network, different simulation strategies are useful also in other contexts. For example, when designing optical networks of limited extension (LAN or MAN), fiber non-linearity may usually be neglected, while noise levels and signal crosstalk are the fundamental issues. In this case, an SPT simulation to estimate OSNR levels, followed by a simplified VBS simulation may be sufficient.

2.2 Setting Up Your First Simulation Setting up a simulation is a simple operation that we may divide into four main steps:

• creating a new OptSim project and setting up the simulation parameters

• drawing the schematic

• starting the simulation

• viewing the results with the Data Display tool

Now let’s start the OptSim tool.

2.2.1 Starting OptSim In order to launch the OptSim tool, perform one of the following procedures:

To start OptSim from a Windows NT/2000/XP system

• Open the Start menu, point to the Programs menu and select the RSoft Photonics CAD suite, then select OptSim 4.0. The OptSim window (Figure 1) appears.

Page 80: 39865643 Optsim Guide

70 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 1. The OptSim window

From this window you can:

• create a new project or open an existing project

• create a new compound component or open an existing compound component

Now we are able to create a new project or open the existing examples.

2.2.2 Initialization of Settings The first time OptSim is launched, the user will be asked to initialize some OptSim settings.

Figure 2. Information message about setting user and workgroup directories

Click “OK”

Page 81: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 71

Figure 3. Setting user and workgroup directories, initializing runtime options

Workgroup directory: Please specify the desired workgroup directory. This directory is for sharing custom components and projects with other users in a group.

User directory: This is where the custom components available to the user only will be saved

Sample-Mode RunTime Options(not shown): Allows you to set the maximum memory required by OptSim when running a simulation. We suggest you set this to approximately 50% of the available RAM on your PC. When this setting is low, OptSim will split each simulation into smaller steps and the total simulation time will be longer.

To accept the default settings (or modify later), simply click “OK”.

2.2.3 Creating a new Project An OptSim project is a file with extension .moml that stores all the information on the design schematic and simulation parameters. OptSim files created with a previous version (.opf files) can be read by the OptSim 4.0 interface and saved as .moml files.

After a simulation procedure other files and sub-directories may be created in the same directory where the project file is. For this reason, we recommend creating a working directory for each new project.

Directory Tree A good choice is to keep all your projects in the same "working directory" and create a sub-directory for each project.

Let's start creating the following working path:

• for Windows systems create the folder Gs1 under the folder ProductInstDir\products\optsim\sample_mode\projects

• for UNIX systems create the directory Projects and then, under this directory, create the directory Gs1

Page 82: 39865643 Optsim Guide

72 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Gs1

Here is where all the projectfiles and project folders willbe created.

Project folder

\OptSim\Projects

Windows Systems

Workingfolder

Gs1

Here is where all the projectfiles and project directorieswill be created.

Project RootDirectory

user_directory

UNIX Systems

WorkingdirectoryProjects

Figure 4. The project directory tree

Note Allowed characters for directory names are: alphanumerical, "." (dot), "_" (underscore), "-" (dash) and "+" (plus). Spaces are not allowed in the filename nor in the path.

Creating a Project To create a new project

1. Click on the Create an OptSim project button in the top left corner of the menu in the OptSim window (Figure 1). A file selection dialog window appears.

2. Select the new working directory and type the new file name (without extension) for the new project, for example getting_started_1. Click on the OK button. A new OptSim design area is opened and the “Configuration for OptSim Director” window is opened. For first time users we recommend default settings, by clicking the OK button.

Note Allowed characters for file names are: alphanumerical, "_" (underscore), "-" (dash) and "+" (plus). ). Spaces are not allowed in the filename nor in the path.

Opening a Project If you want to skip the steps of setting up the system schematic and parameter values, described in the following sections, you may copy the project example to your working directory and open the local copy of the project file.

To copy the example

Copy the project example to your working directory.

• In Windows systems copy all the files contained in the folder ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_1\ into the folder ProductInstDir\products\optsim\sample_mode\projects\Gs1.

• In UNIX systems type the command: cp ProductInstDir/examples/optsim/sample_mode/Getting_started/Getting_started_1/* HomeDir/Projects/Gs1/

To open the existing example

1. Click on the Open existing project button in the OptSim Startup Dialog window. The file selection dialog window appears.

2. Select the new working directory and the copied opf project file. Click on the OK

Page 83: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 73

button, and the project network appears in the design area of the OptSim tool.

2.2.4 Sample Mode Simulation Parameters Before you design the system, you should set the Simulation Parameters, i.e. a set of parameters that are essential in controlling the accuracy and duration of the simulation. An improper choice of some of these parameters, such as the VBS simulation bandwidth or the total simulated time span, may result in exceedingly long CPU simulation times (if these values are chosen to be too large) or lead to completely incorrect results (if these values are too small compared to the system characteristics).

Any component you place in the design will automatically be initialized with default values that are calculated as a function of these simulation parameters. Therefore, it's convenient to define these parameters first, before designing the system network.

The Configuration for OptSim director window is automatically opened when you create a new project. However you can open the window at any time performing this simple procedure.

To open the Simulation Parameters dialog window

1. In the OptSim editor window choose the menu command Edit > Simulation Parameters.

Figure 5. The Simulation Parameters window – Time Domain section

The Simulation Parameters window is organized into the following five sections:

• Run Options: allows choosing the simulation type (SPT, VBS) with options for noiseless simulation etc.

Page 84: 39865643 Optsim Guide

74 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

• Time Domain: allows setting the VBS bandwidth and other parameters related to time domain simulation, such as the total simulation time and the reference bit rate

• Frequency Domain: allows setting the SPT bandwidth limits, the optical polarization representation (single or dual polarization) and a seed for random number generation

• Simulation Accuracy: allows setting several precision parameters, mostly related to the simulation of optical fibers

• Naming: Various naming functions for the simulation In the following, we will briefly introduce the meaning of the most important fields contained in the Simulation Parameters dialog window.

The first and most important simulation parameters that should be set are the SPT and VBS bandwidth, taking into account the following general rules:

• the SPT bandwidth must be large enough to cover the frequency range of all the components included in the current project

• the VBS bandwidth can be smaller; however a component whose output spectrum does not fit the VBS bandwidth will not be simulated in the time domain

• the VBS bandwidth must be 20% smaller than the SPT bandwidth In our example, we have a single source at 193.1 THz, modulated at 10 Gbit/s. The signal spectrum will thus be approximately confined to some tens of GHz around 193.1 THz. We can then reasonably set the VBS bandwidth upper and lower limits to193.04 and 193.16 THz, since a 120 GHz total VBS bandwidth should allow to sufficiently sample the input signal in the time domain.

The SPT bandwidth should then be set to be at least 25% larger. Whenever this is not the case, a message asks you if you wish to have the simulation bandwidth enlarged so as to have a SPT bandwidth 25% larger than the VBS bandwidth.

Other important simulation parameters to be set are:

• Reference Bit Rate: the bit rate that is used to set many default values, such as digital data source rates and lowpass electrical filter cutoff frequencies. In our case it is the OC-192 rate of 9.953 Gbit/s.

• Total Simulated Time Span and Number of Bits at the Reference Bit-Rate: this parameter sets the duration of the simulation in terms of simulated time expressed in [ns] or in the number of bits at the reference bit-rate, defined above. In our example, we left this parameter at its default, thus allowing a simulation of about five hundred bits.

• When you wish to study the effects of noise on an optical system—for example in terms of the Q parameters—at least a hundred bits should be simulated. On the contrary, when you need to study propagation effects—like in soliton systems—even a single pulse maybe sufficient. When selecting this parameter you should remember that the required CPU simulation time increases with the Total Simulated Time Span. The relation between the two parameters is not strictly proportional. OptSim's numerical algorithms have been developed in a way that the required CPU time grows worst case linearly with the Total Simulated Time Span - and usually quite a bit less than linearly, thus allowing very long bit streams to be simulated.

• Optical Field Representation: this parameter toggles between Single Polarization or Dual Polarization, meaning that the propagated field in the fiber is simulated as a single electromagnetic mode or as a two-coupled degenerate mode. In the latter case the fiber model takes into account the polarization effects birefringence and PMD. Moreover it is possible to use the available OptSim components for managing and estimating the field polarization.

• When you choose this parameter you should remember that the required CPU simulation time for the single polarization model is reduced by a factor of 2-4X compared with dual polarization, but the single polarization model is a simplification of the more realistic dual polarization model.

We can summarize the procedure for setting the simulation parameters in our new project as follows:

Page 85: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 75

To set the simulation parameters

1. In the Simulation Parameter Window (Figure 5) click on the Time Domain tab.

2. Type 193.04 in Lower Limit [THz] and type 193.16 in Upper Limit [THz].

3. Type 9.953 in Reference Bit Rate and click on the Force Bit-Rate button so that the VBS bandwidth is automatically modified to allow the simulation of this bit rate with an integer number of time-domain samples per symbol.

4. Click on OK. A warning message appears, click on Yes to modify the SPT bandwidth (Basic Attributes section) according to the VBS bandwidth set.

2.2.5 Drawing the Schematic

Transmitter Section Now that the simulation parameters have been set, we are ready to design the optical network for our example We will start with the transmitter section, which will be composed of four components:

a digital data source

an electrical driver (NRZ Rectangular)

a laser (CW Lorenzian)

an external amplitude modulator (Sin2 Mach-Zehnder)

To help you to quickly find components, you should remember that OptSim uses the following color convention:

• optical links and components are red

• electrical links and components are blue

• digital links and components are black

You will find each of these components in the component palette under “model palettes” and “OptSim models” to the left of your design area. This palette contains the most frequently used components in the OptSim Library. Note that clicking on “all models” then “OptSim models” you can access less frequently used components and the user-defined components through a tree structure.

Some users will prefer working directly with the tree structure under the “all models” tab. This structure has direct access to all available models, organized in groups.

The advanced user can also create a custom palette, this will be described in detail later.

Now, place the four components of the transmitter in the design area to begin creating the system network

To draw the transmitter section

1. Click on the Datasource component in the component palette and drag it to the spot in

the design area where you wish to place it.

2. Click on the NRZ Raised Cosine Driver component in the component palette and drag

it to the design area to the right of the data source component.

Page 86: 39865643 Optsim Guide

76 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

3. Click on the CW Lorenzian Laser component in the component palette and drag it to

the design area below the data source component.

4. Click on the Sin2 Amplitude Modulator component in the component palette and drag

it to the design area to the right of the laser component.

Each newly inserted component has a question mark across the icon. This is to remind you that you still need to assign parameter values to that component, if you do not wish to accept default values.

Double click on the component icon in the design area and a dialog window with all the component parameters will open. You should notice that a default value has been given in order to help you assign parameters. Remember that these default values depend on the simulation parameters set earlier.

To set the parameters for the laser component

1. Double click on the laser icon and the following dialog window appears:

2. In the “General” tab, type 5 (dBm) in the CW power field. Type 30 in the FWHM Linewidth parameter. Select the Deterministic option in the Laser Phase parameter to set the initial phase to 0 rad. When done, click on the “Naming” tab. Ignore the “Ports” tab for now.

Page 87: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 77

3. Type TX_Laser in the Name field.

4. Click on OK to close the window.

To set the parameters for the amplitude modulator component

1. Double click on the Sin2 amplitude modulator icon, and the parameters dialog window

appears.

Page 88: 39865643 Optsim Guide

78 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

2. In the Basic Attributes section type 5 in the Excess loss field then type 2.5 in the Maximum Transmissivity Offset Voltage field. Select Yes in the Electrical Filtering with sin(ππππf/Bw)/(ππππf) Law and type 12 in the -3dB Bandwidth field. Ignore the “Spectral Estimation” and “Ports” tabs for now. Under the “Naming” tab, Type Modulator in the Name field.

3. Click on OK to close the window.

To set the parameters for the digital data source component

1. Double click on the data source icon, and the parameters dialog window appears.

2. Type Digital source in the Name field under the “Naming” tab. Leave all other settings at default. Click on OK to close the window.

Note that the Name field is optional, however it helps you to read the system schematic. The name you provide is displayed near the component in the design area.

To set the parameters for the electrical driver component

1. Double click on the NRZ rectangular electrical driver icon, and the parameters dialog

window appears.

2. Type -2.5 in the Low level field and 2.5 in the High level field under the “General” tab.

3. Type Electrical driver in the Name field under the “Naming” tab. Leave all other settings at default. Click on OK to close the window.

Now that all the placed components have been characterized by defining their type and parameter values, you need to connect them, much like you would in a physical system. You can draw connections between components by linking the appropriate connectors of each component. The connections are color-coded as follows:

• optical connection - red - transmits light (optical signal)

• electrical connection - blue - transmits an electrical analog signal

• logical connection - green - transmits a serial digital signal

• a dotted line signifies that this is a monitoring connection and not a transmission connection To draw the transmitter section connections

Left click the mouse on the origin port, drag it to the destination port, and release the mouse button. The connection is made. Red color indicates connection for optical signal, blue color indicates connection for electrical signal, and green color indicates connection for logical signals. The connections in the dotted lines represent connections to visualizers.

Page 89: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 79

Figure 6. The transmitter section

The transmitter section is now complete.

The Optical Link Now, we should define the optical link part of the network. As previously stated, we want to simulate a 150 km long link, made up of three spans of Dispersion Shifted (DS) single mode fiber alternated with EDFAs placed every 50 Km. In this example, since the EDFA output power (6 dBm) and noise figure (5 dB) have been specified, we can choose the fixed output power model. This allows setting output power and noise figure as frequency independent (flat) values, as required in our case, or frequency dependent, with values specified in a data file.

To draw the optical link section

1. Click on the Fixed Output Power Optical Amplifier component in the component

palette and click to the right of the transmitter section in the design area.

2. Double click on the optical amplifier icon, and the parameters dialog window appears.

3. In the “General” tab, type 6 (dBm) in the Output Power field. Type 5 (dB) in the F field (Noise Figure). Type Booster in the Name field in the “Naming” tab. Click on OK to close the window.

4 Click on the Fiber component in the component palette and click to the right of the amplifier in the design area.

5. Double click on the fiber icon, and the parameters dialog window appears.

Page 90: 39865643 Optsim Guide

80 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 7. The Fiber dialog window

This is one of the most important and complex dialog windows of the OptSim simulator, since it allows specification of all the physical parameters of the fiber. As shown above, the fiber dialog has ten tabs, named Basic Attributes, Loss, Dispersion, Statistical Dispersion, Advanced Effects, Raman Effects, Raman Amplifier, Advanced Control, Ports and Naming. The sections associated with each of these tab permits the specification of all fiber parameters.

More specifically, the Basic Attributes permits the selection of the predefined fiber type and to set the fiber length. We advise beginners to use predefined types when beginning to get acquainted with the OptSim fiber component parameters. These predefined types are available in the popup menu of Parameter Files.

The Loss section defines the attenuation characteristics of the fiber. You can introduce directly the coefficient values or supply a description file.

The Dispersion section defines the dispersion characteristics of the fiber. You can introduce directly the coefficient values or supply a description file.

Statistical Dispersion defines the statistical dispersion characteristics of the fiber.

The Advanced Effects section defines non-linear Kerr coefficient and several polarization-related parameters, such as birefringence, beat and correlation length and fiber polarization mode dispersion (PMD).

The Raman Effects section defines the characteristic parameters employed to simulate the effects induced by the Stimulated Raman Scattering (SRS): Raman cross-talk and Raman amplification.

The Advanced Effects section permits the selection of fiber effects such as non-linearity, PMD and birefringence. In this manner, you can selectively determine which effects are to be taken into account for each fiber span. In our example, in the Advanced Control section, we decided to set all flags On since, as we will show later, we will switch on and off these effects globally, that is on all fibers in the project.

The Raman Amplifier section allows to set distributed Raman amplification in the fiber (single pump or multi-pump).

To set up the fiber links in the optical link section

7. Select DS_Normal in the Library pop-up menu, then click “Load”.

8. Type 50 in Length, then click on the OK button to close the fiber window.

Page 91: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 81

9. Repeat the steps 1-3 inserting another EDFA to the right of your fiber icon. This time, name it In-line EDFA.

10. Select the fiber and the last EDFA just placed in the design area. Choose the menu command Edit > Copy or click the Copy button in the toolbar.

11. Click just below the previous components. Then select the menu command Edit > Paste or click the Paste button in the toolbar. Repeat once to create three identical sets of fiber and in-line amplifiers. At the end of the procedure the optical link section should look like the following:

To draw the connections of the optical link section

12. Left click the mouse on the origin port, drag it to the destination port, and release the mouse button. The connection is made. Red color indicates connection for optical signal, blue color indicates connection for electrical signal, and green color indicates connection for logical signals. The connections in the dotted lines represent connections to visualizers. Your total layout should now look like this:

Page 92: 39865643 Optsim Guide

82 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 8. The transmitter plus optical link section

Receiver Section The receiver specifications we want to model are the following:

• receiver sensitivity: -27 dBm at BER=10-9;

• receiver filter: Bessel, 3 dB bandwidth 8 GHz, 5-pole; With these specifications we can take advantage of the Sensitivity Optical Receiver model. This model is very powerful when modeling a receiver whose known parameters are its sensitivity and bandwidth. In our example, we have also placed an optical attenuator before the receiver, so as to be able to vary the received power. We will explain later the reason for adding the variable attenuator.

To draw the receiver section

1. Click on the Raised Cosine Optical Filter component in the component palette and click

below the optical link section in the design area.

2. Click on the Optical Attenuator component in the component palette and click to the

right of the optical splitter component.

3. Click on the Sensitivity Optical Receiver component in the component palette and click

to the right of the optical attenuator component.

4. Click on the Bessel Electrical Filter component in the component palette and click to

the right of the electrical splitter component.

Now the section should appear like the following figure:

Page 93: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 83

5. Double click on the Raised Cosine optical filter icon, and the parameters dialog window

appears. Click on OK to accept the default settings and close the window.

6. Double click on the optical attenuator icon, and the parameters dialog window appears.

Type 25 (dB) in the Attenuation field. Click on OK to close the window.

7. Double click on the optical sensitivity receiver icon, and the parameters dialog window

appears. In the Basic Attributes section type -27 in the Sensitivity under test condition field. Click on the Receiver Filters tab and type 5 in the Bessel filter order field. Type 0.8 in the Normalized -3dB frequency field. Click on OK to close the window.

8. Double click on the Bessel electrical filter icon, and the parameters dialog window

appears. Type 5 in the Number of Poles field. Type 8 in the - 3dB Bandwidthfield. Click on OK to close the window.

9. Click on the red output connector of the last optical in-line amplifier in the design area.

Holding the mouse button down, drag the cursor over to the red input connector of the raised cosine optical filter component and release. A red link should now appear between the two. Repeat to link the attenuator and the sensitivity optical receiver.

10. Click on the top blue output connector (Z1_Unfiltered) of the sensitivity optical receiver

in the design area. Holding the mouse button down, drag the cursor over to the blue input connector of the Bessel electrical filter component and release.

A blue link should now appear between the two. We have finished; the receiver section should appear like the following figure.

Figure 9. The receiver section

Measurement Components Now we are done with laying out the optical network. We still have to determine what kind of measurements we require. OptSim comes with a vast choice of measurement components, which can be grouped as follows:

• optical probe which produces diagrams such as power, phase, instantaneous frequency, Stokes coordinates and spectrum of the optical signal and allows several post-processing operations such as channel detection and OSNR evaluations

Page 94: 39865643 Optsim Guide

84 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

• electrical scope which produces diagrams such as signal amplitude, eye, histogram on eye and spectrum of the electrical signal and allows several post-processing operations such as peak detection, Q factor and BER estimations

• single optical and electrical spectrum analyzers

• single Q factor and BER estimators

• optical and electrical power meters The results of a simulation are recorded and displayed by measurement components, which are the most important components to setup for a simulation.

In our example, we will place optical spectrum analyzers at the output of each EDFA, and several other measurements for the signals inside the receiver.

To draw the measurement components

1. Click on the Optical Spectrum Analyzer (OSA) component in the component palette

and click to the right and slightly above the first EDFA (booster) of the optical link section.

2. Double click on the OSA icon, the parameters dialog window appears. Type OSA

transmitter in the Name field. Click on OK to close the window.

3. Connect the EDFA component and the OSA component with an optical link. Note that this is a dotted line – this signifies a monitoring connection, not a transmission connection.

4. Repeat the above three steps to connect:

− an OSA named OSA first span to the second EDFA (in-line EDFA1) of the optical link section

− an OSA named OSA second span to the third EDFA (in-line EDFA2) of the optical link section

− an OSA named OSA third span to the fourth EDFA (in-line EDFA3) of the optical link section

− an OSA named OSA optical filter to the raised cosine optical filter component in the receiver section

5. Click on the Electrical Spectrum Analyzer (ESA) component in the component palette

and click to the right and slightly above the sensitivity optical receiver of the receiver section.

6. Double click on the ESA icon, the parameters dialog window appears. Click on OK to

close the window and accept the default parameters.

7. Connect the first output (Z1_Unfiltered) connector of the sensitivity receiver and the ESA component with an electrical link. Again, this line will be dotted since it is a monitoring link, not a transmission link.

8. Click on the Electrical Scope component in the component palette and click on the right

of the electrical filter of the receiver section.

9. Double click on the scope icon, and the parameters dialog window appears. Click on

OK to close the window and accept the default parameters.

10. Connect the filter component and the scope component with an electrical link.

You have finished! The project should look like the following.

Page 95: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 85

Figure 10. The project network

In order to save the project, click on the Save button in the tool bar of the editor window or select the menu command File > Save.

2.2.6 Simulation

Simulation Run Dialog Window: Setting up a Single Simulation Run First we describe how to set up a single scan simulation of a sample mode project and then we shall come back and simulate the project we just laid out.

Clicking on the Go button (or choose the menu comman Run > Go) and the simulation win dow will open up as shown below:

Page 96: 39865643 Optsim Guide

86 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

User selects appropriate Simulation Method, VBS Simulation Option (in case of a VBS simulation), and inclusion or exclusion of Optical Noise and Electrical Noise from the Run Options of the simulation window. The parameters under the Time Domain, Frequency Domain, and Simulation Accuracy groups are similar to those described earlier in the Sample Mode Simulation Parameters section.

The user can also access to the online help from within the Simulation Run Dialog window via the Help button.

The Global Symbols for a project can be added, modified or deleted via its tab. The dialog window is shown below with several parameters defined for illustration:

Page 97: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 87

Now, coming back to our original project, the project has now been fully described and is ready to be simulated! We can choose one of the OptSim simulation strategies. Let’s start from the SPT simulation.

To start the simulation

1. Click on the Go button (or choose the menu command Run > Go). The Simulation Run Dialog will open:

Page 98: 39865643 Optsim Guide

88 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

For Simulation Method, select “Spectral Propagation (SPT)”. Then click the Start Single Run button. The OptSim numerical engine for an SPT simulation will be launched, and a small window will inform you of the status of the simulation. SPT usually runs very quickly, typically in a few seconds.

Page 99: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 89

Figure 11. The simulation status window

You can access SPT results by right clicking on any optical link and then selecting in the popup menu the View Power Spectrum Chart command.

For realistic fiber components you can view the input or output signal spectrum by right clicking and selecting the View Power Spectrum Chart option.

You should remember that SPT results are displayed as power spectral densities and that you can integrate them over a given resolution bandwidth, just as any laboratory OSA would do. You can change the integration bandwidth directly in the measurement dialog window.

SPT is basically meant for complex WDM systems. In this first, simple example, it could be useful to run it anyway in order to check if the power spectrum looks as expected at different points in the network. For example, the spectrum at the input of the receiver optical filter is made up of a line at the laser frequency and a noise floor generated by the EDFA noise.

To view the spectrum chart

1. Right-click the optical link between the optical filter in the receiver section and the last EDFA of the optical link section. Choose the View Power Spectrum Chart command. A measurement window appears with the power spectral density of the optical signal (Figure 12).

2. In the Parameters section of the Measurements tab open the Type list of the Filter option and choose Rectangular. Open the list on the right of the Resolution field and select nm, type 0.1 in the field and click on the Set button on the right.

3. In the Search Peaks group click on the Next button. In the measurement area of

the window are printed the channel frequency and the average peak power.

Figure 12. The power spectrum chart after the last EDFA

To obtain the OSNR

1. In the Measurement section of the window click on the OSNR and Channel tab.

Page 100: 39865643 Optsim Guide

90 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

2. Click on the Show/Hide OSNR Diagram option. A right axis appears on the chart and the OSNR value of the channel is plotted on the diagram.

3. Click on the Evaluate OSNR on channels button, the peak power and the OSNR value of the channel are printed in the measurement area of the window.

Figure 13. The OSNR after the last EDFA

As expected, we have a single line with a 6 dBm average power. The measured OSNR is 46.67 dB on a 0.1 nm bandwidth, a value that would likely give a good performance at the receiver. We remind you that, if no other impairments are present, an OSNR greater than 12 should be sufficient to have BER<10-9 at 10 Gbit/s.

Close the window choosing the menu command File > Exit.

2.2.7 VBS Simulation Now we are ready to start a VBS simulation. In order to save computational time in case errors have been made in creating the project, you should consider running VBS while modeling all fibers in the project incrementally:

• first, as loss elements without any other impairments (non-linearity, dispersion, polarization effects, etc)

• then, as loss and dispersive elements, neglecting non-linearities

• finally as full models, considering all linear and non-linear effects As a rule of thumb, you should realize that if a system simulated with a simplified model gives poor performance (closed eye, low BER) it would probably not work all for the more realistic models. This is particularly true for standard NRZ systems.

Let’s suppose an R&D engineer wants to design an optical link and the output power for each channel needs to be optimized. This might involve performing a sequence of simulations varying the power from 4 to 14 dBm, in 1 dB steps. This would require running 11 simulations. Note: OptSim can launch multiple runs automatically, as we will show shortly in the next section. If the link is very complex, a full model VBS simulation could be extremely time consuming.

Page 101: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 91

Instead, you can simulate using a simplified model, and begin to exclude levels that yield poor performance at the receiver. Then you can run a more detailed simulation on a reduced set of parameters.

Note An exception to this general rule is the simulation of soliton systems, which take advantage of the combined effects of dispersion and non-linearity We advise you to investigate this example (getting_started_1.opf) running the different simulation strategies.

To start a VBS simulation

1. Click on the Go button (or choose the menu command Run > Go). The Simulation Run Dialog will open:

Figure 14. The VBS simulation run dialog window

2. You can choose between the three VBS simulation techniques:

− VBS Loss Only Fiber, where fibers are simulated taking into account their attenuation only

− VBS Linear Fiber, where a complete linear fiber model is implemented (the non-linear effects are neglected)

− VBS Full, where a complete fiber model is considered (linear and non-linear effects)

Select the VBS Full option.

3. Click the Start Single Run button to launch the simulation.

Page 102: 39865643 Optsim Guide

92 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

For each of these three simulation techniques, a small window will inform you of the status of the simulation. The following information is given:

• the percentage of CPU simulation time already executed with respect to the total expected CPU time

• which section of the design is currently being processed and the total number of sections

Figure 15. The simulation status window for a VBS simulation

2.2.8 Using the Data Display At the end of a VBS simulation, the results are ready to be displayed. To display them you may alternatively:

• start the OptSim data display environment clicking on the View Results button in the editor window tool bar

• right-click any of the measurement components and choose your view from the popup list, for example Eye Diagram

Some measurement components may have the command View Data on their popup menu. This command opens a text window displaying numerical results. Examples of these measurement components are the Q estimator, the BER estimator and the optical power meter.

For a fiber span, you can also get the Raman amplification chart by right-clicking the fiber span and selecting the View Chart command. This command is present only if, before running the simulation, you have selected the Raman Gain and Noise Spectra Plots option in the Raman Amplifier section of the fiber parameters dialog window.

Also the OptSim components with frequency-dependent transfer functions such as filters and amplifiers may display graphical simulation results.

Starting the Tool To start the Data Display tool

1. Click on the View Results button in the tool bar of the OptSim editor window. The measurement list window appears (Figure 16).

The measurement list window presents all the simulation results in a hierarchical tree structure, called also measurement tree, for one or more OptSim projects. The first level of the structure is the project (getting_started_1).

To expand the sub-levels

1. Expand the project level clicking the on the icon of the getting_started_1 node or double clicking the node.

Page 103: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 93

Now the tree presents all the measurement components drawn in the schematic.

2. Expand the electrical scope measurement component. It will be listed all the diagrams that component can display.

Figure 16. The measurement list window

Displaying a Diagram We want to display the eye diagram in a measurement window.

To display a diagram

1. Right click the Eye Diagram icon and choose the popup menu command Open. A measurement window appears displaying the electrical eye diagram (Figure 17).

Note You can also open a diagram directly from the editor window schematic, right clicking the measurement component and choosing the desired chart from the popup menu

For example to open the eye diagram you can right click the electrical scope and choose Eye Diagram. This command opens the measurement list window and the measurement window displaying the chosen diagram.

Page 104: 39865643 Optsim Guide

94 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 17. The Eye diagram

In the eye diagram you can evaluate the Q factor, the BER and the eye opening, at the optimum conditions (optimum sampling instant and/or optimum decision threshold) or at given conditions (set with the markers).

To evaluate the Q and the eye opening

1. In the Measurement section of the measurement window make sure that Optimum option is set in the Sampling Instant and Decision Threshold lists.

2. Click on the Q factor button. The optimum sampling time value, the optimum decision threshold value and the Q factor value will be displayed in the measurement area.

3. Click on the Eye Opening button. The optimum sampling time value, the optimum decision threshold value, the closure value, the opening value and the average opening value will be displayed in the measurement area.

Let’s try to display the optical spectrum of the transmitter section. Go back to the measurement list window.

To display the optical spectrum

1. Expand the OSA_optical_filter measurement component. It contains only the optical spectrum diagram (using the optical probe you can get more diagrams).

Page 105: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 95

2. Right click the Optical Spectrum icon of the OSA_optical_filter component and choose the popup menu command Open. A new measurement window appears displaying the optical spectrum diagram (Figure 18).

Figure 18. The optical power spectrum on the OSA of the receiver section

Superimposing a Diagram The diagrams may be superimposed. We can superimpose the optical spectrum diagrams at the beginning of the link section (after the first EDFA) to the current optical spectrum.

Go back to the measurement list window and expand the OSA_transmitter node.

To superimpose a diagram

1. In the measurement list window right click the Optical Spectrum icon of the OSA_transmitter component and choose the popup menu command Superimpose. A new curve is superimposed in the opened window displaying the optical spectrum diagram (Figure 19).

Page 106: 39865643 Optsim Guide

96 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 19. Two superimposed optical spectra

Close all the measurement windows choosing the menu command File > Exit in one of them and close the measurement list window choosing the same menu command.

2.3 Overview of other OptSim Features We will now briefly review some other, powerful OptSim features. This section is meant as an introduction, and a detailed description can be found elsewhere in this manual. We will see:

• how to make parametric runs, i.e. how to create parameter variables set multiple values and make a simulation that sweeps all these values

• how to iterate recurrent components like the three fiber optics in the link section

• how to group component in a single compound component and set its component parameters

• how to get correlation diagrams from the data display tool

2.3.1 Setting up Parameter Scans Let’s start by introducing a feature called parameter scans. This technique permits a sequence of simulations, which differ only in the numerical values of certain parameters. The idea is to define some variables instead of some component parameters, define their values in a table and then start the simulation that sweeps these values.

Before proceed create another directory under the Projects directory, for example create the directory Gs2.

Page 107: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 97

Gs2 New Project

\OptSim\Projects

Windows Systems

Workingfolder

user_directory

UNIX Systems

WorkingdirectoryProjectsGs1 Old Project

Gs2 New Project

Gs1 Old Project

Now save the current project (getting_started_1.opf) under the new project directory.

To copy the project 1. In the OptSim editor window choose the menu command File > Save as. A file selection

dialog window appears.

2. Choose the new project directory and type another project file name, for example getting_started_2. Click on OK.

If you want to skip the steps of setting up the system schematic and parameter values, described in this section, you may copy the project example to your working directory and open the local copy of the project file. The example is named getting_started_2.opf and is contained in the directory ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_2\.

The getting_started_2.opf example is identical to the previous one except that we want to measure the receiver performance while changing the value of the optical attenuation in front of the photodiode.

Simulation Variables Whenever you want to use a variable for a component parameter instead of a fixed numerical value, first create the variable in the Global Symbols window and then use it in the component parameter dialog window.

Another way is to simply type a variable name in the component parameter dialog window. You will be asked if you want to open the symbol table editor for creating this variable. When the variable is defined, it will appear in the component parameter window with its default value.

In our example we have substituted the value for Attenuation with the symbolic variable name RX_atten in the optical attenuator.

To set up the simulation variable

1. Click on the Symbols button in the in the tool bar of the OptSim editor window.

The Global Symbols list window appears as shown below.

Page 108: 39865643 Optsim Guide

98 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

2. Click the Add button and type in the new parameter RX_atten with a default value of 0 and click OK. Your new parameter should now appear in the list. Click OK to close the Global Symbols window.

3. Open the properties of the optical attenuator by double clicking the icon. Type the string RX_atten in Attenuation [dB] and click on OK. We have now be able to vary the attenuation through a parameter scan.

Multiple Runs Before running the simulation, we need to assign values to RX_atten, and this can be done through the Scan Setup dialog window (Figure 20). This window is a spreadsheet where you can assign the values to all simulation variables present in the project.

Page 109: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 99

To define multiple runs

1. Choose the menu command Run > Setup Scan. The Scan Setup dialog window appears (the table has only one column in this case).

2. Click the Add Column button until you have a total of 11 runs. Type 23 in the first row then press enter. Fill in all the other data (from 24 through 33) in a likewise manner and then click on the OK button.

Figure 20a. The Scan Setup dialog window

The Setup Linear Scan button at the top opens a dialog that allows the user to easily setup multidimensional linear scans. Figure 20b shows an example of how this dialog could be used to setup the scan table shown in Figure 20a. As can be

Page 110: 39865643 Optsim Guide

100 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

seen from the dialog, the user simple needs to specify the Starting Value, End Value and Increment. Each parameter specified in the table must be unique. The “Number of Runs” field at the top of the dialog indicates the total number of runs for the current multidimensional linear scan. The “Add” button adds a new parameter to the set of parameters to be scanned. The “Move Up” and “Move Down” buttons move the selected parameter up and down respectively. The “Delete” button deletes the selected table row. The “Apply” and “OK” button immediately updates the Scan Setup Dialog, the difference being that the latter also dismisses the dialog. Scan Depth 0 corresponds to Param1, Scan Depth 1 corresponds to Param2 and so on and so forth. That is, Scan Depth N corresponds to ParamN+1 in the Scan Setup Dialog, where N is a positive integer.

Figure 20b. Multidimensional Linear Scan Setup dialog window

In order to save the project, click on the Save button in the tool bar of the editor window or select the menu command File > Save.

Parameter Scan Dialog Window Click on the Scan button (or Run > Scan Variable… from the menu) and a dialog window as shown below will open up:

Page 111: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 101

Like the Simulation Run Dialog Window we discussed earlier, the user here makes choices of appropriate Simulation Method, VBS Simulation Option, and inclusion or exclusion of Optical Noise and Electrical Noise. The parameters under the Time Domain, Frequency Domain, and Simulation Accuracy groups are similar to those described earlier in the Sample Mode Simulation Parameters section.

The user can also access to the Symbols used, Scan Parameters defined and the online Help from their respective buttons from within the Parameter Scan Dialog window.

The Global Symbols for a project can be added, modified or deleted via its tab. The dialog window is shown below with several parameters defined for illustration:

Page 112: 39865643 Optsim Guide

102 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Running the Simulation Whenever variables with multiple values are present in a project, the simulation (SPT or VBS) is run over all possible values. OptSim does this automatically for you, and has some built-in strategies that reduce the simulation time as much as possible. In our project for example, the existence of the variable only affects the simulation beginning with the attenuator and after the optical link. In this case, OptSim runs a simulation from the transmitter to the output of the optical link once, and then repeats the receiver section several times changing the attenuation value. This approach is much more efficient than running the complete simulation several times on the entire project.

To start a VBS simulation

1. Click on the Scan button in the tool bar, then click Start: Parameter Scan. By

default it will launch the last VBS simulation technique selected in the VBS simulation options dialog window (it was a VBS Full simulation technique).

Viewing the Results At the end of simulation let’s see how OptSim gathers the results.

Page 113: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 103

To display the results 1. Right click the electrical probe in the receiver section and select the popup menu command Eye

Diagram. This launch the data display tool, the measurement list window and the measurement window displaying the electrical eye appear.

2. Now the Runs list on the right of measurement window diagram displays the 11 runs. Click on the number of the list to display the corresponding eye.

Now switch to the electrical spectrum diagram clicking on the Electrical Spectrumbutton in the measurement window tool bar.

To superimpose the diagrams 1. Click on the run number 1.

2. Hold down the <Ctrl> key and click on the run number 6 and then on 11.

To see all the charts adjust the range of the Y axis.

To change the range of the Y axis 1. Right click the Y axis and choose the popup menu command Axis Properties or choose the

menu command View > Y1 Axis Properties. The Y1 Axis Properties dialog window appears.

2. Select the Auto scaling option then click on OK.

You can also remove a superimposed curve from a diagram (you cannot remove the last curve displayed in the diagram).

To remove a superimposed curve from a diagram 1. Select the curve clicking on the curve itself or clicking the name in the legend window.

2. Choose the menu command Edit > Cut or click on the Cut button in the tool bar.

Please note that now in the measurement list window the runs are listed on each diagram node.

Close the measurement window choosing the menu command File > Exit and close the measurement list window choosing the same menu command.

2.3.2 Iterated Components Another important feature is the use of the iteration function when you need to draw links that are intrinsically periodic. You will save time in these situations by creating a single period of the link—having a single optical input and a single optical output—and iterating it a number of times.

Before proceed create another directory under the Projects directory, for example create the directory Gs3.

Page 114: 39865643 Optsim Guide

104 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Gs2 Old Project

\OptSim\Projects

Windows Systems

Workingfolder

user_directory

UNIX Systems

WorkingdirectoryProjectsGs1 Old Project

Gs2 Old Project

Gs1 Old Project

Gs3 New Project

Gs3 New Project

Now save the current project (getting_started_2.opf) under the new project directory.

To copy the project

1. In the OptSim editor window choose the menu command File > Save as. A file selection dialog window appears.

2. Choose the new project directory and type another project file name, for example getting_started_3. Click on OK.

If you want to skip the steps of setting up the system schematic and parameter values, described in this section, you may copy the project example to your working directory and open the local copy of the project file. The example is named getting_started_3.opf and is contained in the directory ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_3\.

The getting_started_3.opf example is identical to the previous one except the optical link section has been reduced to simpler structure where the amplifier, fiber and OSA are grouped in an iteration area and repeated three times.

Drawing Iterated Components To make iterated components

1. Click on the OptSim Iteration Loop component in the vertical toolbar left of the

design area and place it in the design area next to your optical link section.

Page 115: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 105

2. Select the first set of fiber, amplifier and OSA by highlighting them, then select Edit -> Copy from the menu bar.

4. Right click the OptSim Iteration Loop component and select “look inside”. You will see an input and an output port of the iteration loop. Select Edit -> Paste from the menu bar to paste you three components inside the loop. Your iteration loop should now look like this:

5. To connect the input port to the fiber, hold down the Ctrl key on your keyboard, then click on the input port. Drag the cursor over to the input connector on the fiber component and release. To connect the EDFA to the output port, simply click on the output connector of the EDFA, drag the cursor over to the output port and release (No Ctrl key necessary). Your iteration loop is now ready:

6. To close the iteration loop window, select File -> Close in the menu bar. There is no need to save the iteration as a separate file, it will be saved automatically with your main project file.

7. Now select your three fibers, in-line EDFAs and corresponding OSAs from your main layout and delete them by selecting Edit -> Delete in the menu bar. To replace these components, connect the output of the booster to the input of the Iteration Loop component and the output of the Iteration Loop component to the optical filter in the receiver section. Your entire layout will now look like this:

Page 116: 39865643 Optsim Guide

106 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 21. The project with the iterated optical link section

8. To change the number of iterations, right click the Iteration Loop component and choose the popup menu command Properties. Under the General tab in the Iteration Properties dialog window, type 3 in the NumReps field and click on OK.

In order to save the project, click on the Save button in the tool bar of the editor window or select the menu command File > Save.

Running the Simulation

1. Click on the Scan button in the tool bar, then click Start: Parameter Scan. By

default it will launch the last VBS simulation technique selected in the VBS simulation options dialog window (it was a VBS Full simulation technique).

Viewing the Results When viewing the output of an iterated optical link or of an iterated measurement component, a dialog window prompts you to enter which period of the iteration you wish to view. Let’s see the optical spectrum of the OSA measurement component.

To display the results

1. Select the menu command View Results. The OptSim Data Display dialog window appears. Please note that in the project tree there is now the iterated component. If you expand this node you can see the single spans. Inside these spans you can find the iterated measurement components.

2. Now the Spans list on the right of measurement window diagram displays the 3 spans of the iteration. Click on the number of the list to display the corresponding spectrum.

You may superimpose spectra of different spans in the same way we did in the previous section for the runs. You may not select multiple spans and multiple runs at the same time.

To superimpose the diagrams

1. Click on the span number 1.

Page 117: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 107

2. Hold down the <Ctrl> key and click on the span number 3.

Close the measurement window choosing the menu command File > Exit and close the measurement list window choosing the same menu command.

2.3.3 Compound Components Another feature we want to introduce in this chapter is the use of compound components. Very often an optical system (e.g., a complex WDM link), is composed of a large number of components, and creating all of them separately would be a tedious, error-prone procedure.

In many cases, a significant portion of the design can be created out of subsystems of identical structure but different numerical parameters. For example, each of the transmitters of a WDM system could have a structure identical to the one described in the transmitter section of the project \ (getting_started_1.opf project) but could have different central frequencies.

In this situation, compound components are very useful. You can think a compound component as a subsystem, with any number of inputs and outputs (optical, electrical or logical) and a set of free parameters. The compound component can then be placed in an OptSim project in a way identical to a standard component.

Before proceeding, create another directory under the Projects directory, for example create the directory Gs4.

Gs2 Old Project

\OptSim\Projects

Windows Systems

Workingfolder

user_directory

UNIX Systems

WorkingdirectoryProjectsGs1 Old Project

Gs2 Old Project

Gs1 Old Project

Gs3 Old Project

Gs3 Old ProjectGs4 New Project

Gs4 New Project

Now leave the current project (getting_started_3.opf), open the Gs2\getting_started_2.opf project and save it under the new project directory.

To copy the project

1. In the OptSim editor window choose the menu command File > Open or click on the Open button in the tool bar. The file selection dialog window appears.

2. Select the Projects/Gs2 project directory and the getting_started_2 project file. Click on the OK. A new OptSim editor window appears displaying the project.

3. Choose the menu command File > Save as. A file selection dialog window appears.

Page 118: 39865643 Optsim Guide

108 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

4. Choose the new project directory (Gs4) and type another project file name, for example getting_started_4. Click on OK.

If you want to skip the steps of setting up the system schematic and parameter values, described in this section, you may copy the project example to your working directory and open the local copy of the project file. The example is named getting_started_4.opf and is contained in the directory ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_4\.

The getting_started_4.opf example is identical to the getting_started_2.opf example except that the transmitter, link and receiver sections are grouped into compound components. You can see how much simpler the project looks employing this feature.

By familiarizing yourself with this example and the one described in previously, you will see how compound components can be useful to:

• simplify the appearance of the project in the design area

• create a personal library of specific, re-useable components/subsystems Compound components have some advanced options that will be described in a later section. For example, they can be protected with a password so that they can be used inside a simulation but cannot be opened. In this way, a company may create a library of OptSim models for its own components and protect the components with passwords. Then they can provide them to customers who may use them in a simulation, without having access to either the structure or the parameter values.

The Compound Component for the Transmitter Section We want to turn the transmitter section into a compound component. This section has only a single output: the optical link to the link section. Furthermore we decide to set two compound component parameters: the central frequency and the output power of the laser.

To create a compound component

1. Select the four components of the transmitter section: with the mouse, drag an area that covers the data source, the laser, the driver, the modulator and all the links between them (alternatively you can select all these elements holding down the <Shift> key on the keyboard).

2. Click the button Inline Hierarchy on the menu bar. The four components of the

transmitter section will now collapse into one compound component.

3. Right click the compound component and select Look Inside. You will now see the four components of your transmitter connected to an output port:

4. Right click the laser component and select properties from the popup menu. In the Laser center emission frequency field, type a variable name, for example Ch_frequency. Click Apply. A warning symbol will appear:

Page 119: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 109

Click Yes in the warning window to define the new symbol Ch_frequency. The parameter list for the compound component will open. It is currently empty. Click Add to add a new parameter, then type Ch_frequency in the name field and 193.1 in the value field. Click OK to close the window. The parameter Ch_frequency will now appear in the Laser center emission frequency field.

5. In the CW power field, type another variable name, for example Ch_power. Click Apply. Repeat step 4 to define the new symbol Ch_power in the parameter list, with a default value of 5. When finished, click on OK to close the laser properties window.

6. Select File -> Save As and save the transmitter in the same directory as the main project under the name Transmitter. Close the window by using File -> Close.

7. Right click on the compound component (which will now appear under the name Transmitter) and select “set icon”. You will now browse through the predefined icons of OptSim. Select the file tx1.svg for the transmitter.

8. You have finished creating your first compound component! Your whole transmission section is now a single component:

The Compound Component for the Link Section The optical link section has only one optical input, and one optical output. We will set also two compound component parameters (the fixed output power of the EDFAs and the dispersion of the fiber links).

To create a compound component

Page 120: 39865643 Optsim Guide

110 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

1. Select the components of the link section: with the mouse drag an area that covers the four EDFAs, the three fibers and the four optical spectrum analyzers (alternatively you can select all these elements holding down the <Shift> key on the keyboard).

2. Click the button Inline Hierarchy on the menu bar. The eleven components of the

link section will now collapse into one compound component.

3. Right click the compound component and select Look Inside. You will now see the eleven components of your link section connected to an input port and an output port:

4. Right click the first EDFA component and select Properties from the popup menu. In the Output Power (dBm) field, type a variable name, for example EDFA_pow_output. Click Apply and the warning window about defining variables will appear. Click Yes in the warning window to define the new symbol EDFA_pow_output. The parameter list for the compound component will open. It is currently empty. Click Add to add a new parameter, then type EDFA_pow_output in the name field and 6 in the value field. Click OK to close the window. The parameter EDFA_pow_output will now appear in the Output Power (dBm) field. Click OK to close the EDFA properties window. Repeat for the three remaining EDFAs using the same variable EDFA_pow_output, which has already been defined.

5. Now right click the first fiber component and select Properties from the popup menu. Under the Dispersion tab, in the Dispersion at Reference Frequency (ps/nm/km) field, type another variable name, for example Dispersion. Click Apply. Repeat step 4 to define the new symbol Dispersion in the parameter list, with a default value of 6.42. When finished, click on OK to close the fiber properties window. Repeat for the two other fiber components using the same variable Dispersion previously defined.

6. Select File -> Save As and save the link compound component in the same directory as the main project under the name Link. Close the window by using File -> Close.

7. Right click on the compound component (which will now appear under the name Link) and select “set icon”. You will now browse through the predefined icons of OptSim. Select the file fiber.svg for the transmitter. Your whole link section is now a single component, represented by a fiber icon.

Page 121: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 111

The Compound Component for the Receiver Section The receiver section will have an optical input, an optical output (for the last OSA) and two electrical outputs (for the other measurement components). The free parameters for the receiver section will be the central frequency of the optical filter and the attenuation of the optical attenuator.

To create a compound component

1. Select the components of the receiver section: with the mouse drag an area that covers all the remaining components except the measurement components (alternatively you can select all these elements holding down the <Shift> key on the keyboard).

2. Click the button Inline Hierarchy on the menu bar. The three components of the

receiver section will now collapse into one compound component.

3. Right click the compound component and select Look Inside. You will now see the three components of your link section connected to an optical input port, an optical output port and two electrical output ports.

Figure 22. The compound component schematic of the receiver section

To define the compound component parameters

1. Double click on the optical filter icon, the parameters dialog window appears.

2. Type Ch_frequency in the Center Frequency (THz) field. Then define a new variable Ch_frequency with default value 193.1. When the parameter definition is done, click on OK to close the filter properties window.

3. Double click on the attenuator icon, the parameters dialog window appears.

4. Type RX_atten in the Attenuation (dB) field. Then define a new variable RX_atten with default value 25. When the parameter definition is done, click on OK to close the filter properties window.

5. Select File -> Save As and save the receiver compound component in the same directory as the main project under the name Receiver. Close the window by using File -> Close.

6. Right click on the compound component (which will now appear under the name Receiver) and select “set icon”. You will now browse through the predefined icons of OptSim. Select the file rx1.svg for the transmitter. Your whole receiver section is now a single component, represented by a fiber icon.

Page 122: 39865643 Optsim Guide

112 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 23. The project with the compound components

In order to save the project, click on the Save button in the tool bar of the editor window or select the menu command File > Save.

Running the Simulation To start a VBS simulation

Click on the Go button (or choose the menu command Run > Go). The Simulation Run Dialog will open: Click the Start Single Run button to launch the simulation.

Viewing the Results Let’s start the data display tool to see how the measurement tree has changed.

To start the Data Display tool 1. Click on the View Results button in the tool bar of the OptSim editor window. The

measurement list window appears.

2. Expand the project level clicking the on the icon of the getting_started_4 node or double clicking the node.

Now the tree structure has a compound component and if you expand this node you can see the four optical spectrum analyzers defined inside the component.

Exit the data display tool choosing the menu command File > Exit in the measurement list window.

2.3.4 Correlation Diagrams With the data display tool you can also correlate a single measurement with the run number, a variable value or another single measurement to produce a single curve or a family of curves.

Single measurements are obtained from the Q, BER, power meters and sensitivity receiver measurement components. These components appear in the tree of the measurement list window only if parametric runs have been executed.

In the example of this section we will get three correlation diagrams (at the receiver section):

Page 123: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 113

• the trend of the electrical power versus the increasing of the attenuation value (RX_atten variable)

• the Q value function of the RX_atten variable (attenuation value)

• the correlation between the Q value and the electrical power using as common parameter the RX_atten variable value

• the family of curves showing the correlation between the Q value and the electrical power using as family parameter a new variable value set to sweep the laser power

Before proceeding, create another directory under the Projects directory, for example create the directory Gs5.

Gs2 Old Project

\OptSim\Projects

Windows Systems

Workingfolder

user_directory

UNIX Systems

WorkingdirectoryProjectsGs1 Old Project

Gs2 Old Project

Gs1 Old Project

Gs3 Old Project

Gs3 Old ProjectGs4 Old Project

Gs4 Old ProjectGs5 New Project

Gs5 New Project

Now leave the current project (getting_started_4.opf), open the Gs3\getting_started_3.opf project and save it under the new project directory.

To copy the project

1. In the OptSim editor window, choose the menu command File > Open or click on the Open button in the tool bar. The file selection dialog window appears.

2. Select the Projects/Gs3 project directory and the getting_started_3 project file. Click on the OK. A new OptSim editor window appears displaying the project.

3. Choose the menu command File > Save as. A file selection dialog window appears.

4. Choose the new project directory (Gs5) and type another project file name, for example getting_started_5. Click on OK.

If you want to skip the steps of setting up the system schematic and parameter values, described in this section, you may copy the project example to your working directory and open the local copy of the project file. The example is named getting_started_5.opf and is contained in the directory ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_5\.

The getting_started_5.opf example is identical to the getting_started_3.opf example except that in the receiver section two more measurement components have been added. These components collect the data for the single measurements to correlate.

To add the new components

1. Click on the Electrical Power Meter component in the component palette and drag

and drop it above the electrical scope measurement component.

Page 124: 39865643 Optsim Guide

114 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

2. Click on the Q estimator component in the component palette and drag and drop it

below the electrical scope measurement component.

3. Double click on the power meter icon, the parameters dialog window appears. Type Pout in the Model Instance Name field under the Naming tab. Click on OKto close the window.

4. Double click on the Q estimator icon, the parameters dialog window appears. Type

Qout in the in the Model Instance Name field under the Naming tab. Click on OK to close the window.

5. Now click on the electrical output connector of the Bessel electrical filter and connect it with the two new measurement components: power meter, and Q estimator.

Now the electrical part of the receiver section should look like the following.

In order to save the project, click on the Save button in the tool bar of the editor window or select the menu command File > Save.

Running the Simulation To start a VBS simulation

Click on the Scan button in the tool bar, then click Start: Parameter Scan.

Vieing the Results Let’s start the data display tool to see how the measurement tree has changed.

To start the Data Display tool

1. Click on the View Results button in the tool bar of the OptSim editor window. The measurement list window appears.

Expand the project level clicking the on the icon of the getting_started_5 node or double clicking the node.

Now the tree structure has two more measurement components and if you expand this node you can see the single measurements they produce.

Page 125: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 115

Measurement versus Run Number Let’s display the first correlation diagram, a single measurement (the electrical power) versus the run number. We know that the RX_atten variable value increases with the run number so this correlated diagram will show the trend of the electrical power with the increasing of the attenuation value.

To correlate a Measurement with the Run Number

1. In the measurement list window select the Electrical Power diagram icon of the Pout power meter measurement component. This measurement will be put in the diagram’s Y-axis.

2. In the OptSim Data Display, Choose the menu command Tools > Correlate diagram or click on the Correlate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard (Figure 24).

Figure 24. The Correlation Diagram Setting wizard – Step 1

3. Step 1 - Type the diagram title in the Title field, for example type Electrical Power vs. run. In the Graph kind group choose Curve. Click on Next.

Page 126: 39865643 Optsim Guide

116 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 25. The Correlation Diagram Setting wizard – Step 2

4. Step 2 – In the tree on the left select Run number. Click on Finish. The following XY diagram appears.

Figure 26. The measurement versus run number correlate diagram

Page 127: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 117

We see from the diagram above that runs 6 through 11 are not significant for the power value and they can be removed. We will remove them later on when we get the family curves correlate diagram.

Measurement versus Variable The second diagram shows the existing function between a single measurement (the Q value) and a variable value (RX_atten).

To correlate a Measurement with a Variable

1. In the measurement list window select the Q Value diagram icon of the Qout Q estimator component. This measurement will be put in the diagram’s Y-axis.

2. Choose the menu command Tools > Correlate diagram or click on theCorrelate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard (Figure 24).

3. Step 1 - Type the diagram title in the Title field for example type Q vs. RX_atten. In the Graph kind group choose Curve. Click on Next.

4. Step 2 – In the tree on the left expand the project level clicking the on the icon of the Variables node and select the RX_atten variable. Click on Finish. The following XY diagram appears.

Figure 27. The measurement versus variable correlate diagram

Measurement versus Measurement (common parameter Variable) The third diagram correlates two measurements (Q value and electrical power) using as common parameter a variable value (RX_atten).

To correlate Measurements (common parameter: Variable)

Page 128: 39865643 Optsim Guide

118 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

1. In the measurement list window select the Q Value diagram icon of the Qout Q estimator component. This measurement will be put in the diagram’s Y-axis.

2. Choose the menu command Tools > Correlate diagram or click on the Correlate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard (Figure 24).

3. Step 1 - Type the diagram title in the Title field for example type Q vs. Electrical Power. In the Graph kind group choose Curve. Click on Next.

4. Step 2 – In the tree on the left expand the electrical power meter clicking the on the icon of the Pout node and select the Electrical Power diagram icon. This measurement will be put in the diagram’s X-axis. Click on Next.

Figure 28. The Correlation Diagram Setting wizard – Step 3

5. Step 3 - In the tree on the left expand the variables level clicking the on the icon of the Variables node and select the RX_atten variable. Click on Finish. The following XY diagram appears.

Page 129: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 119

Figure 29. The measurement versus measurement correlate diagram

Close the measurement window choosing the menu command File > Exit and close the measurement list window choosing the same menu command.

Measurement versus Measurement (family parameter Variable) The last diagram shows a family of curves that correlate two measurements (Q value and electrical power) using a variable value as family parameter.

We choose to define a new variable named Pin for the laser power and set 5 values from 3 dBm to 7 dBm. For each value we sweep the RX_atten variable values. We choose also to reduce to 5 the RX_atten values (the first 5 values) to reduce the number of simulation runs. We will have globally 25 simulation runs.

The variable chosen as family parameter determines the number of curves (one curve each value). So in our example we will have 5 curves.

To set up the simulation variable

1. Double click on the laser icon, and the parameters dialog window appears.

2. Type the string Pin in CW power (dBm) and click on OK. Click on Yes in the warning message window to define this variable with a default value of 3 dBm in the global symbols window.

3. When the variable is defined, click on OK to close the fiber properties window.

Now we need to assign values to the two variables RX_atten and Pin through the Run definition dialog window.

To define multiple runs

1. Choose the menu command Run > Setup Scan. The Scan Setup dialog window appears (the table has only one column in this case).

Page 130: 39865643 Optsim Guide

120 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

2. Click the Append Row button until you have a total of 25 runs. Click the Add Column button to create a column for the new variable Pin. In the first row, type the value 23 for R and 3 for Pin then press enter. Fill in all the other data in a likewise manner to recreate the table below, then click on the OK button to close the scan setup window.

In order to save the project, click on the Save button in the tool bar of the editor window or select the menu command File > Save.

Run the simulation (full VBS) by clicking on the Scan button in the tool bar, then clickStart: Parameter Scan.

Start the data display tool clicking on the View Results button in the tool bar. The measurement list window appears. Expand the project level clicking the on the icon of the getting_started_5 node or double clicking the node.

To correlate Measurements (family: Variable)

1. In the measurement list window select the Q Value diagram icon of the Qout Q estimator component. This measurement will be put in the diagram’s Y-axis.

2. Choose the menu command Tools > Correlate diagram or click on theCorrelate diagram button in the tool bar or choose the popup menu commandCorrelate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard (Figure 24).

3. Step 1 - Type the diagram title in the Title field for example type Q vs. Electrical Power. In the Graph kind group choose Family. Click on Next.

Page 131: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 121

4. Step 2 – In the tree on the left expand the electrical power meter clicking the on the icon of the Pout node and select the Electrical Power diagram icon. This measurement will be put in the diagram’s X-axis. Click on Next.

Figure 30. The Correlation Diagram Setting wizard – Step 4

5. Step 4 - In the tree on the left expand the variables level clicking the on the icon of the Variables node and select the Pin variable. Click on Finish. The following XY diagram appears.

Page 132: 39865643 Optsim Guide

122 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 31. The measurement versus measurement correlate diagram

Close the measurement window choosing the menu command File > Exit and close the measurement list window choosing the same menu command.

2.4 A more Complex Example We will now show a more complex example: simulating a WDM system with eight channels at the OC-192 rate of 9.953 Gbit/s sent over the same link described in the previous examples. The spacing between channels is 50 GHz.

In order to create this project, which is saved in the example directory as getting_started_5.opf, you can use the same compound components created in the previous project. We will not present here a detailed description of the example as well as the step-by-step instructions to draw its schematic, but we invite you to open it and explore its parameters. You should also run different simulation strategies on this project, so as to become further acquainted with the OptSim tool.

Before proceeding, create another directory under the Projects directory, for example create the directory Gs6.

Page 133: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 123

Gs2 Old Project

\OptSim\Projects

Windows Systems

Workingfolder

user_directory

UNIX Systems

WorkingdirectoryProjectsGs1 Old Project

Gs2 Old Project

Gs1 Old Project

Gs3 Old Project

Gs3 Old ProjectGs4 Old Project

Gs4 Old ProjectGs5 Old Project

Gs5 Old ProjectGs6 New Project

Gs6 New Project

To copy the example

1. Copy the project example to your working directory.

In Windows systems copy all the files contained in the folder ProductInstDir\examples\optsim\sample_mode\Getting_started\Getting_started_6\ into the folder ProductInstDir\products\optsim\sample_mode\projects\Gs6.

In UNIX systems type the command: cp ProductInstDir/examples/optsim/sample_mode/Getting_started/Getting_started_6/* HomeDir/Projects/Gs6/

To open the project

1. In the OptSim editor window choose the menu command File > Open or click on the Open button in the tool bar. The file selection dialog window appears.

2. Select the Projects/Gs6 project directory and the getting_started_6 project file. Click on the OK. A new OptSim editor window appears displaying the project.

Compound components are very useful in systems like this one. For example, notice how simple the 8-channel WDM transmitter appears when using multiple getting_started_TX.opm single channel transmitters with variable central frequencies.

Page 134: 39865643 Optsim Guide

124 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 32. The complex example schematic

You can imagine when designing more complex systems than this one, you can create a WDM compound component comprised of 8 channels, and then grouping 8 compound components into one. In this way, you can create very dense WDM systems of 64, 128 or even 256 channels!

At the receiver, we chose to demodulate four out of the eight channels, and measure eye diagrams, spectra and Q-factors on them.

When running the SPT simulation, you may investigate what happens when changing the bandwidth in VBS simulations, by simulating over a bandwidth large enough to accommodate all channels, or just on a subset of channels.

To start the SPT simulation

1. Click on the Go button (or choose the menu command Run > Go). TheSimulation Run Dialog will open.

2. For Simulation Method, select “Spectral Propagation (SPT)”. Then click the Start Single Run button. The OptSim numerical engine for an SPT simulation will be launched, and a small window will inform you of the status of the simulation. SPT usually runs very quickly, typically in a few seconds.

Let’s see the optical power spectrum at the end of the total fiber link, after a SPT simulation.

To view the spectrum chart

1. Right-click the optical link between the optical link compound component and the last optical splitter. Choose the View Power Spectrum Chart command. A measurement window appears with the power spectral density of the optical signal. Note that the channels are equispaced and that the channel power levels are equal.

2. In the Parameters section of the Measurements tab open the Type list of the Filter option and choose Rectangular. Open the list on the right of the Resolution field and select nm, type 0.1 in the field and click on the Set button on the right.

3. Click on the OSNR and Channel tab. Click on the Show/Hide OSNR Diagram option. A third right axis appears on the chart and the OSNR value of the channel is plotted on the diagram. Click on the Evaluate OSNR on channels button, the peak power and the OSNR value of the channel are printed in the measurement area of the window.

Page 135: 39865643 Optsim Guide

OptSim User Guide Chapter 2: Getting Started with Sample Mode Simulations •••• 125

Figure 33. The power spectrum chart at the end of the fiber

Close the window choosing the menu command File > Exit.

To start the VBS simulation

Run the simulation (full VBS) by clicking on the Scan button in the tool bar, then clickStart: Parameter Scan. This simulation is longer than the others made in the previous sections (it could last about 10 minutes).

To evaluate the Q and the eye opening

1. Right click the upper electrical probe in the receiver section and select the popup menu command Eye Diagram. This launches the data display tool, the measurement list window and the measurement window displaying the electrical eye appear.

2. In the Measurement section of the measurement window make sure that Optimum option is set in the Sampling Instant and Decision Threshold lists.

3. Click on the Q factor button. The optimum sampling time value, the optimum decision threshold value and the Q factor value will be displayed in the measurement area.

4. Click on the Eye Opening button. The optimum sampling time value, the optimum decision threshold value, the closure value, the opening value and the average opening value will be displayed in the measurement area.

Page 136: 39865643 Optsim Guide

126 •••• Chapter 2: Getting Started with Sample Mode Simulations OptSim User Guide

Figure 34. Eye diagram for the first demodulated channel

2.5 Conclusions This brief introduction to the OptSim simulation environment is complete. You should now be able to design fairly complex systems and set up your own simulations. In case of problems, you can refer to the rest of the documentation:

• Application Notes and Examples (a separate volume) contains examples using OptSim, which can be a good starting point to get a sense of OptSim capabilities

• This volume of User Guide also contains details on simulation techniques, the OptSim user interface or advanced features, and a chapter on the OptSim Data Post-processing and Display.

• The third part of the manual contains a number of withe papers on the OptSim tool, a frequently asked question section and a rich bibliography section on the OptSim tool

• The OptSim Models Reference contains a complete description of all the building components belonging to the OptSim library, optical, electrical and logical In this section, you can find complete details regarding features, parameters and options for each component

If you have any other questions, please feel free to contact the OptSim technical support at RSoft.

Page 137: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 127

Chapter 3: Sample Mode Simulation Techniques and Features

This chapter explains how OptSim works to simulate a system and which are the main steps to setup a simulation and get the results. Section 3.1 describes the two main simulation techniques while section 3.2 describes strategies to best utilize these simulation techniques in practical situations. Section 3.3 provides information on the parameters controlling simulation and how to tune these parameters to achieve useful results in a finite amount of time. Section 3.4 describes how to setup a system simulation and section 3.5 describes the OptSim unit conventions and representations for signal and other parameter units such as frequency, bandwidth, time, and power. Section 3.6 describes the best fit laser toolkit utility.

3.1 Simulation Techniques Two different simulation techniques are available in OptSim:

• the Spectral Propagation Technique (SPT)

• the Variable Bandwidth Simulation technique (VBS)

OptSimSpectralDomain

TimeDomain

SPT

Optical Spectra andsignal-to-noise ratio(OSNR) evaluation

VBS

Loss Linear Full

Fibe

r los

s on

ly

Line

ar fi

ber e

ffect

s

Line

ar a

nd n

on-

linea

r fib

er e

ffect

s

Figure 1. The OptSim simulation techniques

Page 138: 39865643 Optsim Guide

128 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

3.1.1 Spectral Propagation Technique (SPT) The spectral propagation simulation technique is a spectral domain simulation where optical signals are propagated as power spectra. Each component is characterized by a transfer function that does not take into account fiber non-linearities (e.g. the Kerr effect).

SPT is a simplified simulation technique that does not consider phase distortion or non-linearities. The optical components in SPT are considered as linear devices taking into account their insertion loss or gain and the generation of noise. SPT gives results that are similar to what can be obtained experimentally using optical spectrum analyzers. Details on how each component is modeled under SPT simulation may be found in the “OptSim Components Library” manual. Only the optical components are simulated in the SPT. Electrical and logical components are not taken into account.

Optical transmitters generate a single spectral line at the specified laser frequency and carry the specified transmitter power. Modulation is neglected.

Under an SPT simulation, the following optical measurements may be made:

• power spectra, resolved on a selectable resolution bandwidth (just as what would happen using a laboratory Optical Spectrum Analyzer)

• optical signal-to-noise ratio (OSNR) on any channel

• power level on any channel SPT simulation may be useful in the following situations.

1. After initial creation of an optical design SPT can be run to quickly check for errors.

For example SPT may be run to quickly verify that the many numerical values assigned to a dense WDM system—laser and optical filter frequencies, amplifier gains, power levels—are correct.

2. A preliminary estimate of the performance of WDM systems may be gained by measuring the OSNR or channel power measurements. For example, if the OSNR of a 10 Gb/s system at 0.1 nm resolution is lower than 12 dB, the channel will very likely have extremely poor performance.

3. Systems where non-linear and dispersive effects are known to be negligible, such as in smaller local area networks.

You should anyway be aware of the assumption underlining the SPT simulation to be able to correctly use SPT results.

3.1.2 Variable Bandwidth Simulation Technique (VBS) The variable bandwidth simulation technique is a time domain simulation where signals are propagated along the network as samples in the time domain. The Time Domain Split-Step method is used to simulate linear and non-linear behavior for both optical and electrical components.

This is the core of the OptSim simulation environment. The key feature of this technique is the ability to set the system bandwidth to include the total spectrum of the system or only a portion of it. In the latter case only those channels that are included in the VBS bandwidth are simulated, permitting the system to be separated into a set of slices in the spectral domain. Each slice can be analyzed separately resulting in dramatic reductions in computation time and simplicity in the optimization process.

VBS works as follows:

• A preliminary SPT simulation is run in order to estimate the operating points of such components as Erbium Doped Fiber Amplifiers (EDFAs), which require the knowledge of the input average power spectrum in order to be properly modeled. This occurs automatically without user input or control.

• After all operating points have been evaluated, the time-domain simulation is run with the chosen VBS bandwidth

Any component whose output does not fit into the VBS bandwidth is not simulated in the time domain. However, those components are taken into account during the preliminary SPT simulation, to achieve an accurate determination of the operating points of all average power sensitive components.

Page 139: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 129

To understand the utility of the variable bandwidth approach, let us simulate a dense WDM system with 64 channels. Further, suppose that a dispersion map has already been chosen so that the non-linear effects among spectrally distant channels are negligible. Under these conditions, we may draw the complete WDM network with all the 64 channels, but then run the simulation only on a smaller bandwidth which includes only 8-10 channels. In this way the simulation runs much faster.

WDM Channels

1 2 3 4 10 11 20 21

VBS Bandwidth

SPT Bandwidth

61626364

Figure 2. Frequency slicing in the VBS simulation

For example, as shown in Figure 2, the SPT bandwidth should be set to include all WDM channels, while the VBS bandwidth can be set to simulate in the time domain only channels 11 to 20.

Optical Fiber Optical fiber, one of the most complex and important components of the OptSim library, is simulated in the VBS by solving the nonlinear Schrödinger equation using a modified version of the standard Split-Step Fourier (SSF) method. This method solves problems related to cyclical numerical convolution effects intrinsic to the standard SSF method by implementing a true linear numerical convolution by means of component processing techniques (overlap-and-add algorithm). Using this method, even extremely long fiber links may be simulated in a large time window (thousands of bits at standard bit rates) with excellent accuracy.

System Sectioning

System sectioning is another important feature of the VBS simulation. The system to be simulated is automatically subdivided into a number of sections that are then simulated in a sequence determined by the OptSim processor. The processor analyzes the topology of a given project and then subdivides it into a proper number of sections, according to several internal optimization rules.

System sectioning is essential in order to:

• reduce memory requirements to simulate very long fiber links by subdividing the fiber into smaller spans of suitable length

• allow upgrades to parallel processing in a multiprocessor environment. In fact, system sectioning will allow introducing parallelism in the processing of different sections, to reduce the required simulation time

• allow complex topological networks to be properly simulated, by subdividing the network into smaller sub-networks, thus allowing to properly simulate spectra and delays propagation

Project sectioning is completely transparent to the user.

The Incremental Approach The basic purpose of the VBS is to simplify the optimization of optical systems and to allow an incremental approach to achieving an optimum configuration.

In order to have a very flexible instrument to support the incremental optimization approach, the VBS technique has been further subdivided into three categories, each representing different levels of simulation accuracy. The following is a discussion of the different SPT levels and a discussion of their relative simulation fidelity.

Page 140: 39865643 Optsim Guide

130 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Loss-only Fiber VBS

The Loss-only Fiber VBS technique is based on the simplest possible fiber model: each fiber-span is considered as an attenuator. All other components are fully modeled. The advantage of this technique is to optimize the system in terms of power levels and signal-to-noise ratio, after a first-round check employing an SPT simulation. While SPT allows measuring average spectra only, this technique allows estimating in the time domain such effects as linear signal distortion and crosstalk.

This technique quickly yields the eye diagram, BER and Q curve and linear spectral analysis. However with VBS a sub-set of channels can be selected first, followed by an analysis of all system channels.

Linear Fiber VBS

The Linear Fiber VBS technique takes into account linear propagation effects such as loss, dispersion and PMD while fiber non-linearities are neglected. This technique analyses signal distortion due to linear fiber dispersion for all channels present and permits the development of dispersion compensation strategies.

Full VBS The Full VBS is the simulation technique where all the fiber propagation effects are included and the final-step optimization can be carried-out.

Different degrees of approximation can be set, by selecting the bandwidth over which the full-VBS simulation is carried-out, by tuning the simulation accuracy through the simulation parameter dialog window, or by choosing dual-polarization or single-polarization models for the optical components.

3.2 Simulation Strategies The previous section described the different simulation techniques available in OptSim to trade-off accuracy and simulation speed. These techniques are particularly useful when making a choice between different versions of a design In this case, the space of the free parameters to be investigated is often so large that a complete simulation taking into account all effects would be too time consuming.

The following description explains how different paths can be followed to achieve an optimal system design. The advantages and disadvantages of each simulation technique must be understood in order to develop an effective strategy leading from a general idea of the system to the optimal designed set-up. We strongly suggest using an incremental system simulation approach, starting with a SPT simulation up to a complete bandwidth full-VBS.

The following path should realize the best results in the shortest time.

1. SPT simulation. Run one or more SPT runs to optimize the system in terms of power levels and optical signal-to-noise ratio. SPT runs are quick and the results are easy to check, therefore, SPT simulations are an efficient method to move from a general idea of the system to a more refined design.

For some scenarios SPT simulation results can already provide a good definition of the system configuration. These include all-optical networks of limited extension (LAN or MAN) where fiber non-linearities may usually be neglected, while noise levels and signal crosstalk are the more important impairments. In this case, an SPT simulation to estimate optical signal-to-noise levels, followed by a reduced bandwidth VBS simulation may be sufficient.

2. Loss-only Fiber VBS. Signals are now fully described as sequences of samples in the time domain. Optical propagation in the fiber is modeled through loss only, but all other components are simulated according to their complete model. At this stage, different modulation formats can be compared and resulting impairments can be check using eye diagrams, Q and BER curves.

3. Linear-Fiber VBS. With this technique all linear fiber effects such as attenuation, dispersion, birefringence, and PMD are included in the model.

The system may be optimized with respect to dispersion compensation. Using the variable bandwidth feature, these optimizations can be carried-out one channel at a time or for all system channels.

Page 141: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 131

More than one run can be performed, starting with a limited set of channels and continuing up to the whole system. For PMD-sensitive systems, a Monte-Carlo analysis of the system can be carried out by varying the random generator seed, so that different random values are obtained for each run.

In addition, simulation parameters can be changed at any time. In particular, one can choose a single-polarization or dual-polarization model for the

4. Full VBS This is the final-step in the optimization process. With this technique all the propagation effects are included. This is the most time-consuming technique, therefore, we suggest it be run when the system has been extensively analyzed using the previously discussed techniques.

Nonetheless, this technique can also be tuned to obtain different degrees of approximation. The most important is the selection of the bandwidth. In the same way as for the other VBS simulation techniques, changing the bandwidth can be used to select which channels are fully simulated.

The parameters defining the simulation accuracy can be changed and single-polarization or dual-polarization can be chosen for the optical components. In this way, the level of accuracy of the Time-Domain Split-Step (TDSS) can be adjusted to get different level of suppression of spurious tones.

Bandwidthincrement

SPT

Loss orLinear VBS

Full VBS

Full Bandwidthsimulation

REFINING PARAMETERS

Figure 3. The incremental simulation approach

3.3 Sample Mode Simulation Parameters Simulation parameters are the most important parameters in the OptSim simulator: they control the accuracy and the speed of the simulation.

These parameters should be defined before system design is initiated. If default values are to be used, they should be checked as well. A careful approach to initializing simulation parameters should take place, even though they can be modified at any time during the simulation. Any component placed in the design will automatically be initialized with default values that are calculated based on these simulation parameters.

These parameters set the simulation bandwidth (for both SPT and VBS techniques), the VBS time-span to be simulated, the polarization options for optical component modeling and the simulation accuracy.

An improper choice of some of these parameters (such as the VBS simulation bandwidth or the total simulated time span) may result in exceedingly long CPU simulation times or lead to completely incorrect results. Particular care must be devoted to tuning the accuracy parameters controlling the VBS simulations. Higher accuracy results in longer computational times.

We suggest accepting the default value of a parameter if its meaning or its impact on simulation is not well understood.

Page 142: 39865643 Optsim Guide

132 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

To open the simulation parameters dialog window

1. Select the menu command Edit > Simulation Parameters or click on the Simulation Parameters button in the toolbar.

3.3.1 The Simulation Parameters Dialog Window The simulation parameters dialog window is organized into three sections that can be selected by clicking on the tabs in the upper part of the window. The sections are:

• Run Options allows setting the simulation methods and options, inclusion/exclusion of electrical noise and optical noise

• Time Domain allows setting the VBS bandwidth and other parameters related to time domain simulation, such as the total simulation time and the reference bit rate

• Frequency Domain allows setting the SPT bandwidth, the optical polarization representation (single or dual polarization)

• Simulation Accuracy allows setting several accuracy parameters, principally related to the simulation of optical fibers

• Naming allows setting model class name, and changing, showing or hiding it.

Run Options In this section you can select simulation methods and options. You can also enable/disable inclusion of electrical noise and optical noise.

Figure 4. Run Options in Simulation Parameters Window

Page 143: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 133

Time Domain This section includes all parameters required by the Time-Domain VBS simulations. These include the definition of the VBS bandwidth, and the definition of the time-span to be simulated (in terms of time [ns] or number of bits at the reference bit-rate).

Figure 5. The Simulation Parameters dialog window - Time Domain section

Variable Bandwidth Simulation

Force Full-Bandwidth sets the largest VBS bandwidth BWVBS compatible with the SPT bandwidth parameter BWSPT set in the Basic Attributes section. The value is computed to set the VBS bandwidth to a value 20% smaller than the SPT bandwidth. The re-scaling creates a BWVBS centered in the middle of BWSPT.

Lower Limit [THz] or [nm] is the lower limit flowVBS of the simulated VBS bandwidth. All the components defined through a center frequency and/or a working bandwidth (i.e., optical sources, optical filters, frequency shifters, and EDFA) whose lower spectral limit is smaller than flowVBS are not simulated during the VBS run. However these components are taken into account to evaluate the working-point of the network in terms of power levels. For instance, gain and noise level of an EDFA are properly set taking into account that part of the spectrum inside the simulation bandwidth but smaller than flowVBS.

The following constraint must be satisfied between the simulation bandwidth and the VBS lower frequency.

( )VBSVBSSPTVBS flowfupflowflow −⋅+> 125.0

Upper Limit [THz] or [nm] is the upper limit fupVBS of the simulated VBS bandwidth. All the components defined through a center frequency and/or a working bandwidth (i.e., optical sources, optical filters, frequency shifters, and EDFA) whose upper spectral limit is greater than fupVBS are not simulated during the VBS run. However these

Page 144: 39865643 Optsim Guide

134 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

components are taken into account to evaluate the working-point of the network in terms of power levels. For instance, gain and noise level of an EDFA are properly set taking into account that part of the spectrum inside the simulation bandwidth but greater than fupVBS.

The following constraint must be satisfied between the simulation bandwidth and the VBS lower frequency.

( )VBSVBSSPTVBS flowfupfupfup −⋅−< 125.0

Center Frequency [THz] or [nm] is the center frequency f0,VBS of the VBS bandwidth set with the upper and lower limits mentioned above.

( )VBSVBSVBS flowfupf +=21

,0

Bandwidth [THz] or [nm]: it is the VBS bandwidth BWVBS set with the upper and lower limits mentioned above.

VBSVBSVBS flowfupBW −=

Reference Bit Rate [Gbit/s] sets the reference bit-rate Rb for the simulation. This is the default value for all components concerned with bit generation or bit manipulation. However for each component the value may be changed in the parameters dialog window for that component.

The actual value of the reference bit-rate used in the simulation is displayed by the Corresponding Simulated Bit-Rate parameter. See the description of the Forced Bit Rate button.

Forced Bit Rate forces the VBS bandwidth to be correlated with the reference bit-rate introduced in the Reference Bit Rate field.

The bit-time in OptSim, i.e. the time-duration of the bit, must be an integer number of time-samples NS (Samples per bit value). The sample-period depends on the VBS bandwidth. Independently specifying the VBS bandwidth and the reference bit-rate, may cause the bit-time not to be an exact multiple of the sample-period. In these cases, the bit-rate is rounded to the closest value whose bit-time is an exact multiple of the sample-period. The value is displayed by the Corresponding Simulated Bit-Rate parameter. To simulate the exact value of the introduced reference bit-rate, the VBS bandwidth has to be modified accordingly in order to have an integer number of time-domain samples per bit.

Corresponding Simulated Bit-Rate [Gbit/s] is the actual simulated reference bit-rate with the defined VBS bandwidth.

Samples per bit is the number of time-sample per bit at the simulated reference bit-rate.

Total Simulated Time Span [ns] sets the duration of the time-span Tsim observed at the measurement components. The value is expressed in nanoseconds. The simulation duration is consequently set to ensure the requested time-span. It is one of the most important parameters in terms of required CPU simulation time, since the CPU simulation time increases roughly linearly with Tsim.

Total Simulated Time Span in Number of Bits at Reference Bit-Rate sets the duration of the time-span Tsim observed at the measurement components (in a manner similar to the previous parameter). The value is expressed in number of bits at the reference bit-rate.

One of the main issues in setting-up a Time-Domain simulation is the choice of the number of bits used to estimate the system performance. When you wish to study the effects of noise on an optical system - for example the effects of noise on the Q parameter - at least a hundred bits should be simulated. On the contrary, when you need to study propagation effects - as in soliton systems - even a single pulse may be sufficient. Remember that the required CPU simulation time grows at most linearly with the Tsim - and normally quite less than linearly, thus allowing very long bit streams to be simulated.

Frequency Domain In this section you can set the upper and lower limits for the spectral bandwidth. All optical sources, optical noise, frequency shifts, and optical filters must be defined within this spectral region. The defined spectral bandwidth also controls the SPT bandwidth.

Page 145: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 135

Figure 6. The Simulation Parameters dialog window – Frequency Domain section

Simulation Bandwidth

Lower Limit [THz] or [nm] is the lower limit flowSPT of the spectral region to be simulated. All components that are defined through a center frequency and/or a working bandwidth (i.e., optical sources, optical filters, frequency shifters, and EDFAs) must have a lower spectral limit greater than flowSPT.

Several examples: for a Lorentzian optical filter the lower spectral limit (that is its center frequency minus half its bandwidth) must be greater than flowSPT. For a laser source the emitting frequency must be greater than flowSPT. For EDFAs the lower limit of the noise bandwidth must be greater than flowSPT.

Upper Limit [THz] or [nm] is the upper limit fupSPT of the spectral region to be simulated. All components which are defined by a center frequency and/or a working bandwidth (i.e., optical sources, optical filters, frequency shifters, EDFAs, etc.) must have an upper spectral limit smaller than fupSPT.

For example, for a Lorentzian optical filter the upper spectral limit (that is its center frequency plus half its bandwidth) must be smaller than fupSPT, while for a laser source the condition is that the emission frequency must be smaller than fupSPT. For the EDFA the upper limit of the noise bandwidth must be smaller than fupSPT.

Center Frequency [THz] or [nm] (read only) is the center frequency f0,SPT of the SPT simulation bandwidth. It is evaluated according to the upper and lower limits mentioned above as:

( )SPTSPTSPT flowfupf +=21

,0

Bandwidth [THz] or [nm] (read only) is the SPT simulation bandwidth BWSPT. It is evaluated according to the upper and lower limits mentioned above as:

Page 146: 39865643 Optsim Guide

136 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

SPTSPTSPT flowfupBW −=

Note that SPT bandwidth should be set at least 25% larger than VBS bandwidth (see the “Time Domain” section description). If this is not the case, a message asks you to enlarge the simulation bandwidth to at least the minimum required value.

Optical Field Representation determines how OptSim simulates the polarization for optical components. There are two options: Single Polarization or Dual Polarization.

With single polarization no polarization-dependent effects are simulated. In particular, birefringence, PMD (Polarization Mode Dispersion) and polarization-dependent Kerr effect are neglected.

With dual polarization the propagating optical signal is simulated using a vectorial representation, i.e., by taking into accounts the two orthogonal degenerate modes of a single mode optical fiber. For all optical components the influence on polarization of the signal is taken into account, in addition to any influence on the envelope. In particular, the non-linear Schrödinger equation takes into account birefringence, PMD and the polarization-dependent Kerr effect.

The dual/single polarization option impacts only VBS simulations since SPT simulations do not take into account the polarization of the signal. The required CPU simulation time for the single polarization model is smaller than by a factor of 2 to 4 compared to the dual polarization model.

Random Parameters Seed is the seed used by the OptSim random generators to produce different sets of parameter values. In order to simulate all components in a system, many random parameters are generated to obtain the random noise of sources and receivers, and to generate all random parameters for the fiber: length, birefringence, PMD and dispersion.

In order to run the same simulation again using different random parameters and noises, this seed must be changed.

By making multiple runs with a varying seed parameter one can create a Monte-Carlo analysis. For instance this procedure may be used to analyze the system-impact of PMD in high bit-rate links by automatically re-running the same simulation with different realization of the PMD stochastic process.

Simulation Accuracy In this section you can understand how to tune the accuracy of fiber propagation, fiber grating propagation and filtering in VBS simulations.

Page 147: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 137

Figure 7. The Simulation Parameters dialog window - Simulation Accuracy section

Simulation Accuracy selects one of the predefined simulation accuracy choices. The simulator can be tuned to obtain the best trade-off between accuracy and computational time. If you are not familiar with the parameters of this section, you can set up them automatically choosing one of these accuracy configurations: Loose, Standard or Tight.

Loose is suggested for a first time simulation. It yields a good estimation of the system performance. Standard should be used when all the system parameters have been completely defined, and a high simulation precision is required. Tight is suggested for simulations requiring a particular level of precision, e.g., to investigate phenomena whose effects are extremely smaller - in terms of power levels- than the useful propagating signals.

Page 148: 39865643 Optsim Guide

138 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Linear Link Transfer Function Accuracy

This group of parameters tunes the simulation precision of the Linear Fiber VBSsimulation technique that takes into account dispersion and PMD effects. The same degree of precision is assigned to fiber gratings and optical filters.

Enforcement: allows to automatically set the parameters related to the control of the error of the linear operator (Overall Amplitude or Group Delay Error, see below). Selecting the Strict option, all the fiber links are subdivided into the same number of TDSS steps. It can be demonstrated that this is a conservative choice, which is suggested for short links, or in long point-to-point links with a strongly periodical structure, such as short recirculating loops. With the Statistical option, linear TDSS steps are randomized with respect to one other. This is the most common choice, since in real systems fiber lengths and power levels are not strictly periodical. To summarize, statistical enforcement is suggested in most 'real-life" situations.

Overall Amplitude Error [dB] sets the maximum amplitude error ErdB introduced by the linear TDSS step of the fiber. The error is defined in terms of a maximum acceptable amplitude-error in the numerical simulation of the fiber linear TDSS operators over the complete link. When a new value is introduced in this field, the corresponding Overall Group Delay Error is automatically evaluated.

Overall Group Delay Error [ps] sets the maximum group delay error Ergd

introduced by the linear TDSS step of the fiber. The error is defined in terms of a maximum acceptable group-delay error (fluctuations of the group-delay of the fiber linear TDSS step operators) over the complete link. When a new value is introduced in this field, the corresponding Overall Amplitude Delay Error is automatically evaluated.

The following parameters impact the accuracy of the complete TDSS algorithm (linear step and non-linear step). Therefore they affect only the accuracy of Full VBS simulation technique.

Peak Power Detection Averaging [ps] sets the time interval (in the time domain) over which power averaging takes place. To guarantee the maximum non-linear phase-shift ÎNL.max over each of the TDSS steps, the optical peak power is detected. To perform this evaluation an averaging operation is computed to avoid occasional spikes due for example to noise. If no averaging is chosen, a sample by sample peak search is performed.

Resulting in averaging over simulation time-samples: it is the correspondingnumber of time-samples (NSav) on which the peak power averaging computation is done (see previous parameter description).

Maximum non-linear phase shift over a spatial step [degrees]: sets the maximum non-linear phase-shift allowed ÎNL.max to be introduced by the non-linear operator alone during the simulation of a single TDSS spatial-step [1].

That means that for each step of amplitude Çz, the following constraint is respected:

Ó Ppeak Çz < ÎNL,max

where Ó is the non-linear coefficient and Ppeak is the detected peak-power.

Level of suppression of FWM Artifacts [dB]: sets thesuppression level SPRSFWM for the spectral line generated by numerical spurious artifacts. The length of the step of split-step method used in each simulation is set automatically using accurate algorithms [2] developed to ensure that any spectral line generated by numerical spurious artifacts is below the signal level of this specified value.

This is one of the most important parameters; its value may greatly impair the speed of full VBS simulations. It ensures that the spurious tones - induced by the algorithm applied to simulate fiber propagation - reach a maximum predefined level. Therefore before set this value, the maximum level of spurious tolerated interference must be estimated.

For example if the system has been predicted to have - through an SPT run, for instance - an optical signal-to-noise ratio of 20 dB, probably all the interference that are at least 3 dB under the noise floor does not influence the system performance. In this case the SPRSFWM value can be reasonably set to 23 dB.

Page 149: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 139

Raman Amplifier simulation accuracy: sets the accuracy of the Raman amplification model taking part to the step size choice for the adaptive Runge-Kutta algorithm [5] applied to derive the Raman gain profile. Allowed values: min 10-10; max 10-4; default 10-6.

Naming In this section you can choose to show, hide, or change the model instance name.

Figure 8. Naming section in the Simulation Parametesr Window

3.4 How to Setup a Simulation This section describes how to setup a simulation for a system already created in the design area of OptSim and whose simulation parameters have already been set.

Remember that the project file name (project_name.opf) set at the beginning will be used in all output files generated by the simulation (to change the project file name use the menu command File > Save As). Moreover, the names given to the measurement components used in the project will be used as labels in the simulation output files. These names are displayed in the component labels.

All output files are stored in a subdirectory of the project directory. The name of the subdirectory is xv_project_name. For example for a project named “laser.opf” the subdirectory will be named “xv_laser”. When you want to send a copy of your current project to another OptSim user (including the simulation results) remember to copy this subdirectory together with the project description file.

Page 150: 39865643 Optsim Guide

140 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Note Allowed characters for file names are: alphanumerical, "_" (underscore), "-" (dash) and "+" (plus) while for directory names are: alphanumerical, "." (dot), "_" (underscore), "-" (dash) and "+" (plus).

SPT Simulation To perform an SPT simulation

Use the menu command Run > Go to start the simulation of the project. If previous results of the same system are stored in the working directory, a warning message is displayed, advising that these results will be overwritten. Select SPT as simulation method. Click on Start to begin the simulation.

Figure 9. Running SPT Simulation

A window appears, displaying the simulation steps and reporting all the warning and error messages encountered. At the end of this process click on Close to close the window.

VBS Simulation If a VBS simulation is to be carried-out, perform the following steps:

Page 151: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 141

To perform a VBS simulation

Use the menu command Run > Go to start the simulation of the project. If previous results of the same system are stored in the working directory, a warning message is displayed, advising that these results will be overwritten. Select VBS as simulation method.

Figure 10. Running VBS Simulation

Choose between the three simulation techniques:

− VBS Loss Only Fiber: fibers are simulated taking into account their attenuation only

− VBS Linear Fiber: a complete linear fiber model is implemented (but non-linear effects are neglected)

− VBS Full: a complete fiber model is considered (linear and non-linear effects)

If you wish to perform a noiseless optical simulation select No for Optical Noise option. For a noiseless electrical simulation select No for Electrical Noise option. A noiseless simulation is required to perform semi-analytic BER evaluation with the Sensitivity Receiver component (see the OptSim Component Library).

Click on Start to begin the simulation.

A window appears, displaying the simulation steps and reporting all warning and error messages encountered. The simulation may be divided into more than one section. In the window the following information is given:

Page 152: 39865643 Optsim Guide

142 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

• the percentage of CPU simulation time already executed with respect to the total expected CPU time

• which section of the design is currently being processed and the total number of sections

Figure 11. The simulation status window (Windows systems)

For UNIX systems a terminal window appears and all the messages are printed sequentially. For example you may see: ... 98 % OF SECTION 2 OF 4 99 % OF SECTION 2 OF 4 END SECTION 2 OF 4 SECTION 2 User time 0.79 sec SECTION 2 System time 0.06 sec OptSim-I-Simulating section 3 of 4 1 % OF SECTION 3 OF 4 ...

At the end of this process click on Close (for Windows systems) or press any key (for UNIX systems) to close the window.

Note You may perform simultaneous simulations on the same machine, by saving the projects in different directories and then starting each simulation. Saving your projects in different directories is necessary because different simulations may exchange temporary files giving system errors or incorrect results.

3.4.1 Forbidden Topologies One restriction on topologies in OptSim is that a Driver component (except NRZ Driver) must be preceded by a Data-source component.

Moreover the OptSim tool prevents you from drawing loops. Therefore, a signal path may not form a topology where a given signal propagates along the network and then, overlaps over itself—for example through a combiner. This

Page 153: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 143

prohibition holds even though the signal may change its "nature" by undergoing a transformation from electrical to optical and back to electrical.

Particular attention must be devoted to the simulation of “split and sum” topologies. These are topologies in which a signal is split into two or more paths and, after propagating along the network, at least two of the paths overlap one another, for instance through a combiner. If during the propagation the signal becomes optical and goes through fiber or filters, it may be affected by propagation delays whose absolute values are not under user control, since they depend on the numerical implementation of the component models. For example, the fiber model does not take into account the physical absolute delay due to propagation, but only the differential group delay (due to dispersion and PMD). Consequently, even if “split and sum” topologies are allowed in OptSim, they cannot be used to simulate interferometric effects, particularly when fiber or filters are placed in one of the branches of the interferometer.

3.4.2 Simulation Messages OptSim messages appears in the simulation status window with the following syntax:

OptSim-X-Message

where X is a letter describing the message category and Message is a string reporting the simulation message.

OptSim simulation messages are grouped in the following categories:

• trace messages T, related to debug procedures during the software test. They should never appear when using the OptSim

• information messages I, related to the normal operation of the OptSim simulator

• warning messages W, related to low severity errors These messages will not stop the simulation, and results are calculated. However, the results may be inaccurate

• error messages E, related to high severity errors These messages will not stop the simulation, but the results are not calculated for that portion of the network following the component that has generated the error)

• fatal messages F, related to the highest severity errors. These messages stop the simulation In the simulation message, the component is identified by its name or its identifier (if it does not have a name). For nested compound components, the syntax is the same as the path for a file:

CC_name,CC_file_name/.../component_name

where CC_name is name of the compound component CC_file_name.opm or CC_file_name.moml used in the project.

3.4.3 The Simulation Log Window The simulation messages can be inspected at the end of a simulation, through the log window (Figure 12). This window displays messages belonging to following categories:

The Information button shows all the information messages, which syntax is OptSim-I-message.

The Warning button shows all the warning messages, which syntax is OptSim-W-message.

The Error button shows all the error messages, which syntax is OptSim-E-message.

The Help button starts the HTML on-line help system, opening the description of the View Output dialog window.

To open the Simulation Log Window

Click on Logging on OptSim menu bar, and select Open Simulation Log File. A window as shown in Figure 12 will appear.

Page 154: 39865643 Optsim Guide

144 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Figure 12. The View Output dialog window

3.4.4 Expressions in Component Parameters In a compound component parameter field you may type in an expression that will compute the parameter value. However, expressions cannot be used:

• in the component parameters of type string, such as filenames or component names

• in any field of the Simulation Parameters dialog window except for the Random Parameters Seed field Expression may contain a mix of variable names, numerical values, parenthesis, arithmetic operators + - * / ^ and some functions. For instance if V1 is the name of a variable then you may type into a dialog field the expression:

(2 * V1 /(1E-5 * 13.1))^3.0

The expression syntax is checked when you close the dialog window that contains the expression by clicking on the OK button.

The expression value is computed at the beginning of the simulation. Therefore, only at that time is the result checked to be in the valid range for that parameter.

A typical use of expressions is the case where you have a WDM system with many transmitters, which operate at different frequencies. For instance if f0 is the central frequency and Df is the spacing between two successive channels, then you may express the emission frequency of the first transmitter as f0, the second as f0+Df, the third as f0+2*Df, and so on.

Please note that when the expression is calculated all the terms of the expression are considered as double precision numbers. So if an integer number is used inside an expression, when the expression is calculated, it is automatically converted in a double precision number.

Arithmetic Operators The following arithmetic operators are available:

• +, sum

Page 155: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 145

• -, subtraction

• *, multiplication

• /, division

• ^, raise to power For instance the expression x^y returns the value of x raised to the power of y.

Functions The following functions are available.

• exp(x)

The exp() function returns the value of e (the base of natural logarithms) raised to the power of x.

• sqrt(x)

The sqrt() function returns the square root of x. x must not be negative.

• sin(x)

The sin() function returns the sine of x, where x is given in radians.

• cos(x)

The cos() function returns the cosine of x, where x is given in radians.

• log(x)

The log() function returns the natural logarithm of x.

• log10(x)

The log10() function returns the 10-base logarithm of x.

• min(x,y)

The min() function returns the lesser of the two parameters.

• max(x,y)

The max() function returns the larger of the two parameters.

Pseudo-Random Functions A component parameter may be assigned a random value with a Gaussian or uniform distribution. To do so you must type into the parameter field a pseudo-random function with the desired statistical parameters. For instance you can write in a parameter field the following expression:

rnd_gauss(Mean, Sigma)

In this way the parameter will assume a random value with Gaussian distribution with the Mean and the Sigma values during the simulation.

The random value is computed at the start of the simulation. If the value is outside the valid range of the parameter, OptSim re-compute it up to 10 times. After ten tries, OptSim will issue an error.

Pseudo-random values are useful to evaluate the impact on simulation results of the random variation of a parameter. For example, to perform this kind of evaluation with a Gaussian distribution, follow this procedure (we suppose the values Mean and Sigma have been already fixed):

1. Set the selected parameter to the value Mean and perform a simulation of the project. Do not use any random function. Check for correct results.

2. Set the parameter to the following expression: Mean+rnd_gauss(0.0, Sigma)

Page 156: 39865643 Optsim Guide

146 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

3. Define a new variable named RndSeed and use it in the Random Parameters Seed field of the Simulation Parameters dialog window.

4. Define ten parametric runs with ten different values for the RndSeed variable. To see the random values used in each run, at the end of the simulation, click on Logging on OptSim menu bar, and select Open Simulation Log File.

The following pseudo-random functions are currently available.

• rnd_gauss(mean, sigma)

The function rnd_gauss() returns a pseudo-random value according to a standard Gaussian distribution with mean value mean and square root of the variance sigma. The generated sequence may be affected by changing the Random Parameters Seed value in the Simulation Parameter dialog window.

• rnd_unif(min, max)

The function rnd_unif() returns a pseudo-random value according to a uniform distribution in the range [min,max]. The generated sequence may be affected by changing the Random Parameters Seed value in the Simulation Parameter dialog window.

3.4.5 The Scan Setup Dialog Window The Run definition dialog window is used to introduce the values of the simulation variables defined for parametric runs.

Below is the screenshot of the Scan Setup dualog window, where ten runs are set with four variables used in each run.

This window is a spreadsheet where each run is represented by a row, while the columns are the variable used in that run. When you open the dialog for the first time, only one row appears.

Remember that you must set a value for each variable before starting the simulation.

The spreadsheet data may be saved to (or read from) a file. This allows loading the parametric run set without retyping the variable values.

To define parametric runs

Page 157: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 147

• Choose the menu command Run > Setup Scans. The Run definition dialog window. The command is enabled only if at least one variable is set.

• Type the values for all the variables into the cells; then press the down arrow key on the keyboard. A new row appears.

In the spreadsheet you may perform the following operations.

You must click on the OK button of the window to confirm any of the above operations and close the window.

Note: You may not specify a variable name in a cell. You must enter a numerical value. All the defined runs are executed in the order they appear in the dialog window.

Import/Export File Format The buttons Import and Export in the Run Definition dialog window allow the loading or saving of a file with the spreadsheet data. Three formats for the file are allowed:

• file_name.csv, where the values in the file are comma-delimited

• file_name.txt, where the values in the file are tab-delimited

• file_name.prn, where the values in the file are space-delimited The file extension must be explicitly typed as part of the file name. These files are in ASCII format and can be used in conjunction with any program that reads and writes to these three formats.

File Format The required file format is as follows:

OptSimRUN separator_char 1 ## variable1 separator_char variable2 ... separator_char variableN value1_run1 separator_char value2_run1 ... separator_char valueN_run1 value1_run2 separator_char value2_run2 ... separator_char valueN_run2 ...

Where:

• separator_char is the separator character. The ‘,’ is used in files with extension csv; the ‘tab’ is used in files with extension txt; the ‘space’ is used in files with extension prn

• the first row contain the keyword OptSimRUN and the grammar version 1

• the second row must contain two (and only two) "pound-sign" characters

• the third row is the list of the variable names (case sensitive) used in the parametric run definition

• the fourth and following rows specify the variable values for each run All values in the file must be separated only by the separator_char specific to the kind of file in use.

3.5 OptSim Conventions

3.5.1 Signal Units and Representation In the OptSim environment, there are three categories of signals: logical, electrical and optical. Each of these signal categories follows its own convention in terms of measurement-units and representation format.

Page 158: 39865643 Optsim Guide

148 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Logical Signals Logical signals are unitless. The level of the logical signal is the number of bits per symbol. The logical signal may carry more than 1 bit, and is represented through n parallel sequences (n bits = n parallel sequences) of time-samples that may assume two values only (0 and 1).

Logical signals are simulated during VBS simulation techniques only.

Electrical Signals Electrical signals are described using their evolution in the time-domain, that is, through sequences of time-samples. The sample frequency depends on the simulation bandwidth.

Electrical signals are considered through their base-band representation, therefore the signal is represented as it is, without extracting information about the center frequency (complex envelope representation).

The units for electrical signals depend on the generating component and also on the driven component. For example, if the signal is generated by a photodetector, its unit is [A]; if it is from a Driver to drive a modulator the unit is [V] but if this signal drives directly a Laser the unit is [A]. Therefore, whenever a measurement component is applied to an electrical signal, the results must be carefully analyzed.

Power-meters measure the average of the square of the signal with respect to the time; hence, the unit may be either [V2] or [A2]. For the electrical signal probe and the eye-diagram on the y-axis the unit depends upon which component is used. The electrical spectrum analyzer gives a power spectral density expressed on a dB scale, and scale unit may be either [10log(V2)/GHz] or [10log(A2)/GHz].

Electrical signals are simulated during VBS simulation techniques only.

Optical Signals The optical signals are described by their evolution in the time-domain, that is, through a sequence of time-samples. Sample frequency depends on the simulation bandwidth.

Optical signals may be represented using the complex envelope representation, that means that the fast phase-variations induced by the center frequency are extracted and isolated. In general, a band-pass signal, i.e. a signal whose spectral information is in narrow a spectral region around the carrier frequency, may be expressed as:

tfjtfj etxetxtx 00 2*2 )(~)(~21)( ππ −+=

where )(~ tx is the complex envelope representation of x(t), and f0 is the center frequency of the signal. All the

information of the signal is carried by the base-band signal )(~ tx and the frequency f0. In OptSim optical signals are

represented through sequences of complex numbers that are samples of )(~ tx and through the center frequency f0.

The complex envelope representation implemented in OptSim is normalized so that it carries the same amount of power of the signal. Thus all measurements and non-linear simulations may be performed using x(t).This is the assumption employed in [3]. This kind of representation is valid for time-domain simulations such as VBS. For SPT simulations, optical signals are represented using their optical power spectra.

In OptSim, the optical signal amplitude is expressed in mW . Hence, to obtain the optical power it sufficient to evaluate the absolute value squared. The optical power-meter measures power in [mW] or [dBm] and the optical spectrum analyzer measure power spectral density in [dBm/THz] (if the infinite resolution is chosen) or power in [dBm] (if the finite resolution is chosen).

Page 159: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 149

3.5.2 Conventions about Parameter Units In OptSim we have chosen units that are as similar as possible to the real world. For components, we have used parameter units most frequently found on data-sheets. To be perfectly clear, measurement units are specified in all dialog windows. For each category of parameters the following unit conventions have been followed.

• Optical frequency (wavelength): [THz] ([nm])

• Optical bandwidth: [THz] or [nm]

• Electrical bandwidth: [GHz]

• Bit-Rate: [Gbit/s]

• Time: [ns].

• Lengths: [km].

• Loss (gain): [dB].

• Optical power: [dBm] or [mW].

Note When dealing with numerical spectral measurement, you should pay particular attention to the used conventions. The following paragraph gives some more information on spectral estimation in OptSim.

Optical Power Spectral Density and Negative Frequencies The optical power spectrum diagram may be represented as power spectral density. The spectral density is assumed as "single-sided", meaning that all power is contained in the positive frequencies. Negative frequencies are not considered. The spectral resolution is given by the specified total bandwidth divided by an integer number (corresponding to the number of points over which the FFT is evaluated) that can be set by the user.

The use of power spectral density ensures that flat spectra, such as the noise floor produced by a white Gaussian noise generator, has a fixed spectral, independently of the spectral resolution.

On the contrary, the use of power spectral density on narrow bandwidth signals, such as spectral lines due to unmodulated lasers or subcarrier tones, generates an output plot whose level depends from the chosen spectral resolution. To explain this effect, let’s suppose the input signal to be a single line at frequency f0 and power P0. Theoretically, the single sided power spectral density is thus G(f) = P0δ(f-f0). Numerically, spectra are evaluated over finite resolution bandwidth Bres, thus the resulting numerical power spectral density around f0 is evaluated as P0/Bres, i.e., it is inversely proportional to Bres.

A single tone signal, that is a signal whose spectrum is theoretically a Dirac-delta function, represents another specific case. In this case, it is known from numerical signal processing theory [4] that the resulting spectral estimate depends on where the tone frequency falls with respect to the FFT grid. The resulting spectrum may appear as a single peak or a pyramid.

Page 160: 39865643 Optsim Guide

150 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

SPT Optical Power Spectrum

The output of a SPT simulation is an optical power spectrum with a finite resolution. This means that each point represents the power (in [dBm]) over the resolution bandwidth. This representation is the same used in commercial Optical Spectrum Analyzer for laboratory.

VBS Optical Power Spectrum

VBS optical spectra may represent either power density (expressed in [dBm/THz]) or power (expressed in [dBm]). If the infinite resolution option is chosen the spectrum is a power density. If the resolution is set to a finite value, the spectrum is integrated over a Lorentzian or rectangular filter, and the result is a power spectrum, which means that each point represents the power under the filter shape.

3.6 Best Fit Laser Toolkit The Best-fit Laser toolkit is the tool that fits the laser physical parameters to achieve a given set of laser data-sheet target parameters, required by the Rate-Equation mathematical model for an accurate laser simulation. To invoke this toolkit, click on Utilities on OptSim menu bar, and select Best-Fit Laser Toolkit.

The Best-fit Laser toolkit appears within a single dialog window where to insert the laser data-sheet target parameters and start the fitting operation. At the end of the process the results, as well as the input data, can be saved into a data file and imported directly into a Rate-Equation laser dialog window.

3.6.1 Functioning The purpose of the Best-fit Laser toolkit is to find out the set of physical parameters required by the target laser Rate-Equation mathematical model giving as input the laser data-sheet parameters.

You can build a laser model following one of these ways:

• Create a new laser model from scratch.

• Modify a Rate-Equation laser already defined on your OptSim project.

• Modify a laser model already fitted.

To create a new laser model you have to start the Best-Fit Laser toolkit within the OptSim window and modify the default values that appear on the dialog window.

To modify an existing Rate-Equation laser you have to open the laser parameter dialog window in the OptSim project, start the Best-Fit Laser toolkit and modify the loaded laser parameters.

To modify an existing laser model you have to load the laser model into the Best-Fit Laser toolkit window and modify the loaded laser parameters.

All these input values might be saved into a data file so that settings may be retrieved at any time. When the input values are supplied you can start the fitting process. The algorithm performs an iterative process to find out the best physical parameters that satisfy the required condition.

At the end of the fitting process the results can be saved into a data file and imported directly into a Rate-Equation laser dialog window.

3.6.2 Best-Fit Laser Toolkit Window The Best-Fit Laser toolkit dialog window is shown in the following figure. It has a menu bar a tool bar and fields to fill with the requirements.

Page 161: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 151

Figure 13. The Best-Fit Laser toolkit dialog window

Menu Bar Directly below the title bar, the menu bar groups commands into Windows-style pull-down menus. Clicking on a pull-down menu will display a list of commands. Moving the cursor onto a command in the menu will display a description of the associated command on the message bar at the bottom of the window.

Tool Bar Directly below the menu bar, the tool bar groups shortcuts for the most frequently used commands. Placing the cursor onto a tool bar button, a green-background box (tools & tips) will pop up with the name of the command executed by the button. A brief description of the command will appear on the message bar.

Message Bar The message bar is at the bottom of the window and provides explanations and context-sensitive hints regarding the menus or tool bar buttons that the cursor is pointed to.

3.6.3 The Menu Bar The menu bar consists of three menus with the following commands.

Page 162: 39865643 Optsim Guide

152 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

File Menu The New command starts a new session where a new laser model can be fitted. If changes have been made to the data displayed in the window, a message will appear requesting whether you want to save the changes or not.

The Open command opens a data file (with extension obp) and loads the input data into the fields of the window. If changes have been made to the data previously displayed in the window, a message will appear requesting whether you want to save the changes or not.

The Save command saves the fitting process results and the settings made in the window (input data) in a data file with extension obp.

The Save As command saves the fitting process results and the settings made in the window (input data) in a data file with extension obp.

The Exit command quits the Best-Fit Laser toolkit and closes the window. If changes have been made to the data displayed in the window, a message will appear requesting whether you want to save the changes or not.

Tools Menu The Accuracy command opens the Accuracy dialog window where set the tolerance value and set the max number of iteration for the fitting procedure.

The Check command checks the data input into the fields of the window for errors or inconsistencies for the fitting procedure.

The Fit command starts the fitting procedure for the current data.

Help Menu The Contents command starts the HTML on-line help system, opening the main page of the Best-Fit Laser toolkit help.

The Overview command starts the HTML on-line help system, opening the “Functioning” section of the Best-Fit Laser toolkit help.

The FAQs command starts the HTML on-line help system, opening the “Frequently Asked Questions” section.

The RSoft on the Web command starts the default HTML browser, loading the "www.rsoftdesign.com" site.

The About command opens a dialog window where you may find the OptSim version, the license information and your license number; do not forget to include this number when you contact your local RSoft office for support.

3.6.4 The Tool Bar Button Description

The New button starts a new session where a new laser model can be fitted. If changes have been made to the data displayed in the window, a message will appear requesting whether you want to save the changes or not.

The Open button opens a data file (with extension obp) and loads the input data into the fields of the window. If changes have been made to the data previously displayed in the window, a message will appear requesting whether you want to save the changes or not.

The Save button saves the fitting process results and the settings made in the window (input data) in a data file with extension obp.

The Accuracy button opens the Accuracy dialog window where set the tolerance value and set the max number of iteration for the fitting procedure.

The Check button checks the data input into the fields of the window for errors or inconsistencies for the fitting procedure.

Page 163: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 153

The Fit button starts the fitting procedure for the current data.

The Help button starts the HTML on-line help system, opening the description of the Best-Fit Laser toolkit dialog window.

3.6.5 Window Parameters The parameter values of the window are arranged into two sections:

• in the Defined Parameters section you have to define the laser data-sheet input parameters

• in the Evaluated Parameters section you get the physical parameters results of the fitting process

Please note that at least one parameter must be defined in the Defined Parameters section in order to start the fitting procedure.

Defined Parameters Section This section groups the laser data-sheet target parameters, input of the fitting procedure.

Center Emission Wavelength [nm] or [THz]: the referring emission frequency of the source. This value is used for the calculation of the most of the system-relevant quantities.

Insert Test Current Value [mA]: the input value of injection current that sets the operating point for the calculation of the most of the system-relevant quantities. It must be greater than the Threshold Current. Allowed values: min Threshold Current; max -.

Threshold Current [mA]: the laser threshold current.

Linear Output Power [mW]: it is the output power into a fiber pigtail at the Test Current Value. It is assumed that the power produced by the laser is equally split between the two output facets. Therefore half of the power is lost and the remainder is coupled to a fiber with the evaluated Fiber Coupling Efficiency. It takes into account neither the effect of the Non-Linearity Coefficients [cj's], nor the effect of the internal laser non-linearity in the P-I curve. This is the reason why it is called “linear” output power

P-I Slope [mW/mA]: the slope of the Power/Current curve as measured at the output of a fiber pigtail, under the same assumptions as defined above for the Linear Output Power. It takes into account neither the effect of the Non-Linearity Coefficients [cj's], nor the effect of the internal laser non-linearity in the P-I curve.

Turn-On Delay [ns]: the time needed for the carrier density to reach the threshold density, using the injection current specified in Test Current Value. Note that the turn-on delay only says how long it takes for the laser to reach threshold gain conditions, but not how long it takes for the laser to reach steady state. After turn-on, a series of oscillations ensues, that may last for several ns.

Relaxation Oscillation Peak Frequency [GHz]: the frequency of the peak in the small signal output power vs. modulation current response of the laser. It also approximately corresponds to the frequency of the output power oscillation after the injection of a step-current going from zero to the Test Current Value. For more details see [3].

Relaxation Oscillation Peak Overshoot [dB]: the overshoot in the frequency of the small signal output power vs. modulation current response of the laser, at the relaxation oscillation frequency. For more details see [3].

Quasi-Static Frequency Chirp Above Threshold [GHz/mA]: it defines how much the laser frequency varies as a function of a change in modulation current after fast transients have subsided. Note that before steady state is reached, the laser frequency may undergo much wider fluctuations, in response to an injected current change. See FM modulation response in [3]. Note that thermal effects are not taken into account. This chirp is defined quasi-static because it neglects the typical thermal red shift generally occurring with microsecond time-constants and longer.

Linewidth [MHz]: steady-state laser linewidth at the selected Test Current Value.

Average RIN Start Frequency [GHz]: start frequency of the frequency range over which the RIN will be averaged on. Allowed values: min 0; max -.

Page 164: 39865643 Optsim Guide

154 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Average RIN Stop Frequency [GHz]: stop frequency of the frequency range over which the RIN will be averaged on. Allowed values: min 0; max -.

Average RIN [dB/Hz]: the Relative Intensity Noise at steady state, averaged over the frequency range supplied through the parameters Start Frequency and Stop Frequency. For more information on RIN please see [3].

Evaluated Parameters Section This section groups the laser physical parameters, results of the fitting procedure.

Waveguide Volume V [m3]: the volume of the optical waveguide in the laser cavity. Allowed values: min: 0; max: -.

Photon Lifetime in the Cavity ττττph [s]: the mean time spent by a photon in the cavity before being scattered or ejected through a facet. Allowed values: min: 0 s; max: -.

Output Facet Photon Output Rate 1/ττττout [s-1]: the rate of emission of photons through the facet that is coupled to the laser pigtail. The total number of photons per second exiting the laser through the output facet is P/τout, where P is the total number of photons in the cavity. For a Fabry-Perot laser:

=

rLvg

out

1ln1τ

where vg is the lasing mode group velocity, L is the cavity length and r is the field facet reflectivity (note: the facet power reflection coefficient would be |r|2). For a DFB laser the calculations to derive τout are more complex due to the action of the grating. Please see [2] for reference. Allowed values: min: 0; max: -.

Carrier Density at Transparency n0 [m-3]: the carrier density at which a perfect balance between stimulated emission and stimulated absorption occurs. Allowed values: min: 0; max -.

Gain Constant a [m2]: the linear slope of the optical gain g versus the carrier density n. The expression of the optical gain, without gain saturation, is: g = a(n-n0). Allowed values: min: 0; max: -.

Optical Gain vs. Photon Number Slope GP [s-1]: accounts for non-linear gain saturation. The expression of the complete optical gain, expressed as a rate of difference between stimulated emission and stimulated absorption, is:

( ) PGnnavG Pg −−Γ= 0

where Γ is the Field Confinement Factor, vg is the field group velocity, a is the Gain Constant, n0 is the Carrier Density at Transparency and P is the total number of photons in the cavity. GP accounts for such phenomena as spatial and spectral hole burning. Allowed values: min: -; max: -.

Auger Carrier Recombination Factor C [m6s-1]: contributes to the determination of the excited carrier lifetime τe whose expression is:

( ) [ ]sCnBnAnre12 −++=τ

It accounts for Auger recombination phenomena. The coefficients Anr and B are parameters explained below. Allowed values: min: 0; max -.

Spontaneous Carrier Recombination Factor B [m3s-1]: accounts for the radiative carrier recombination process. It contributes to the determination of the excited carrier lifetime τe. Allowed values: min: 0; max: -.

Nonradiative Carrier Recombination Factor Anr [s-1]: accounts for the non-radiative carrier recombination processes. It contributes to the determination of the excited carrier lifetime τe. Allowed values: min: 0; max: -.

Spontaneous Emission Factor ββββsp: the fraction of all photons generated through spontaneous emissions that couple into the lasing mode. This parameter mainly affects the laser near threshold, whereas it has almost no effect well above threshold. Allowed values: min: 0; max: -.

Linewidth Enhancement Factor ββββc: formally defined as the ratio of the derivative of the real part of the complex susceptibility of the active layer vs. carrier density divided by the derivative of the imaginary part of the complex

Page 165: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 155

susceptibility of the active layer vs. carrier density. In fact, it is a phenomenological parameter that permits to fit both laser chirp and laser linewidth values. Note though that the laser chirp depends linearly on βc whereas the laser linewidth is proportional to (1+βc

2). See [1] for more details.

Field Confinement Factor ΓΓΓΓ: the fraction of the field energy in the cavity that is contained within the active layer. Allowed values: min 0; max 1.

Group Index µµµµg: the field group refractive index in the cavity. By definition, the group index is:

gg v

c=µ

where c is the speed of light in vacuum and vg is the field group velocity in the cavity. Allowed values: min 0; max -.

Non-Linearity Coefficients Order 2 [W-1], Order 3 [W-2], Order 4 [W-3], Order 5 [W-4]: the c2, c3, c4, c5, coefficients of the series expansion of the non-linear mapping law between the output power as generated by the rate equations and the actual output power of the laser simulation model. It can be used to impose a controlled amount of non-linearity on the laser P/I curve.

Fiber Coupling Efficiency (range 0 to 1) [-]: the fraction of the optical power emitted by the laser that actually coupled into the fiber. Allowed values: min 0; max 1.

3.7 Using the Best-Fit Laser Toolkit

3.7.1 Launching the Best-Fit Laser Toolkit The Best-Fit Laser toolkit may be launched within the OptSim editor using the menu bar or the tool bar or from a laser Rate-Equation parameters dialog window.

To start the Best-Fit Laser toolkit from OptSim

1. In the OptSim editor window choose the OptSim menu command Utilities > Best-Fit Laser or click on the Best-Fit Laser button in the OptSim tool bar. The Best-Fit Laser toolkit dialog window appears (Figure 13).

3.7.2 Defining the Parameters In the Defined Parameters section of the dialog window (Figure 13) you may define the laser data-sheet target parameters. In the Evaluated Parameters section, where you get the physical parameters results of the fitting process, you can force some physical parameter values before starting the fitting procedure.

Please note that at least one parameter must be defined in the Defined Parameters section in order to start the fitting procedure.

To define the parameters

1. In the Defined Parameters section for each parameter click the Define option and type the new value in the field that appears on the right.

2. In the right list choose the parameter accuracy. This set an error range around the defined value for the fitting procedure.

Now click on the Evaluated Parameters tab. In this section the physical parameters related to the parameters previously defined in the Defined Parameters section, are highlighted with a blue dot on the left of the parameter name. Please bear in mind that the fitting procedure evaluates all the physical parameters not only the ones marked by the blue dots.

To force a physical parameter value

In the Evaluated Parameters section click the Force option of the parameter you want to force its value and write the forced value in the field.

Page 166: 39865643 Optsim Guide

156 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

3.7.3 Starting the Fitting Procedure When at least one parameter has been defined in the Defined Parameters section of the dialog window you can start the fitting procedure.

Before start the procedure you have to set the fitting procedure parameters.

To set the fitting procedure parameters

1. In the Best-Fit laser toolkit dialog window choose the menu command Tools >

Accuracy or click on the Accuracy button. The Accuracy dialog window appears.

Figure 14. The Accuracy dialog window

2. Set the Tolerance value and the number of Max Iterations for the fitting procedure. Click on OK to close the window.

Now we can start the fitting procedure.

To start the fitting procedure

1. Choose the menu command Tools > Check or click on the Check button.

2. If no errors are detected choose the menu command Tools > Fit or click on the Fit button.

3.7.4 Using the Results In order to use the results obtained by the Best-Fit Laser toolkit you have to save them in a data file. After that, directly on the Rate-Equation laser dialog window, you can import that file to set all laser parameters.

The saving operation saves also all the settings made into the window (input data).

To save the settings

1. In the Best-Fit laser toolkit dialog window choose the menu command File > Save or click on the Save button. The file selection dialog window appears. 2. Choose a filename (the default directory is the project directory) and click on OK. A

filename.prm will be created in the current directory.

To use the results in the laser 1. Within an OptSim project double click the Rate-Equation laser or choose the popup menu

command Properties. The laser dialog window appears.

2. Click on the Load button and a secondary list window will open up.

3. From that list of the available lasers, select the laser model name just created. All the values of the file are loaded into the parameter window fields.

Page 167: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 157

3.9 References [1] R. W. Tkach et al., Four-Photon Mixing and High Speed WDM Systems, IEEE/OSA J.

Lightwave Technology, vol. 13, no. 5, pp. 841-849, May 1995.

[2] G. Bosco et al., Suppression of Spurious Tones in Fiber System Simulations based on the Split-Step Method, on LEOS'99 Proceedings, paper WH0004, Nov. 1999, San Francisco, CA, USA.

[3] Govind P. Agrawal and Niloy K. Dutta, Semiconductor lasers. New York : Van Nostrand Reinhold, copyr. 1993.

[4] Louis L. Scharf, Statistical signal processing: detection, estimation and time series analysis, Addison-Wesley, 1991.

[5] "Numerical Recipes" Cambridge University Press, (see also www.nr.com site)

[6] Max Ming-Kang Liu, Principles and Applications of Optical Communications. Irwin Book Team, London, 1996.

3.10 Appendix: Application Notes and White Papers This appendix collects the application notes and the most important white papers on the main simulation issue. These are:

• the Time Domain Split Step fiber simulation approach

• an analysis of spurious tones on sin2 and linear amplitude modulators

• considerations on the accuracy of BER and Q-factor estimation in optical system simulations

• a report on phase noise issue in OptSim

3.10.1 TDSS: Time Domain Split-step This is the white paper on a fiber simulation approach, the unique simulation technology to overcome the limits of first generation optical simulators.

The Split-step Method All commercial optical system simulation tools use the Split-step method to perform the integration of the fiber propagation equation. The form of such equation is as follows:

( ) ( )ztANLz

ztA ,, +=∂

∂ (1)

where A(t,z) is the optical field, L is the linear operator responsible for dispersion and other linear effects and N is the non-linear operator that accounts for the Kerr effect and other non-linear effects like SRS or pulse self-steepening.

The Split-Step integration algorithm works by applying separately L and N to A(t,z) over small spans of fiber ∆z. The error deriving from separating the effects of L and N goes to zero faster than (∆z)2.

Time Domain Split-step and Frequency Domain Split-step These two methods differ only in the way L is calculated. The non-linear operator N is instead always calculated in time domain by both methods. Being a linear operator, L is fully characterized by its impulse response h(t) and the mathematically correct way to compute its effect on A(t,z) is via a convolution product in time.

Page 168: 39865643 Optsim Guide

158 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Time Domain Split-step (TDSS) calculates L in the time domain by calculating the convolution product in sampled time, which can be written as:

[ ] [ ] [ ] [ ] [ ]∑∞

−∞=

−=∗=⇒k

L knhkAnhnAnATDSS (2)

Frequency Domain Split-step (FDSS) calculates L in the frequency domain, by multiplying the FFT or Fast Fourier Transform of A[n] - the signal in sampled time - with the FFT of h[n] - the impulse response in sampled time. The resulting array is converted back to sampled time domain with an inverse-FFT, as expressed in the following formula:

[ ] [ ] [ ] [ ]( ) [ ]( )( )nhFFTnAFFTFFTnhnAnAFDSS L ×=⊗=⇒ −1' (3)

It is well known from Signal Processing and Simulation Theory that FDSS as calculated above does not implement a real convolution product, but a circular convolution - indicated with the ⊗ symbol. The circular convolution creates a signal fold-over error effect - or aliasing - in the resulting array A'

L[n], which may contains less samples than needed to compute the actual convolution product AL[n]. The error is intrinsic to the method, thus it cannot be avoided and there is no way the exact result AL[n] can be derived from A'

L[n].

FDSS is simple to implement using the FFT in a straightforward way, and for this reason it has been used in several simulators that researchers developed for their own personal studies on fiber propagation, from which the first generation of optical simulators was derived.

The effective implementation of TDSS is much more difficult to achieve, and this makes it the most important intellectual property and technological strength of OptSim.

TDSS is Free from Aliasing Errors and Modeling Limits The errors due to the FDSS approximated calculation of convolution can be dramatic. With a span of plainly dispersive fiber and a perfectly flat envelope CW wave in input, by using FDSS to calculate the output, you easily observe severe amplitude oscillations in the envelope of the calculated output signal, even in the total absence of non-linearity. Such behavior is clearly an artifact, fully due to the intrinsic errors of FDSS.

Theory shows that such errors can be avoided only if the simulated optical waves conform to very strict constraints:

(i) their frequency must be an exact multiple of the fundamental value f0=1/T, where T is the time-length of the array of the simulated signal. Carrier waves can be modulated - for instance by an RZ data signal - but if they are modulated, then

(ii) the modulating signals must also be strictly periodic and their periods must be sub-multiples of T

These constraints are extremely taxing, especially within complex WDM and broadband systems that may include sources with chirp and phase noise, frequency converters and other frequency modulating components. In fact, constraint (i) is unrealistic for today's systems. Constraint (ii) can be more easily met, but ensuring it may be critical. For sure it denies the possibility of studying the effects of non-perfectly congruent concurrent transmission rates like OC-48 and OC-192 in mixed WDM systems.

Since (i) cannot be realistically imposed, practical workarounds are used to avoid the generation of dramatic errors. One possible remedy is adding a large number of leading and trailing zeros to the signal to keep it away from the array boundaries, whose trespassing causes the fold-over effect and the generation of errors. This technique is effective only if the signal is simulated in such a way that its average group velocity is zero, i.e. pulses are stationary with respect to the array boundaries. All the early work on soliton pulse propagation was done this way. In this limit, FDSS yields correct results. However, this technique is only viable for single-channel systems. In today's broadband WDM systems, the average group velocities are so much different because of dispersion that some channels may walk out and back in the array, crossing the array boundaries several times and thus causing severe problems.

Constraint (i) is met when both amplitude and phase are continuous across the boundaries of the array. Therefore, a drastic workaround is imposing the signal phase to be the same at the two boundaries of the array. This can be achieved “accelerating” the phase shift in time of the parts of signal that are close to the array boundaries. This method greatly reduces the intensity of the envelope oscillations that one would get otherwise, but it never completely eliminates them, since it introduces a phase modulation of the signal at the borders of the array, that broadens the original signal spectrum.

Page 169: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 159

Moreover, it does not help at all to correct a fundamental problem that occurs every time an optical carrier frequency does not comply with (i). When a modulating signal folds over in the array, its phase is altered as if it came from a different source. From the viewpoint of phase-dependent non-linear effects, this means that the beating with the other channels is altered by a spurious additional phase that has nothing to do with physical reality. This error can by no means be eliminated and will always affect FDSS simulations.

All the modeling limits and intrinsic numerical errors of FDSS simply do not apply to TDSS, which has no constraints whatsoever on the shape and spectra of the signals. Furthermore TDSS requires no tricky workarounds since it guarantees the absence of intrinsic errors.

OptSim TDSS Accurately Considers Differential Group Delays FDSS does not correctly handle the time shifts among signals of different wavelengths that are due to the frequency-dependent group-velocity, which is a by-product of dispersion. In fact, when a channel shifts out of the A'L[n] array boundaries it is incorrectly shifted back in from the opposite side. Noise does the same too, creating the potential for some unrealistic noise sample correlation, which is again another simulation artifact.

TDSS computes a true convolution in the time domain and therefore channels are free to shift in time. Differential group delays are part of the physical reality and can play an important role in the way the signal is propagated. TDSS is therefore more realistic.

Handling these delays poses critical implementation problems. Large overheads can be incurred unless proper optimizing strategies are included in the software implementation. OptSim TDSS implements sophisticated strategies deeply rooted in the software to manage delays in such way as to minimize overheads to a point that virtually no loss of efficiency exists. Such outstanding results set OptSim as the leader in TDSS simulation.

Overhead is incurred when, due to dispersion, distant channels shift with respect to each other to an extent that they only partially overlap. To preserve accuracy, the non-overlapping bits are cut off at the end and only the bits that have always beaten with all channels are presented to the user. This mechanism is fully automated and transparent to the user, who defines the desired observation time window so that OptSim automatically simulates a possibly longer sequence of data to allow for trimming of “bad bits” to ensure accuracy in the defined observation window. Some trimming of non-overlapping parts of signals takes places all along the link to optimize efficiency. Dispersion compensation reduces the impact of such overhead. In typical WDM simulations with compensation at every span, the overhead is commonly between 10 and 20%.

The worst case occurs with large bandwidth simulations - like 100 channels - with large dispersion values and infrequent compensation, and the resulting overhead may sometimes even double or triple the simulation time. Therefore, to improve performance when rigorous accuracy is not required, OptSim provides the option to define the bandwidth of a shifting window within which contemporary presence of all channels is ensured. For example, with 128 channels the user may elect to have contemporary presence of all adjacent sets of 32 channels only. Note that all channels are simulated and available at the end in any case. Furthermore the windowing algorithm is “smooth” since superposition of farther channels gradually decreases with the distance in frequency.

This feature allows the user to simulate with all channels fully overlapped in time when a high accuracy is required, whereas system set-up and initial optimization can be simulated using partial channel overlap to enhance speed.

OptSim TDSS Is More Efficient and Keeps Error under Control The OptSim TDSS implements the linear operator L by means of Finite Impulse Response (FIR) filters. OptSim automatically truncates the theoretically infinite h(t) impulse response of L and calculates the FIR filter with a sophisticated technique that ensures full control on the end-to-end overall error over links of any length. The accuracy of the computation is user-defined. For example, Medium accuracy settings ensure the overall linear link transfer function error to stay below 0.025 dB on the amplitude and 0.1 [ps] on the group delay. These constraints can be made tighter or looser according to needs, providing flexibility in accuracy and calculation performance. OptSim automatically calculates the optimal z integration step to ensure the desired accuracy requirements are met.

FIR filters can be implemented using various algorithms. One of the best in terms of complexity is the famous overlap-and-add algorithm [1] that takes advantage of FFTs while correcting the aliasing problems that affect FDSS. To filter M signal samples A[n], the computational effort of L at each ∆z - i.e. for each filter - is on the order of M[log2(K)+2],

Page 170: 39865643 Optsim Guide

160 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

where K is the number of samples of the impulse response h(t) of the FIR filter which implements L. The computational complexity of FDSS for each L is on the order of M[log2(M)+1].

The relative complexity of TDSS/FDSS calculation of the L operator therefore depends on [log(K)+2]/[log(M)+1]. For large broadband systems M is in the range 50,000-400,000 whereas K averages 512-1024 samples, thanks to OptSim's proprietary FIR filter synthesis which is very efficient. M gets larger as the bandwidth and the signal length grow, while K depends on the bandwidth and on the fiber dispersion. These numbers may vary widely, depending on system parameters, but the bottom line is that TDSS requires a much smaller computational effort than FDSS to carry out the same simulation job. The slow-varying logarithm gives stability to this ratio in the range between 55% and 65% - therefore TDSS performs almost twice as fast than FDSS in average to calculate the L operator.

OptSim TDSS Allows Full-broadband Simulation FDSS requires the entire array A[n] of M field time samples to be available at each spatial step z. With complex wide-bandwidth simulations - assuming double precision and dual polarization - A[n] easily gets in the hundred MBytes range. Furthermore FDSS requires several copies of A[n] to be stored in memory at all times for processing needs. RAM requirements therefore skyrocket in the GBytes range.

Huge RAM requirements make full-broadband FDSS simulation unviable on today's available computers. FDSS performs a full FFT and IFFT at each z over the entire array A[n] with M samples. With such large arrays, the FFT code and data will never fit in the processor cache. This causes swapping of data from cache and RAM that further slows down FDSS computation.

On the contrary, TDSS uses FFTs on subsets of only K samples, and - since the size of each processing component is around 32 KB - code and data comfortably fit in the processor cache for optimal efficiency. Due to its inherent nature, TDSS can handle full broadband simulations with even as low as 32 MB of peak RAM occupancy.

Some FDSS simulators even explicitly advocate in their user's manual the use of large machines with “Gigabytes of RAM and multiple CPUs, in order for FDSS to be able to handle complex simulations.” The use of multiple CPU's with FDSS depends on the capability of executing a parallel computation of the extremely large FFTs that the method requires. Very specialized and expensive parallel-computation software and hardware is needed for this purpose, and the effectiveness may vary largely, improving speed by a small factor at most.

For this reason some commercial tools recently have turned to approximated methods and signal representations. The no-approximation, full-bandwidth Frequency-Domain Split-Step could not keep up with the emerging needs of the DWDM community.

TDSS can Take Full Advantage of Parallel Computing Time-Domain simulation is a one-sample-in one-sample-out sequential processing of each time sample of the input signal AI[n] to calculate each time sample of the output signal AO[n] for each functional component. A function component can be any time domain component and also each FIR filter or non-linear operator N that implement a single ∆z in the fiber. Thanks to this, TDSS naturally lends itself to pipelining the simulation, so that each time sample of the input signal may be fed through a pipeline of functional components. Each component will process one sample and pass it to the next component in the pipeline before processing the next sample. The output of one component is feeding continuously the input of the next. This pipeline computation naturally allows the simulation to be segmented, so each set of sequential components can be simulated independently and concurrently. In fact, each Time Domain component never requires the array of samples in time is as a whole at any specific spatial location in the system, but processes the array of samples one sample after the other.

As a result, the RAM requirement can be made arbitrarily small and even complex WDM simulations may require as little as 32 MB of RAM. Furthermore, parallel computation is straightforward to implement by assigning to a different CPU each set of sequential components that form a simulation segment. Each segment must simply forward the part of signal in time that has already been processed to the following segment in the pipeline.

OptSim TDSS pipeline computation can take full advantage of cheap multiprocessor computers without the need for any special DSP hardware, large RAM or special parallel processing software. A simulation using several PC's concurrently over a conventional LAN is also possible, thus slicing simulation time by a factor equal to the number of CPUs.

Page 171: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 161

OptSim TDSS Technology Guarantees Future-proof Scalability Today's explosive demand for bandwidth has made FDSS a technology of the past. Perfectly adequate to handle single-pulse or even single-channel simulations, FDSS - with today's complex WDM systems - suffers from both intrinsic errors and intrinsic implementation problems. The required computing resources make FDSS not a practically viable option for broadband simulation, which would require several GB of RAM.

RSoft believes there is no need to give up on the full-bandwidth Split-step and resort to radically approximated methods because FDSS cannot handle complex simulations. Thanks to its features, TDSS constitutes a breakthrough technology that allows the simulation of complex systems using the full-bandwidth Split-step - all channels simulated together. Thanks to the cheap multiprocessor computers available today and the unique capability of TDSS to take advantage of them, RSoft believes that TDSS will put at the users' disposal the best accuracy at a reasonable elapsed time.

When a final system validation requires fully-fledged accuracy, a no-approximation full bandwidth simulation is necessary and TDSS is the only viable choice. RSoft believes that Time Domain simulation - a well-known technology pervasively used for conventional transmission system simulation - provides a powerful means of increasing speed and efficiency. Thanks to the unique features of TDSS, even complex, very wide bandwidth simulations can be handled using the full-bandwidth split-step method on today's available multiprocessor PCs.

3.10.2 Spurious Tones in Amplitude Modulators General Analysis In general, the optical signal at the output of an amplitude modulator can be expressed in the following complex-envelope format:

( ) ( )[ ]tzVAfty bias += (1)

where A is the amplitude of the optical carrier, f[...] is electro-optic trans-characteristic, Vbias is the bias voltage, and z(t) is the modulating electric signal. If an quasi-linear modulation is needed - like for CATV and Microwave on fiber optics systems - the following condition is satisfied:

( ) biasVtz << (2)

Hence, equation (1) can be expressed through its Taylor series expansion, getting the following result:

( ) ( ) ( ) ( )

+++≈ LtzFtzFtzFFAty 3

32

210 61

21

(3)

where Fi's are the derivatives of the function f[...] with respect to its argument:

[ ][ ][ ][ ]bias

bias

bias

bias

VfFVfF

VfFVfF

'''''

'

3

2

1

0

====

(4)

Higher order terms of the series expansion have been neglected for simplicity.

To simplify the analysis and to focus our attention on the spurious tones, we suppose to modulate the optical carrier with a single tone signal, thus considering the following signal:

( ) ( )tatz ωcos= (5)

where a is the amplitude of the tone, and ω = 2πf. f is the frequency of the modulating tone, i.e., the sub-carrier frequency. Substituting equation (5) in equation (3), we get the following expression for the optical carrier modulated by the single tone sub-carrier:

Page 172: 39865643 Optsim Guide

162 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

( ) ( ) ( ) ( ) tatataaAty ωωω 3cos2coscos 3210 +++≈ (6)

where

333

222

3311

220

24141

81

41

aFa

aFa

aFaFa

aFFa

=

=

+=

+=

(7)

From equation (6) can be clearly observed that, in general, from a single-tone modulating sub-carrier, all the multiple tones appear in the optical signal. Therefore, the power spectrum of the optical signal at the output of an amplitude generator, in general, shows all the multiple tones. Even if the modulating signal is a single-tone sub-carrier. Intensity of these tones depends on the electro-optics transfer-function of the modulator f[...], and on the modulation depth giving by the ratio

biasVa

In optical systems, the important signal is the electric signal at the output of the photodetector. For simplicity, we suppose the photodetector is an ideal derive giving the exact power of the optical signal. Hence, the electric signal ω(t) at the output of the photodetector can be expressed as:

( ) ( ) 2tyt =ω (8)

and taking into account the general expression reported in equation (1) for modulated signals, the electric signal can be rewritten as

( ) ( )[ ]tzVgAty bias += 2 (9)

where

[ ] [ ] 2LL fg = (10)

Therefore, following the same procedure used to get the expression reported in equation (1) to describe the optical signal modulated by a single-tone sub-carrier, we obtain the following expression for the electric signal at generated by an ideal photodiode detecting the modulated signal reported in equation (1):

( ) ( ) ( ) ( ) tbtbtbbAt ωωωω 3cos2coscos 32102 +++≈ (11)

where

Page 173: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 163

333

222

3311

220

24141

81

41

aGb

aGb

aGaGb

aGGb

=

=

+=

+=

(12)

and

[ ][ ][ ][ ]bias

bias

bias

bias

VgGVgG

VgGVgG

'''''

'

3

2

1

0

====

(13)

From equation (13) can be observed that, in general, even for the electric signal at the output of the photodetector, from a single-tone modulating sub-carrier, in general, all the multiple tones appear. Their intensity, beside to depend on the modulation depth like for tones in the optical signal, in this case is controlled by the derivatives of the function g[...] = |f[...]|2. Therefore, in general, optical amplitude modulation generates multiple tones, and their intensity is different in the optical signal with respect the intensity of the ones in the electric signal at the output of the photodetector.

Sin2 Modulator In previous section, we analyzed the behavior of a general amplitude modulator defined trough the transfer function f[...]. In this section, we focus our attention on the sin2 amplitude modulator simulating a single-arm Mach-Zehnder modulator. In this case, for the simplest situation of infinite extinction-ratio and no insertion-loss, the optical field at the output of the modulator presents the following format:

( ) ( )

−+=

π

πV

VtzVAty onbias

2cos (14)

Supposing Von = Vπ and Vbias = Vπ/2, we get the following expression for the optical field:

( ) ( )

+−= tzAty

4cos π

(15)

Supposing z(t) = a cos(ωt) to be a single tone modulating signal, and following the same procedure described in the previous section, we get the following expression for the optical signal y(t):

( ) −

−+

−≈ taaAty ωcos

811

411

22)( 3

( ) ( )−− tata ωω 3cos

2412cos

41 32 (16)

Therefore, at the output of a sin2 modulator one has to expect all the multiple tones in the optical spectrum from a modulating single-tone sub-carrier. Intensity of the tones depends on the modulation depth that is given by the ratio of the sub-carrier amplitude with Vπ.

Page 174: 39865643 Optsim Guide

164 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Now, we want to investigate what happens to the electric signal in this case. Following the same procedure described in the previous section, we get the following expression for the electric signal:

( ) ( )

+−≈ tataaAt ωωω 3cos

61cos

211

41)( 322

(17)

Therefore, even if the optical signal presents all the multiple tones, in case of modulation through a sin2 modulator, the spectrum of the electric signal presents the odd multiple tones only.

The example sin2.opf describes the behavior of the sin2 modulator in OptSim. An excellent agreement can be observed. -150 dB tones are numerical noise that may change depending on the number of points of the FFT.

In the following figures the optical and electrical spectrums obtained from sin2.opf example are shown. The charts correspond to a modulating signal with amplitude equal to 0.2.

Figure 15 Optical power spectrum of a sin2 modulator

Page 175: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 165

Figure 16 Electrical power spectrum of a sin2 modulator

Linear Modulator The ideal optical modulator is the one with a linear trans-characteristic between the electric signal and the optical power, therefore it may be modeled using the following law for optical field:

( ) ( )tzKty = (18)

that implies the following linear law for the electric signal

( ) ( )tzKt 2=ω (19)

If z(t) = a cos(ωt), in this case, the electric signal can be easily expressed as

( ) ( )taKt ωω cos2= (20)

Hence, the electric signal reshapes exactly the modulating signal, and thus its spectrum presents the modulating tone

only. But for the optical signal, the modulation function is not linear, it is f[...] = K , therefore the procedure described

above must be applied to obtain the expression in terms of spurious tones. Noting that the derivatives of the K function are not equal to zero, it is easy to understand that for linear modulator, even if the electric signal does not present multiple tones, in the optical spectrum all the multiple tones can be observed.

The example linear.opf describes the behavior of the linear modulator in OptSim. An excellent agreement with the theory can be observed. -150 dB tones are numerical noise that may change depending on the number of points of the FFT.

In the following figures the optical and electrical spectrums obtained from linear.opf example are shown. The charts correspond to a modulating signal with amplitude equal to 0.2.

Page 176: 39865643 Optsim Guide

166 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Figure 17 Optical power spectrum of a linear modulator

Figure 18 Electrical power spectrum of a linear modulator

Page 177: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 167

3.10.3 On the Accuracy of BER and Q-factor Estimation in Optical System Simulations Introduction The simulation of an optical communication system does not only require implementation of detailed models for the link subsystems and components, but also the accurate techniques for the evaluation of the system performance. Focusing our attention on the binary digital systems, the most commonly used performance parameters are:

• the Bit Error Rate (BER)

• the Q-factor, defined as:

01

01

σσ +−

=mm

Q

where m1,σ1 (m0,σ0) are the mean and the standard deviation of the received signal at the sampling instant when a logical “1” (“0”) is transmitted.

In a laboratory or field experiment, BER can be easily and accurately measured using commercial BER testers, which are based on direct error counting by comparison of the input and output digital streams. Otherwise, BER evaluation is usually a very difficult task in a software simulation environment for the following reasons:

• the reference BER for an optical communication system is very low (10-9 and lower)

• the noise statistic at the output of the link, after the photodetection process is usually unknown or very complex due to the non-linear interaction between the signal and the noise in the fiber, in the photodetection process and in any other non-linear devices placed along with the link

• the signal at the output of the link is usually effected by intersymbol interference

• the number of simulated bits is limited with respect to the available CPU time The most commonly used techniques in the communications system simulations are direct error counting, semi-analytical techniques and the various forms of Gaussian approximations based on the estimation of the moments of the received signals. A detailed analysis of all these techniques may be found in [2]. Of all these techniques, direct error counting is seldom used in the simulation of the optical systems. In fact, a BER close to 10-9 requires [2, Fig.2] the simulation of at least 1010 bits to achieve a reasonable accuracy, and would thus need an prohibitively large CPU time even for extremely simple link setups.

Semi-analytical techniques are often very powerful. Several versions of these techniques are available. The common requirement to all these techniques is the exact knowledge of the noise distribution at the receiver. Whenever this is true, the semi-analytical techniques provide extremely accurate results even when a few bits are simulated (see [2, Sec. VI]). A typical example of application is an optical system whose performance is limited by the noise of the electrical part of the receiver. In this case, it can be assumed that the only relevant noise source is a Gaussian noise at the receiver, and thus the semi-analytical techniques can be used. OptSim has a powerful built-in algorithm to analyze this situation. Whenever only receiver noise is considered, this feature can be successfully utilized.

Unfortunately, unless several approximations are made, the noise distribution at the receiver cannot be easily estimated in many practical cases. For example, whenever the predominant noise source is the Amplified Spontaneous Emission (ASE) noise coming from optical amplification along the link, the fiber non-linearity mixes signal and noise in a non easily predictable way. Generally, the most commonly used approach is the simulation of the propagation of signal and noise along the link and on the estimation of a few moments (typically the mean and variance) of the received signal. Noise is generated at each optical amplifier by using numerical pseudo-random sources, so the simulation can be though as a kind of Monte Carlo simulation.

OptSim is based on this approach, since it is the only one that allows taking into account the complex interaction of signal and noise in the fiber and in any other device showing some forms of non-linearity. Other kinds of approximated

Page 178: 39865643 Optsim Guide

168 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

or semi-analytical techniques [3,4] have usually a very good accuracy over a given system scenario, but are not sufficiently flexible to handle very different systems, as required by today optical communication.

In this paper we focus our attention on how to reliably analyze system performance in this scenario. In particular, we will study the reliability of the evaluation of Q-factor and BER, whenever they are evaluated over a finite number of bits. We will show that, contrary to what it is often thought, at least some hundreds of bits must be simulated to obtain a reasonable accuracy in the performance estimation.

The paper is organized as follows; next section will introduce some basic theoretical results that allow predicting the accuracy of performance estimation as a function of the number of simulated bits. Then we will report some evidence of the application of this theory by showing several results obtained using OptSim. We will finally discuss on how to successfully use OptSim performance evaluation blocks.

Theory A very common parameter for the estimation of system performance by simulation is the well-known Q-factor, defined as:

01

01

σσ +−

=mm

Q (1)

The BER is then often evaluated as:

=22

1 QerfcBER (2)

It is commonly know that this last relation is exact only when:

• noise at the receiver is Gaussian;

• ISI is negligible. There is usually a widespread perception among the users of simulation tools of the scope and consequences of these two assumptions. On the contrary, it is much less understood that there is an intrinsic uncertainty in the evaluation of the Q-factor whenever it is measured over a FINITE number of bits.

In order to investigate this point, let’s suppose that the above assumptions are exactly met, i.e., that the signal is not significantly affected by intersymbol interference and that the noise is Gaussian. Let’s start by focusing on that the estimate m* of the mean of a Gaussian-distributed variable of mean m and standard deviation σ. The estimate is evaluated over N samples of the variable as:

∑=

=N

iis

Nm

1

1* (3)

where si are the N samples of the variable. From standard estimation theory [3], it can be demonstrated that the estimate m* has an uncertainty whose standard deviation is given by:

Nmdev σ=*][ (4)

Similarly, the estimate of the variance σ2* has an uncertainty whose standard deviation is given by [3]:

22 2*][ σσN

dev = (5)

Starting from these results, assuming that we are simulating Ntot bits and we have an equal number of “1” and “0”, it can be shown that the uncertainty in the estimation of the Q-factor has a standard deviation which is approximately given by:

Page 179: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 169

totNQQdev

2*][ ≅ (6)

As commonly accepted, we will now assume as a “confidence interval” of the estimate a range given by two standard deviations which, for a Gaussian variables, accounts for a 95% probability. We can interpret the confidence interval as follows: the estimate Q* has a 95% probability to be in the range:

[ ]*][2,*][2 QdevQQdevQ +− (7)

In the next two graphs, we report this range for a nominal Q=6 (15.56 dB) and Q=8.2 (18.2 dB), corresponding to the two commonly used reference BER of 10-9 and 10-16, respectively.

Figure 19 Q-factor estimate range (95% confidence interval) for a nominal Q=6 (15.56 dB), corresponding to BER= 10-9

Figure 20 Q-factor estimate range (95% confidence interval) for a nominal Q=8.2 (18.2 dB), corresponding to BER= 10-16

Page 180: 39865643 Optsim Guide

170 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

It is interesting to note that, in the both cases, approximately 500 bits are required in order to have a Q-factor confidence intervals of ±1dB. Moreover, it should be noted that, even though this is often done in a simulation environment, the estimation over less than 100 bits leads to an exceedingly high confidence interval, greater than ±2dB.

In order to asses the “error” in the evaluation of the Q-factor over a finite number of bits, we consider the two extremes of the 95% confidence interval given by:

+=−=

*][2**][2*

max

min

QdevQQQdevQQ

(8)

The estimate range can be expressed as:

minmax ** QQrange −= (9)

and is given by:

+=

tot

tot

N

Nrange

21

21log20 10 (10)

This is a very useful formula, which shows that the Q-factor range is independent from the Q-factor nominal value and is only dependent on the total number of bits Ntot. The following table reports this range in dB vs. the number of simulated bits.

Number of simulated bits Ntot Q factor uncertainty range [dB]

32 4.43

64 3.10

128 2.18

256 1.53

512 1.09

1024 0.77

An even more useful insight in this description of the estimation accuracy can be obtained by the following two graphs, where the BER range (evaluated from the Q-factor in the Gaussian approximation) is plotted versus the number of simulated bits for the two nominal BER’s equal to 10-9 and 10-16.

Page 181: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 171

Figure 21 BER estimate range (95% confidence interval) for a nominal BER= 10- 9

Figure 22 BER-factor estimate range (95% confidence interval) for a nominal BER= 10-16

As it can be shown by direct comparison, that confidence interval at BER around 10-9 is given by roughly ±1 order of magnitude for Ntot=512. We believe that this is an acceptable range for most application and we thus advice the user to simulate at least 512 bits when even the accurate indication of the BER value is in the 10-9 range.

The situation is the worst at lower bit rates, as it can be seen from the graphs at BER= 10-16. In fact for a given Ntot, the range in terms of BER increases while decreasing the reference BER. This is due to the fact that the BER vs. Q function is steeper for smaller BER. Thus for a fixed range in term of Q-factor correspond to a BER range that increases for the decreasing reference BER, as shown in the following graph. For example when simulating 512 bits at BER= 10-16, the range is more than ± 2 orders of magnitude.

Page 182: 39865643 Optsim Guide

172 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Figure 23 BER vs. Q factor

Examples using OptSim The following theoretical results have been tested using OptSim. We have analyzed the following system:

Figure 24 Layout of the OptSim project used in this section

We run several simulations by changing the global random generator seed and the attenuation at the receiver. The following two graphs shows the measured Q-factor and BER vs. the received power. Each plot refers to different seeds.

Page 183: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 173

Figure 25 Q-factor vs. received power for several different random seeds

Figure 26 BER vs. received power for several different random seeds

As stated in the previous section, the Q-factor range is clearly independent from its central value, while the BER range increases for increasing BER.

Discussion and Conclusion We have previously shown both theoretically and through simulations, that:

• the Q-factor and BER have an intrinsic uncertainty that decrease while increasing the number of the simulated bits;

• at least some hundreds of bit should be simulated in order to have sufficiently accurate measurement.

Page 184: 39865643 Optsim Guide

174 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

The user should always be aware of these results. Let’s suppose that one wants to measure the BER as a function of some given system parameters as, for example, the receiver attenuation. Two situations are possible:

• the simulation tools force the pseudorandom noise sources to be the same for all simulation runs on the different values of the variable parameters;

• the simulation tools generate independent pseudorandom noise sources for the different runs.

Figure 27 BER vs. received power

We would like to highlight that the resulting uncertainty range is exactly the SAME for both the strategies. The second strategy is the one that OptSim follows in the most of the cases while simulating multiple runs since it avoids to create unwanted correlation between different realization of the pseudorandom sequences. The user should anyway be aware that, for each value of the free parameters in the multiple runs, different noise sequences are generated, and thus the resulting Q or BER can have different positions inside their uncertainty range. The resulting plots, in the same situation of the last graph, but with only one common random generator seed will typically look as the solid line in the graph of Figure 27.

The solid line shows a typical result obtained when the pseudorandom sources are independent from one run to the next in a multiple run simulation.

3.10.4 Report on Phase Noise Issues in OptSim The present report analyzes issues related to phase noise generation and conversion. In particular, we will focus on:

• phase modulation to intensity modulation (PM-AM) conversion in optical fibers

• laser phase noise generation

• interaction between laser phase noise generation and PM-AM conversion

We will show that:

• PM-AM conversion in OptSim shows an excellent agreement with published results

• laser phase noise models are consistent with their definition

Page 185: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 175

PM-AM Conversion in Optical Fibers It is know from the literature (see for example [4]) that, even in the assumption of a perfectly linear fiber (no Kerr effect), fiber dispersion induces a conversion of phase modulation to intensity modulation.

Let’s consider an optical signal with a constant envelope and a variable phase; i.e., let’s assume that the fiber input signal is given by:

( ) ( )[ ]ttfjinin

inoePtE Φ+= π2 (1)

where:

• P is the (constant) input power

• f0 is the signal central frequency

• Φin(t) is the instantaneous phase of the signal

The signal coming out from the fiber will be affected by intensity fluctuations, due to the PM-AM conversion induced by fiber dispersion. The power spectrum of the output intensity fluctuations (normalized to the intensity mean value) is given by [4]:

( ) ( ) ( )

⋅Φ=∆ 222 2

2sin

2fLf

SfS

in πβ (2)

where:

• β2 is the fiber dispersion value (typically expressed in [ps2/km])

• L is the fiber length

We have simulated with OptSim the propagation of an optical phase modulated signal over 150 Km of standard (SMF) fiber with dispersion D=16 [ps/nm/km] (corresponding to β2=- 20.4 [ps2/km]). A white Gaussian noise was used for the phase modulation, so that the spectrum of the phase input signal is constant over frequency, i.e.:

( ) constant=Φ fin (3)

Here is the layout of the OptSim project.

Figure 0.4 Layout of the OptSim project used in this section

The output spectrum is thus given by:

( ) ( )

⋅=∆ 222 2

2sinconstant

2fL

SfS πβ

(4)

Page 186: 39865643 Optsim Guide

176 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

Figure 28 Simulation vs. theory comparison on the electrical power spectrum

Apart from a proportionality constant, this is the electrical power spectrum that would be observed at the output of the fiber after a photodiode. We are thus able to compare the simulated results with those expected from the theory, as shown in the graph of Figure 28.

The graph shows the excellent agreement between theory and simulation results, and confirms the validity of the fiber model in OptSim.

Laser Phase Noise Generation: Lorentzian Laser The CW Lorentzian laser model used in OptSim is based on a widely accepted model where the laser is approximated as a sinusoidal source whose instantaneous frequency is modulated by a white Gaussian noise whose variance is related to the 3-dB bandwidth of the laser itself. It can be demonstrated that the resulting signal has a Lorentzian spectrum.

In this model the instantaneous phase, being by definition the integral of the instantaneous frequency, has a power spectrum given by:

( ) 2fkfin =Φ (5)

where k is a constant depending on the 3-dB bandwidth of the laser itself. At the output of a fiber, the amplitude fluctuation has thus a power spectrum given by:

( ) ( )

−⋅=∆ 222

2 22

sin2

fLfk

SfS πβ

(6)

We have checked this result using OptSim. Here is the layout of the used project.

Figure 29 Layout of the OptSim project used in this section

The following graph reports the comparison between the results obtained with OptSim and the theoretical ones.

Page 187: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 177

Figure 30 Simulation vs. theory comparison on the electrical power spectrum

Again, the excellent agreement between theory and simulation results shows that the Lorentzian laser and fiber models have the expected behavior.

Comparison Between Lorentzian and Rate Equation Lasers OptSim includes a detailed Rate Equation laser model that takes into account a great number of physical parameters. Even when using a constant electrical signal to drive the Rate Equation laser, i.e., when using it as a CW source, the phase noise behavior of this model is significantly different from the Lorentzian model.

We have simulated the two laser models by setting the parameters so to have the SAME 3dB bandwidth for both models. Other parameters for the Rate Equation laser are:

• Center emission wavelength [nm] : 1550

• Waveguide Volume [m3] : 1e-16

• Photon Lifetime in the Cavity [s] : 2e-12

• Output Facet Photon Output Rate [s-1] : 168634064081

• Carrier Density at Transparency [m-3] : 1e+24

• Gain Constant [m2] : 2.5e-20

• Optical Gain vs. Photon Number Slope [s-1] : -34000

• Auger Carrier Recombination Factor [m6 s-1] : 3e-41

• Spontaneous Carrier Recombination Factor [m3 s-1] : 1e-16

• Nonradiative Carrier Recombination Factor [s-1] : 500000000

• Spontaneous Emission Factor : 2e-05

• Linewidth Enhancement Factor : 12.5

• Field Confinement Factor : 0.3

• Group Index : 4

• Fiber Coupling Efficiency (range 0 to 1) : 0.3

Page 188: 39865643 Optsim Guide

178 •••• Chapter 3: Sample Mode Simulation Techniques and Features OptSim User Guide

• Insert Test Current Value [mA] : 48.1987696754

• Threshold Current [mA] : 24.0993848377

• Linear Output Power [mW] : 1.95047633707

• P-I Slope [mW/mA] : 0.0809346939851

• Turn-On Delay [ns] : 0.829

• Relaxation Oscillation Peak Frequency [GHz] : 4.38593249253

• Relaxation Oscillation Peak Overshoot [dB] : 7.13880525363

• Static Frequency Chirp Above Threshold [GHz/mA] : 0.422177672987

• Linewidth [MHz] : 29.7019102264

The resulting spectra after 150 km of fiber are shown in the following graph.

Figure 31 Comparison between Lorentzian and Rate Equation laser

The main differences between the two models can be summarized as follows:

• the CW laser has higher spectral component than the Lorentzian Laser in the low frequency range, due also to the fact that the Rate Equation laser model do not only emit phase noise, but also intensity noise (RIN).

• the decrease at higher frequency is faster for the Rate Equation laser.

It is thus left to the requirements of the user to choose between models. The CW Lorentzian Laser model is much easier to be used than the Rate Equation laser, since it requires just a few parameters, and it is suitable in most situations whenever an optical CW source is required.

Conclusion We have shown that:

• fiber phase noise conversion in OptSim due to fiber dispersion is accurately taken into account

• CW Lorentzian laser model performs accordingly to its theoretical assumptions

• Rate Equation and Lorentzian laser models may behave in different ways even when the last one is used as a CW source

Page 189: 39865643 Optsim Guide

OptSim User Guide Chapter 3: Sample Mode Simulation Techniques and Features •••• 179

3.10.5 References [1] M. C Jeruchim, P. Balaban, and K. S. Shanmugan, Simulation of Communication Systems, Plenum Publishing Corporation, New York, 1992.

[2] M. C. Jeruchim, Techniques for estimating the bit error rate in the simulation of digital communication systems, IEEE Journal of Selected Areas in Communications, Vol. SAC-2, No. 1, January 1984.

[3] A. Papoulis, Probability, random variables and stochastic processes, New York, Mc-Graw Hill, 1991.

[4] J. Wang and K. Peterman, Small signal analysis for dispersive optical fibers communication systems, IEEE Journal of Lightwave Technology, vol. 10, no. 1, pp. 96-100, Jan. 1992

Page 190: 39865643 Optsim Guide
Page 191: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 181

Chapter 4: Sample Mode Data Post-Processing and Display

This chapter describes the sample mode data post-processing and display environment, the part of OptSim that manages sample mode simulation results.

Section 4.1 describes the data display tool and how OptSim launch it to display the results. Section 4.2 lists the OptSim component that may collect data and display the simulation results and describes how to export these results. Sections 4.3 and 4.4 describe all the graphical elements that compose the measurement list window and the measurement window.

From section 4.5 up to section 4.15 are described all the diagrams that can be displayed in the measurement window. The elements of the Measurements tab and post-processing operations allowed are described for each diagram.

Section 4.16 describes the grammar rules for the measurement data files.

Sections 4.17 and 4.18 describe sample mode toolkits available for using with MATLAB.

4.1 The Data Display Tool The Data Display is the tool that visualizes the simulation results. Two main windows compose the tool:

• the measurement list window where, for one or more OptSim projects, all measurement components and their related measurements are displayed in a “tree” or hierarchical manner

• the measurement window where a single diagram of one or more curves is displayed and you may perform some post-processing operations

Page 192: 39865643 Optsim Guide

182 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Measurement List Window

Measurement Window

Figure 1. An example of a graphical result

4.1.1 How to Display the Results Generally speaking, simulation results are available once the simulation is finished. Specifically, simulation results are available from components for which the simulation is complete.

This latter capability may be useful during very long simulations. While the simulation is running you may observe results as soon as they have been generated, and in this way verify that the simulation is proceeding properly. You may also begin working on some of the results before the simulation is finished.

The principal way to start the tool is using the Data Display button.

To start the Data Display tool

1. Click on the Data Display button in the tool bar of the OptSim editor window. The measurement list window appears (Figure 1).

Alternatively you can choose the popup menu command View Chart directly on any of the measurement components drawn in the design area. In this case the measurement list window and the measurement window (Figure 1) displaying the chosen diagram appears.

Note For those components producing more than one diagram, the View Chart command has also a sub-menu listing all the diagrams the component can display.

Some measurement components may have the command View Data on their popup menu. This command opens a text window displaying numerical results (Figure 2). Examples of these measurement components are the Q estimator, the BER estimator, the optical and electrical power meters.

Page 193: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 183

Figure 2. An example of numerical result

4.2 Simulation Results Three different types of OptSim elements may used to collect data and display simulation results. These may be grouped in the following categories.

Measurement Components Measurement components are OptSim components dedicated solely to the collection of simulation data. Examples of measurement components include optical Probe, electrical Scope, ESA, OSA, Q, BER, power meters and the sensitivity receiver.

Some measurement components such as Q, BER, power meters and sensitivity receiver evaluate several single measurements. For example the Q measurement component evaluates the Q measurement (linear or in dB), the Eye opening and closure measurements, the Jitter measurement, and so on. These quantities are not represented in diagrams since they are single values but, in case of parametric run, they can be correlated with the run number, a variable value, or some other quantity.

Optical Links Optical links may be used to display the spectrum of the optical signal. Realistic optical links (optical fibers) may be used to display the Raman gain and the noise transfer functions, if enabled. Optical spectrum is available after performing an SPT simulation, while Raman and noise transfer functions are available after performing a VBS simulation.

Components with Frequency-dependent Transfer Functions Components with frequency-dependent transfer functions are regular OptSim components that are characterized in whole or part by a transfer function, such as gain, loss, and group delay or noise figure versus frequency (or wavelength). These transfer functions are calculated during simulation and are available as charts, in a manner similar to actual simulation results.

4.2.1 OptSim Components This section summarizes the main characteristics of all the OptSim components that may used to collect data and display simulation results.

Components Producing Simple Diagrams The following table lists, for the measurement components, the diagrams produced, the available post-processing operations and the diagrams that can be superimposed.

Page 194: 39865643 Optsim Guide

184 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Component Diagram Units Post-Processing Operations Superimpose

Optical Spectrum Analyzer

Optical Spectrum [dBmW/THz] vs [THz] or [nm]

[dBm] vs [THz] or [nm]

set two real spectrum models (with pre-filter) change resolution peak search power evaluation channel detection OSNR on channels/markers display OSNR vs. Run diagram

Instantaneous Optical Power [mW] vs [ns]

min, max, peak-to-peak on display chirp analysis

Istantaneous

Phase Deviation [rad] vs [ns] change reference freq. and phase range min, max, peak-to-peak on display chirp analysis

Instantaneous Frequency Deviation

[GHz] vs [ns] change reference frequency min, max, peak-to-peak on display chirp analysis

Instantaneous Stokes

Parameters [-] vs [ns] show single Stokes components None

Optical Probe

Optical Spectrum [dBmW/THz] vs [THz] or [nm]

[dBm] vs [THz] or [nm]

change resolution view the X or Y polarization component set two real spectrum model (with pre-filter) peak search power evaluation channel detection OSNR on channels/markers export to a file OSNR on channels display OSNR vs. Run diagram

Electrical Signal [a.u.] vs [ns] min, max, peak-to-peak on display

Eye Diagram [a.u.] vs [ns]

Q factor (optimum/markers) BER (optimum/markers) opening (optimum/markers) jitter for RZ signals (optimum/markers)

Histogram on Eye

Diagram [-] vs [a.u.] change sampling instant change number of divisions max, mean, standard deviation, variance

None

Electrical Spectrum

[dB(a.u.)2/GHz] vs [GHz] [dBm] vs [GHz]

change bandwidth change resolution set two real spectrum model (with pre-filter) peak search

Electrical Scope

Histogram on

Electrical Signal [-] vs [a.u.] change number of divisions max, mean, standard deviation, variance

None

Electrical Spectrum Analyzer

Electrical Spectrum

[dB(a.u.)2/GHz] vs [GHz] [dBm] vs [GHz]

set two real spectrum model (with pre-filter) change resolution peak search

Logical Signal Display

Logical Signal [-] vs [ns] None None

Page 195: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 185

Component Diagram Units Post-Processing Operations SuperimposeScattering Diagram

Scattering [a.u.] vs [a.u.] None None

SCATD3

Scattering [a.u.] vs [a.u.] None None

Q vs Sampling

Instant [dB] vs [ns] min, max, peak-to-peak on display (same)

Q estimator

Eye Closure vs

Sampling Instant [dB] vs [ns] min, max, peak-to-peak on display (same)

BER vs Sampling

Instant [-] vs [ns] min, max, peak-to-peak on display (same)

BER estimator

BER vs Decision

Threshold [-] vs [a.u.] min, max, peak-to-peak on display (same)

BER vs Received

Power [-] vs [mW] min, max, peak-to-peak on display (same) Sensitivity

Receiver

BER vs Decision Threshold

(optimum) (ASE- lim)

[-] vs [a.u.] min, max, peak-to-peak on display (same)

Components Producing Correlation Diagrams The following table lists all the correlation XY diagrams produced by the measurement components. These diagrams are created only if parametric runs have been executed.

All these diagrams may be superimposed to diagrams of the same type and with the same X axis type. All these diagrams may be superimposed using the copy&paste measurement window feature.

For all these diagrams the post-processing operations available are the evaluation of the minimum, maximum and peak-to-peak values.

Component Diagram Units Optical Power Meter

Optical Power [dBm] or [mW] vs [run] or [variable] or [other]

Electrical Power Meter

Electrical Power [10log(a.u.)] or [a.u.] vs [run] or [variable] or [other]

Q Value [dB] or [lin] vs [run] or [variable] or [other]

Eye Closure [dB] vs [run] or [variable] or [other]

Average Eye Opening [a.u.] vs [run] or [variable] or [other]

Eye Opening [a.u.] vs [run] or [variable] or [other]

Jitter [ns] vs [run] or [variable] or [other]

Q estimator

Sampling Instant Tolerance [a.u.] vs [run] or [variable] or [other]

Component Diagram Units

BER at Optimal Threshold [-] vs [run] or [variable] or [other]

BER at Relative Threshold [-] vs [run] or [variable] or [other] BER estimator

BER at Fixed Threshold [-] vs [run] or [variable] or [other]

Equivalent Q [dB] or [lin] vs [run] or [variable] or [other] Sensitivity Receiver

Required Power (for BER) vs Run or Variable [mW] vs [run] or [variable] or [other]

All Order PMD

DGD [ps] vs [run] or [variable] or [other]

Page 196: 39865643 Optsim Guide

186 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Components Producing Charts The following table lists all the XY diagrams produced by the components with frequency-dependent transfer functions.

For all these diagrams the post-processing operations available are the evaluation of the minimum, maximum and peak-to-peak values.

Component Diagram (XY) Units

Requested Transfer Function Module [dB] vs [THz]

Requested Group Delay [ps] vs [THz]

Transfer Function Module [dB] vs [THz] Optical Filter

(User Defined)

Group Delay [ps] vs [THz]

Requested Transfer Function Module [dB] vs [THz]

Optical Filter

(Raised Cosine) Transfer Function Module [dB] vs [THz]

Requested Transfer Function Module [dB] vs [GHz]

Requested Group Delay [ps] vs [GHz]

Transfer Function Module [dB] vs [GHz] Electrical Filter (User Defined)

Group Delay [ps] vs [GHz]

Requested Transfer Function Module [dB] vs [GHz]

Electrical Filter (Butterworth) Transfer Function Module [dB] vs [GHz]

Requested Transfer Function Module [dB] vs [GHz]

Electrical Filter

(Bessel) Transfer Function Module [dB] vs [GHz]

Requested Transfer Function Module [dB] vs [GHz]

Electrical Filter (Chebychev) Transfer Function Module [dB] vs [GHz]

Requested Transfer Function Module [dB] vs [GHz]

Electrical Filter

(Raised Cosine) Transfer Function Module [dB] vs [GHz]

Gain [dB] vs [THz]

Optical Amplifier (Physical Model) Noise Figure [dB] vs [THz]

Page 197: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 187

Component Diagram (XY) Units

Requested Transfer Function Module [dB] vs [THz]

Requested Noise Spectrum [ps] vs [THz]

Transfer Function Module [dB] vs [THz] Optical Amplifier (User Defined)

Noise Spectrum [ps] vs [THz]

Requested Transfer Function Module [dB] vs [GHz]

Requested Noise Spectrum [ps] vs [GHz]

Transfer Function Module [dB] vs [GHz]

Noise Spectrum [ps] vs [GHz]

Requested Transfer Function Group Delay [dB] vs [GHz]

Transfer Function Group Delay [dB] vs [GHz]

Requested Noise Spectrum Group Delay [dB] vs [GHz]

Electrical Amplifier

(User Defined)

Noise Spectrum Group Delay [dB] vs [GHz]

Raman Gain [dB] vs [THz]

Noise Figure [dB] vs [THz]

Optical Fiber

Noise Figure Penalty [dB] vs [THz]

Requested Transfer Function Module [dB] vs [THz]

Requested Group Delay [ps] vs [THz]

Transfer Function Module [dB] vs [THz] Fiber Grating

(User Defined)

Group Delay [ps] vs [THz]

Measured PI [mW] vs [mA]

Fitted PI [mW] vs [mA]

Measured AM [dB] vs [GHz] Laser MQW

Fitted AM [dB] vs [GHz]

4.2.2 How to Export Simulation Results You may export an OptSim project with all its simulation results and send them to other OptSim users on other computer platforms.

This operation may be performed directly from the UNIX console or the Windows OptSim console (without the OptSim tool) using the opzip command.

Note This command and the opexp command (see section 4.2.2) use the zip and unzip shareware programs that are installed during the OptSim installation procedure. Sources and license terms are available at Info-ZIP's home site www.info-zip.org/pub/infozip/.

To start the Windows OptSim console

1. Open the Start menu, point the OptSim 3.x menu and select the OptSim Console command.

Appears a window similar to the Command Prompt window. Within this window you can launch all the offline OptSim commands like the opzip.

To close the window type exit and press <Enter>.

To export an OptSim project

Page 198: 39865643 Optsim Guide

188 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

1. From the OptSim console, type the command opzip then press <Enter>. The following window appears.

Figure 3. The OptSim Data Export window

2. Click on the upper button. A file selection dialog window appears. Choose the location and the file opf of the OptSim project to export. Click on OK.

3. A directory selection dialog window appears. Choose the destination directory where the file opz will be stored. Click on OK.

Note The destination directory must be empty.

To import an OptSim project

1. From the OptSim console, type the command opzip then press <Enter>. The window of Figure appears.

2. Click on the lower button. A file selection dialog window appears. Choose the location and the file opz of the OptSim project to import. Click on OK.

3. A directory selection dialog window appears. Choose the destination directory where the OptSim project will be stored. Click on OK.

Note The destination directory must be empty.

The opexp Command From the OptSim console you may also convert in ASCII the simulation results of your projects and vice versa.

Note The destination directory must always be empty.

Conversion to ASCII

The following syntax converts the simulation results of the file_name.opf project. The converted ASCII files are stored under the dest_dir directory.

opexp [-options] [-global_options]-ascii file_name.opf dest_dir

The options are the following:

• zip, compresses the ASCII files in a zip file

• rm, removes all the simulation result files after the conversion (the project files opf, opm and dat are not removed)

Page 199: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 189

The global options are the following:

• help, displays the command's usage

• verbose, displays all the information messages involved in the conversion

Conversion from ASCII

The following syntax converts from the ASCII files stored in the dest_dir directory the simulation results of the file_name.opf project.

opexp [-options] [-global_options]-bin file_name.opf dest_dir

The options are the following:

• rm, removes the ASCII files after the conversion The global options are the following:

• help, displays the command's usage

• verbose, displays all the information messages involved in the conversion

Conversion from a Zip File

The following syntax converts from the file_name.zip file the simulation results and stores them in the dest_dir directory.

opexp [-options] [-global_options]-unzip file_name.zip dest_dir

The options are the following:

• rm, removes the zip file after the conversion The global options are the following:

• help, displays the command's usage

• verbose, displays all the information messages involved in the conversion

Page 200: 39865643 Optsim Guide

190 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Examples To display the command's usage type one of the following:

opexp opexp -help

To convert in ASCII the simulation results of the project prj2.opf and put the ASCII files in the export_dir directory, type: opexp -ascii prj2.opf ../export_dir

To convert in ASCII the simulation results of the project dwdm3.opf, create a zip file in the results/senddir directory and remove the simulation results, type: opexp -zip -rm -ascii dwdm3.opf results/senddir

To convert from the ASCII files stored in the resultascii directory the simulation results of the project catv_nrt.opf, type: opexp -bin catv_nrt.opf resultascii

To convert the zip file wdm2.zip in the projects directory and remove the zip file, type: opexp -rm -unzip wdm2.zip projects

4.3 The Measurement List Window The measurement list window presents all the simulation results in a hierarchical tree structure for one or more OptSim projects. The window appears as in Figure 4. It is composed of two tabs corresponding to two hierarchical trees and one menu bar.

Figure 4. The measurements list window

Page 201: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 191

4.3.1 The Menu Bar The menu bar consists of four menus with the following commands.

File Menu The Add Project command adds a project to the two hierarchical trees.

The Remove Project command removes a project from the two hierarchical trees.

The Exit command closes the measurement list window and all the measurement windows currently open.

View Menu The Measurement tree command displays the measurement hierarchical tree.

The Chart tree command displays the chart hierarchical tree.

The Dwdm tree command displays the chart hierarchical tree for the DWDM Template Manager tool (see the related help on line).

Tools Menu The Open measure command displays the selected diagram on a new measurement window.

The Superimpose measure command superimposes the selected diagram on a measurement window already open.

The Correlate diagram command starts the wizard for displaying a correlation diagram.

The Options command opens the Options dialog window for setting the parameters for the diagrams displayed in the measurement window.

Help Menu Online help and documentation is available.

The About OptSim command opens a dialog window where you may find the OptSim version, the license information and your license number; do not forget to include this number when you contact your local RSoft office for support.

4.3.2 The Tool Bar

Button Description

The Add Project button adds a project to the two hierarchical trees.

The Expand All button expands all groups of the current tree.

The Collapse All button collapses all groups of the current tree.

The Open button displays the selected diagram on a new measurement window.

The Superimpose button superimposes the selected diagram on a measurement window already open.

Page 202: 39865643 Optsim Guide

192 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

The Correlate diagram button starts the wizard for displaying a correlation diagram.

The Help button starts the HTML on-line help system, opening the “Overview” section of the “Data Post-Processing and Display” chapter.

4.3.3 The Hierarchies Two hierarchical trees are available: the measurement tree and the chart tree. The measurement tree organizes the diagrams of the measurement components of one or more OptSim projects. The chart tree organizes the transfer functions charts of the OptSim components with frequency-dependent transfer functions of one or more OptSim projects.

The hierarchies comprise several levels. The top level is root, the starting point of the hierarchy. The second level is the OptSim project. There may be more than one project “loaded”. For example if you have several OptSim windows open, each project appears at the second level of the tree. In turn, each OptSim project contains the following groups:

• variables defined in the OptSim project

• iterated components used in the OptSim project, containing at least one measurement component

• compound components used in the OptSim project, containing at least one measurement component

• measurement components used in the OptSim project (not contained in the iterated components or in the compound components)

The chart tree hierarchy uses the same groups as the measurements tree hierarchy with the measurement components replaced by the components with frequency-dependent transfer functions.

To Proceed as follows Expand one level Click the on the icon of the level, double click the

level icon, or choose the popup menu command Expand/Collapse on the level icon.

Collapse one level Click the on the icon of the level, double click the level icon, or choose the popup menu command Expand/Collapse on the level icon.

Expand or collapse all the levels Select the root icon and choose the popup menu command Expand/Collapse All. Click on the Expand All or on the Collapse All buttons in the tool bar.

To add a new project to the trees

1. Choose the menu command File > Add Project or click on the Add Project button in the tool bar. A file selection dialog window appears.

...or...

1. Choose the popup menu command Add Project on the root icon. A file selection dialog window appears.

2. Choose the project directory and select the project file name with extension opf to add.

To remove a project from the trees

1. Select the project root icon and choose the menu command File > Remove project or choose the popup menu command Remove on the icon.

Page 203: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 193

Variables Under the variables group are listed all the variable names along with their values. The figure below shows the variable “attenuation” defined for 2 different runs with values 1.2 and 1.32.

Variables Group

Variable Name

Variable ValueRun Number

Figure 5. The variables group

Iterated Components Each iterated component has an entry for each span that it is located in, and under each span are listed the measurement components. The figure below shows an optical Probe “Optn” used inside the iterated component b27.

Iterated Component

Component Name

Diagram Name

Run Number

Span Number

Figure 6. The iterated component group

Compound Components Each compound component has an entry for each measurement component that it is located in. A compound component that has not measurement components inside does not appear in the tree.

The figure below shows an optical spectrum analyzer “OSA_transmitter” used inside the compound component b46.

Compound Component Component Name

Diagram Name

Run Number

Figure 7. The compound component group

Measurement Components Each measurement component contains an entry for each diagram, and the run session numbers are listed under each diagram. The figure below shows an electrical Scope named “Ele” with some of its diagrams.

Page 204: 39865643 Optsim Guide

194 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Measurement Component Component Name

Diagram

Run Number

Diagrams

Figure 8. The measurement component group

4.3.4 Displaying and Superimposing Diagrams From the measurement list window you may:

• display the selected diagram on a new measurement window

• superimpose the selected diagram on a measurement window already open (the diagrams already displayed in the window must be compatible with the diagram selected)

To display a diagram on a new measurement window

1. Select the component icon, the diagram icon, or the run icon and choose the

menu command Tools > Open measure or click on the Open button in the tool bar.

...or...

1. Choose the popup menu command Open on the component icon, the diagram icon, or the run icon .

To superimpose a diagram on a measurement window already open

1. Select the component icon, the diagram icon, or the run icon and choose the menu command Tools > Superimpose measure or click on theSuperimpose button in the tool bar.

...or...

1. Choose the popup menu command Superimpose on the component icon, the diagram icon, or the run icon .

You cannot superimpose the correlation XY diagrams (unit versus run or variable) from the measurement list window; you can do that using the copy&paste measurement window feature.

4.3.5 Correlation Diagrams Single measurements obtained from the Q, BER, power meters and sensitivity receiver measurement components may be correlated with:

• the run number

• any variable value

• any other single measurement (obtained from the aforementioned components) The correlation may produce:

• a single curve specifying a common parameter (run or variable)

• a family of curves specifying a family parameter (run or variable) To help you to make a correlation of these quantities, OptSim comes with a powerful correlation diagram wizard.

Page 205: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 195

Figure 9. The Correlation Diagram Setting wizard – Step 1

Measurement versus Run Number This diagram is useful to show the trend of a measurement. If you make parametric runs increasing a variable value, for example the power of a laser, you can show the trend of a measurement, for example the Q value versus run number, i.e. versus the increasing of the laser power.

1

Run Pin Q

2 12.7

2 6 13

3 10 14

4 12 14.5

1 2 3 4

Measure vs Run Number

12.5

12

13.5

13

14.5

14

15

Q

Run

To correlate a Measurement with the Run Number

1. In the measurement list window select the diagram icon of the measurement for the diagram’s Y-axis. Choose the menu command Tools > Correlate diagram or click on the Correlate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard.

2. Step 1 - Type the diagram title in the Title field. In the Graph kind group choose Curve. Click on Next.

Page 206: 39865643 Optsim Guide

196 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

3. Step 2 – In the tree on the left select Run number. Click on Finish.

Measurement versus Variable This diagram shows the existing function between a measurement and a variable value. The points are drawn in the variable value order. The example in the following figure shows the BER value function of the Pow variable value.

1 2 3 4

Measure vs Variable

12.5

12

13.5

13

14.5

14

15

BER

Pow

1

Run Pow BER

2 12.7

2 3 13

3 1 14

4 4 14.5

To correlate a Measurement with a Variable

1. In the measurement list window select the diagram icon of the measurement for the diagram’s Y-axis. Choose the menu command Tools > Correlate diagram or click on the Correlate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard.

2. Step 1 - Type the diagram title in the Title field. In the Graph kind group choose Curve. Click on Next.

3. Step 2 – In the tree on the left open the variable node and choose the variable name for the diagram’s X-axis. Click on Finish.

Measurement versus Measurement (common parameter Run Number) This diagram correlates two measurements using as common parameter the run number. The example in the following figure shows the correlation between the electrical power value P and the Q value.

0.5

Measure vs MeasureCommon Parameter: Run

12.5

12

13.5

13

14.5

14

15

0.75 1 1.25Q

P

Run=1Run=2

Run=3

Run=4

1

Run Q P

0.5 12.7

2 1 13

3 1.1 14

4 1.2 14.5

To correlates Measurements (common parameter: Run number)

Page 207: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 197

1. In the measurement list window select the diagram icon of the measurement for the diagram’s Y-axis. Choose the menu command Tools > Correlate diagram or click on the Correlate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard.

2. Step 1 - Type the diagram title in the Title field. In the Graph kind group choose Curve. Click on Next.

3. Step 2 – In the tree on the left select the diagram icon of the measurement for the diagram’s X-axis. Click on Next.

4. Step 3 - Select Run number (in the tree on the left). Click on Finish.

Measurement versus Measurement (common parameter Variable) This diagram correlates two measurements using as common parameter a variable value. The points are drawn in the variable value order. The example in the following figure shows the correlation between the electrical power value P and the Q value using the variable Pow as common parameter.

0.5

Measure vs MeasureCommon Parameter: Variable

12.5

12

13.5

13

14.5

14

15

0.75 1 1.25Q

P

Pow=4

Pow=1

Pow=2Pow=3

1

Run Pow Q P

2 0.5 12.7

2 3 1 13

3 1 1.1 14

4 4 1.2 14.5

To correlate Measurements (common parameter: Variable)

1. In the measurement list window select the diagram icon of the measurement for the diagram’s Y-axis. Choose the menu command Tools > Correlate diagram or click on the Correlate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard.

2. Step 1 - Type the diagram title in the Title field. In the Graph kind group choose Curve. Click on Next.

3. Step 2 – In the tree on the left select the diagram icon of the measurement for the diagram’s X-axis. Click on Next.

4. Step 3 - Open the variable node (in the tree on the left) and choose a variable name for the common parameter. Click on Finish.

Measurement versus Run Number (family parameter Variable) This family of curves shows the trends of a measurement as function of a variable. The family parameter determines the number of curves (one curve each value). The example in the following figure shows the trend of Q function of Roll variable value (family parameter).

Page 208: 39865643 Optsim Guide

198 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

1 2 3 4

12.5

12

13.5

13

14.5

14

15

Q

Run

1

Run Roll Q

2 12.7

2 2 13

3 3 14

4 3 14.5

Roll=3

Roll=2

Measure vs Run numberFamily Parameter: Variable

To correlate a Measurement with a Run Number (family: Variable)

1. In the measurement list window select the diagram icon of the measurement for the diagram’s Y-axis. Choose the menu command Tools > Correlate diagram or click on the Correlate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard.

2. Step 1 - Type the diagram title in the Title field. In the Graph kind group choose Family. Click on Next.

3. Step 2 - In the tree on the left select Run number. Click on Next.

4. Step 4 – Choose (in the tree on the left) the variable name for the family parameter. Click on Finish.

Measurement versus Variable (family parameter Variable) This family of curves shows a measurement function of two variables. The variable chosen as family parameter determines the number of curves (one curve each value). The example in the following figure shows the family curves of BER value function of Pow with Roll variable value as family parameter.

1

Measure vs VariableFamily Parameter: Variable

12.5

12

13.5

13

14.5

14

15

2 3 4Pow

BER

Roll=3

1

Run Pow Roll BER

2 2 12.7

2 3 2 13

3 1 3 14

4 4 3 14.5Roll=2

To correlate a Measurement with a Variable (family: Variable)

1. In the measurement list window select the diagram icon of the measurement for the diagram’s Y-axis. Choose the menu command Tools > Correlate diagram or click on the Correlate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

Page 209: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 199

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard.

2. Step 1 - Type the diagram title in the Title field. In the Graph kind group choose Family. Click on Next.

3. Step 2 - In the tree on the left open the variable node and choose the variable name for the diagram’s X-axis. Click on Next.

4. Step 4 – Choose (in the tree on the left) the variable name for the family parameter. Click on Finish.

Measurement versus Measurement (family parameter Run Number) This family of curves correlates two measurements using the run number as family parameter. Because the run number changes on each run, all the curves degenerate in just one point (one curve each value). The example in the following figure shows the relationship between the electrical power value P and the Q value on each run.

0.5

Measure vs MeasureFamily Parameter: Run number

12.5

12

13.5

13

14.5

14

15

0.75 1 1.25Q

P Run=3

Run=1Run=2

1

Run Q P

0.5 12.7

2 1 13

3 1.1 14

4 1.2 14.5

Run=4

To correlate Measurements (family: Run num.)

1. In the measurement list window select the diagram icon of the measurement for the diagram’s Y-axis. Choose the menu command Tools > Correlate diagram or click on the Correlate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard.

2. Step 1 - Type the diagram title in the Title field. In the Graph kind group choose Family. Click on Next.

3. Step 2 – In the tree on the left select the diagram icon of the measurement for the diagram’s X-axis. Click on Next.

4. Step 4 – Choose Run number (in the tree on the left) for the family parameter. Click on Finish.

Measurement versus Measurement (family parameter Variable) This family of curves correlates two measurements using a variable value as family parameter. The variable chosen as family parameter determines the number of curves (one curve each value). The example in the following figure shows the correlation between the electrical power value P and the Q value with Roll variable value as family parameter.

Page 210: 39865643 Optsim Guide

200 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

1

Run Roll Q P

2 0.5 12.7

2 2 1 13

3 3 1.1 14

4 3 1.2 14.5

0.5

Measure vs MeasureFamily Parameter: Variable

12.5

12

13.5

13

14.5

14

15

0.75 1 1.25Q

P

Roll=2

Roll=3

To correlate Measurements (family: Variable)

1. In the measurement list window select the diagram icon of the measurement for the diagram’s Y-axis. Choose the menu command Tools > Correlate diagram or click on the Correlate diagram button in the tool bar or choose the popup menu command Correlate on the diagram icon.

The Correlation Diagram Setting dialog window appears displaying the Step 1 of the wizard.

2. Step 1 - Type the diagram title in the Title field. In the Graph kind group choose Family. Click on Next.

3. Step 2 – In the tree on the left select the diagram icon of the measurement for the diagram’s X-axis. Click on Next.

4. Step 4 - Open the variable node (in the tree on the left) and choose the variable name for the family parameter. Click on Finish.

4.3.6 Data Display Options With this dialog window you can set the data display options for the diagrams displayed in the measurement window. These settings will be applied to all diagrams that will be opened in all your OptSim projects.

Optical Spectrum

These parameters act on all optical spectrum diagrams.

The Filter list sets the type of spectral filtering. You may choose Ideal, Lorentzianor Rectangular.

X-Axis: sets the X-axis unit as THz for frequency or nm for wavelength.

Resolution [THz] or [nm]: the bandwidth of the filtering transfer function. For the ideal spectrum this field is disabled.

Instantaneous Phase/ Frequency Deviation

These parameters act on all instantaneous phase deviation diagrams and on all instantaneous optical frequency deviation diagrams. See the related sections for more information on these parameters.

Use Reference Frequency, sets for the reference frequency the value written in the following Reference Frequency field. If this option is deselected, the considered reference frequency value is the one set in the OptSim project.

Reference Frequency [THz] or [nm]: is the reference frequency for the signal representation. To change the measurement unit open the list on the right, select THz or nm.

Phase Range: is the factor n in the range [-nπ,+nπ] where the phase is represented.

Page 211: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 201

Electrical Spectrum

These parameters act on all electrical spectrum diagrams. See section 4.14 for more information on these parameters.

The Filter list sets the type of spectral filtering. You may choose Ideal, Lorentzian or Rectangular.

Resolution [GHz]: the bandwidth of the filtering transfer function. For the ideal spectrum this field is disabled.

Start Frequency [GHz]: is the spectrum lower frequency.

Stop Frequency [GHz]: is the spectrum upper frequency.

Clicking on the Defaults button you can restore the default values for these parameters.

4.4 The Measurement Window The measurement window is composed of the main graphical elements or “areas” shown in Figure 10.

Command AreaTitle Bar Menu Bar Tool Bar Display Area

Measurement AreaMessage Bar

Legend Window

Figure 10. The measurement window

You can enlarge or reduce the size of the window dragging any side or corner of the window to the desired location. This operation will resize only the display area.

Page 212: 39865643 Optsim Guide

202 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Title Bar The title bar at the top of the measurement window displays the name of the component selected and the name of the project.

Menu Bar Directly below the title bar, the menu bar groups commands into Windows-style pull-down menus. Clicking on a pull-down menu will display a list of commands. Moving the cursor onto a command in the menu will display a description of the associated command on the message bar at the bottom of the window.

Tool Bar Directly below the menu bar, the tool bar groups shortcuts for the most frequently used commands. Placing the cursor onto a tool bar button, a green-background box (tools & tips) will pop up with the name of the command executed by the button. A brief description of the command will appear on the message bar.

Legend Below the tool bar the legend lists the identifiers of the curves plotted in the display.

Display Below the legend the display area displays the graphical results.

Measurement Area

The measurement area is the area below the display area where numerical results of the post-processing operations are printed.

Command Area

The command area at the left of the window has two tabs: Measurements andMarkers. The items associated with the Markers tab are the same for all the measurements while the items associated with the Measurements tab depend on the measurement selected.

Message Bar The message bar is at the bottom of the window and provides explanations and context-sensitive hints regarding the menus or tool bar buttons that the cursor is pointed to.

4.4.1 The Menu Bar The menu bar consists of four menus with the following commands.

File Menu The Import Curve command imports from file the signal samples and superimposes the resulting curve on the curves currently plotted in the display. The signal samples file may be binary file or ASCII file written following the grammar rules described in section 4.18.

The Export Curve command exports to a file the signal samples of the curve currently selected in the display. The signal samples file will be written following the grammar rules described in section 4.18.

The Export Diagram command exports to a file all points (pixel coordinates) of the curves currently plotted in the display. The diagram file will be written following the grammar rules described in section 4.18.

The Page Setup command opens a window to change the page setting for the print.

The Print command prints the contents of the display area (in postscript format).

The Export Graphics command exports to a file the picture of the curves currently plotted in the display. The graphical file could be the following format: X Pixmap (xpm, UNIX only), Encapsulated Postscript (eps), Portable Network Graphics (png, UNIX only), Bitmap (bmp, Windows only) or Windows Metafile (emf, Windows only).

The Close command closes the current window.

The Exit command quits the data post-processing and display environment, closing all the measurement windows and the measurement list window.

Page 213: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 203

Edit Menu The Undo command reverses the last graphical operation and restores the window to its previous state. A series of operations can be undone by repeating this command. You cannot undo a post-processing operation.

The Redo command reverses the last Undo commands. A series of operations can be redone by repeating this command. This command is enabled only after the first Undo command.

The Cut command deletes the selected curve and saves the contents to the clipboard.

The Copy command copies the selected curve and saves the contents to the clipboard.

The Paste command pastes the contents of the clipboard into the display.

View Menu The Grid command toggles gridlines on and off in the display area.

The Legend command shows/hides the legend and reduces/enlarges the display.

The Command Area command shows/hides the command area and reduces/enlarges the display and the measurement area.

The Line style sub-menu groups the commands for line style of the displayed curves:

• the Lines command displays the curves with a continuous line

• the LinesPoints command displays the curves with a continuous line and with a tag on the sample points (one tag for each curve displayed, max 7 curves)

• the Points command displays the curves with a tag on the sample points (one tag for each curve displayed, max 7 curves)

The X Axis Properties command opens the dialog window allowing changes to the X axis properties.

The Y1 Axis Properties command opens the dialog window allowing changes to the first Y axis properties.

The Y2 Axis Properties command opens the dialog window allowing changes to the second Y axis properties.

The Original Range command resets the original zoom range of the display.

The Clear Measurement Area command deletes all the lines displayed in the measurement area.

Help Menu Online help (user guide, application notes and examples, and models reference) is accessible through Help menu.

The About OptSim command opens a dialog window where you may find the OptSim version, the license information and your license number; don’t forget to include this number when you contact RSoft for support.

4.4.2 The Tool Bar

Standard Tools

The Import Curve button imports from file the signal samples and superimposes the resulting curve on the curves currently plotted in the display. The signal samples file may be binary file or ASCII file written following the grammar rules.

The Export Curve button exports to a file the signal samples of the curve currently selected in the display. The signal samples file will be written following the grammar rules described.

Page 214: 39865643 Optsim Guide

204 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

The Export Diagram button exports to a file all points (pixel coordinates) of the curves currently plotted in the display. The diagram file will be written following the grammar rules described.

The Print button prints the contents of the display area (in postscript format).

The Cut button deletes the curve selected on the display and saves the contents to the clipboard.

Button Description

The Copy button copies the curve selected on the display and saves the contents to the clipboard.

The Paste button pastes the contents of the clipboard into the display.

The Undo button reverses the last graphical operation and restores the window to its previous state. A series of operations can be undone by repeating this command. You cannot undo a post-processing operation.

The Redo button reverses the last Undo commands. A series of operations can be redone by repeating this command. This command is enabled only after the first Undo command.

The Original Range button resets the original zoom range of the display.

The Clear Measurement Area button deletes all the lines printed in the measurement area.

The Show/Hide Legend Window button shows/hides the legend and reduces/enlarges the display.

The Show/Hide Command Area button shows/hides the command area and reduces/enlarges the display and the measurement area.

Diagram Tools

The Instantaneous Optical Power button displays the instantaneous power diagram of the optical signal. This button is present only in the Probe window toolbar.

The Instantaneous Phase Deviation button displays the phase deviation diagram of the optical signal. This button is present only in the Probe window toolbar.

The Instantaneous Frequency Deviation button displays the frequency deviation diagram of the optical signal. This button is present only in the Probe window toolbar.

The Instantaneous Stokes Parameters button displays the Stokes diagram of the optical signal. This button is present only in the Probe window toolbar and is enabled only if the dual polarization simulation parameter is set.

The Optical Spectrum button displays the spectrum diagram of the optical signal. This button is present only in the Probe window toolbar.

The Electrical Signal button displays the diagram of the electrical signal. This button is present only in the Scope window toolbar.

Page 215: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 205

This button is present only in the Scope window toolbar.

The Eye Diagram button displays the eye diagram of the electrical signal. This button is present only in the Scope window toolbar.

The Histogram on Eye Diagram button displays the histogram on the eye diagram of the electrical signal. This button is present only in the Scope window toolbar.

The Histogram on Electrical Signal button displays the histogram diagram of an electrical signal. This button is present only in the Scope window toolbar.

The Electrical Spectrum button displays the spectrum diagram of the electrical signal. This button is present only in the Scope window toolbar.

4.4.3 The Legend Window Located below the tool bar there is the legend window. This window lists the identifiers for all the curves plotted in the diagram. The identifier is written with the same color of the corresponding curve. For a measurement component the syntax is:

project_name: diagram at id, component_name, Run number

For an iterated component the syntax is: project_name: diagram at id, component_name, Run number, Span number

For a compound component the syntax is: project_name: diagram at id, component_name, Run number, CC id

You may select a curve by clicking on its identifier in the legend window or by clicking directly on the plotted curve in the display. The selected curve is plotted in:

• red color if the curve is related to an optical signal

• blue color if the curve is related to an electrical signal

• black color if the curve is related to a logical signal

• orange color if the curve is of an XY diagram

You may close/open the legend window by deselecting the menu bar command View > Legend or by releasing the Show/Hide Legend Window button.

4.4.4 The Display The display is the area of the measurement window where graphical results are displayed in the form of one or more diagrams. The display is composed of the elements shown in Figure 11.

Page 216: 39865643 Optsim Guide

206 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Third Axis

Span Numbers

Run Numbers

VerticalMarkers

HorizontalMarkers

GridlinesDiagram

Curves

Figure 11. The Measurement Display area and its elements

You may enlarge or reduce the size of the display by dragging any side or corner of the measurement window to the desired location. You may also enlarge the display by deselecting the menu bar command View > Command Area or by releasing the Show/Hide Command Area button.

On the diagrams you may set gridlines or change axis properties. You may also expand any particular area of the diagram by using the zoom feature.

Hide/show the gridlines Choose the menu command View > Grid.

Set the axis properties Choose the menu command View > X/Y1/Y2 Axis Properties or choose the popup menu command Axis Properties on the axis of the diagram.

Zoom in on a particular portion of the diagram

Drag a rectangle over that portion of the diagram.

Restore the original view of the diagram

Choose the menu command View > Original Range or click on the Original Range button in the tool bar.

Display the coordinates of a point

Click on the point in the display; the coordinates are printed in the measurement area.

Page 217: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 207

Curves Superimposed Several diagrams may be superimposed on the display. When more than two dependent variables are involved, a third axis (Y2) is shown to the right of the diagram (see Figure 11). The identifiers of the curve superimposed are listed in the legend window.

All the post-processing operations may be made locally on the selected curve or globally on all the curves of the diagram. The items in the Measurement section of the command area are grouped in Local and Global. The selections made in the Local group act only on the selected curve. The selections made in the Global group act on all the displayed curves and on all the curves that will be superimposed.

You may select a curve by clicking on its identifier in the legend window or by clicking directly on the plotted curve in the diagram.

You can superimpose diagrams displayed in more measurement windows using the Edit > Copy and Edit > Paste menu commands or the related tool bar buttons Copy and Paste. On diagrams the superimposed curves must be compatible (optical with optical, electrical with electrical or logical with logical). Copy & paste is the only way to superimpose correlation XY diagrams (unit versus run or variable).

Runs and Spans Lists On the right side of the display there are two lists:

• Runs, which lists all the runs simulated in the current project that are available for the curve currently selected; for example you may not see a run for which the measurement component is outside the VBS bandwidth simulation

• Spans, lists all the spans for an iterated measurement component which has produced the curve currently selected

With these lists you may superimpose several curves coming from different runs in the same span or from different spans in the same run. You may not select multiple spans and multiple runs at the same time.

To view one or more curves simply select the run or span numbers from the lists.

To Proceed as follows Select a single number Click on the number in the list.

Select a sequence of numbers Click and drag the mouse over the numbers in the list.

Select different numbers (not consecutively)

Click each number holding down the <Ctrl> key.

Deselect a single number Click on the number selected holding down the <Ctrl> key.

Axis Properties The X- or Y1/Y2-axis properties dialog window may be selected by choosing the menu command View > X/Y1/Y2 Axis Properties or by choosing the popup menu command Axis Properties on the axis of the diagram.

Page 218: 39865643 Optsim Guide

208 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Figure 12. The Axis Properties dialog window

With this window you may:

• change the axis label name in the Label field

• change the axis unit by choosing the appropriate type in the Unit list

• change the axis scale to either Linear or Logarithmic in the Scale list

• specify the Minimum and the Maximum axis values or choose the auto- scaling feature

4.4.5 The Measurement Area The measurement area is the bottom pane where the numerical results of the post-processing operations are printed.

You may enlarge or shrink the size of the measurement area by dragging the sash point between this area and the display. You may also enlarge the measurement area by deselecting the menu bar command View > Command Area or by releasing the Show/Hide Command Area button.

To clear the measurement area, choose the menu bar command View > Clear Measurement Area or click on the Clear Measurement Area button in the tool bar.

4.4.6 The Markers Markers are guidelines that you may set on a diagram to read-out values. For example you may evaluate the eye opening at the sampling instant on the vertical marker or set a threshold value using an horizontal marker. Markers may be also used in post-processing operations like channel detection or peak level searching.

There are four markers available in the display: X1 and X2 for the X axis and Y1 and Y2 for the Y axis. Each marker has a colored flag and the colors have the following meaning:

• grey, for disabled marker

• red or blue, for enabled marker

Note In the case of multiple superimposed curves, the values displayed are related to the selected curve.

Page 219: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 209

Markers Tab By clicking on the Markers tab in the command area of the measurement window, you can gain access to the marker controls

General Reset, resets the positions of the markers.

X Track, locks the distance between X axis markers.

Y Track, locks the distance between Y axis markers.

First This group refers to the first pair of markers, X1 and Y1.

Marker X1, is the current axis position of the first vertical marker. To change the value, type in the new axis position and press <Enter> or click on the Set button to the right.

Marker Y1, is the current axis position of the first horizontal marker. To change the value, type in the new axis position and press <Enter> or click on the Set button to the right.

Second This group refers to the second pair of markers X2 and Y2.

Marker X2, is the current axis position of the second vertical marker. To change the value, type in the new axis position and press <Enter> or click on the Set button to the right.

Marker Y2, is the current axis position of the second horizontal marker. To change the value, type in the new axis position and press <Enter> or click on the Set button to the right.

Delta DeltaX, is the value of the difference between the two vertical markers. A value is displayed only if both the markers are positioned in the diagram. To change the value, type in the new value and press <Enter> or click on the Set button on the right (X2 marker is positioned while X1 marker is kept fixed).

DeltaY, is the value of the difference between the two horizontal markers. A value is displayed only if both the markers are positioned in the diagram. To change the value, type in the new value and press <Enter> or click on the Set button on the right (Y2 marker is positioned while Y1 marker is kept fixed).

Operations on Markers

To Proceed as follows Move the marker on the display Drag the corresponding flag on the display.

Move the marker, be specifying a new position

In the marker field (in the First or Second group) type the new value and press <Enter> or click on the Set button.

Locking the Markers

You may lock the relative distance between two axis markers (X1 and X2, or Y1 and Y2). In this way when you change the position of one marker, the position of the other marker changes to maintain a fixed relative distance between the two.

Page 220: 39865643 Optsim Guide

210 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

To Proceed as follows Set a relative distance between two axis markers

Type in DeltaX/Y the required value between the X/Y axis markers and press <Enter> or click on the Setbutton.

Lock the X or Y axis marker position

In the General group select the option X Track or Y Track.

Tracking the Curve

You may also track a single curve with the markers. Positioning the vertical marker X1 or X2 on any point of the X axis, the Y1 or the Y2 marker will be positioned to the corresponding Y axis’ point, intersection of the selected curve.

To Proceed as follows Set the tracking of a curve Choose the popup menu command Associate to

marker 1 (X1-Y1) or Associate to marker 2 (X2-Y2) on the curve.

Remove the tracking condition Choose the popup menu command Remove association on the curve.

With this new feature you can easily obtain the difference between two curves plotted in the display.

To obtain the difference between two curves

1. Choose the popup menu command Associate to marker 1 (X1-Y1) on the first curve. Position the marker X1 on the first curve.

2. Choose the popup menu command Associate to marker 2 (X2-Y2) on the second curve. Position the marker X2 on the second curve (it might be the same position of marker X1).

In the Delta Y field you can read the difference between the two curves.

You can also explore all the X values to obtain all the Y differences. To do so select the X track option to lock the distance between the X markers.

4.4.7 Operations on the Measurement Window

Import/Export Measurement Data Files The signal samples generating the single curves and the diagrams displayed in the measurement window may be exported or imported through measurement data files. This feature is used to send graphical results to other OptSim users or to display the results in another tool such as Microsoft Excel or MATLAB.

The measurement data files are in ASCII format and follow the grammar rules. However you can also import binary data files, i.e. files directly produced by the simulation (without exporting to convert them into an ASCII file).

You may import/export:

• the signal samples of a single plotted curve

• the points (pixel coordinates) of all the plotted curves of a diagram The measurement data file for a single curve is the record of the signal samples on which you can perform post-processing operations as described in following sections. The measurement data file related to a diagram is as a “snapshot” of all of the curves displayed in the measurement window. On these curves you cannot perform other post-processing operations.

Page 221: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 211

Note Remember that you can export all the simulation results in a single operation using the opzip offline command (see section 4.2.2).

To import a single curve

1. Choose the menu bar command File > Import Curve or click on the Import Curve button in the tool bar. A file selection dialog window appears.

2. In the Type list select the file format:

− Formatted text (*.prn), where the file values are space-delimited

− Text (*.txt), where the file values are tab-delimited

− CSV (*.csv), where the file values are comma-delimited

− OptSim Signal File (*.osg), for optical, electrical or logical signal samples binary data file

− OptSim Spectrum File (*.osp), for optical, electrical spectrum samples binary data file

− OptSim Chart File (*.oxy), for XY chart binary data file

3. Choose the directory and select the measurement data file.

To export a single curve

1. Choose the menu bar command File > Export Curve or click on the Export Curve button in the tool bar. A file selection dialog window appears.

2. In the Type list select the file format:

− Formatted text (*.prn), where the file values are space-delimited

− Text (*.txt), where the file values are tab-delimited

− CSV (*.csv), where the file values are comma-delimited

3. Choose the directory and type the measurement data file name.

To export a diagram

1. Choose the menu bar command File > Export Diagram or click on the Export Diagram button in the tool bar. A file selection dialog window appears.

2. In the Type list select the file format:

− Formatted text (*.prn), where the file values are space-delimited

− Text (*.txt), where the file values are tab-delimited

− CSV (*.csv), where the file values are comma-delimited

3. Choose the directory and type the measurement data file name.

Note Exporting a curve in a diagram from a component with frequency-dependent transfer function you export all the diagrams that component may produce. For example exporting a curve in the Requested Transfer Function Module diagram of a Butterworth electrical filter you obtain also the Transfer Function Module diagram.

Printing a Diagram You can print (in postscript format) the diagram to the printers configured in the system. You can also set the page setting for the print.

Page 222: 39865643 Optsim Guide

212 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

To change the page setting

1. Choose the menu command File > Page Setup. The Page Setup dialog window appears.

Figure 13. The Page Setup dialog window

2. Choose the page measurement units in the Margins list and set the page margins in the fields Top, Bottom, Left and Right.

3. Choose the page size in the Paper Size list. Set also the page orientation between Portrait and Landscape.

4. To not print the legend of the diagram deselect the Show Graph Legend option. To print the diagram proportionally (exactly as appears in the display) deselect the Fit to Page option.

5. Click on OK to confirm the settings.

To print a diagram

1. Choose the menu command File > Print or click the Print button in the toolbar. On Windows systems OptSim directly shows the standard Windows print dialog to confirm the printer selection. On UNIX systems appear the following dialog window.

Page 223: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 213

Figure 14. The print dialog window

2. Select the configured printer in the Printers list.

3. Select to print all the pages (All) or type a range of pages in from and to.

4. Type the number copies to print in Number of copies.

5. In the Print Command group select the correct print command lp or lpr or select user command to specify the print command in the field below. No alias can be used when specifying the print command.

6. Click on OK to confirm.

4.5 Instantaneous Optical Power Diagram This diagram displays the instantaneous power of the optical signal as a function of time. The units used in the diagram

are mW or sqrt(mW) ( mW , signal amplitude) for the Y axis and nanoseconds (ns) for the X axis.

As described in section 3.5, optical signals in OptSim are represented using the complex envelope )(~ tx that is related to the optical signal x(t) by the following formula:

tfjtfj etxetxtx 00 2*2 )(~)(~21)( ππ −+=

where f0 is the center frequency of the signal, corresponding to central frequency of the VBS bandwidth.

If the dual polarization simulation parameter is set, the signal is composed of two components x(t) and y(t), one for each

polarization, that are represented by the two complex envelope representations )(~ tx and )(~ ty .

Page 224: 39865643 Optsim Guide

214 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

This diagram displays the value of the power 2)(~ tx

or 2)(~ ty

for single polarization and 22 )(~)(~ tytx +

for dual polarization.

4.5.1 Measurements

Global Parameters Section The Polarization option is enabled only if the dual polarization simulation parameter is set. You can choose:

• X: selects the X component of the optical field.

• Y: selects the Y component of the optical field.

• X+Y: selects the whole optical field.

Local Parameters Section

Signal Analysis

The button Minimum Value evaluates the minimum value of the plotted curve shown in the display.

The button Maximum Value evaluates the maximum value of the plotted curve shown in the display.

The button Peak-to-Peak Value evaluates the difference between the maximum value and the minimum value of the plotted curve shown in the display.

Chirp Analysis

Instantaneous Frequency: superimposes the instantaneous frequency deviation diagram onto the current diagram for chirp analysis.

Phase: superimposes the instantaneous phase deviation diagram onto the current diagram for chirp analysis.

4.5.2 Post-Processing Operations On this diagram you can:

• evaluate the minimum value, the maximum value and the peak-to-peak value of the plotted curve currently displayed

• perform a chirp analysis superimposing the instantaneous frequency deviation diagram or the instantaneous phase deviation diagram

To Proceed as follows Evaluate the minimum value Click on the Minimum Value button. The value is

printed in the measurement area.

Evaluate the maximum value Click on the Maximum Value button. The value is printed in the measurement area.

Evaluate the peak-to-peak value Click on the Peak-to-Peak Value button. The value is printed in the measurement area.

Perform a chirp analysis Check the Instantaneous Frequency option to superimpose the instantaneous frequency deviation diagram or check the Phase option to superimpose the instantaneous phase deviation diagram.

If you zoom in on a curve, the values are calculated only for that portion of the curve shown in the display.

Page 225: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 215

4.6 Instantaneous Phase Deviation Diagram This diagram shows the phase deviation of the optical signal as a function of time. The units used in the diagram are radians (rad) for the Y axis and nanoseconds (ns) for the X axis.

Optical signals in OptSim are represented using the complex envelope )(~ tx that is related to the optical signal x(t) by the following formula:

tfjtfj etxetxtx 00 2*2 )(~)(~21)( ππ −+= (1)

where f0 is the center frequency of the signal, corresponding to central frequency of the VBS bandwidth.

If the dual polarization simulation parameter is set, the signal is composed of two components x(t) and y(t), one for each

polarization, that are represented by the two complex envelope representations )(~ tx and )(~ ty .

You may set a new frequency/wavelength value in Reference Frequency instead of the default value f0. If you choose to do so, let f1 be this custom reference frequency value. Then the complex envelopes used to evaluate the quantities that will be displayed are:

tffjetxtx )(21

01)(~)(~ −= π

tffjetyty )(21

01)(~)(~ −= π

where )(~1 ty is present only in the case of dual polarization.

The diagram displays the phase value )](~arg[)( 1 txt =ϕ for single polarization and:

2)](~arg[)](~arg[)( 11 tytxt +=ϕ

for dual polarization. In both cases the phase is represented in radians over the range [-nπ,+nπ] where n is the Phase Range parameter.

This means that the plotted phase ϕ’(t) is defined as follow:

−<−+>+−

=nπ (t) ntnt

nπ(t) ntntt

ϕππϕπϕϕππϕπϕ

ϕif)2,)(mod(2)(

if)2,)(mod(2)()('

where mod(a,b) is the remainder of the division a/b.

Page 226: 39865643 Optsim Guide

216 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

ϕ(t)

π

tϕ’(t)

t

n=1

ϕ’(t)

t

n=2

π

-2π

Figure 15. Phase representation

4.6.1 Measurements

Represent. Parameters

Reference Frequency [THz] or [nm]: is the frequency f0 used in equation (1) for the signal representation. To change the value, type in the new value and press <Enter> or click on the Set button to the right. To change the measurement unit open the list on the right, select THz or nm and click on the Set button to the right.Allowed values: min flowVBS; max fupVBS; default f0,VBS.

Phase Range: is the factor n in the range [-nπ,+nπ] where the phase is represented (see figure above). To change the value, type in the new value and press <Enter> or click on the Set button on the right. Allowed values: min: 1; max 50; default 1.

Signal Analysis

The Minimum Value button evaluates the minimum value of the curve shown in the display.

The Maximum Value button evaluates the maximum value of the curve shown in the display.

The Peak-to-Peak Value button evaluates the difference between the maximum value and the minimum value of the curve shown in the display.

Chirp Analysis

Power: superimpose the instantaneous optical power diagram onto the current diagram for chirp analysis.

Page 227: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 217

Instantaneous Frequency: superimpose the instantaneous frequency deviation diagram onto the current diagram for chirp analysis.

4.6.2 Post-Processing Operations On this diagram you can:

• change the reference frequency for the signal representation

• change the phase range

• evaluate the minimum value, the maximum value and the peak-to-peak value of the curve currently displayed

• perform a chirp analysis superimposing the instantaneous optical power diagram or the instantaneous frequency deviation diagram

To Proceed as follows Change the reference frequency Insert the new value in the Reference Frequency

field and press <Enter> or click on the Set button to the right.

Change the phase range Insert the new value in the Phase Range field and press <Enter> or click on the Set button to the right.

Evaluate the minimum value Click on the Minimum Value button. The value is printed in the measurement area.

Evaluate the maximum value Click on the Maximum Value button. The value is printed in the measurement area.

Evaluate the peak-to-peak value Click on the Peak-to-Peak Value button. The value is printed in the measurement area.

Perform a chirp analysis Check the Power option to superimpose the instantaneous optical power diagram or check the Instantaneous Frequency option to superimpose the instantaneous frequency deviation diagram.

If you zoom in on a curve, the values are calculated only for that portion of the curve shown in the display.

4.7 Instantaneous Optical Frequency Deviation Diagram This diagram shows the frequency deviation of the optical signal as a function of time. The units used in the diagram are GHz for the Y axis and nanoseconds (ns) for the X axis.

Optical signals in OptSim are represented using the complex envelope )(~ tx that is related to the optical signal x(t) by the following formula:

tfjtfj etxetxtx 00 2*2 )(~)(~21)( ππ −+= (1)

where f0 is the center frequency of the signal, corresponding to central frequency of the VBS bandwidth.

If the dual polarization simulation parameter is set, the signal is composed by two components x(t) and y(t), one for each

polarization, that are represented with the two complex envelope representations )(~ tx and )(~ ty .

Page 228: 39865643 Optsim Guide

218 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

You can set a new frequency/wavelength value in Reference Frequency instead of the default value f0. If you choose to do so, let f1 be this custom reference frequency value. Then the complex envelopes used to evaluate the quantities that will be displayed are:

tffjetxtx )(21

01)(~)(~ −= π

tffjetyty )(21

01)(~)(~ −= π

where )(~1 ty is present only in the case of dual polarization.

The diagram shows the instantaneous frequency deviation f(t) of the signal from the Reference Frequency value. It is related to the phase by the following formula:

tttf

d)(d

21)( ϕπ

=

4.7.1 Measurements Reference Frequency [THz] or [nm]: is the frequency f0 used in equation (1) for the signal representation. To change the value, type in the new value and press <Enter> or click on the Set button on the right. To change the measurement unit open the list on the right select THz or nm and click on the Set button on the right. Allowed values: min flowVBS; max fupVBS; default f0,VBS.

Signal Analysis

The Minimum Value button evaluates the minimum value of the plotted curve shown in the display.

The Maximum Value button evaluates the maximum value of the plotted curve shown in the display.

The button Peak-to-Peak Value evaluates the difference between the maximum value and the minimum value of the plotted curve shown in the display.

Chirp Analysis

Power: superimposes the instantaneous optical power diagram onto the current diagram for chirp analysis.

Phase: superimposes the instantaneous phase deviation diagram onto the current diagram for chirp analysis.

4.7.2 Post-Processing Operations On this diagram you can:

• change the reference frequency for the signal

• evaluate the minimum value, the maximum value and the peak-to-peak value of the plotted curve currently displayed

• perform a chirp analysis superimposing the instantaneous optical power diagram or the instantaneous phase deviation diagram

To Proceed as follows Change the reference frequency Insert the new value in the Reference Frequency

field, and press <Enter> or click on the Set button on the right.

Evaluate the minimum value Click on the Minimum Value button. The value is displayed in the measurement area.

Page 229: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 219

Evaluate the maximum value Click on the Maximum Value button. The value is displayed in the measurement area.

Evaluate the peak-to-peak value Click on the Peak-to-Peak Value button. The value is displayed in the measurement area.

Perform chirp analysis Check the Power option to superimpose the instantaneous optical power diagram or check the Phase option to superimpose the instantaneous phase deviation diagram.

If you zoom in on a curve, the values are calculated only for that portion of the curve shown in the display.

4.8 Instantaneous Stokes Parameters Diagram This diagram displays the Stokes parameters S1 S2 S3 of the optical signal as a function of time in nanoseconds (ns). These parameters express the optical field polarization evolution on the Poincaré sphere.

A Poincaré sphere [1] is a mapping of all possible polarization states of a photon. Counterclockwise circular polarization maps to the north pole and clockwise circular polarization to to south pole. Linear polarization states map to the equator, with counterclockwise elliptical states filling the northern hemisphere and clockwise elliptical states the southern hemisphere. Every photon is polarized, and unpolarized light consists of photons that are uniformly distributed on the Poincaré sphere.

The Stokes diagram is displayed only if the dual polarization simulation parameter is set.

4.8.1 Measurements

Poincare’ Sphere Component

The button S1 Component shows the first Stokes parameter on the diagram.

The button S2 Component shows the second Stokes parameter on the diagram.

The button S3 Component shows the third Stokes parameter on the diagram.

4.8.2 Post-Processing Operations You may display the three Stokes parameters separately or any combination of them by clicking on the S1, S2 and S3 buttons.

4.9 Optical Spectrum Diagram This diagram displays the spectrum of the optical signal. The spectrum is estimated using the method of modified periodograms. In this method, the entire data sequence is sectioned into a number of parts each containing NP samples, where NP is the number written in the Number of Points parameter. The mean squared amplitudes of the Fourier transforms of each part are displayed.

By default the spectrum is ideal (no pre-filter). You may also specify two real (with pre-filter) spectrum models simulating in this way an optical spectrum analyzer with finite resolution bandwidth. This feature is particularly useful when you need to compare simulated spectra with those obtained using a real measurement instrument.

The two real models depend on the filter transfer function used to simulate the finite resolution bandwidth. From the Type list of the Filter option you may choose Ideal, Lorentzian or Rectangular.

With the Lorentzian model the spectrum is obtained by convolving the ideal spectrum with a Lorentzian transfer function whose noise equivalent bandwidth is defined by the Resolution parameter.

Page 230: 39865643 Optsim Guide

220 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

With the Rectangular model the spectrum is obtained by convolving the ideal spectrum with a rectangular transfer function whose bandwidth is defined by the Resolution parameter.

In other words, each point of the real spectrum represents the power spectral density integrated over the optical filter resolution.

Like a normal power meter you may also evaluate the power of the spectrum using the Power Evaluation button. The power may be evaluated on the displayed frequency range or on a specified range.

The units used in the diagram are:

• dBmmW/THz for the ideal spectrum (power spectral density)

• dBm for the real spectrum (power spectrum) for the Y axis and THz or nanometers (nm) for the X axis.

4.9.1 Measurements

Global Parameters Section The Polarization option is enabled only if the dual polarization simulation parameter is set. You can choose:

• X: selects the X component of the optical field.

• Y: selects the Y component of the optical field.

• X+Y: selects the whole optical field. The Filter option sets the type of spectral filtering. From the Type list you may choose Ideal, Lorentzian or Rectangular.

Resolution [GHz]: the bandwidth of the filtering transfer function. For the ideal spectrum this field is disabled. To change the value, type in the new value and press <Enter> or click on the Set button to the right. Allowed values: min 0; max BWVBS/4; default 0.1 (THz).

Local Parameters Section Number of Points: the number of points of the plotted curve. To change the value, type in the new value and press <Enter> or click on the Set button to the right. Allowed values: min 2; max 500000; default 1000.

Search Peaks

Marker: selects the X axis marker to indicate the peak found during the peak searching. You can choose None for any marker, X1 for the first axis marker (red), X2 for the second axis marker (blue).

Level Difference [dB]: sets the threshold level for the peak searching. To change the value, type in the new value and press <Enter> or click on the Set button to the right.

The button Previous searches for a peak in the range of frequencies/wavelengths lower than the frequency/wavelength of the last peak found.

The button Highest searches for the highest peak in the spectrum.

The button Next searches for a peak in the range of frequencies/wavelengths higher than the frequency/wavelength of the last peak found.

Page 231: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 221

Power Evaluation

Range: selects the range of frequency where the power will be evaluated. You may choose All for the displayed frequency range or Marker X1-X2 for the range between the positions of the two markers set.

The button Power Evaluation evaluates the power on the specified range.

OSNR and Channel Section

Channels/ OSNR

This group of items is enabled only if a real spectrum model has been set in the Filteroption of the Parameters section.

Show/Hide Channels: shows/hides the red triangles that indicate the channels.

Show/Hide OSNR Diagram: shows/hides the red squares that indicate the signal-to-noise ratio for each channel. The third axis, scaled to the signal-to-noise ratio values, appears on the right of the diagram.

Level Difference [dB]: set the threshold level for the signal-to-noise ratio evaluation. To change the value, type in the new value and press <Enter> or click on the Set button to the right.

Evaluate OSNR on channels: evaluates the signal-to-noise ratio for each channel detected.

Evaluate OSNR on markers: evaluates the signal-to-noise ratio at the position of the X axis markers.

Export OSNR diagram: exports to a file all the signal-to-noise ratio diagrams displayed .

OSNR vs. Run

This group of items is enabled only if two or more spectra in the diagram have the Show/Hide OSNR Diagram option set.

Range: selects the range of frequency for the OSNR vs. Run diagram. You may choose All for the displayed frequency range or Marker X1-X2 for the range between the positions of the two markers set.

The button Show OSNR vs. Run diagram displays the OSNR values vs. Run diagram

Join OSNR points: joins with a line all the points of all the OSNR diagram displayed (one line for each diagram).

4.9.2 Post-Processing Operations On this diagram you can:

• change the resolution of the plotted curve

• view the spectrum of the X or Y components of the optical field

• choose either Lorentzian or Rectangular filters or Ideal

• search for peaks on the plotted curve

• evaluate the power of the spectrum

• detect channels on the plotted curve

• evaluate and display the signal-to-noise ratio for the channels detected

• evaluate and display the signal-to-noise ratio at the X axis markers

• export to a file the signal-to-noise ratio of the channels detected for all diagrams

• display the OSNR vs. Run diagram

Page 232: 39865643 Optsim Guide

222 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

To Proceed as follows Change the resolution of the spectrum

In the Parameters section insert the new value in the Number of Points field and press <Enter> or click on the Set button to the right.

View the spectrum of an optical field component

In the Parameters section select the X or the Yoption of Polarization.

View the spectrum of the whole optical field

In the Parameters section select the X+Y option of Polarization.

Choose a model for the real spectrum filter

In the Parameters section open the Type list of the Filter option and choose Lorentzian or Rectangular. Insert the filtering transfer function bandwidth in the Resolution field and press <Enter> or click on the Setbutton to the right.

Peak Searching A local maximum data point is marked as a peak only if the following condition is met. Draw a horizontal line at a value equal to the local maximum minus the Level Difference value (specified in the Search Peaks group). Locate the first data points, on either side of the local maximum data point, those cross this line. If the local maximum in question is greater that any other local maxima within this range, it is marked as a peak. Maxima that occur at the end points of the data set are not marked peaks.

PeakNo Peak

Peak

Leve

lD

iffer

ence

Figure 16. The peak searching method

You may perform a peak searching on the entire plotted curve currently displayed by using the Previous and Next buttons. These buttons search for the previous peak (in the lower frequencies/wavelengths) or the next peak (in the higher frequencies/wavelengths) starting from the last peak found.

If no last peak was found the Previous button searches for the first peak towards lower frequencies/wavelengths beginning at the highest frequency/wavelength; while the Next button searches the first peak towards higher frequencies/wavelengths beginning at the lowest frequency/wavelength.

To search peaks

1. In the Search Peaks group of the Parameters section, insert the threshold level in the Level Difference field and press <Enter> or click on the Set button to the right.

2. If you want a marker to indicate the peak found, open the Marker list and choose X1 or X2.

3. Click on the Previous button or on the Next button. If a peak is found, the peak frequency/wavelength and the peak power spectral density value will be displayed in the measurement area.

Page 233: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 223

To search the highest peak

1. If you want a marker to indicate the peak found, open the Marker list and choose X1 or X2.

2. Click on the Highest button. The peak frequency/wavelength and the peak power

spectral density value are displayed in the measurement area.

Note If you zoom in on a curve, the peaks are searched only for that portion of the curve shown in the display.

Power Evaluation You can evaluate the spectrum power just like a normal power meter, specifying the range of the frequencies.

To evaluate the power on the displayed frequency range

1. In the Power Evaluation group of the Parameters section select the All option in the Range list.

2. Click on the Power Evaluation button. The power value in mW and dBm and the frequency range will be displayed in the measurement area.

Note If you zoom in on a curve, the power is evaluated only on the range of frequencies shown in the display.

To evaluate the power on a given range

1. Position the X markers on the edge of the desired range.

2. In the Power Evaluation group select the Marker X1-X2 option in the Range list.

3. Click on the Power Evaluation button. The power value in mW and dBm and the frequency range will be displayed in the measurement area.

Channel Detection In peak searching, a maximum is marked as a channel only if the criteria set in the Peak Searching section, directly above, with the Level Difference value specified in the Channel/OSNR group of the OSNR and Channel section. Maxima that occur at the end points of the data set are not marked channels. Channel detection works only on real spectra.

To display detected channels

1. In the Channel/OSNR group of the OSNR and Channel section, insert the threshold level in the Level Difference field and press <Enter> or click on the Set button to the right.

2. Select the Show/Hide Channel option. A red triangle will appear on the diagram for each detected channels.

To print the frequencies of the detected channels

1. In the Channel/OSNR group, insert the threshold level in the Level Difference field and press <Enter> or click on the Set button to the right.

2. Click on the Evaluate OSNR on channels button. The frequencies of the channel detected and the power levels will be displayed in the measurement area.

Note If you zoom in on a curve, the channels are detected only for that portion of the curve shown in the display.

Page 234: 39865643 Optsim Guide

224 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

OSNR Evaluation The optical signal-to-noise ratio (OSNR) can be evaluated at a channel or at the position of an X axis marker only for filtered spectra.

The signal-to-noise ratio is calculated considering the value of the signal at the detected channel, and two values of the noise. The values of the noise are determined as follows:

• for a single-channel spectrum, the noise values are chosen to be the two absolute minima of the spectrum on either side of the channel

• for a multi-channel spectrum, the noise values are chosen in the following way: one value each, measured at the midpoints between the channel in question and next adjacent channel at a lower frequency and at a higher frequency. For channels detected at the spectrum edge, the value of the noise is chosen at the midpoint between the edge channel and the first adjacent channel.

S1 S2 S3 S4

= =

N11

N12

= = = =

N21N22 N31

N32 N41

N42

S1

N11 N12

Multi-Channel Spectrum Single-Channel Spectrum

Figure 17. The signal and noise level detection method

For the detected channel in question, the signal-to-noise ratio is evaluated as follows:

221 nn

nn NN

SOSNR +=

You may also evaluate the signal-to-noise ratio at the levels selected by the two X axis markers. The OSNR will be the ratio of the values selected by the red X1 marker and the blue X2 marker.

To display the OSNR values

1. In the Channel/OSNR group of the OSNR and Channel section, insert the threshold level for the channel detection in the Level Difference field and press <Enter> or click on the Set button to the right.

2. Select the Show/Hide OSNR Diagram option. The third axis will appear (to the right) with a range of signal-to-noise ratio values and each detected channel will be indicated by a red square.

To print the OSNR values for the channel detected

1. In the Channel/OSNR group, insert the threshold level for the channel detection in the Level Difference field and press <Enter> or click on the Set button to the right.

2. Click on the Evaluate OSNR on channels button. The signal-to-noise ratio values for each detected channel will be displayed in the measurement area.

To print the OSNR value at the X axis markers position

Page 235: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 225

1. Set the X1 red marker to indicate the signal level.

2. Set the X2 blue marker to indicate the noise level.

3. Click on the Evaluate OSNR on markers button. The signal-to-noise ratio value will be displayed in the measurement area.

To export to a file the OSNR values for the channel detected

1. In the Channel/OSNR group, insert the threshold level for the channel detection in the Level Difference field and press <Enter> or click on the Set button to the right.

2. Select the Show/Hide OSNR Diagram option. The third axis will appear (to the right) with a range of signal-to-noise ratio values and each detected channel will be indicated by a red square.

3. Click on the Export OSNR diagram button. Type in the file name to be exported. See section 4.18.7 for the grammar rules of the file.

Note If you zoom in on a curve, the OSNR values are evaluated only for that portion of the curve shown in the display.

OSNR vs. Run From the optical spectrum diagram you can display the OSNR vs. Run diagram (see later on), specifying the range of the frequencies to display.

To display the diagram on the displayed frequency range

1. In the OSNR vs. Run group of the OSNR and Channel section select the All option in the Range list.

2. Click on the Show OSNR vs. Run diagram button.

Note If you zoom in on a curve, the diagram is displayed only on the range of frequencies shown in the spectrum display.

To display the diagram on a given range

1. Position the X markers on the edge of the desired range.

2. In the OSNR vs. Run group select the Marker X1-X2 option in the Range list.

3. Click on the Show OSNR vs. Run diagram button.

4.9.3 OSNR vs. Run Diagram This diagram displays the OSNR values [dB] versus Run number. Each curve represents a different detected channel. Channels are numbered in a consecutive way, without distinguishing between different Runs.

Two OSNR values are considered of the same channel when the difference between their frequencies is lower than 30 GHz. If a channel contains only one value, it is represented with a single point.

Choosing a very little level difference, it may happen that several OSNR values detected for the same Run, fall within the 30 GHz and are assigned to the same channel (usually these are spurious channels). In this case all values are displayed, and a vertical line will be present at the related Run.

Page 236: 39865643 Optsim Guide

226 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Power [dBm]

Run 1

Run 2

Run 3 5

10

15

20

25

30

-60

-50

-40

-30

-20

-10

-70

OSNR [dB]

< 30 GHz

> 30 GHz

Spuriouschannel

Run1 2 3

Single valueSpuriouschannel

Optical Spectrum Diagram OSNR vs. Run Diagram

Figure 18. Example of OSNR vs Run diagram

Note Clicking on the curve of OSNR vs Run diagram the channel number appears on the message area of the window.

4.10 Electrical Signal Diagram This diagram displays the electrical signal as a function of time. The units used in the diagram are arbitrary unit (a.u.) for the Y axis and nanoseconds (ns) for the X axis.

4.10.1 Measurements

Signal Analysis

The Minimum Value button evaluates the minimum value of the plotted curve shown in the display.

The Maximum Value button evaluates the maximum value of the plotted curve shown in the display.

The Peak-to-Peak Value button evaluates the difference between the maximum value and the minimum value of the plotted curve shown in the display.

4.10.2 Post-Processing Operations On this diagram you may evaluate the minimum value, the maximum value and the peak-to-peak value of the plotted curve currently displayed. The values are displayed in the measurement area.

To Proceed as follows Evaluate the minimum value Click on the Minimum Value button. The value is

displayed in the measurement area.

Page 237: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 227

Evaluate the maximum value Click on the Maximum Value button. The value is displayed in the measurement area.

Evaluate the peak-to-peak value Click on the Peak-to-Peak Value button. The displayed is printed in the measurement area.

If you zoom in on a curve, the values are calculated only for that portion of the curve shown in the display.

4.11 Eye Diagram This diagram displays the eye of the electrical signal, a superimposition of the analog signal pattern. The units used in the diagram are arbitrary units (a.u.) for the Y axis and nanoseconds (ns) for the X axis.

4.11.1 Measurements

Eye Measures

Sampling Instant: sets the instant of time for the eye measurement. WithOptimum, the instant is automatically adjusted to obtain the best measurement (higher Q, lower BER, and larger eye opening). With Marker X1, the instant is the value selected by the red X1 marker. With Marker X2, the instant is the value selected by the blue X2 marker. With Marker X1 & X2, the sampling occurs over a range of times specified by the X1 and X2 markers. Over this interval the electrical levels will be averaged.

Decision Threshold: sets the decision threshold level Vth for the eye measurements. With Optimum, the level is automatically evaluated to obtain the best measurement (higher Q, lower BER). With Marker Y1, the level is the value selected by the red Y1 marker. With Marker Y2, the level is the value selected by the blue Y2 marker.

Q Factor: evaluates the Q factor of the electrical signal according to the options set for the sampling instant and the decision threshold.

BER: evaluates the BER value of the electrical signal according to the options set for the sampling instant and the decision threshold.

Eye Opening: evaluates the eye opening of the diagram according to the options set for the sampling instant and the decision threshold.

Jitter: evaluates the jitter value of the electrical signal according to the options set for the sampling instant and the decision threshold.

4.11.2 Post-Processing Operations On this diagram you can:

• evaluate the Q factor (optimum or setting the sampling instant and/or the decision threshold)

• estimate the BER value (optimum or setting the sampling instant and/or the decision threshold)

• evaluate the eye opening (optimum or setting the sampling instant and/or the decision threshold)

• evaluate the jitter for RZ signals (optimum or setting the sampling instant and/or the decision threshold)

Q Factor Estimation The Q factor is calculated using mean values and standard deviations of the signal samples using the following expression:

Page 238: 39865643 Optsim Guide

228 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

01

01

σσ +−

=mm

Q (1)

where m1, m0, σ1, σ0 are the mean values and standard deviations of the signal samples when a “1” or a “0” is received. This definition of Q factor is is not relevant for multilevel digital modulation or for analog modulation; it only makes sense for binary digital modulation.

The mean values m1, m0 and the standard deviations σ1, σ0 depend on the sampling instant and on the decision threshold. Therefore the Q may be evaluated by choosing the optimum values of sampling instant and decision threshold (i.e. to obtain the maximum Q), or may be evaluated by specifying values with the X and Y axis markers.

Note This expression does not take into account any pattern dependence. Pattern dependence is fundamental when the received eye-diagram is significantly distorted due to fiber dispersion, non-linearities or non-optimum receiver filters. In order to avoid strongly overestimated Q values in these cases, we suggest the use of the Q measurement component and the careful setting of the proper pattern length in parameter dialog window.

To evaluate the optimum Q factor

1. Select the Optimum option in the Sampling Instant list.

2. Select the Optimum option in the Decision Threshold list.

3. Click on the Q Factor button. In the measurement area will be displayed: the sampling time value, the decision threshold value, the Q factor in linear measurement unit and the Q factor in dB.

To evaluate the Q factor at a given point

1. Select the marker in the Sampling Instant list.

2. Select the marker in the Decision Threshold list.

3. Position the markers to the desired points.

4. Click on the Q Factor button. In the measurement area will be displayed: the value of the sampling time, the value of the decision threshold, the Q factor in linear measurement units and the Q factor in dB units.

BER Estimation The evaluation of the BER when simulating an optical system is in general a nontrivial task. Direct error counting is usually impractical, since target BER values are typically of the order of 10-9 or less. BER estimation as implemented in OptSim is not relevant for any kind of multilevel digital modulation or for analog modulation; it only makes sense for binary digital modulation.

The solution implemented in OptSim is based on fitting a given distribution to the first two moments of the received signal. You should know in advance which kind of probability density function (pdf) is most likely to represent the received signal statistics. As a rule of thumb, in a standard optical system based on binary On-Off modulation and direct detection (IM-DD), the received signal pdf tends to be:

• a Gaussian distribution when the noise mainly comes from the electrical part of the receiver, after the photodetection process

• a χ2 distribution when the noise mainly comes from the optical part of the system, typically from the ASE noise of optical amplifiers. In any event, the Gaussian approximation is very often used in this case, as well

Good discussions on BER Estimation can be found in the following references: [2] where a detailed theory on χ2 is given, [3] a fundamental paper presenting the theory of BER estimation in optical systems limited by ASE noise, and [4] where a detailed review of BER evaluation in optical systems is given.

Page 239: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 229

The Scope measurement component uses the Gaussian distribution for the pdf of the received signal. In order to use the χ2 distribution you must employ the BER measurement component.

In the Gaussian approximation, the BER is evaluated starting from the received signal mean values m1, m0 and standard deviation σ1, σ0 as follows:

−+

−=0

0

1

1

2241

σσmVerfcVmerfcBER thth (2)

where Vth is the decision threshold level between “0” and “1”. The mean values m1, m0 and the standard deviation σ1, σ0 also depend on the sampling instant and on the decision threshold Vth.

Therefore the BER may be evaluated taking the optimum values of Vth and sampling instant (i.e. to obtain the minimum BER) or setting a value of Vth with the Y axis markers and a value of sampling instant with the X axis markers.

Note This algorithm doesn’t take into account any pattern dependence. This feature is fundamental when the received eye-diagram is significantly distorted due to fiber dispersion, non-linearities or improper receiver filters. In order to avoid strongly overestimated BER in these cases, we suggest that you to use the BER measurement component and carefully set the proper pattern length in the parameters dialog window.

To evaluate the optimum BER

1. Select the Optimum option in the Sampling Instant list.

2. Select the Optimum option in the Decision Threshold list.

3. Click on the BER button. The sampling time value, the decision threshold value and the estimated BER value will be displayed in the measurement area..

To evaluate the BER at a given point

1. Select the marker in the Sampling Instant list.

2. Select the marker in the Decision Threshold list.

3. Position the markers at the desired points.

4. Click on the BER button. The sampling time value, the decision threshold value and the estimated BER value will be displayed in the measurement area.

Eye Opening The eye opening is the difference between the minimum value of the samples related to a logical “1” and the maximum value of samples related to a logical “0”, measured at the sampling instant.

The average eye opening is the difference between the mean values of the samples related to a logical “1” and samples related to a logical “0”, measured at the sampling instant.

The closure is defined by 10·log10[(average opening)/(opening)].

These three values depend on the sampling instant and on the decision threshold. Therefore the eye opening may be evaluated by using the optimum values for sampling instant and decision threshold (i.e. to obtain the highest Q or the lowest BER), or by specifying values with the X and Y axis markers.

To evaluate the optimum eye opening

1. Select the Optimum option in the Sampling Instant list.

2. Select the Optimum option in the Decision Threshold list.

Page 240: 39865643 Optsim Guide

230 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

3. Click on the Eye Opening button. The sampling time value, the decision threshold value, the closure value, the opening value and the average opening value will be displayed in the measurement area.

To evaluate the eye opening at a given point

1. Select the marker in the Sampling Instant list.

2. Select the marker in the Decision Threshold list.

3. Position the markers at the desired points.

4. Click on the Eye Opening button. The sampling time value, the decision threshold value, the closure value, the opening value and the average opening value will be displayed in the measurement area.

Jitter The jitter value is the standard deviation of the received RZ signal maximum with respect the specified sampling instant.

The signal maximum depends on the decision threshold, therefore the jitter may be evaluated by using optimum values of the sampling instant and decision threshold (i.e. to obtain the highest Q or the lowest BER), or by specifying values with the X and Y axis markers.

The jitter evaluation is suitable for RZ signals with a clearly defined maximum, such as soliton pulses. It is not suitable for NRZ modulation.

Note The jitter calculations only performed for RZ signals.

To evaluate the optimum jitter

1. Select the Optimum option in the Sampling Instant list.

2. Select the Optimum option in the Decision Threshold list.

3. Click on the Jitter button. The sampling time value, the decision threshold value and the jitter value will be displayed in the measurement area.

To evaluate the jitter on a given point

1. Select the marker in the Sampling Instant list.

2. Select the marker in the Decision Threshold list.

3. Position the markers at the desired points.

4. Click on the Jitter button. The sampling time value, the decision threshold value and the jitter value will be displayed in the measurement area.

Note Chosing the Marker X1 & X2 option in the Sampling Instant list the signal maximum is evaluated only in the range between the two markers.

4.12 Histogram on Eye Diagram This diagram displays the histogram of the electrical signal sample distribution at the specified sampling instant. The units used in the diagram are the frequency (number of occurrences) or relative frequency (number of occurrences/total occurrences) for the Y axis and arbitrary units (a.u.) for the X axis (the same unit used for the Y axis of the eye diagram).

Page 241: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 231

The range of the sample values (X axis) is subdivided into a number of intervals (classes) given by the Number of Divisions parameter.

You may evaluate the maximum value, the mean value, the standard deviation and the variance of the distribution. The evaluation may be performed on the whole distribution or on a subset defined by the two X axis markers.

The mean value is evaluated using the following formula:

n

xx

n

ii∑

== 0 (1)

where n is the number of total occurrences and xi is the value of a single sample. The standard deviation and the variance are evaluated using the following formulas.

( )n

xxn

ii∑

=

−= 0

2

σ (2)

( )n

xxV

n

ii∑

=

−== 0

2

2σ (3)

4.12.1 Measurements

Eye Histogram Parameter

Sampling Instant [ns]: sets the sampling instant. By clicking on the Optimum button, the instant is automatically evaluated to obtain the best measurement (highest Q, lowest BER, and greatest eye opening). You may also set a new value of sampling instant. Type the new value in the field immediately below and press <Enter> or click on the Set button to the right.

Number of Divisions: sets the number of classes for the X axis. To change this value, type the new value and press <Enter> or click on the Set button to the right.

Eye Histogram Measures

Range: selects the X axis range over which the eye histogram evaluations are made. With All selected, the range is the whole distribution. With Marker X1-X2 selected, the range is defined as the interval between the two X axis marker positions.

Maximum: evaluates the maximum value of the distribution in the selected range.

Mean: evaluates the mean value of the distribution in the selected range.

Standard Deviation: evaluates the standard deviation of the distribution in the selected range.

Variance: evaluates the variance of the distribution in the selected range.

4.12.2 Post-Processing Operations On this diagram you can:

• choose the optimum sampling instant or specify a new value

• change the number of classes of the distribution

• evaluate the maximum value, the mean value, the standard deviation or the variance of the distribution

Page 242: 39865643 Optsim Guide

232 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

The evaluations may be performed over the whole distribution or over the range between the two X axis marker positions.

To Proceed as follows Set the optimum sampling instant

In the Eye Histogram Parameter group, click on the Optimum button.

Set a new value of the sampling instant

In the field of the Sampling Instant parameter, type the new value and press <Enter> or click on the Set button to the right.

Change the number of classes of the distribution

In the Number of Divisions field, type the new value and press <Enter> or click on the Set button to the right.

To evaluate an eye histogram measurement over the whole distribution

1. In the Eye Histogram Measures group, select the All option in the Range list.

2. In the Eye Histogram Measures group, click on the measurement button. The measurement value and the range of evaluation will be displayed in the measurement area.

To evaluate an eye histogram measurement over a selected range 1. In the Eye Histogram Measures group, select the Marker X1-X2 option in the Range

list.

2. Position the X axis markers to define the range.

3. In the Eye Histogram Measures group, click on the measurement button. The measurement value and the range of evaluation will be displayed in the measurement area.

4.13 Histogram on Electrical Signal Diagram This diagram displays the histogram of an electrical signal. The units used in the diagram are the frequency (number of occurrences) or relative frequency (number of occurrences/total occurrences) for the Y axis and arbitrary units (a.u.) for the X axis.

The range of the sample values (X axis) is subdivided into a number of intervals (classes) given by the Number of Divisions parameter.

You may evaluate the maximum value, the mean value, the standard deviation and the variance of the distribution. The evaluation may be performed over the whole distribution or over a range set by the two X axis markers.

The mean value is evaluated with the following formula:

n

xx

n

ii∑

== 0 (1)

where n is the number of total occurrences and xi is the value of a single sample. The standard deviation and the variance are evaluated with the following formulas.

( )n

xxn

ii∑

=

−= 0

2

σ (2)

Page 243: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 233

( )n

xxV

n

ii∑

=

−== 0

2

2σ (3)

4.13.1 Measurements

Histogram Parameters

Number of Divisions: sets the number of classes on the X axis. To change the value, type in the new value and press <Enter> or click on the Set button to the right.

Histogram Measures

Range: selects the range over the X axis for the histogram evaluations. With Allselected the range is the whole distribution. With Marker X1-X2 selected the range is defined between the two X axis marker positions.

Maximum: evaluates the maximum value of the distribution over the selected range.

Mean: evaluates the mean value of the distribution over the selected range.

Standard Deviation: evaluates the standard deviation of the distribution over the selected range.

Variance: evaluates the variance of the distribution over the selected range.

4.13.2 Post-Processing Operations On this diagram you may:

• change the number of classes of the distribution

• evaluate the maximum value, the mean value, the standard deviation or the variance of the distribution The evaluations may be performed over the whole distribution or over the range defined between the two X axis marker positions.

To Proceed as follows Change the number of classes of the distribution

In the Number of Divisions field type the new value and press <Enter> or click on the Set button to the right.

To evaluate a histogram measurement over the whole distribution

1. In the Histogram Measurement group, select the All option in the Range list.

2. In the Histogram Measurements group, click on the measurement button. The measurement value and the range of evaluation will be displayed in the measurement area.

To evaluate a histogram measurement over a selected range 1. In the Histogram Measurement group, select the Marker X1-X2 option in the Range

list.

2. Position the X axis markers to define the range.

3. In the Histogram Measurement group, click on the measurement button. The measurement value and the range of evaluation will be displayed in the measurement area..

Page 244: 39865643 Optsim Guide

234 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

4.14 Electrical Spectrum Diagram This diagram displays the spectrum of the electrical signal. The spectrum is estimated using the method of modified periodograms. This method sections the entire data sequence into a number of parts each containing NP samples, where NP is computed in order to obtain the number of points written in the Number of Points parameter between Start Frequency and Stop Frequency. The squared amplitudes of the Fourier transforms of each part are then summed and averaged.

By default the spectrum is ideal (no pre-filter). You may also specify two real (with pre-filter) spectrum models, which simulate the performance of an electrical spectrum analyzer with a finite resolution bandwidth. This feature is particularly useful when you need to compare simulated spectra with those obtained using a real measurement instrument.

The two real spectrum models are defined by the filter transfer function used to simulate the finite resolution bandwidth. In the Filter option you may choose Ideal, Lorentzian or Rectangular from the Type list.

With the Lorentzian model, the spectrum is obtained by convolving the ideal spectrum with a Lorentzian transfer function whose noise equivalent bandwidth is defined by the Resolution parameter.

With the Rectangular model, the spectrum is obtained by convolving the ideal spectrum with a rectangular transfer function which bandwidth is defined by the Resolution parameter.

In other words, each point of a real spectrum model represents the power spectral density integrated over the electrical filter resolution.

Like a normal power meter you may also evaluate the power of the spectrum using the Power Evaluation button. The power may be evaluated on the displayed frequency range or on a specified range.

The units used in this diagram are:

• dB(a.u.)2/GHz for the ideal spectrum (power spectral density)

• dB for the real spectrum models (power spectrum) for the Y axis and GHz for the X axis.

4.14.1 Measurements

Global Parameters Section The Filter option sets the type of spectral filtering. From the Type list you may choose Ideal, Lorentzian or Rectangular.

Resolution [GHz]: the bandwidth of the filtering transfer function. For the ideal spectrum this field is disabled. To change the value, type in the new value and press <Enter> or click on the Set button to the right. Allowed values: min 0; max BWVBS/4; default 0.1.

Local Parameters Section Number of Points: the number of points of the plotted curve distributed over the bandwidth defined with the above two parameters. To change this value, type in the new value and press <Enter> or click on the Set button to the right. Allowed values: min 2; max 500000; default 1000.

Page 245: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 235

Frequency Range

Start Frequency [GHz]: is the spectrum lower frequency. To change this value, type in the new value and press <Enter> or click on the Set button to the right. Allowed values: min 0; max BWVBS/2; default 0.

Stop Frequency [GHz]: is the spectrum upper frequency. To change this value, type in the new value and press <Enter> or click on the Set button on the right. Allowed values: min 0; max BWVBS/2; default BWVBS/2.

Search Peaks

Marker: selects the marker of the X axis that will indicate the peak found during the peak searching. You can choose None for any marker, X1 for the first axis marker (red), or X2 for the second axis marker (blue).

Level Difference [dB]: set the threshold level for peak searching. To change the value, type in the new value and press <Enter> or click on the Set button to the right.

The button Previous searches for a peak in the range of frequencies lower than the frequency of the last peak found.

The button Highest searches for the highest peak in the spectrum.

The button Next searches for a peak in the range of frequencies higher than the frequency of the last peak found.

Power Evaluation

Range: selects the range of frequency where the power will be evaluated. You may choose All for the displayed frequency range or Marker X1-X2 for the range between the positions of the two markers set.

The button Power Evaluation evaluates the power on the specified range.

4.14.2 Post-Processing Operations On this diagram you can:

• change the frequency interval of the spectrum displayed

• change the resolution of the plotted curve

• choose either Lorentzian or Rectangular filters or Ideal

• search for peaks on the plotted curve

To Proceed as follows Change the lower frequency of the spectrum

Insert the lower frequency in the Start Frequency field and press <Enter> or click on the Set button to the right.

Change the higher frequency of the spectrum

Insert the higher frequency in the Stop Frequency field and press <Enter> or click on the Set button to the right.

Change the resolution of the spectrum

Insert the new value in the Number of Points field and press <Enter> or click on the Set button to the right.

Choose a model for the real spectrum filter

Open the Type list in the Filter option, and choose Lorentzian or Rectangular. Insert the filtering transfer function bandwidth in the Resolution field and press <Enter> or click on the Set button to the right.

Page 246: 39865643 Optsim Guide

236 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Peak Searching A local maximum data point is marked as a peak only if the following condition is met: Draw a horizontal line at a value equal to the local maximum minus the Level Difference value (specified in the Search Peaks group). Locate the first data points, on either side of the local maximum data point, those cross this line. If the local maximum in question is greater that any other local maxima within this range, it is marked as a peak. Maximum that occurs at the left end point of the data set (DC component) is marked peak (See Figure 19).

Leve

lD

iffer

ence

PeakAxis

Peak

Leve

lD

iffer

ence

No Peak

Figure 19. The peak searching method

You may perform a peak searching on the whole plotted curve currently displayed using the Previous and Next button. These buttons search the previous peak (towards lower frequencies) or the next peak (towards higher frequencies) starting from the last peak found.

If no last peak was found the Previous button searches for the first peak towards lower frequencies/wavelengths beginning at the highest frequency/wavelength; while the Next button searches the first peak towards higher frequencies/wavelengths beginning at the lowest frequency/wavelength.

To search peaks

1. In the Search Peaks group, insert the threshold level in the Level Difference field and press <Enter> or click on the Set button to the right.

2. If you want a marker to indicate the peak found, open the Marker list and choose X1 or X2.

3. Click on the Previous button or on the Next button. If a peak is found, the peak frequency and the peak power value are displayed in the measurement area.

To search the highest peak

1. If you want a marker to indicate the peak found, open the Marker list and choose X1 or X2.

2. Click on the Highest button. The peak frequency and the peak power value are

displayed in the measurement area.

Note If you zoom in on a curve, the peaks are searched only for that portion of the curve shown in the display.

4.15 XY Diagram This diagram displays a generic XY function, such as one measurement versus another or versus the run number. The units used in the diagram depend on the measurements/variables selected. This diagram is also used to display the transfer functions of the electrical/optical filters or amplifiers and to display the Raman gain of the optical fibers.

Page 247: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 237

You may evaluate the mean value, the standard deviation and the variance of the selected curve. The evaluation is performed over the range selected by the Range list and the evaluation depends also by the line style of the selected curve.

In particular for the Points line style the mean value is evaluated with the following formula:

n

yy

n

ii∑

== 0 (1)

where n is the number of the points and yi is the y value of a single point. The variance V and the standard deviation σ are evaluated with the following formulas.

( )

n

yyV

n

ii∑

=

−== 0

2

2σ (2)

( )

n

yyn

ii∑

=

−= 0

2

σ (3)

For the Lines or LinesPoints line style the mean value is evaluated with the following formulas:

0

0

xx

Ay

n

n

ii

−=∑

= (4)

2)()( 11 iiii

ixxyyA −⋅+

= ++ (5)

where yi and xi are the coordinates of the ith point. The mean value is therefore the height of the equivalent rectangle which area is the equal to the area bounded by the selected curve and the X axis. For the variance V and the standard deviation σ we have formulas equivalent to (2) and (3):

yxx

AV

n

n

ii

−−

==∑

=

0

0

2

2σ (6)

yxx

A

n

n

ii

−−

=∑

=

0

0

2

σ (7)

Page 248: 39865643 Optsim Guide

238 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

4.15.1 Measurements

Chart Analysis

The button Minimum Value evaluates the minimum value of the plotted curve shown in the display.

The button Maximum Value evaluates the maximum value of the plotted curve shown in the display.

The button Peak-to-Peak Value evaluates the difference between the maximum value and the minimum value of the plotted curve shown in the display.

Range, specifies the X axis range where the following statistical calculations should be performed. You can choose All for the whole range of the diagram, Visualized for the X axis range currently displayed, Marker X1-X2 for the range delimited by the two X axis markers.

Mean, select the mean value statistical calculation.

Standard Deviation, select the standard deviation value statistical calculation.

Variance, select the variance value statistical calculation.

Statistical, performs the selected statistical calculation on the range specified by the Range list. The results are printed in the measurement area.

4.15.2 Post-Processing Operations On this diagram you can evaluate the minimum value, the maximum value and the peak-to-peak value of the plotted curve currently displayed. The values are displayed in the measurement area.

To Proceed as follows Evaluate the minimum value Click on the Minimum Value button. The value is

displayed in the measurement area.

Evaluate the peak-to-peak value Click on the Peak-to-Peak Value button. The value is displayed in the measurement area.

Evaluate the maximum value Click on the Maximum Value button. The value is printed in the measurement area.

If you zoom in on a curve, the values are calculated only for that portion of the curve shown in the display.

4.16 Logical Signal Amplitude Diagram This diagram displays the logical signal as a function of time. The unit used in the diagram for the X axis is nanoseconds (ns). The Measurements Tab contains no elements and there are no post-processing operations available for this diagram.

4.17 Scattering Diagram This diagram shows the scattering of two components of the signal. The units used in the diagram are arbitrary for both axes. The Measurements Tab contains no elements and there are no post-processing operations available for this diagram.

Page 249: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 239

4.18 File Grammars This section describes the grammar rules used in the ASCII measurement data file imported or exported by the measurement window. OptSim has four kinds of measurement data file:

• the optical signal file imported/exported by the optical probe measurement window

• the electrical signal file imported/exported by the electrical scope measurement window

• the spectrum file imported/exported by the OSA and ESA measurement window

• the diagram file exported by the measurement window displaying a generic diagram

General Rules • Files are formatted by line

• No blank lines are allowed

• The first line identifies the file type; this line is mandatory

• The following field separators are allowed: space char, tab char, comma char and semicolon char

• Only exponential notation is allowed for numbers (e.g. 10.0, 0.1, or - 12.388888E+002)

Grammar Notation used is EBNF (Extended Backus Naur Form)

• [ item ] stands for optional item occurring only once

• item stands for optional item occurring any number of times

• ( item_a | item_b) stands for items that can occur as alternative

• Bold stands for language keywords

• Italic stands for rules (non-terminal symbols)

• Plain stands for identifiers and names

4.18.1 Electrical Signal File This file can also be used by the electrical Playback component, which plays the signal stored in the file. See the OptSim Component Library manual for a complete description of this component.

OptSimEltSgn grammar_version SamplesNum num Delt delt Fsym f0 SamplesPerBit ns Minimum min Maximum max z

Description grammar_version ::= 3

num ::= integer Number of samples of the signal.

delt ::= real Time sampling step [ps].

f0 ::= real Simulation center frequency [THz].

Page 250: 39865643 Optsim Guide

240 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

ns ::= integer Number of samples per bit.

min ::= real Minimum of the signal [a.u.].

max ::= real Maximum of the signal [a.u.].

z ::= real Electrical signal amplitude.

Note The two fields fsym_thz and irep present in the electrical time sample file grammar are not used in this grammar and are always set to 0.0 and 1 respectively.

4.18.2 Optical Signal File This file can also be used by the optical Playback component, which plays the signal stored in the file. See the OptSim Components Library manual for a complete description of this component.

OptSimOptSgn grammar_version SamplesNum num Delt delt Fsym f0 Tstart tstart Polarization (1|2) Minimum min Maximum max ( x1 x2 | x1 x2 y1 y2 )

Description grammar_version ::= 4

num ::= integer Number of samples of the signal.

delt ::= real Time sampling step [ps].

f0 ::= real Simulation center frequency [THz].

tstart ::= real Starting time of the samples.

Polarization indicates the kind of polarization used (simulation parameter) 1 for single polarization, 2 for dual polarization.

min ::= real Minimum of the signal [a.u.].

max ::= real Maximum of the signal [a.u.].

x1 =:: real Real component of the signal (along the x polarization axis in case of dual polarization).

x2 =:: real Imaginary component of the signal (along the x polarization axis in case of dual polarization).

y1 =:: real Real component of the signal along the y polarization axis (for dual polarization).

y2 =:: real Imaginary component of the signal along the y polarization axis (for dual polarization).

Page 251: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 241

4.18.3 Logical Signal File OptSimLogSgn grammar_version SamplesNnum num NBitsPerSymbol level Minimum 0 Maximum 1 Delt delt bits

Description grammar_version ::=3

num ::= integer Number of samples of the logical signal.

level ::= integer Number of levels (bits per symbol) of the logical signal.

Delt ::= real Time sampling step [ps].

bits ::= integer Samples of the bit sequence.

4.18.4 Spectrum File The grammar rules for this file are valid for all spectra, electrical and optical.

Information_Header Spectrum_Header x Information_Header ::= OptSimExpSpr grammar_version Type (4|5) Spectrum_Header ::= SamplesNum num Delt delt Fsym f0 FrequencyStep delt_f StartFrequency f_start StopFrequency f_stop Minimum min Maximum max

Description The Information_Header contains information common to all spectra stored in the file while each Spectrum_Header contains information specific to each single spectrum.

grammar_version ::= 2

Type indicates the type of the spectrum, 4 for optical spectrum, 5 for electrical spectrum.

num ::= integer Number of samples of the current spectrum.

delt ::= real Time sampling step [ps].

f0 ::= real Simulation center frequency [THz].

delt_f ::= real Frequency interval for the samples of the current spectrum.

f_start ::= real Starting frequency of the samples of the current spectrum.

f_stop ::= real Ending frequency of the samples of the current spectrum.

Page 252: 39865643 Optsim Guide

242 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

min ::= real Minimum of the current spectrum.

max ::= real Maximum of the current spectrum.

x ::= real Spectrum amplitude.

Note Unfiltered spectra are stored in this measurement data file(i.e. power spectral densities). For the optical spectrum, the data unit is dB or mW/THz while for the electrical spectrum the data unit is dB or (a.u.)2/GHz.

4.18.5 XY Diagram File The grammar rules for this file are valid for all charts XY.

Information_Header Chart_Header Column_Header Column_Data Information_Header ::= OptSimExpXY grammar_version Type 7 Chart_Header ::= ChartType (0|1|2|3) GraphStyle -1 SamplesNum snum ColumnNum cnum Title chtitle LabelY chylabel MeasureY chyunit Column_Header ::= ColumnBegin Type (3|5) Minimum min Maximum max StartingScale (0|1|2) Ordering val Label cllabel Measure clunit ColumnEnd Column_Data ::= X_value Y_column

Description The Information_Header contains information common to all the charts XY stored in the file. Chart_Header contains information specific to each chart XY. Each chart in turn may entail many curves (column of data) and each column has its own Column_Header. The first column is always related to the X values. The Column_Data are arrange in a table where each column represents a single curve and in the first column are written all the X axis values.

grammar_version ::= 4

ChartType indicates the type of chart, 0 for chart undefined, 1 for single curve, 2 for family of curves, 3 for DWDM chart.

snum ::= integer Number of samples of the current chart (the number of row in Column_Data).

cnum ::= integer Number of column (curve) present in the current chart.

chtitle ::= string Chart title.

chylabel ::= string Y label of the chart.

Page 253: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 243

chyunit ::= string Measurement unit displayed for the Y axis chart.

Type indicates the type data stored for the current column, 3 for double, 5 for integer.

min ::= real Minimum value for the current column.

max ::= real Maximum value for the current column.

StartingScale indicates the scale for the column values, 0 for undefined, 1 for linear, 2 for logarithmic (10-base).

val ::= real Value used to order the columns.

cllabel ::= string Curve label that appears in the legend.

clunit ::= string Curve measurement unit for the current column.

X_value ::= real X axis value.

Y_column ::= real Y axis value for a single curve (current column).

4.18.6 Diagram File File_Header Curve_Header Curve_Point File_Header ::= Diagram_Type grammar_version Diagram_Type ::= ( OptGoiElFt | OptGoiEsa | OptGoiHistEye | OptGoiHistFt | OptGoiOsa | OptGoiOpFt | OptGoiStok | OptGoiXY | OptGoiLogFt) Curve_Header ::= [see “Curve Header Description” below] Curve_Point ::= abscissa data

Description The File_Header contains the diagram information. For each curve of the diagram, Curve Header contains the post-processing parameters (see “Curve Header Description” below) and Point Curve is a single point of the curve.

grammar_version ::= 1

OptGoiElFt indicates the electrical signal diagram or the eye diagram.

OptGoiEsa indicates the electrical spectrum diagram.

OptGoiHistEye indicates the histogram on eye diagram.

OptGoiHistFt indicates the histogram on electrical signal diagram.

OptGoiOsa indicates the optical spectrum diagram.

OptGoiOpFt indicates the instantaneous optical power or phase or frequency diagram.

OptGoiStok indicates the instantaneous Stokes parameters diagram.

OptGoiXY indicates the generic XY diagram.

OptGoiLogFt indicates the logical signal diagram.

abscissa ::= real The X axis value of a diagram point.

data ::= real The Y axis value of a diagram point.

Page 254: 39865643 Optsim Guide

244 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Curve Header Description In the Curve_Header are stored all the post-processing parameters for the curve. These parameters are specified in the measurement window during the post-processing operations. For example, the kind of filtering transfer function and the resolution bandwidth are two post-processing parameters of a real spectrum.

Curve_Header ::= title parameter measure_unit value label_x label_y

title ::= string Title of the curve that appears in the diagram key.

parameter ::= string The post-processing parameter name.

measure_unit ::= string Unit of the post-processing parameter.

value ::= real or integer Current value of the post-processing parameter.

label_x ::= string The X axis label of the diagram.

label_y ::= string The Y axis label of the diagram.

A complete post-processing parameter description of all diagrams follows.

Electrical Signal or Eye

Header Curve ::= Title BitRate [Gbit/s] bit_rate SamplesPerBit ns Minimum [a.u.] min_val Maximum [a.u.] max_val Time [ns] Electrical Signal [a.u.]

title ::= string Title of the curve that appears in the diagram key.

bit_rate ::= real Nominal bit rate in Gbit/s of the measurement.

ns ::= integer Number of samples per bit.

min_val ::= real Minimum value in a.u of the curve.

max_val ::= real Maximum value in a.u of the curve.

Electrical Spectrum

Header Curve ::= Title StartFrequency [GHz] f_start StopFrequency [GHz] f_stop NumberofPoints points EsaType (Ideal | Lorentzian | Rectangular) Resolution [GHz] resolution Minimum ([dBm]| [dB (a.u.)^2/GHz]) min_val Maximum ([dBm]| [dB (a.u.)^2/GHz]) max_val Frequency [GHz] (Electrical Power Spectrum [dBm]| Electrical Power Spectral Density [dB (a.u.)^2/GHz] )

title ::= string Title of the curve that appears in the diagram key.

f_start ::= real Starting frequency in GHz of the samples of the spectrum.

f_stop ::= real Ending frequency in GHz of the samples of the spectrum.

points ::= integer Number of points of the spectrum.

Page 255: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 245

EsaType indicates the filtering transfer function selected for the spectrum. No Filter for an unfiltered spectrum, or Rectangular for the spectra obtained with a Lorentzian or rectangular filtering law.

resolution ::= real Bandwidth of the filtering transfer function in GHz (zero for ideal spectrum).

min_val ::= real Minimum value in dB or (a.u.)2/GHz for ideal spectrum or dBm for real spectrum.

max_val ::= real Maximum value in dB or (a.u.)2/GHz for ideal spectrum or dBm for real spectrum.

Histogram on Eye

Header Curve ::= Title SamplingTime [ns] ts DivisionsNumber n_div Minimum min_val Maximum max_val Signal Value [a.u.] Eye Histogram

title ::= string Ttile of the curve that appears in the diagram key.

ts ::= real Sampling instant in ns.

n_div ::= integer Number of classes (intervals) on the X axis.

min_val ::= real Minimum value of the curve (set to zero).

max_val ::= real Maximum value of the curve.

Histogram on Electrical Signal

Header Curve ::= Title DivisionsNumber n_div Minimum min_val Maximum max_val Signal Value [a.u.] F(t) Histogram

title ::= string Title of the curve that appears in the diagram key.

n_div ::= integer Number of classes (intervals) on the X axis.

min_val ::= real Minimum value of the curve (set to zero).

max_val ::= real Maximum value of the curve.

Optical Spectrum

Header Curve ::= Title NumberofPoints points Polarization (X | Y | X + Y ) OsaType separator(Ideal | Lorentzian | Rectangular) Resolution [(THz|nm)] resolution SimCentralFrequency [THz] f0 SimBandwidth [THz] bw Minimum ([dB(mW/THz)]| [dBm]) min_val Maximum ([dB(mW/THz)]| [dBm]) max_val Frequency [THz] (Optical Power Spectrum [dBm]| Optical Power Spectral Density [dB(mW/THz)] )

title ::= string Title of the curve that appears in the diagram key.

points ::= integer Number of points of the spectrum.

Polarization indicates the component of the optical field, X for the X component, Y for the Y component, X + Y for the whole optical field.

Page 256: 39865643 Optsim Guide

246 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

OsaType indicates the filtering transfer function selected for the spectrum. NoFilter for an unfiltered spectrum, Lorentzian or Rectangular for the spectrum obtained with a Lorentzian or rectangular law.

resolution ::= real Bandwidth of the filtering transfer function in THz or nm (zero for unfiltered spectrum).

f0 ::= real Simulation center frequency or wavelength in THz.

bw ::= real Simulation bandwidth in THz.

min_val ::= real Minimum value in dB or mW/THz for ideal spectrum or dBm for real spectrum.

max_val ::= real Maximum value in dB or mW/THz for ideal spectrum or dBm for unfiltered spectrum.

Instantan. Optical Power

Header Curve ::= title Polarization (X | Y | X + Y ) SimCentralFrequency [THz] f0 Minimum [mW] min_val Maximum [mW] max_val Time [ns] Power [mW]

title ::= string Title of the curve that appears in the diagram key.

Polarization indicates the component of the optical field, X for the X component, Y for the Y component, X + Y for the whole optical field.

f0 ::= real Simulation center frequency in THz.

min_val ::= real Minimum value of the curve.

max_val ::= real Maximum value of the curve.

Instantan. Optical Phase

Header Curve ::= title SimCentralFrequency [THz] f0 ReferenceFrequency [(THz|nm)] ref_freq PhaseRange [2*PI*rad] phrange Time [ns] Phase [rad]

title ::= string Ttile of the curve that appears in the diagram key.

f0 ::= real Simulation center frequency in THz.

ref_freq ::= real Reference frequency in THz or nm for the optical signal representation.

phrange ::= integer The n factor in the range [-nπ,+nπ] over which the phase is represented.

Instantan. Optical Frequency

Header Curve ::= Title SimCentralFrequency [THz] f0 ReferenceFrequency [(THz|nm)] ref_freq Minimum [GHz] min_val Maximum [GHz] max_val Time [ns] Instantaneous Frequency Deviation [GHz]

title ::= string Title of the curve that appears in the diagram key.

f0 ::= real Simulation center frequency in THz.

Page 257: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 247

ref_freq ::= real Reference frequency in THz or nm for the optical signal representation.

Instantan. Stokes Parameters

Header Curve ::= title SimCentralFrequency [THz] f0 Time [ns] S1 ...data... Time [ns] S2 ...data... Time [ns] S3 ...data...

title ::= string Title of the curve that appears in the diagram key.

f0 ::= real Simulation center frequency in THz.

Logical Signal

Header Curve ::= title Time [ns] L1 ...data... Time [ns] L2 ...data... ...

title ::= string Title of the curve that appears in the diagram key.

4.18.7 OSNR Values File OptGoiOsnr grammar_version OSNR_Diagram_Header Curve_Point OSNR_Diagram_Header ::= title NumberOfPoints number_of_points Polarization (X | Y | X+Y ) OsaType (Lorentzian | Rectangular) Resolution [(THz|nm)] resolution SimCentralFrequency [THz] f0 SimBandwidth [THz] bw LevelDifference [dB] leveldifference NumChannels numchannels ChannelNumber Frequency [(THz|nm)] Power [dBm] OSNR [dB] Curve_Point ::= numchannel freqchannel powchannel osnrchannel

Description grammar_version ::= 1

title ::= string Ttile of the curve that appears in the diagram key.

number_of_points ::= integer Number of points of the spectrum.

Polarization indicates the component of the optical field, X for the X component, Y for the Y component, X + Y for the whole optical field.

OsaType indicates the filtering transfer function selected for the spectrum. Lorentzian or Rectangular for the spectrum obtained with a Lorentzian or rectangular law.

resolution ::= real Bandwidth of the filtering transfer function in THz or nm (zero for unfiltered spectrum).

Page 258: 39865643 Optsim Guide

248 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

f0 ::= real Simulation center frequency or wavelength in THz.

bw ::= real Simulation bandwidth in THz.

leveldifference ::= real The threshold level for the channel detection.

numchannels ::= integer The number of channels detected.

numchannel ::= integer The progressive number of the detected channel.

freqchannel ::= real The frequency of the detected channel (in THz or nm as specified in the row above).

powchannel ::= real The power level of the detected channel.

osnrchannel ::= real The OSNR value of the detected channel.

Note The channels detected are always ordered by increasing frequency or decreasing wavelength. If you zoom in the spectrum, the values are calculated only for that portion of the curve shown in the display.

4.19 SPT Data Display Toolkit The SPT Data Display toolkit is an interface to MATLAB that performs some graphical analysis on the optical results of OptSim simulations based on the Spectral Propagation technique (SPT). For detailed description on MATLAB interface, please see chapter on “MATLAB Cosimulation in Sample Mode.”

The toolkit retrieves the SPT simulation results from any pair of optical points of your current project schematic, it shows the optical power spectra and for each channel detected calculates the gain, the noise figure and the OSNR between these points.

To implement any variation to this toolkit or to discuss development of new, tailor-made toolkit solutions supporting your specific application requirements, please contact RSoft to arrange a meeting with our engineers.

4.19.1 Plot Types Let's A and B two optical points of your project schematic, the SPT Data Display toolkit shows the following plots of SPT simulation results.

Please note that by default all the spectra are pre-filtered with rectangular transfer function which bandwidth is specified through the Rectangular Filter Resolution parameter. Furthermore the channels are detected using the ∆∆∆∆Lev parameter with the OptSim Data Display method detailed in the OptSim Data Display optical spectrum description.

Gain For each channel detected, a single plot curve shows the gain calculated as follows:

A

Blin P

PG =

where PA and PB are the power values in point A and B.

On this diagram you can perform some statistical evaluation such as min, max, mean and peak-to-peak. These evaluations are performed on the whole spectrum.

Page 259: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 249

Noise Figure For each channel detected, a single plot curve shows the noise figure calculated as follows:

( )

+−= 111

0nAlinnB

lin

PGPhBG

where PnA and PnB are the noise power values in point A and B, ν is the frequency, h is the Planck constant and B0 is the resolution bandwidth.

On this diagram you can perform some statistical evaluation such as min, max, mean and peak-to-peak. These evaluations are performed on the whole spectrum.

OSNR For each channel detected, two curves show the OSNR evaluated on point A and/or B as detailed in the OptSim Data Display optical spectrum description. Please refer to the OptSim user manual.

On this diagram you can choose to show a single curve or superimpose the two curves (the default) or show the difference of OSNR for each channel. You can also perform some statistical evaluation such as min, max, mean and peak-to-peak. These evaluations are performed on the whole spectrum.

Channel Power For each channel detected, two curves show the channel powers evaluated on point and/or B.

On this diagram you can choose to show a single curve or superimpose the two curves (the default). You can also perform some statistical evaluation such as min, max, mean and peak-to-peak. These evaluations are performed on the whole spectrum.

Power Spectrum Two curves show the power spectrum evaluated on point A and/or B.

On this diagram you can choose to show a single curve or superimpose the two curves (the default). You can also perform some statistical evaluation such as min, max, mean and peak-to-peak. These evaluations are performed on the whole spectrum.

4.19.2 SPT Data Display Window The SPT Data Display dialog window is shown in the following figure. It consists mainly on a group of controls (buttons, options and lists) and a diagram that displays graphically the results.

Page 260: 39865643 Optsim Guide

250 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Diagram

WindowControls

Figure 20. The SPT Data Display dialog window

Window Controls The Export button exports to a text file the point values of the current diagram.

The Plot Type options select the plot type displayed in the diagram. You can choose the following options:

• Gain, displays in a single curve the frequency behavior of the gain from point A to point B

• Noise Figure, displays in a single curve the frequency behavior of the noise figure from point A to point B

• OSNR, displays the channel OSNRs evaluated in the two measured points

• Channels Power, displays the channel powers in the two measured points

• Power Spectrum, displays the power spectra in the two measured points

The Plot Mode options select the display mode. You can choose the following options:

• Difference, displays in a single curve the difference (point-to-point) of the two curves; enabled only for the OSNR plot type

• Superimpose, displays both the curves; enabled for the OSNR, Channels Power and Power Spectrum plot types

• Single, displays only a curve; enabled for the OSNR, Channels Power and Power Spectrum plot types

The Run Number list selects a run number in a multiple run simulation.

The Rectangular Filter Resolution [THz] or [nm] sets the bandwidth of the filtering transfer function for the power spectrum. See the OptSim Data Display optical spectrum description in the OptSim user manual for more details.

The ∆∆∆∆Lev [dB] sets the threshold level for the channel detection. See the OptSim Data Display optical spectrum description in the OptSim user manual for more details.

In Calculations you can evaluate some statistical evaluations (minimum, maximum, mean and peak-to-peak) of the plotted curves. These evaluations are performed on the whole spectrum.

The Power Spectrum A and B lists contain all the project schematic points where the spectra are available.

Page 261: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 251

Diagram The diagram shows the selected information versus the frequency (upper horizontal axis) or wavelength (lower horizontal axis).

To Proceed as follows Zoom in on a particular portion of the diagram Drag a rectangle over that portion of the diagram.

Restore the original view of the diagram Double click on any point of the diagram.

4.19.3 Project Conditions Before using this toolkit your project must have been simulated with the Spectral Propagation Technique (SPT).

To perform an SPT simulation on your project

1. In the OptSim editor window choose the menu command Simulate > SPT > Check or click on the SPT check button in the tool bar to initiate several checks on the system parameters and topology.

2. Choose the menu command Simulate > SPT > Start or click on the SPT button in the tool bar to start the simulation of the project. If previous results of the same system are stored in the working directory, a warning message is displayed, advising that these results will be overwritten.

4.19.4 Getting Started This section describes the step-by-step procedures by which an OptSim user can rapidly learn the toolkit essentials and get started.

The procedure assumes that you are working on the Getting_started_WDM64.opf project example installed with the toolkit. You may copy the example file into your working directory and use it immediately. The example is located in the directory:

ProductInstDir/examples/Matlab/SPT_DataDisplay/

where ProductInstDir is the directory where you installed the OptSim product.

Please note that the /examples directory is considered read-only by OptSim, and you will not be able to run simulations from this directory. If you wish to change the example design structure and parameters or you wish to run a simulation, first save all the example files (opf, opm, dat, etc.) to your working directory. This will allow you to make changes that will not effect the original versions.

The System to be Simulated The system we want to simulate has the following characteristics:

Transmitter Section

• 64-channels WDM transmitter

• bit rate: 10 Gbit/s

• modulation format: rectangular Non-Return-to-Zero (NRZ)

• optical modulator: external Mach-Zehnder, 3 dB insertion loss

• lower channel frequency: 191.15 THz

Page 262: 39865643 Optsim Guide

252 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

• channel spacing: 100 GHz

• optical source: CW laser (10 MHz spectral width), -30 dBm peak power

• booster: EDFA, fixed output power 0 dB with real gain shape, Noise Figure 4.5 dB

Link Section

• link type: 2 span of 50 km, Lucent TrueWave optical fiber

• Raman amplification: 2 counter-propagating pumps at 1438 nm and 1452 nm with power of 600 mW and 400 mW respectively

• amplification: EDFA placed every 50 Km, fixed output power 0 dB with ideal flat gain profile, Noise Figure 4.5 dB

With the SPT Data Display toolkit we want to analyze the optical gain, noise figure, OSNR, channel powers and power spectra at the beginning of the link section (output of the compound component 64 channels WDM transmitter) and at the end of the link section (output of the ideal EDFA second span).

Opening the Project Example Before opening the example create a new working directory (for example named SPT_toolkit) under the Projects directory and copy the example in that directory.

Note Please note that on Windows systems a predefined working folder “C:\OptSim\Projects” is already prepared for you work while on UNIX systems each user has to create his/her own working directory.

SPT_toolkit

Here is where all the projectfiles and project folders willbe created.

Project folder

\OptSim\Projects

Windows Systems

Workingfolder

SPT_toolkit

Here is where all the projectfiles and project directorieswill be created.

Project RootDirectory

user_directory

UNIX Systems

WorkingdirectoryProjects

Figure 21. The project directory tree

To copy the example

Copy the project example to your working directory.

In Windows systems copy all the files contained in the folder \OptSim\examples\Matlab\SPT_DataDisplay into the folder \OptSim\Projects\SPT_toolkit.

In UNIX systems type the command: cp ProductInstDir/examples/Matlab/SPT_DataDisplay/* HomeDir/Projects/SPT_toolkit/

To open the existing example

1. In the OptSim editor window choose the menu command File > Open or click on the Open button in the tool bar. The file selection dialog window appears.

Page 263: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 253

2. Select the Projects/SPT_toolkit project directory and the Getting_started_WDM64 project file. Click on the OK. A new OptSim editor window appears displaying the project.

Figure 22. The example project network

SPT Simulation The project is already ready to be simulated with the SPT simulation technique. We remind that this is the basic condition in order to start and correctly use the SPT Data Display toolkit.

To start the SPT simulation

1. Click on the SPT button (or choose the menu command Simulate > SPT > Start).

The OptSim numerical engine for an SPT simulation will be launched, and a small window will inform you on the status of the simulation. SPT usually run very quickly, typically in a few seconds.

Using the Toolkit Let's start the SPT Data Display interface to MATLAB toolkit.

To start an interface to MATLAB toolkit

1. Click the Interface to MATLAB button in the toolbar. The Toolkit Selection dialog window appears.

Figure 23. The Toolkit Selection dialog window

2. In the Available Toolkits list click on the SPT_DataDisplay toolkit name.

3. Click on Start. The MATLAB engine starts then the toolkit About dialog window appears. Please wait, the dialogs may take a while to appear!

When you click the OK button of the About dialog window the SPT Data Display dialog window (Figure 20) appears.

Page 264: 39865643 Optsim Guide

254 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Power Spectrum By default the Power Spectrum option is selected in Plot Type. The diagram shows 2 superimposed power spectra at the output of the 64-channels WDM transmitter (power spectrum A) and at the output of the ideal EDFA second span (power spectrum B).

Figure 24. The Power Spectrum diagram

The spectra are filtered with a rectangular transfer function of 0.125 THz bandwidth as specified in the Rectangular Filter Resolution parameter.

You can zoom in a particular with the mouse just dragging a rectangle on the diagram. To restore the original range of view double-click any point of the diagram.

Select the Single option in Plot Mode to display a single power spectrum.

Channels Power Select the Channels Power option in Plot Type. The diagram shows 2 superimposed curves with all the channel power values at the output of the 64 channels WDM transmitter (power spectrum A) and at the output of the ideal EDFA second span (power spectrum B).

Page 265: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 255

Figure 25. The Channels Power diagram

The channels are detected using a 10 dB peak level as specified in the ∆∆∆∆Lev parameter.

Again you can select the Single option in Plot Mode to display a single power spectrum.

OSNR Select the OSNR option in Plot Type. The diagram shows the difference for each channel of the OSNR values measured at the output of the 64 channels WDM transmitter (power spectrum A) and at the output of the ideal EDFA second span (power spectrum B).

Figure 26. The OSNR diagram (difference)

You can select the Superimpose option in Plot Mode to display the two curves of channel OSNR values at the point A and B. You can select also the Single option in Plot Mode to display a single curve.

Page 266: 39865643 Optsim Guide

256 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Noise Figure Select the Noise Figure option in Plot Type. The diagram shows for each channel the noise figure value measured between the output of the 64 channels WDM transmitter (power spectrum A) and the output of the ideal EDFA second span (power spectrum B).

Figure 27. The Noise Figure diagram

Gain Select the Gain option in Plot Type. The diagram shows for each channel the linear gain value measured between the output of the 64 channels WDM transmitter (power spectrum A) and the output of the ideal EDFA second span (power spectrum B).

Figure 28. The Gain diagram

Page 267: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 257

Click on the Min button in Calculations, to obtain the minimum gain value. Click on the Max button in Calculations, to obtain the maximum gain value.

4.20 Q Surfaces Toolkit This toolkit plots the contour lines map and the surface map of Q(var1, var2) expressed in [dB]. The Q values are extracted from the OptSim project results while var1 and var2 are two project variables on which the user has performed a parametric run.

A series of pop-up menu windows guides you on choosing the Q Estimator block and the two variables var1 and var2, to plot the Q evolution.

The implementation of this toolkit as described below is with reference to MATLAB interface. To implement any variation to this toolkit or to discuss development of new, tailor-made toolkit solutions supporting your specific application requirements, please contact RSoft to arrange a meeting with our engineers. For detailed description on MATLAB interface, please see chapter on “MATLAB Cosimulation in Sample Mode.”

4.20.1 Functioning The purpose of the Q Surfaces routine is to plot contour and surface 3D maps of Q(var1, var2) [dB] factor or QPEN(var1, var2) [dB] versus two project variables used in a parametric run. This routine is particular suitable for dispersion maps optimization analysis.

QPEN(var1, var2) is defined as follow:

),(),( 2121 varvarQQvarvarQ MAXPEN −= [dB]

More details on the Q evaluation may be found on the Q Estimator component description. Please refer to the OptSim component library manual.

4.20.2 Plot Types Let’s suppose “X” and “Y” be the two selected variables of your system, the Q Surfaces routine shows the following plots.

Contour From the Q [dB] values generated by the selected Q Estimator block the routine plots the contour lines of Q vs. (X,Y) or (Y,X), or QPEN vs. (X,Y) or (Y,X).

To obtain the contour map the routine use the MATLAB <contour(Z)> functions. Refer to the MATLAB help for more details. An example of contour map is shown in Figure 38.

Surface From the Q [dB] values generated by the selected Q Estimator block the routine plots the 3D map of Q vs. (X,Y) or (Y,X), or QPEN vs. (X,Y) or (Y,X).

To obtain the surface map the routine use the MATLAB <surf(X,Y,Z,C)> functions. Refer to the MATLAB help for more details. An example of surface map is shown in Figure 38.

Page 268: 39865643 Optsim Guide

258 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Figure 29. The Family parameter selection window

4.20.3 Project Conditions

Schematic Conditions The project must contain at least one Q Estimator block. When more Q Estimators are present, you are prompted to select the Q Estimator to get data from.

Figure 30. The Q estimator selection window

You must have performed a multiple run simulation using at least two project variables.

Parametric Run Matrix Rules

In the Run definition dialog window you must set the values of the two selected variables (var1 and var2) in order to scan all possible combinations. This means that all the value of var2 must be set for each value of var1.

For example, you need to investigate the effect on Q factor of varying the attenuation value of an attenuator and the power value of a laser source in your project. Let’s say you have defined att as the variable for the attenuator and pow for the laser power and that you would perform the analysis for att = 10, 15, 20 dB and pow = 3, 9 dBm. To use the Q Surfaces routine on this project you must define the 6 parametric runs corresponding to all the possible combinations.

Figure 31. The Run definition dialog window

Please note in the Run definition dialog window you can insert the values combination in any order.

Page 269: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 259

The Q Surfaces routine processes the project results and associates each Q value to the corresponding couple of variable according to matrix formalism.

Parametric Runs matrix

Q(att, pow) Q1 Q2 Q3 (10,3) (15,3) (20,3)

Q4 Q5 Q6 (10,6) (15,6) (20,6)

Q values matrix

Figure 32. Example of Matrix data

Simulation Conditions Before using the routine your project must have been simulated with the Variable Bandwidth Simulation (VBS).

To perform an VBS simulation on your project

1. In the OptSim editor window choose the menu command Simulate > VBS > Check or click on the VBS check button in the tool bar to initiate several checks on the system parameters and topology.

2. Choose the menu command Simulate > VBS > Start, the following dialog window appears.

Figure 33. The VBS simulation options dialog window

3. Select the VBS Full option then click on Start to begin the simulation of the project. If previous results of the same system are stored in the working directory, a warning message is displayed, advising that these results will be overwritten.

4.20.4 Getting Started This section describes the step-by-step procedures by which an OptSim user can rapidly learn the toolkit essentials and get started.

The procedure assumes that you are working on the D_Analysis.opf project example installed with the toolkit. You may copy the example file into your working directory and use it immediately. The example is located in the directory:

ProductInstDir/examples/Matlab/Q_Surfaces/

where ProductInstDir is the directory where you installed the OptSim product.

Page 270: 39865643 Optsim Guide

260 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Please note that the /examples directory is considered read-only by OptSim, and you will not be able to run simulations from this directory. If you wish to change the example design structure and parameters or you wish to run a simulation, first save all the example files (opf, opm, dat, etc.) to your working directory. This will allow you to make changes that will not effect the original versions.

The System to be Simulated The system consists of a 4-channel WDM transmitter working at 10 Gb/s. The transmitter is composed of 4 laser sources externally modulated (NRZ modulation format) with power equal to 0 dBm and with wavelengths ranging from 193.3 THz to 193.6 THz. The channel spacing is set to 100 GHz.

The optical signal is launched into 1000 km of fiber. The link consists of 10 spans composed of 100 km of fiber (D=4 ps/nm/km) in-line dispersion compensated followed by an optical amplifier.

After the fiber a Post-compensation unit is placed; both In-Line and Post-compensation unit are ideal fiber grating blocks.

The dispersion parameters of the two fiber grating blocks are defined as following:

• -(D·L-InLine) for the In-Line grating

• Ext for the Post-compensation grating

Where D is the fiber dispersion, L is the fiber length and InLine is the amount of in-line residual dispersion. Ext is the amount of external residual dispersion that can be expressed by the following relation:

−+−=

1001**** PercCompNLDInLineNExt spanspan

Now, performing a multiple run simulation varying Ext and InLine values, it is possible to plot the Q penalty maps by means of the Q_Surfaces routine.

Opening the Project Example Before opening the example create a new working directory (for example named Q_penalty) under the Projects directory and copy the example in that directory.

Note Please note that on Windows systems a predefined working folder “C:\OptSim\Projects” is already prepared for you work while on UNIX systems each user has to create his/her own working directory.

Q_penalty

Here is where all the projectfiles and project folders willbe created.

Project folder

\OptSim\Projects

Windows Systems

Workingfolder

Q_penalty

Here is where all the projectfiles and project directorieswill be created.

Project RootDirectory

user_directory

UNIX Systems

WorkingdirectoryProjects

Figure 34. The project directory tree

To copy the example

Page 271: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 261

1. Copy the project example to your working directory.

In Windows systems copy all the files contained in the folder \OptSim\examples\Matlab\Q_Surfaces into the folder \OptSim\Projects\Q_penalty.

In UNIX systems type the command: cp ProductInstDir/examples/Matlab/Q_Surfaces/* HomeDir/Projects/Q_penalty/

To open the existing example

1. In the OptSim editor window choose the menu command File > Open or click on the Open button in the tool bar. The file selection dialog window appears.

2. Select the Projects/Q_penalty project directory and the D_Analysis project file. Click on the OK. A new OptSim editor window appears displaying the project.

Figure 35. The example project network

VBS Simulation The project is already ready to be simulated with the VBS simulation technique.

To start the VBS simulation 1. Choose the menu command Simulate > VBS > Start, the VBS simulation options dialog

window appears (Figure 33).

2. Select the VBS Full option then click on Start to begin the simulation of the project.

Using the Toolkit Let's start the Q Surfaces toolkit.

To start an interface to MATLAB toolkit

1. Click the Interface to MATLAB button in the toolbar. The Toolkit Selection dialog window appears.

Page 272: 39865643 Optsim Guide

262 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Figure 36. The Toolkit Selection dialog window

2. In the Available Toolkits list click on the Q_Surfaces toolkit name.

3. Click on Start. The MATLAB engine starts then the toolkit About dialog window appears. Please wait, the dialogs may take a while to appear!

When you click the OK button of the About dialog window the routine start to process the project results files. Two subsequent small bar windows will inform you of the status of the processing.

Note When you run the first time the Q Surfaces routine in a project, it analyzes the project results and stores data into appropriated matrixes. Furthermore additional data files are saved into the project results folder in order to avoid the re-computation of data for further routine executions.

To use the Q Surfaces toolkit

1. When the process finishes you are prompted to specify the first common family parameter. Its values will be plotted on the X-axis of the plot.

Select Ext as first parameter and click on OK.

2. The routine asks you to specify the second common family parameter. Its values will be plotted on the Y-axis of the plot. Select InLine as second parameter and click on OK.

3. Now select the Q Penalty plot.

Page 273: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 263

When done, click on OK.

After few seconds both the contour (Figure 37) and surface (Figure 38) Q penalty maps are displayed.

Figure 37. Example of contour map

Page 274: 39865643 Optsim Guide

264 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

Figure 38. Example of surface map

4.21 References [1] M. Born and E. Wolf, Principles of Optics, Pergamon, Oxford, UK 1975

[2] J.G.Proakis, Digital Communications, New York: McGraw-Hill, 1983

[3] A.Humblet and M. Azizoglu “On the bit error rate of lightwave systems with optical amplifiers”, Journ. Lightwave Technol., vol. 9, no. 11, pp. 1576-1582, Nov. 1991

[4] W. Willner, S. Benedetto and L. G. Kazovsky, Optical Communication Systems

4.22 Appendix: Frequently Asked Questions

Here you will find the answers to the most frequent questions regarding OptSim. Please do not hesitate to freely contact RSoft for more specific information.

OptSim FAQ are organized into the following categories:

• FAQ on fiber properties and models (section 4.22.1)

• FAQ on optical components (section 4.22..2)

• FAQ on electrical and digital components (section 4.22.3)

• FAQ on measurement components (section 4.22.4)

Page 275: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 265

• FAQ on other miscellaneous problems (section 4.22.5)

For any other question, please contact [email protected]

4.22.1 FAQ on Fiber Properties and Models What kind of effects does OptSim take into account in simulating the fiber?

The effects OptSim takes into account simulating the fiber are:

Linear effects: up to second order loss and up to fifth order dispersion, PMD and birefringence

Non-linear effects: Kerr effect (XPM, SPM, FWM, ...) Raman effect and SRS

What is the model used to simulate birefringence effect?

The birefringence is applied inside the non-linear operator and the spatial step is specified as a fiber parameter (birefringence correlation length). To apply the birefringence at each step, the electro-optical field is decomposed along the principal axes (the axes are computed randomly) and then the phase shift is applied. The phase shift entity is related to the average beat length and the beat length standard deviation.

How is the PMD taken account for?

To simulate the influence of the PMD induced by the random Differential Group Delay, we implemented the model proposed by Foschini and Poole; a good paper on the subject is the following:

G. J. Foschini, C. D. Poole, Statistical theory of polarization dispersion in single-mode fibers, IEEE/OSA J. Lightwave Technol., vol.9, n. 11, pp. 1439-1456, Aug. 1990.

Every run of the simulator - with different random generator seeds - generates a different realization of the random process giving the DGD along the propagation direction, so you can get many results and average them. The results about the influence of PMD are averaged results, because the Differential Group delay is randomly generated on each step accordingly to the statistic model described in the Foschini & Poole paper.

How can I get more information on the algorithm used to simulate the fiber?

Please read the OptSim white paper on TDSS, a fiber simulation approach.

4.22.2 FAQ on Optical Components I defined the shape of the Gain Spectrum in an Optical amplifier using an external file, specifying a Gain value for a set of frequencies (or wavelengths). I defined a few points to design the shape but the shape OptSim built using my file does not contains exactly the gain shape I expected. Does OptSim do an interpolation?

Yes, OptSim interpolates the points you set in the file to design the Gain Spectrum. The chosen interpolation ensures that the simulated gain is exactly equal to the specified one on the given points, and is smooth to the second order (cubic splines) when interpolating between two points. In order to avoid a coarse approximation of this interpolation, you should define a sufficiently number of points to design your shape. Typically, you get good results when two adjacent points differ by less than 0.2 dB. On the contrary, if two successive points differ by much more than 5-10 dB, the resulting approximation may be inaccurate.

Using an EDFA in the system, can the simulation bandwidth and the ASE bandwidth be different? Does the simulation propagate the full ASE spectrum down the chain?

The spectral region where EDFA noise is generated coincides with the SPT bandwidth even when a VBS is running since the saturation properties of the amplifier are estimated on the SPT bandwidth and not on the VBS bandwidth. Basically, an averaged power spectrum on SPT bandwidth is propagated in parallel with the time-domain samples, and each amplifier is “resolved” over this enlarged bandwidth. This is useful to cope with the fact that, while the useful signal range is usually limited to a few nanometers, a typical EDFA has a gain bandwidth of the order of 40-50 nm (approx. from 1520 to 1570 nm) an ASE noise is emitted over this entire bandwidth.

Page 276: 39865643 Optsim Guide

266 •••• Chapter 4: Sample Mode Data Post-Processing and Display OptSim User Guide

What is the “width and resolution step of the ASE spectrum” propagated by the model regarding the EDFAs?

It is the SPT bandwidth, used in the project, divided by 1024. For instance: all the amplifiers in a project have a bandwidth 1520-1570 nm, thus the ASE bandwidth is 50 nm and the internal resolution is: 50 nm / 1024 = 0.05 nm.

How is the population inversion calculated in the EDFA model?

The population inversion is calculated from the input power spectrum and taking into account all the EDFA parameters (emission, absorption curves, etc) and through the solution of the Rate Equations, as indicated for example in:

C. R. Giles and E. Desurvire, Modeling erbium-doped amplifiers, J. Lightwave Technol. vol. 9 no. 2 pp.271-283, Feb 1991

C. R. Giles and E. Desurvire, Propagation of signal and noise in concatenated Erbium-doped fiber optical amplifiers, J. Lightwave Technol. vol. 9 no. 2 pp 147-153, Feb 1991

Is it possible to specify a custom amplitude modulator?

Yes, it is. Using the EAM modulator you can specify your tension/transmittivity function, loss and frequency response.

Why is it not possible to set a chirping factor for the CW Lorentzian Laser?

The reason why the chirping factor parameter is not present in this model is that this laser cannot be directly modulated. To do a direct modulation you can use the Rate Equation Laser model.

4.22.3 FAQ on Electrical and Digital Components Given the total simulated time span, how long should the pseudo-random (or pseudo-noise) sequence length be in the Data Source component?

The pseudo-noise sequence length should be less or equal than the total number of simulated bits. Otherwise, the simulated bits have not all the statistical characteristics of a pseudo-random sequence.

Is it possible to simulate electrical generation of an optical signal?

Yes, it is. Particularly both 2R and 3R regeneration configurations are supported, by using some of the LIB components contained in the OptSim component library.

4.22.4 FAQ on Measurement Components What is the relationship between the number of training bits used for the Q value estimation and the pseudo-random sequence length?

The best case is when the pseudorandom sequence length is equal to the number of bits used for the training phase. Anyway, if you choose different settings, OptSim executes some checks in order to complete the training phase only if the number of training bits is sufficient.

How many simulated bits are needed to have a good estimation of the Q factor?

To have a reasonable estimate of the Q factor, at least 100-200 bits should be simulated, so to have a good accuracy on the evaluation of the mean and standard deviation on the received signal. You can set the number of simulated bits, at a given bit rate, in the Simulation Parameters window. Then we advise you to start using the default values of the Q-estimator dialog window, which should cope with most practical situation.

You should change the default values only in very particular situation, like when the received eye is highly distorted.

How does OptSim calculate the BER?

The evaluation of the BER in optical system simulation is in general a nontrivial task. Error counting is usually impracticable, since target BERs is typically of the order of 109. Therefore of this to measure a realistic BER it should be necessary to simulate at least 1010 bits, a quantity that is not reasonable value in software simulation. OptSim provides

Page 277: 39865643 Optsim Guide

OptSim User Guide Chapter 4: Sample Mode Data Post-Processing and Display •••• 267

two different components to estimate the transmission performance. Both of them are based on the estimation of some statistical parameters (mean, standard deviation and higher order moments). Q value: this parameter (ratio of means and standard deviations of the received signal) is universally recognized as a good indicator for the transmission performance. OptSim implements an extended definition for the Q factor that takes into account pattern dependence (useful for highly distorted signals)

BER estimator: it estimates the Bit Error Rate from the received signal statistics. This computation is based on the moments estimation of the received signal. The moments are used to fit the parameters of a given probability density function (Gaussian or chi2) and then the estimation for the error probability is done from the resulting pdf function.

The correct usage for these two components allows you estimate the system performance for every realistic system.

4.22.5 FAQ on other Miscellaneous Problems Sometimes OptSim simulations may take hours to simulate. Why is it so slow if you claim to be the fastest?

You need to carefully set Simulation Parameters to the accuracy you are actually interested in. OptSim is not a toy and guarantees the accuracy of its numerical results by automatically adjusting the simulation step accordingly to the complexity of the non-linearities to be considered. Accuracy may be decreased to improve speed if you are not interested in ensuring the precision of results. As a matter of fact, OptSim is one of the only two commercial simulators that can manage to calculate more than 15.000 km of non linear fiber with highest precision in a finite time, and it actually is the fastest, essentially because of its proprietary time-domain simulation technology. Go to the Simulation Parameters and set realistic parameters you are actually interested in, especially keep the artifacts suppression low if you are not interested in accuracy. Also make sure that you are not using unnecessarily large bandwidths and observation windows. Please note that the observation window is the time frame for which OptSim guarantees max accuracy of results, but the actual simulation time frame may become much longer depending on the parameters of components and fiber length.

In OptSim is not simple to interpret the y-axis values in the chart. Which units are used in charts? (dB? dBm? linear? or something else?)

The electrical power measured in OptSim has no dimension because it is obtained doing the average of the input_optical_signal2. Looking at the problem from a different point of view the electrical power is measured when the load is 1 ohm. The reason why we have chosen this way is, in the OptSim domain voltages and currents live together.

Which are the characters allowed in the OptSim file and directory names?

Allowed characters for file names, such as project files, compound components files, CCE files or custom fiber files are the following: alphanumerical, "_" (underscore), "-" (dash) and "+" (plus).

Allowed characters for directory names, such as project directories or library directories, are the following: alphanumerical, "." (dot), "_" (underscore), "-" (dash) and "+" (plus).

Page 278: 39865643 Optsim Guide
Page 279: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 269

Chapter 5: Sample Mode User Models

The OptSim Custom Components are a way to extend the OptSim component library where an external executable program becomes an OptSim component managed in a transparent way for all editor and simulator capabilities.

OptSim custom components may be divided into two categories:

• Custom Component Executable (CCE), where the external program is a generic executable program

• Custom Component for using with MATLAB® (CCM), where the external program is a MATLAB routine

This chapter describes how to work with CCE and how to create a new one.

5.1 The Custom Component Executable The CCE is an OptSim component which behavior during the simulation is described by

an external executable program.

The program must therefore realize the transfer function for the signals in the design network and must dialogue with the OptSim simulator scheduler to execute the simulation directives (SPT or VBS techniques) and return error messages in case of errors.

The external executable program can be developed using the preferred programming language and the integration by executable guarantees that it can be distributed as a black box.

CCE may also reproduce transmitter or receiver components. It can define custom parameters and produces custom outputs to collect specific kind of data.

A CCE has the same graphical and functional properties like any other OptSim component. For example you can use it in an iterated section or in a compound component.

Page 280: 39865643 Optsim Guide

270 •••• Chapter 5: Sample Mode User Models OptSim User Guide

OptSimSIMULATION

MODEL

CCE

Signal InputFiles

Signal OutputFiles

CCE CONTROLS

CCE TRANSFERFUNCTION

OptSimSIMULATORSCHEDULER

Input/OutputControl Files

ControlsSignals

Figure 1 The CCE theory of operation

As you can see from Fig. 1, the communication between the CCE and the OptSim simulator is made through data files. The simulator writes the input control and signal files, then invokes the CCE action and finally reads the output control and signal files. When the CCE is invoked it reads the input signal files and performs the action according to the data written in the input control files, and writes the output signal files (and also the output control file in case of errors).

CCE Composition The CCE is made of the following elements:

• a component description file, i.e. an ASCII file with obs extension, where are described the simulation techniques in which the component will be able to work, the component parameters and the input/output connections (see section 0 for the grammar rules of this file)

• the executable program that simulates the component behavior

If the executable program uses other input files they must be supplied with the above two items.

5.1.1 CCE Types Depending on where the CCE files are saved, there are three categories of CCE. These are:

• locally defined CCE, when the files are stored in the same directory where is stored the project file that uses them

• user library's CCE, when the files are stored in the user library directory (see below)

• predefined CCE, when the files are stored in the default directory created in the OptSim standard installation

User Library The user library is the directory:

• HomeDir/OptSim for UNIX systems

• SystemRoot\profiles\username\Application Data\OptSim for Windows NT systems

• SystemRoot\Documents and Settings\username\Application Data\Optsim for Windows 2000 systems

Page 281: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 271

Note Allowed characters for directory names are: alphanumerical, "." (dot), "_" (underscore), "-" (dash) and "+" (plus).

On Windows 2000 systems this directory may be set as hidden directory so it could be not visible to an OptSim user. To set the directory as visible perform the following procedure (for each OptSim user).

To set the user library as visible

5. Close all applications and log-on as “administrator” or as any user that belongs to group “administrators” in the local domain.

6. Open the Windows Explorer application and select the folder SystemRoot\Documents and Settings\username\Application Data

7. Choose the popup menu command Properties on the folder.

8. Click on the Attributes tab and deselect the Hidden option. Click on OK.

Please note that path contains spaces so you cannot copy files with OptSim (by means of Save As menu command) because spaces are not allowed in the dialog window directory fields. To copy files on that directory you have to use the Windows Explorer application.

5.2 Using a CCE A CCE can be used in a project (or in a compound component) like any other OptSim component.

To use a CCE

1. Click on the Custom Component Executable button then click on the design area of

the design to place it.

2. Choose the popup menu command Properties on the icon. The Choose Custom Component Executable dialog window appears (Fig. 2).

3. In the Category list click on:

− Locally Defined, if the component is stored in the same directory where the project file is saved

− User Library, if the component is stored in the user library directory

− Predefined, if the component comes from the OptSim standard installation

Figure 2 The Choose Custom Component Executable dialog window

Page 282: 39865643 Optsim Guide

272 •••• Chapter 5: Sample Mode User Models OptSim User Guide

4. In the Blocks list click on the name of the component you want. The CCE parameters dialog window appears (Fig. 3).

5. Click on the parameter name in the Parameters list then change the value in the Value field. Repeat this operation for all the parameters then click on OK to close the window.

Figure 3 The CCE parameters dialog window

At any time you can change the parameters of the CCE like any other OptSim component.

To modify a CCE parameter

1. Choose the popup menu command Properties on the CCE icon. The CCE parameters dialog window appears (Fig. 3).

2. Click on the parameter name in the Parameters list then modify the value in the Value field.

5.3 Creating a CCE In order to create a new CCE you have to:

• write the component description file with extension obs, for defining the simulation techniques in which the component will be able to work, the component parameters and the input/output connections (see section 5.6.1 for the grammar rules of this file)

• write the code that simulates the block behavior in the programming language that you prefer; compile and link the code so to produce an executable file; if the executable needs other input files place them in the same directory of the executable

Note Allowed characters for file names are: alphanumerical, "_" (underscore), "-" (dash) and "+" (plus).

Page 283: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 273

For example you can use the following command syntaxes to compile and link an executable file:

C Compiler cc -o executable_file_name executable_file_name.c -lm

Fortran Compiler

g77 -o executable_file_name executable_file_name.for

Note In a Windows NT system you can issue the same Fortran compiler command from an OptSim Console (menu Start>Programs>OptSim x.x>OptSim Console).

The executable program must communicate with OptSim through the following data files.

Control Files

• simulator parameters file, where the OptSim simulator writes the simulation parameters of the current design and the names of the other input/output files

• component parameters file, where the OptSim simulator writes the current values for the CCE parameters introduced by the CCE parameters dialog window

• messages output file, where the OptSim simulator reads the possible warning or error messages written by the CCE

Signal Files

• optical spectrum input file, where the OptSim simulator writes the samples of the power spectrum input for the CCE

• optical spectrum output file, where the OptSim simulator reads the samples of the power spectrum written by the CCE

• optical and electrical time sample input file, where the OptSim simulator writes the time samples of the signal input for the CCE (only for SPT simulation techniques)

• optical and electrical time sample output file, where the OptSim simulator reads the time samples of the signal output written by the CCE

Figure 4 shows the input/output control and signal communication between OptSim and the CCE.

Page 284: 39865643 Optsim Guide

274 •••• Chapter 5: Sample Mode User Models OptSim User Guide

OptSimSIMULATORSCHEDULER

SPT / VBSp

VBS VBS

SPT / VBSp / VBS

ControlsSignals

OptSimSIMULATION

MODEL

COMPONENTPARAMETERS FILE

- Parameters Values(OptSimBlParC_1 grammar)

SIMULATORPARAMETERS FILE

- Simulation Parameters- I/O File Names

(OptSimBlParS_1 grammar)

MESSAGES OUTPUTFILE

- Scheduler Informations- Error Messages

(OptSimParO_1 grammar)

OPT&ELT TIMESAMPLE INPUT FILES

- Time Sample Signals(Recorder/Playback grammar)

OPTICAL SPECTRUMINPUT FILES

- Power Spectrum Signals(OptSimPS_1 grammar)

OPTICAL SPECTRUMOUTPUT FILES

- Power Spectrum Signals(OptSimPS_1 grammar)

OPT&ELT TIME SAMPLEOUTPUT FILES- Time Sample Signals

(Recorder/Playback grammar)

CCE

Figure 4 The CCE communication

5.3.1 How the CCE is Invoked by OptSim OptSim simulator invokes the executable implementing the CCE by a command line as the following:

<executable> <simulator_parameters> <component_parameters>

where:

• <executable>, is the name of the executable file implementing the CCE

• <simulator_parameters>, is the name of the OptSim simulator interface file (written by OptSim and read by the executable file) containing the simulation parameters of the design and the names for the other input/output files; see section 5.6.2 for the grammar rules of this file

• <components_parameters>, is the name of the parameters file (written by OptSim and read by the executable file) containing the current values of all the component parameters introduced by the CCE parameters dialog window (Fig. 3); see section 5.6.3 for the grammar rules of this file

When the executable exits, it has to return a result code. The allowed values and their meaning are listed below:

• 0 : (EXIT_SUCCESS) the execution has been performed without problems

• 1 : (EXIT_FAILURE) the execution has been terminated abnormally

• 2 : (EXIT_WARNING) the execution has been performed with some warning situation

Warning and error messages can be written in the message output file, which contains all outputs that the simulator engine requires to control the simulation evolution. OptSim will display these messages in the window that shows the

Page 285: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 275

simulation steps. See section 5.6.4 for the grammar rules of the messages output file. The message output file name is indicated, as for the other data files, in the <simulator_parameters> file.

5.4 Executable Behavior During the Simulation In OptSim two kinds of simulation techniques are available: Spectral Propagation Technique (SPT) and Variable Bandwidth Simulation technique (VBS). CCE can be used in both the two techniques, but SPT simulation is mandatory whereas VBS is optional, i.e. you can create a CCE that works only in SPT. When you try to run a VBS on a project that contains a component of this kind an error message is displayed and the VBS simulation is not allowed to start.

5.4.1 SPT Behavior If SPT simulation is chosen, the simulator performs a simplified Spectral Propagation Technique. Signals are propagated inside the network as power spectra, taking into account component loss and noise. Spectra, power levels and Optical Signal to Noise Ratio (OSNR) can be evaluated at any point of the network.

Note During the SPT simulation, OptSim simulator does not invoke a CCE that has neither input nor output optical signals.

This kind of simulation allows to simulate an executable representing a component only in the frequency domain. In SPT the executable must be able to act as a black box with a transfer function that transforms all the input power spectra and peaks in the output power spectra and peaks.

The actions that the executable must do are:

1. Reads the <simulator_parameters> file containing the simulation parameters and the other input/output file assignments.

2. Reads the <component_parameters> file containing the current component parameter values.

3. Reads the spectrum input files, one for each optical input signal, whose names are indicated in the <simulator_parameters> file, containing the information about the input power spectra and peaks.

4. Elaborates the input power spectra and peaks to obtain the output power spectra and peaks.

5. Writes the obtained spectra in the spectrum output files, one for each optical output signal, whose names are indicated in the <simulator_parameters> file.

6. Writes, if needed, the messages output file, whose name is indicated in the <simulator_parameters> file.

The grammar of the power spectrum file is explained in section 5.6.6.

Note We remind that this particular simulation propagates only the optical power spectra. For this reason, in SPT only optical outputs are considered, while electrical signals are not propagated.

Input During an SPT simulation, the executable must read in input as many spectrum files as the number of optical input signals containing the corresponding power spectra and peaks, and it must be able to get from the <simulator_parameters> file the following fields. See also the grammar rules for this file in section 5.6.2.

• sim_tecnique, indicates the kind of simulation; it is set to SPT when OptSim performs a spectral propagation technique. This can be useful to isolate the parts of executable code relative to each simulation technique

• SPT_center_frequency, contains the simulation center frequency, expressed in THz

• SPT_lower_band_limit, contains the simulation bandwidth lower frequency, expressed in THz

Page 286: 39865643 Optsim Guide

276 •••• Chapter 5: Sample Mode User Models OptSim User Guide

• sp_in_sig_list, contains all the information related to the spectrum input files

• sp_out_sig_list, contains all the information related to the spectrum output files

Output During an SPT simulation, the executable must furnish at the output as many spectrum files as the number of optical output signals containing the corresponding power spectra and peaks. See section 5.4.4 for more details on power spectra.

Power Spectrum data input/output Files The grammar of these files is explained in section 5.6.6, and the meaning of each field is the following:

• ps_flag, 1 during SPT run

• ps_peak_power, contains the value of the peak power of the component, i.e. the maximum of the signal in the time domain (over the SPT bandwidth) expressed in mW

• ps_sample_number, contains the number of the spectrum samples (1024 in the current version of OptSim)

• ps_sample, samples of the power spectrum, starting from the sample at the lowest frequency. See section 5.4.4 for more details on power spectra.

5.4.2 VBS Behavior A VBS simulation can be divided into two phases performed one following the other: a preliminary simulation in the frequency domain called prerun phase and the simulation in the time domain (run phase). The prerun phase has the purpose to optimize the VBS run evaluating parameters that will be used during the time domain simulation. Both the two phases are mandatory.

Note During the VBS prerun simulation, OptSim simulator does not invoke a CCE that has neither input nor output optical signals.

The actions that the executable must do during the VBS prerun phase are:

1. Reads the <simulator_parameters> file containing the simulation parameters and the other input/output file assignments.

2. Reads the <component_parameters> file containing the current component parameter values.

3. Reads the spectrum input files, one for each optical input signal, whose names are indicated in the <simulator_parameters> file, containing the power spectra of input optical signals.

4. Elaborates the input power spectra to obtain the output power spectra.

5. Writes the obtained spectra in the spectrum output files, one for each optical output signal, whose names are indicated in the <simulator_parameters> file.

6. Writes the messages output file, whose name is indicated in the <simulator_parameters> file.

The actions that the executable must do during the VBS run phase are:

1. Reads the <simulator_parameters> file containing the simulation parameters and the other input/output file assignments.

2. Reads the <component_parameters> file containing the current component parameter values.

3. Reads the time sample input files, one for each optical and electrical input signal, whose names are indicated in the <simulator_parameters> file, containing the time samples of input optical or electrical signals.

Page 287: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 277

4. Reads the spectrum input files, one for each optical input signal, whose names are indicated in the <simulator_parameters> file, containing the power spectra of input optical signals.

5. Elaborates the input power spectra and time samples to obtain the output time samples.

6. Writes the obtained time samples in the time sample output files, one for each optical and electrical output signal, whose names are indicated in the <simulator_parameters> file.

7. Writes the messages output file, whose name is indicated in the <simulator_parameters> file.

The grammar of the time sample file is explained in section 5.6.5.

Besides, the VBS technique allows defining the VBS bandwidth as a smaller portion of the whole SPT bandwidth, saving simulation time.

5.4.3 Note on Measurement Components If the CCE simulates a measurement component, you have to choose with care the samples to be measured, to avoid those which introduce bounder effects.

The measurement component should measure samples starting from the start_valid_samples time and stopping at stop_valid_samples time. These two variables are set in the <simulator_parameters> file, following the grammar rules explained in section 5.6.2.

S0

S1

Sstart Sstop

Sk-1

Sk

tstart_valid_samples

tstop_valid_samples

samplest

Figure 5 The starting and ending samples in the measurement components

5.4.4 Note on Power Spectra The power spectrum points are actually Power Spectral Densities (PSD), expressed in mW/THz, integrated over the SPT frequency step, obtained by the SPT bandwidth divided by the number of the spectrum samples (1024 in the current version of OptSim).

More precisely the i-th sample of the power spectrum file contains the integral of Power Spectral Density in the frequency range [flo , fhi [, where:

flo = flowSPT + i·∆f - ∆f /2

fhi = flowSPT + i·∆f + ∆f /2

with flowSPT is the lowest frequency of SPT bandwidth and f is the frequency sampling factor (SPT bandwidth / number of points).

5.4.5 Management of Custom Output This section describes how a CCE can collect custom data via files during an OptSim simulation (only in VBS run phase).

You can choose any data format, however some ASCII files can be visualized by OptSim.

Page 288: 39865643 Optsim Guide

278 •••• Chapter 5: Sample Mode User Models OptSim User Guide

Output Files Management Every custom output file produced must have a name in the format

<instance_prefix><4digit>.<extension>

where:

• <instance_prefix> is the value defined by instance_prefix in the <simulator_parameters> file that the executable receives as first parameter; this value is unique for a CCE instance in a simulation; see section 5.6.2 for the grammar rules of this file

• <4digit> is a four digit number that the executable can use to generate a unique name when it produces more than one custom file in a single simulation; any value is allowed

• <extension> is the extension that identifies the file format; all extensions are allowed but only tff and DAT format are visualized by OptSim

All the custom file names must be reported in the cust_output_files_block of the messages output file used by the executable to communicate to the OptSim simulator. The message output file name is indicated, as for the other data files, in the <simulator_parameters> file. See section 5.6.4 for the grammar rules of the messages output file.

Retrieving Produced Files The produced files of every OptSim block, can be retrieved by the index file named

<design_name>._op

where <design_name> is the name of the opf file without extension. See section 5.6.7 for the grammar rules of this file.

Visualizing Produced Files in OptSim DAT Format ASCII data can be collected in files with DAT extension that will be visualized by OptSim choosing the popup menu command View Data on the CCE icon. If a CCE produces more than one DAT file, then all of them will be concatenated in the output window.

A DAT file will be written according to the following rules:

• only printable ASCII characters are allowed

• a line can not start with the <blank>P<blank> sequence (it is reserved)

5.5 CCE VBS Behavior Examples In this section VBS behavior will be explained in the following cases:

• when the CCE has only one optical input and output and it does not introduce group delay on the signal (Case 1, section 5.5.1)

• when the CCE has only one optical input and output and it introduces group delay on the signal (Case 2, section 5.5.2)

• when the CCE has more than one input and/or output, electrical or optical, and it introduces a group delay on the signal (Case 3, section 5.5.3)

5.5.1 Case 1: one input/output with no Group Delay In this section we consider the following case:

• one optical input

• one optical output

Page 289: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 279

• no group delay introduced by the CCE

VBS prerun Phase

Input During the VBS prerun the CCE must be able to read both the two files <simulator_parameters> and <components_parameters>. See section 5.6.2 and section 5.6.3 for the grammar rules of these files. The meaning of the fields of the file <simulator_parameters> used in VBS prerun is the following:

• sim_tecnique, indicates the kind of simulation technique; it is set to VBSp in the VBS prerun phase. This field may be useful writing the executable program, to isolate the parts of code that have to be executed only during VBS prerun

• VBS_center_frequency, contains the value of the VBS center simulation frequency expressed in THz

• VBS_lower_band_limit, contains the value of the lower frequency of the VBS bandwidth expressed in THz. This value and the preceding one are useful to determine the VBS bandwidth and consequently to set the value of the flag ps_flag in the power spectrum file

• SPT_center_frequency, contains the value of the center frequency of SPT bandwidth expressed in THz

• SPT_lower_band_limit, contains the value of the lower frequency of the SPT bandwidth expressed in THz. This value and the preceding one are useful since in the prerun phase the power spectrum and the peak power are evaluated over the whole SPT bandwidth

• sp_in_sig_list, contains all the information related to the spectrum input file

• sp_out_sig_list, contains all the information related to the spectrum output file

Output During the VBS prerun the following field of the messages output file must be written. See section 5.6.4 for the grammar rules of this file.

• max_delay_window_block, in the case we are now considering the two values of this field must be 0

• custom_message, it is a field containing a warning, error, or an information message

Power Spectrum Data input/output Files

The grammar rules of these files are explained in section 5.6.6, and the meaning of each field is the following:

• ps_flag, if this flag is set to 0 the portion of the optical network that follows the CCE will be kept silent during VBS run

• ps_peak_power, contains the value of the peak power of the block, i.e. the maximum of the output power spectrum over the SPT bandwidth, expressed in mW

• ps_sample_number, contains the number of the spectrum samples (1024 in the current version of OptSim)

• ps_sample, samples of the power spectrum, starting from the sample at the lowest frequency; see section 5.4.4 for more details on power spectra

VBS prerun Actions

The action that the CCE must do during the execution of the prerun are the following:

• reads the two input files (<simulator_parameters> and <components_parameters>) and the spectrum input file

• discriminates if the portion of the network following the CCE block must be kept silent in the VBS run. In this case the value contained in the field ps_flag must be set to 0 in the spectrum output file. In order to

Page 290: 39865643 Optsim Guide

280 •••• Chapter 5: Sample Mode User Models OptSim User Guide

determine this, the CCE must verify if over the VBS bandwidth the spectrum of the output signal has a significant value or not (independently of the input signal). Let's consider a simple example: if the CCE represents an optical filter, the portion of the network following the filter must be considered silent if the bandwidth of the filter is not contained in the VBS simulation bandwidth

• writes in the field max_delay_window_block of the messages output file, the two values 0, and 0

• evaluates the output peak power (from the input peak power) and writes this value in the spectrum output file (in the field ps_peak_power)

• evaluates the output power spectrum (from the input power spectrum) over the whole SPT bandwidth, like in SPT simulation, and writes it in the field ps_sample of spectrum output file. The same portion of code used in the SPT spectra generation can be used in the VBS prerun spectra generation

VBS run Phase The VBS run phase is the simulation performed in time domain over the VBS frequency bandwidth.

Input During the VBS run the CCE must be able to read both the two files <simulator_parameters> and <components_parameters>. See section 5.6.2 and section 5.6.3 for the grammar rules of these files. The meaning of the fields of file <simulator_parameters> used in VBS run is the following:

• sim_tecnique, indicates the kind of simulation technique; it is set to VBS in the VBS run phase. This field may be useful writing the executable program to isolate the parts of code that have to be executed only during VBS run

• VBS_center_frequency, contains the value of the VBS center simulation frequency expressed in THz

• VBS_lower_band_limit, contains the value of the lower frequency of the VBS bandwidth expressed in THz

• SPT_center_frequency, contains the value of the center frequency of SPT bandwidth expressed in THz

• SPT_lower_band_limit, contains the value of the lower frequency of the SPT bandwidth expressed in THz

• delt_ps, contains the value of the sampling step expressed in [ps]

• sp_in_sig_list, contains all the information related to the spectrum input file

• sp_out_sig_list, contains all the information related to the spectrum output file

• tm_in_sig_list, contains all the information related to the time sample input file

• tm_out_sig_list, contains all the information related to the time sample output file

Output During the VBS run the following field of the messages output file must be written. See section 5.6.4 for the grammar rules of this file.

• max_delay_window_block, contains two values that in the case we are now considering must be set both to 0

• custom_message, is a field containing a warning, error, or an information message

During the VBS run the CCE can generate also custom output files to store useful data. See section 5.4.5 for further details on managing the custom outputs.

Page 291: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 281

Time Sample Data input/output Files

In the case we are now considering (one optical input and one optical output) there is one file which contains the input optical signal sampled in the time domain and one file which contains the output optical signal. The grammar of these files is explained in section 5.6.5 and the meaning of each field is the following:

• delt_ps, contains the value of the sampling step expressed in ps. This value must be read from the input file and must not be changed by the CCE

• fsym_thz, contains the value of the VBS central simulation bandwidth expressed in THz. This value can be read from the field VBS_center_frequency, of the input file

• irep, contains a flag that defines the signal polarization format (1 = single, 2 = double)

• signal_sample, it is the signal sample that may assume different format depending on the particular kind of signal (single or double polarization)

VBS run Actions

The actions that the CCE must do during the execution of the run phase are the following:

• reads the two input files (<simulator_parameters> and <components_parameters>) and the time sample input file

• discriminates if the portion of the network that follows the CCE must be kept silent in the VBS run. In order to determine this, the CCE must verify if over the VBS bandwidth the spectrum of the output signal has a significant value or not (independently of the input signal). To keep silent the network, in the time domain signal output file it must be written only one sample set to 0.0

• evaluates the time domain sampled signal (from the input time domain signal) and writes it on the time sample output file. In the case we are now considering the CCE must produce as many samples as in the time sample input file

• writes custom data files if there are any; see section 5.4.5 for further details on managing the custom outputs

• writes (if needed) warnings, errors, or information on the messages output file and return the proper exit code

5.5.2 Case 2: one input/output Introducing Group Delay In this section we consider the presence of group delay introduced by the CCE. We consider the following case:

• one optical input

• one optical output

• group delay introduced by the CCE

A component can introduce a group delay on the output signal that is not constant over the frequency bandwidth, i.e. the component may have a group delay curve versus frequency. Let's be tmin the minimum of this curve over the whole SPT bandwidth and tmax the maximum. In the following we will mean these two values when we will speak of minimum delay and maximum delay.

Note Only the differences between this case and the previous one are described in the following.

Page 292: 39865643 Optsim Guide

282 •••• Chapter 5: Sample Mode User Models OptSim User Guide

VBS prerun Phase

Output During the VBS prerun all the fields of the messages output file must be written. See section 5.6.4 for the grammar rules of this file. The meaning of the messages output file fields is the following:

• max_delay_window_block, in this case this field must contain the minimum and the maximum of the group delay curve, tmin and tmax

VBS prerun Actions

Beside the action mentioned in the case without delay, during VBS prerun phase the minimum and maximum delay tmin and tmax must be evaluated and these values must be written in the field max_delay_window_block of the messages output file.

These values must be evaluated with great care, since if the value of the difference between maximum and minimum of the delay is lower than its correct value, simulation results will not be correct. Moreover if this difference is a value quite greater than it is necessary, the performance of the simulation will grow worse, i.e. the simulation time will increase; so we strongly recommend to evaluate tmin and tmax with as greatest accuracy as possible.

VBS run Phase

VBS run Actions

During the VBS run the actions that the CCE must perform are the same as in the Case 1, but in the evaluation of optical output signal samples in the time domain the group delay must be taken into account. Therefore the CCE must also do the following:

• computes the minimum tmin and the maximum tmax of the delay curve

• evaluates the time duration of the input signal tin with the following formula: tin = Nsampl·delt_ps

where delt_ps is the sampling time and Nsampl is the number of time samples contained in the input time domain file

• evaluates the valid output time window ∆tgood : ∆tgood = tin - (tmax - tmin)

• evaluates the time domain sampled signal (from the time domain input signal) and writes it on the time sample output file. In the time sample file there must be only the samples over the valid output time window, ∆tgood , starting from tmax. Hence in the case we are now considering the number of samples in the output file is ∆tgood/delt_ps.

5.5.3 Case 3: More input/output Introducing Group Delay In this section we consider the most general case when the CCE has more than one input and more than one output electrical and optical. We consider the following case:

• m optical inputs

• n optical outputs

• p electrical inputs

• q electrical outputs

• group delay introduced by the CCE over more than one internal optical path of the component between input and output connections

Note Only the differences between this case and the previous one are described in the following.

Page 293: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 283

VBS prerun Phase

Input During the VBS prerun the CCE must be able to read both the two files <simulator_parameters> and <components_parameters>. See section 5.6.2 and section 5.6.3 for the grammar rules of these files. The meaning of the fields of the file <simulator_parameters> used in VBS is the same as in the Case 1 (section 5.5.1) with the following differences:

• sp_in_sig_list, contains all the information related to the m spectrum input files

• sp_out_sig_list, contains all the information related to the n spectrum output files

Output The values of tmin and tmax must be evaluated with the algorithm described below in “Evaluating Maximum and Minimum Delay”.

Power Spectrum input/output Files

In the case we are considering there are m power spectrum input files, and n power spectrum output files. The meaning of the fields of these files is the same as described in Case 1 (section 5.5.1).

VBS prerun Actions

The values of tmin and tmax must be evaluated with the algorithm described below in the following paragraph. In the prerun phase electrical signals are not considered.

Evaluating Maximum and Minimum Delay

Each component must be considered as a set of connections from some of the m optical inputs to some of the n optical outputs. In the most complex case each of the m optical input is connected to each of the n optical output; in a generic case we have k connections, where k ≤ m*n.

For each connection a delay curve over the SPT bandwidth may be defined (for the signal that goes from the input to the output of the connection). The evaluation of the minimum and maximum of the delay must be done in this way:

1. For each connection c, evaluate the maximum tmax,c and the minimum tmin,c of the delay curve on the connection.

2. Evaluate the difference dc=tmax,c - tmin,c .

3. Evaluate the maximum of the differences dc, varying c over the whole set of the connections; let be cmax the corresponding connection.

4. The tmax and tmin of the connection cmax are the tmax and tmin required.

For example consider a component with two optical inputs, I1 and I2 and two optical outputs O1 and O2, and consider the following maximum and minimum values of the delays over the connections (notice that I1 and O2 are not connected):

Connection

Min delay on the connection (ps)

tmin,c

Max delay on the connection (ps)

tmax,c

Difference

dc=tmax,c-tmin,c

I1 → O1 2 3 1

I2 → O2 1 2 1

I2 → O1 4 6 2

Since the third connection (I2→O1) has the greatest difference, the requested values are tmin = 4 ps and tmax = 6 ps.

Page 294: 39865643 Optsim Guide

284 •••• Chapter 5: Sample Mode User Models OptSim User Guide

VBS run phase

Input During the VBS run the CCE must be able to read both the two files <simulator_parameters> and <components_parameters>. See section 5.6.2 and section 5.6.3 for the grammar rules of these files. The meaning of the fields of the file <simulator_parameters> used in VBS is the same as in the Case 1 (section 5.5.1) with the following differences:

• sp_in_sig_list, contains all the information related to the m spectrum input files

• sp_out_sig_list, contains all the information related to the n spectrum output files

• tm_in_sig_list, contains all the information related to the m+p time sample input files

• tm_out_sig_list, contains all the information related to the n+q time sample input files

Time Sample Data input/output Files

In the case we are considering there are m+p time sample input files, and n+q time sample output files. The meaning of the fields of the optical time sample files is the same as in Case 1, section 5.5.1. In the electrical time sample files the field fsym_thz must be filled with the value 0 and the field irep is absent.

See section 5.6.5 for the grammar of OptSim time domain signals.

VBS run Actions

During the VBS run the actions that the CCE must perform are the same as in Case 2, with the following differences:

• the CCE must discriminate if there are some arms of the network that follow the CCE that must be kept silent in the VBS run. In order to determine this, for each of the m optical output the CCE must verify if over the VBS bandwidth the spectrum of the output signal has a significant value or not (independently of all the input signals). To keep silent the network, in the time domain signal output files corresponding to these outputs it must be written only one sample set to 0.0

• the CCE must compute the minimum tmin and the maximum tmax of the delay as explained in “Evaluating Maximum and Minimum Delay” earlier in this section

5.6 OptSim Files Grammar To read and write the main OptSim interface files, you must follow the grammar rules described in this section. The grammars are:

• CCE Component Description, to write the CCE component description file

• Simulation Parameters for CCE (OptSimBlParS_1), to read the OptSim simulator interface file

• Component Parameters for CCE (OptSimBlParC_1), to read the component parameter values file

• Output Simulation Parameters from CCE (OptSimBlParO_1), to write the messages output file

• Recorder and Playback Standard Files, to interface the optical/electrical time sample input/output files

• Optical Power Spectrum Files (OptSimPS_1), to interface the optical spectrum input/output files

• Charts Index, to read the charts index file of the design

5.6.1 CCE Component Description Each CCE component description file contains the description of one component only.

Page 295: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 285

The component name takes the same name of the component description file (with extension obs). The component name is an ASCII printable character string, without blank, tab, new line, whose length cannot exceed 31 characters.

General Rules • Files are formatted by line

• No blank lines are allowed

• The first line is mandatory and it identifies the file type

• All comment lines must have a pound sign character “#” in the first column

• Only blank and tab separators are allowed

• Only exponential notation is allowed for numbers (for example 10.0 or 0.1 or -12.388888E+002)

• All identifiers cannot be longer than 31 ASCII characters

Grammar Notation used is EBNF (Extended Backus Naur Form)

• [ item ] stands for optional item occurring only once

• item stands for optional item occurring any number of times

• ( tem_a | item_b) stands for items that can occur as alternative

• Bold stands for language keywords

• Italic stands for rules (non-terminal symbols)

• Plain stands for identifiers and names ObsVersion grammar_version # comment_line ## [ SourceFile filename Unit kind ] ExeBlock Simulation [SPT] [VBS] Parameters ( Int | Double | File | String ) param_name [ Unit measure_unit ] [ Default default_value ] Inputs ( Electric | Optic ) input_name Outputs ( Electric | Optic ) output_name [ OutputData ]

Description grammar_version ::= 1

Source File Information

The source file information section is not mandatory, but it is strongly recommended. If this section is not present then the executable file name is the same as the component description file name, without the extension. If this section is present it's possible to specify the executable file name.

filename ::= string It is the executable file name, without extension.

kind ::= integer It is a numerical constant that specifies that the file is an executable. In this case it must have the value 120.

Page 296: 39865643 Optsim Guide

286 •••• Chapter 5: Sample Mode User Models OptSim User Guide

Block Parameters

In this section it's possible to specify the parameters of the component. These parameters will appear in the parameters dialog window of the component. The following types of parameters are available:

• Int, integer parameter

• Double, double parameter

• File, file parameter. It is the name, without path, but with extension, of a data file that will be used as an input by the executable during the simulation

• String, string parameter param_name ::= string The name of the parameter, i.e. an ASCII printable character string, without blank, tab, new line. The string length cannot exceed 31 characters.

measure_unit ::= string The measurement unit of the parameter, i.e. an ASCII printable character string, without blank, tab, new line.

default_value ::= value The default value of the parameter.

Block Input/Output

This section defines the I/O of the component. Each I/O signal can be defined as:

• Electric, for electrical signal

• Optic, for optical signal input_name ::= string output_name ::= string The name of the input/output signal, i.e. an ASCII printable character string, without blank, tab, new line.

Block Data Outputs

If this section is present it means that the executable, during the simulation, will produce some output files. See also section 0 for the management of custom output.

Example ObsVersion 1 # this is a block description file example ## SourceFile exe_filename Unit 120 ExeBlock Simulation SPT VBS Parameters Double Hilbert_delay Unit ps Default 1e3 Double Loop_Gain Default 10. # VCO of the block (last default: 1.8e-3) Double VCO_frequency Unit THz Default 2.e-3 Inputs Electric in Outputs Electric VCO Electric multiplier

5.6.2 Simulation Parameters for CCE (OptSimBlParS_1)

General Rules • Files are formatted by line

Page 297: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 287

• No blank lines are allowed

• The first line is mandatory and it identifies the file type

• A line that has two '#' characters in the first two columns is mandatory and it ends the comment section

• All comment lines must have a pound sign character “#” in the first column

• Only blank and tab separators are allowed

• Only exponential notation is allowed for numbers (for example 10.0 or 0.1 or -12.388888E+002)

• After the comment section, all identifiers in first column and all strings are written as 31 ASCII characters, left aligned and filled with blanks

Grammar Notation used is EBNF (Extended Backus Naur Form)

• [ item ] stands for optional item occurring only once

• item stands for optional item occurring any number of times

• ( item_a | item_b) stands for items that can occur as alternative

• Bold stands for language keywords

• Italic stands for rules (non-terminal symbols)

• Plain stands for identifiers and names OptSimBlParS grammar_version # comment_line ## sim_tecnique sim_tecnique polarization_mode polarization_mode VBS_center_frequency VBS_center_frequency VBS_lower_band_limit VBS_lower_band_limit SPT_center_frequency SPT_center_frequency SPT_lower_band_limit SPT_lower_band_limit delt_ps delt_ps min_out_sample min_out_sample start_valid_samples start_valid_samples stop_valid_samples stop_valid_samples sp_in_sig_list opt_in_sig_num input_name sp_in_file_name sp_out_sig_list opt_out_sig_num output_name sp_out_file_name tm_in_sig_list tot_in_sig_num input_name tm_in_file_name tm_out_sig_list tot_out_sig_num output_name tm_out_sig_name instance_prefix instance_prefix instance_out_sim instance_out_sim

Description grammar_version ::= 1

sim_tecnique ::= (SPT | VBSp | VBS) It is the simulation technique of the current simulation ( VBSp is the pre-run phase of VBS simulation).

polarization_mode ::= (1 | 2) It is the polarization representation of the optical signal in the current simulation ( 1 = single, 2 = double).

VBS_center_frequency ::= real number It is the VBS center simulation frequency expressed in THz.

Page 298: 39865643 Optsim Guide

288 •••• Chapter 5: Sample Mode User Models OptSim User Guide

VBS_lower_band_limit ::= real number It is the VBS lower bandwidth frequency expressed in THz.

SPT_center_frequency ::= real number It is the SPT center simulation frequency expressed in THz

SPT_lower_band_limit ::= real number It is the SPT lower bandwidth frequency expressed in THz.

delt_ps ::= real number It is the sampling step expressed in ps.

min_out_sample ::= integer The minimum number of time samples for the blocks which has no input signals (like the laser).

start_valid_samples ::= real number It is the instant where a measurement system should start measuring the samples (only for measurement components).

stop_valid_samples ::= real number It is the instant where a measurement system should stop measuring the samples (only for measurement components).

opt_in_sig_num ::= not negative integer The number of optical input signal files (one for input); this line has to be followed by in_sig_num lines of in_file_name.

input_name ::= string The name of the input defined in the component description.

opt_out_sig_num ::= not negative integer The number of optical output signal files (one for output); this line has to be followed by out_sig_num lines of out_file_name.

output_name ::= string The name of the output defined in the component description.

tot_in_sig_num ::= not negative integer The total number of input signal files (one for input); this line has to be followed by in_sig_num lines of in_file_name.

tot_out_sig_num ::= not negative integer The total number of optical output signal files (one for output); this line has to be followed by out_sig_num lines of out_file_name.

sp_in_file_name ::= string It is the name of a spectral input signal file that the instance has to read.

sp_out_file_name ::= string It is the name of the spectral output signal file that the instance has to write.

tm_in_file_name ::= string It is the name of the time domain input signal file that the instance has to read.

tm_out_file_name ::= string It is the name of the time domain output signal file that the instance has to write.

instance_prefix ::= string The string that must be used by the instance as prefix for all file names produced in order to collect custom data.

instance_out_sim ::= string The name of the file that the instance has to write for collecting output data to the simulator.

5.6.3 Component Parameters for CCE (OptSimBlParC_1)

General Rules • Files are formatted by line

• No blank lines are allowed

Page 299: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 289

• The first line is mandatory and it identifies the file type

• A line that has two '#' characters in the first two columns is mandatory and it ends the comment section

• All comment lines must have a pound sign character “#” in the first column

• Only blank and tab separators are allowed

• After the comment section, all identifiers in first column and all strings are written as 31 ASCII characters, left aligned and filled with blanks

Grammar Notation used is EBNF (Extended Backus Naur Form)

• [ item ] stands for optional item occurring only once

• item stands for optional item occurring any number of times

• ( item_a | item_b) stands for items that can occur as alternative

• Bold stands for language keywords

• Italic stands for rules (non-terminal symbols)

• Plain stands for identifiers and names OptSimBlParC grammar_version # comment_line ## par_number par_number par_name par_value

Description grammar_version ::= 1

par_number ::= not negative integer The number of parameters supplied (according to the component description); it could be 0.

par_name ::= string It is the parameter name specified in the component description.

par_value ::= value It is the current value of the parameter in the same format specified in the component description.

5.6.4 Output Simulation Parameters from CCE (OptSimBlParO_1)

General Rules • Files are formatted by line

• No blank lines are allowed

• The first line is mandatory and it identifies the file type

• A line that has two '#' characters in the first two columns is mandatory and it ends the comment section

• All comment lines must have a pound sign character “#” in the first column

• Only blank and tab separators are allowed

Page 300: 39865643 Optsim Guide

290 •••• Chapter 5: Sample Mode User Models OptSim User Guide

Grammar Notation used is EBNF (Extended Backus Naur Form)

• [ item ] stands for optional item occurring only once

• item stands for optional item occurring any number of times

• ( item_a | item_b) stands for items that can occur as alternative

• Bold stands for language keywords

• Italic stands for rules (non-terminal symbols)

• Plain stands for identifiers and names OptSimBlParO grammar_version # comment_line ## custom_message [max_delay_window_block] custom_message [cust_output_files_block] custom_message

Description grammar_version ::= 1

custom_message ::= cust_msg_id cust_msg_string It is one row message that the executable wants to notify to the OptSim user; a custom message row can appear in every line of the file after the comment section.

cust_msg_id ::= ( +E | +W | +I ) The case of the message ( +E = error, +W = warning, +I = information).

cust_msg_string ::= string The message of ASCII characters to be notified.

max_delay_window_block ::= max_delay_window min_value max_value

min_value ::= real number The minimum delay in the VBS bandwidth expressed in ps. For a detailed explanation look at the Section 5.5.3.

max_value ::= real number The maximum delay in the VBS bandwidth expressed in ps. For a detailed explanation look at the Section 5.5.3.

cust_output_files_block ::= cust_out_files_produced cust_out_files_num cust_out_file_name

cust_out_files_num ::= not negative integer The number of custom files produced; it could be 0.

cust_out_file_name ::= string The name of a produced custom file.

5.6.5 Optical and Electrical Time Sample Files

General Rules • Files are formatted by line

• No blank lines are allowed

Page 301: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 291

• The first line is mandatory and it identifies the file type

• A line that has two '#' characters in the first two columns is mandatory and it ends the comment section

• All comment lines must have a pound sign character “#” in the first column

• Only blank and tab separators are allowed

• Only exponential notation is allowed for numbers (for example 10.0 or 0.1 or -12.388888E+002)

Grammar Notation used is EBNF (Extended Backus Naur Form)

• [ item ] stands for optional item occurring only once

• item stands for optional item occurring any number of times

• ( item_a | item_b) stands for items that can occur as alternative

• Bold stands for language keywords

• Italic stands for rules (non-terminal symbols)

• Plain stands for identifiers and names OptSim_file_format grammar_version # comment_line ## delt_ps fsym_thz irep signal_sample

Optical Signal

OptSim_file_format ::= OptSimOSGN

grammar_version ::= 1

delt_ps ::= real number It is the sampling step expressed in ps.

fsym_thz ::= real number It is the simulation center frequency expressed in THz.

irep ::= ( 1 | 2 ) It is the signal polarization format (1 = single, 2 = double).

signal_sample ::= ( sample_format_1 | sample_format_2 ) It is a single signal sample, the format has to be coherent to the irep value.

sample_format_1 ::= x1 x2 x1 = signal real component. x2 = signal imaginary component.

sample_format_2 ::= x1 x2 y1 y2 x1 = signal real component (along x polarization axis). x2 = signal imaginary component (along x polarization axis). y1 = signal real component (along y polarization axis). y2 = signal imaginary component (along y polarization axis).

Electrical Signal

OptSim_file_format ::= OptSimESGN

grammar_version ::= 1

delt_ps ::= real number It is the sampling step expressed in ps.

Page 302: 39865643 Optsim Guide

292 •••• Chapter 5: Sample Mode User Models OptSim User Guide

fsym_thz ::= 0.0 It is reserved for future extension.

irep ::= 1 It is the signal format.

signal_sample ::= sample_format_1 It is a single signal sample, the format has to be coherent to the irep value.

sample_format_1 ::= x1 x1 = signal module.

5.6.6 Optical Power Spectrum Files (OptSimPS_1)

General Rules • Files are formatted by line

• No blank lines are allowed

• The first line is mandatory and it identifies the file type

• A line that has two '#' characters in the first two columns is mandatory and it ends the comment section

• All comment lines must have a pound sign character “#” in the first column

• Only blank and tab separators are allowed

• Only exponential notation is allowed for numbers (for example 10.0 or 0.1 or -12.388888E+002)

Grammar Notation used is EBNF (Extended Backus Naur Form)

• [ item ] stands for optional item occurring only once

• item stands for optional item occurring any number of times

• ( item_a | item_b) stands for items that can occur as alternative

• Bold stands for language keywords

• Italic stands for rules (non-terminal symbols)

• Plain stands for identifiers and names OptSimPS grammar_version # comment_line ## ps_flag ps_peak_power ps_sample_number ps_sample

Description grammar_version ::= 1

ps_flag ::= ( 0 | 1 ) Signal significant or virtually null (because it is out of bandwidth) of the output that has produced it (0 = null, 1 = significant).

ps_peak_power ::= real number It is the peak power of the optical spectrum expressed in mW.

ps_sample_number ::= integer Number of spectrum samples (usually it is 1024).

Page 303: 39865643 Optsim Guide

OptSim User Guide Chapter 5: Sample Mode User Models •••• 293

ps_sample ::= real number It is the sample of the power spectrum, expressed in mW.

5.6.7 Charts Index The charts index file has design_name._op as file name, where design_name is the name of the current design.

General Rules • Files are formatted by line

• No blank lines are allowed

• The first line is mandatory and it identifies the file type

• Only blank and tab separators are allowed

Grammar Notation used is EBNF (Extended Backus Naur Form)

• [ item ] stands for optional item occurring only once

• item stands for optional item occurring any number of times

• ( item_a | item_b) stands for items that can occur as alternative

• Bold stands for language keywords

• Italic stands for rules (non-terminal symbols)

• Plain stands for identifiers and names OptSimVBS grammar_version chart_information_sample

Description grammar_version ::= 1

chart_information_sample ::= [instance_id FileName BlockStatus RunIndex] Describes an entry for a data file produced by a component instance during a run.

instance_id ::= [IterationPath]-BlockID Identifies the component instance that has produced the file.

IterationPath ::= NIteratedBlockID_IterationIndex It is present only if the instance is contained in an iteration area.

IteratedBlockID ::= integer number It is the component ID that OptSim assigned to the iteration area when it was inserted in the design.

IterationIndex ::= integer number It is the index of the iteration: for instance if the iteration area has two spans then the IterationIndex value will be 1 for the files produced in the first span, 2 for the files produced in the second span.

BlockID ::= integer number It is the component ID that OptSim assigned to the component when it was inserted in the design.

FileName ::= string It is the filename that contains the data generated by the instance in a certain run; it is valid only if BlockStatus value is 1.

Page 304: 39865643 Optsim Guide

294 •••• Chapter 5: Sample Mode User Models OptSim User Guide

BlockStatus ::= ( 0 | 1 ) It says if the component has generated a data file ( 0 = no, 1 = yes).

RunIndex ::= integer number It is the index of the run in which the data file is produced. For instance if two runs are defined then the RunIndex value will be 0 for the files produced during the first run, 1 for the files produced during the second run.

Page 305: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 295

Chapter 6: MATLAB Cosimulation in Sample Mode

The OptSim Custom Components are a way to extend the OptSim component library where an external executable program becomes an OptSim component managed in a transparent way for all editor and simulator capabilities.

OptSim custom components may be divided into two categories:

• Custom Component for using with MATLAB® (CCM), where the external program is a MATLAB routine

• Custom Component Executable (CCE), where the external program is a generic executable program

This chapter describes how to work with CCM and how to create a new one. The chapter on “Sample Mode Data Post-Processing and Display” describes in details the SPT Data Display and the Q Surfaces toolkits that can be used with MATLAB.

6.1 Custom Component for MATLAB® Custom Component for using with MATLAB (CCM) is a special OptSim component

whose behavior during the simulation is described by an external MATLAB routine.

The MATLAB routine must therefore realize the transfer function for the signals in the design network and must dialogue with the OptSim simulator scheduler to execute the simulation directives (SPT or VBS techniques).

OptSim's simulation process performs the project simulation until the propagating signal reaches the CCM. Then it starts the MATLAB engine passing the vector signal input and launching the MATLAB routine associated with the component. The MATLAB routine performs the custom transfer function on the vector signal input and writes the vector signal output. When it finishes the OptSim simulation process takes this vector signal output and continues the project simulation. Console Mode All of this sequence is completely transparent to the user, however you can also set a

"console mode" to the CCM: when the MATLAB engine starts, it opens also a MATLAB console and pauses the execution. In this way you can inspect the input signal values, launch the routine or perform some other calculations, and inspect the output signal values before returning the control to the OptSim simulator. This is a very useful feature for debugging the CCM at the first stages of development.

Page 306: 39865643 Optsim Guide

296 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

OptSimSIMULATION

MODEL

CCM

OptSimSIMULATORSCHEDULER

MATLABRoutine

ControlsSignals

Figure 1. The CCM theory of operation

A CCM has the same graphical and functional properties as any other OptSim sample mode component. For example you can use it in an iterated section or in a compound component.

6.2 Using a CCM A CCM can be used in a project (or in a compound component) like any other OptSim component.

To use a CCM

1. Drag a Custom Component for MATLAB (CCM) model from the Custom Models

folder in the Sample-Mode folder. Drop it on the spot of the design area where youwish to place it.

2. Choose the popup menu command Properties on the icon. Select the CCM model that you wish to instantiate from the combo box list (Select Custom Model File list) at the top of the Properties dialog (Figure 2).

3. In the Available Blocks list, click on the name of the CCM you want.

Page 307: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 297

Figure 2. The Choose Custom Component for MATLAB dialog window

4. Click on Load to instantiate the selected model. The ports and the parameters will be added to the model.

5. Click in the value field to change its value and type in the new value. Repeat this operation for all the parameters you need to change.

6. Select the console_mode parameter if you want the CCM to run in console mode. Click on OK to close the window.

At any time you can change the parameters of the CCM like any other OptSim component.

To modify a CCM parameter 1. Choose the popup menu command Properties on the CCM icon.

2. Click in the Value field of any parameter that you wish the change and enter the new value.

When the CCM model is first dropped on the GUI canvas, it will specify a single parameter, namely console_mode. The Custom Model File list will display the Model Not Specified entry to indicate that a predefined CCM model is not yet instantiated. Clicking the Help button at this stage will invoke PDF help documentation on how to create CCM models. Clicking on the CCM Wizard button allows the user to define a new CCM model (i.e. a new .obs file). However, the dialog will have to be closed and reopened in order for the new model to be added to the list of available CCM models. If a previously defined CCM model is selected, the CCM Wizard button will open the Wizard ready to edit the .obs file on which the particular model is based. The Help button action will open the help file for the selected model. The Reset button can be used to return the CCM model to its default state. This action will also delete all the connections to and from the CCM.

6.2.1 Notes on the Console Mode When a CCM of an OptSim project is set in console mode, during the simulation a MATLAB console appears showing the MATLAB environment variables for the calling MATLAB routine.

When the prompt appears the input signals are just input in the routine. Here you can dump the input vector variables or print the CCM parameter values. Two main commands are available in the MATLAB console:

Page 308: 39865643 Optsim Guide

298 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

• run, executes the MATLAB routine code

• return, closes the MATLAB console and returns the control to OptSim

The console is very useful to debug your MATLAB code, for example you can issue the run command to execute your code and then analyze the output vector variables; modify any parameter values and then re-issue the run command to see the changes. You can use the return command when the outputs look like as expected.

6.3 Creating a CCM In order to create a new CCM you have to use the Custom Component for MATLAB Wizard (CCM Wizard). It allows defining the CCM main characteristics such as the component name, the input/output connections, the component parameters, and to generate the skeleton MATLAB m-files and the help description file.

The skeleton MATLAB m-files and the help description file may be generated from scratch using special OptSim templates or may be provided using your own files. In the first case, after the generation, you have to write in the MATLAB m-files the code for the component transfer function, in order to obtain the MATLAB routines. Also the help description file must be customized writing the component and the parameter descriptions.

Summarizing, to create a new CCM:

• use the CCM Wizard to define the main component characteristics and to generate from template the skeleton MATLAB m-files and help description file

• edit the skeleton MATLAB m-files to write the code of your CCM transfer function

• edit the help description file to write the component and the parameter descriptions

With the CCM Wizard you can also modify the main characteristics for an existing CCM. To modify the CCM transfer function, edit directly the MATLAB routine files and modify the code.

6.3.1 Custom Component for MATLAB Wizard The Custom Component for MATLAB Wizard (CCM Wizard) is the tool that allows to define the main characteristics of a new CCM and to generate the skeleton MATLAB m-files and the help description file. These files may be generated from scratch using special OptSim templates or may be provided using your own files.

A skeleton MATLAB m-file must be generated for each simulation (SPT or VBS) supported by the CCM. For example electrical components do not work in SPT simulation so the SPT MATLAB routine can be skipped.

The CCM Wizard is a multi tab window (Figure 3) organized into four sections that can be selected by clicking on the tabs in the upper part of the window. The sections are:

• Attributes: allows setting the CCM name, the CCM store directory and the CCM supported simulation (SPT or VBS)

• IO Signals: allows setting the type and number of CCM input/output connections

• Parameters: allows setting the CCM parameters

• Sources: allows the creation of the CCM help description file and the CCM skeleton MATLAB m-files, either generating from OptSim template or importing your own files

In the following, we will describe in detail all the fields contained in the CCM Wizard window.

To start the CCM Wizard

1.In the OptSim editor window, choose the menu command Utilities > CCM Wizard, or click on the CCM Wizard button in the toolbar. The window of Figure 3 appears.

Page 309: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 299

Attributes Section In this section you can set the CCM name, the directory where it will be created and the CCM supported simulation (SPT or VBS). Component Name A prefix and a name with the syntax prefix_name compose the component name. The

prefix is strongly recommended. It allows identifying unambiguously the CCM in order to avoid conflicts in the component name definition with already existent OptSim components. We suggest you to write your username in this field.

Prefix, sets the component prefix string for the component name.

Name, sets the component name. It will be prefixed by the Prefix string.

Target Directory, sets the directory where the component will be created.

• Current, the component will be created in the current project directory and will be available for those OptSim projects saved in this directory.

• User, the component will be created in your own user directory and will be available for all your OptSim projects. The user directory is defined in the Options dialog window, to modify it choose the menu command Options > Sample Mode > RunTime

• Workgroup, the component will be created in the workgroup directory and will be available for all OptSim users of your workgroup. This directory is defined in the Options dialog window, to modify it choose the menu command Options > Sample Mode > RunTime

Supported Simulations

SPT, sets the component to support the SPT simulation. A MATLAB m-file containing the skeleton for the SPT simulation routine will be generated.

VBS, sets the component to support the VBS simulation. Two MATLAB m-files containing the skeleton for the VBS pre-run and VBS simulation routine will be generated.

Figure 3. The Attributes section of the CCM Wizard dialog window

IO Signals Section In this section you can define all the CCM input/output connections.

Input Signals, defines the optical and electrical input connections for the component.

Output Signals, defines the optical and electrical output connections for the component.

Page 310: 39865643 Optsim Guide

300 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

For each group a tree shows all the connections defined.

To add a new connection

Click on the Add button, choose the kind of signal (optical or electrical) and write the connection name. ... or ...

Choose the popup menu command Add on the Optical or Electrical item of the tree and write the connection name.

Figure 4. The IO Signals section of the CCM Wizard dialog window

Parameters Section This section allows defining the component parameters. For each parameter you have to define:

• Name, the parameter name

• Type, the variable type (double, integer, string) for the parameter

• Unit, the measurement unit for the parameter (if any)

• Default, the default value for the parameter

The Add button opens a dialog window to define a new parameter.

The Remove button removes the parameter currently selected in the list.

The Modify button opens a dialog window to modify the parameter currently selected in the list.

The MoveUp button shifts up of one position the parameter currently selected in the list.

The MoveDown button shifts down of one position the parameter currently selected in the list.

Page 311: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 301

Figure 5. The Parameters section of the CCM Wizard dialog window

Sources Section In this section you can create the CCM help description file and the CCM skeleton MATLAB m-files. You can choose to generate them from an OptSim template or to import your own files.

Please pay attention when choosing your own MATLAB files: these must respect the variable definition as described in section “The Skeleton MATLAB m-files.” Help file Generate, with this option the help description file will be generated from the CCM

Wizard using an OptSim template.

Import, with this option the help description file will be copied from the file specified in the field on the right.

SPT file These options appear only if you have selected the SPT option in the Attributes section.

Generate, with this option the skeleton MATLAB m-file for the SPT simulation will be generated from the CCM Wizard using an OptSim template.

Import, with this option the MATLAB routine m-file performing the SPT simulation will be copied from the file specified in the field on the right.

VBSp file These options appear only if you have selected the VBS option in the Attributes section.

Generate, with this option the skeleton MATLAB m-file for the VBS simulation pre-run will be generated from the CCM Wizard using an OptSim template.

Import, with this option the MATLAB routine m-file performing the VBS simulation pre-run will be copied from the file specified in the field on the right. VBS file These options appear only if you have selected the VBS option in the Attributes section.

Generate, with this option the skeleton MATLAB m-file for the VBS simulation will be generated from the CCM Wizard using an OptSim template.

Import, with this option the MATLAB routine m-file performing the VBS simulation will be copied from the file specified in the field on the right.

Page 312: 39865643 Optsim Guide

302 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

Figure 6. The Sources section of the CCM Wizard dialog window

At the end of CCM definition you can click on Apply to generate the files. On the right of the selected files appears the pathname of the generated file and the Edit button. Click on this button to start the suitable editor on the selected file.

6.3.2 The Skeleton MATLAB m-files The skeleton MATLAB m-files generated from template are empty and contain only comment lines showing the MATLAB base environment variables (input and output signals, component and simulation parameters).

There is a specific MATLAB m-file for each kind of simulation supported by your CCM. Choosing the VBS simulation two MATLAB m-files will be required respectively for the VBS pre-run and the VBS simulation techniques.

SPT m-file (from Template) With this MATLAB m-file the CCM performs a simplified Spectral Propagation Technique. In this simulation technique signals are propagated inside the network as power spectra, taking into account component loss and noise. Spectra, power levels and Optical Signal to Noise Ratio (OSNR) can be evaluated at any point of the network.

Note During the SPT simulation, OptSim does not invoke a CCM that has neither input nor output optical signals.

This kind of simulation allows simulating a component only in the frequency domain. In SPT the component must be able to act as a black box with a transfer function that transforms all the input power spectra to the output power spectra.

The actions that the component must perform are:

• Elaborate the input power spectra, one for each optical input signal, to obtain the output power spectra.

• Store the output power spectra in the corresponding MATLAB base workspace variables.

We remind you that this particular simulation propagates only the optical power spectra. For this reason, in SPT only optical outputs are considered, while electrical signals are not propagated. Simulation Parameters

sim_technique, string type fixed at "SPT" indicating the SPT simulation technique.

runs, double vector type (the size is [runs_num, 1]) containing the run number of the current simulation execution.

lower_frequency, double type containing the SPT lower bandwidth frequency expressed in THz.

center_frequency, double type containing the SPT center bandwidth frequency expressed in THz.

upper_frequency, double type containing the SPT upper bandwidth frequency expressed in THz.

Page 313: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 303

is_opt_noise, double type containing a flag that indicates if the optical noise is simulated.

delt_thz, double type containing the frequency sampling step expressed in THz.

num_samples, double type containing the number of samples of the signals in frequency domain.

frequency, double vector type (the size is [num_samples, 1]) containing the frequency sample values expressed in THz. Component Signals

signal_name, double vector type (the size is [num_samples, 1]) containing the input/output optical signal spectrum expressed in mW. The name of this vector is the name of the input/output connection, defined in the IO Signals section of the CCM Wizard.

Component Parameters

parameter_name, string or double type containing the component parameter value expressed in its defined unit. Both the parameter name and the unit are defined in the Parameters section of the CCM Wizard. The parameter value is defined in the CCM parameters dialog window.

VBS Pre-run m-file (from Template) A VBS simulation can be divided into two phases performed one following the other: a preliminary simulation in the frequency domain called pre-run phase and the simulation in the time domain (run phase).

With this MATLAB m-file the CCM performs the pre-run phase of a Variable Bandwidth Simulation (frequency domain). The purpose of this simulation phase is to optimize the VBS run evaluating parameters that will be used during the time domain simulation.

The actions that the component must perform are:

• Elaborate the input power spectra and peaks, one for each optical input signal, to obtain the output power spectra and peaks.

• Store the output power spectra and peaks in the corresponding MATLAB base workspace variables. Simulation Parameters

sim_technique, string type fixed at "VBSp" indicating the SPT simulation technique.

runs, double vector type (the size is [runs_num, 1]) containing the run number of the current simulation execution.

lower_frequency, double type containing the SPT lower bandwidth frequency expressed in THz.

center_frequency, double type containing the SPT center bandwidth frequency expressed in THz.

upper_frequency, double type containing the SPT upper bandwidth frequency expressed in THz.

is_opt_noise, double type containing a flag that indicates if the optical noise is simulated.

delt_thz, double type containing the frequency sampling step expressed in THz.

num_samples, double type containing the number of samples of the signals in frequency domain.

frequency, double vector type (the size is [num_samples, 1]) containing the frequency sample values expressed in THz.

min_delay_value, double type containing the minimum delay in the VBS bandwidth expressed in ps (see below).

max_delay_value, double type containing the maximum delay in the VBS bandwidth expressed in ps (see below). Component Signals

signal_name, double vector type (the size is [num_samples, 1]) containing the input/output optical signal spectrum expressed in mW. The name of this vector is the name of the input/output connection, defined in the IO Signals section of the CCM Wizard.

signal_name_peak_power, double type containing the input/output optical signal peak power, i.e. the maximum of the signal in the time domain (over the SPT bandwidth) expressed in mW. The signal_name prefix of this variable is the name of the input/output connection, defined in the IO Signals section of the CCM Wizard. Component Parameters

parameter_name, string or double type containing the component parameter value expressed in its defined unit. Both the parameter name and the unit are defined in the

Page 314: 39865643 Optsim Guide

304 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

Parameters section of the CCM Wizard. The parameter value is defined in the CCM parameters dialog window.

VBS m-file (from Template) With this MATLAB m-file the CCM performs the run phase of a Variable Bandwidth Simulation (time domain).

The actions that the component must perform are:

• Elaborate the input power spectra for each optical input signal and the time samples for each optical and electrical input signal, in order to obtain the output time samples.

• Store the output power spectra and peaks in the corresponding MATLAB base workspace variables.

Besides, the VBS technique allows defining the VBS bandwidth as a smaller portion of the whole SPT bandwidth, saving simulation time. Simulation Parameters

sim_technique, string type fixed at "VBS" indicating the SPT simulation technique.

runs, double vector type (the size is [runs_num, 1]) containing the run number of the current simulation execution.

lower_frequency, double type containing the VBS lower bandwidth frequency expressed in THz.

center_frequency, double type containing the VBS center bandwidth frequency expressed in THz.

upper_frequency, double type containing the VBS upper bandwidth frequency expressed in THz.

is_opt_noise, double type containing a flag that indicates if the optical noise is simulated.

is_elt_noise, double type containing a flag that indicates if the electrical noise is simulated.

polarization_mode, double type containing the polarization representation of the optical field. Its value may be 1 for single polarization mode or 2 for double polarization mode.

start_valid_samples, double type containing the instant expressed in ps when a measurement component should start measuring (only for components simulating a measurement instrument, see below).

stop_valid_samples, double type containing the instant expressed in ps when a measurement component should stop measuring (only for components simulating a measurement instrument, see below).

delt_ps, double type containing the time sampling step expressed in ps.

num_samples, double type containing the number of samples of the signals in time domain.

time, double vector type (the size is [num_samples, 1]) containing the time sample values expressed in ps. Component Signals

optical_signal_name, complex vector type (the size is [num_samples, polarization_mode]) containing the time domain samples of the input/output optical signal. The name of this vector is the name of the optical input/output connection, defined in the IO Signals section of the CCM Wizard.

electrical_signal_name, double vector type (the size is [num_samples, 1]) containing the time domain samples of the input/output electrical signal. The name of this vector is the name of the electrical input/output connection, defined in the IO Signals section of the CCM Wizard. Component Parameters

parameter_name, string or double type containing the component parameter value expressed in its defined unit. Both the parameter name and the unit are defined in the Parameters section of the CCM Wizard. The parameter value is defined in the CCM parameters dialog window.

Note on Power Spectra The power spectrum points are actually Power Spectral Densities (PSD), expressed in mW/THz, integrated over the SPT frequency step, obtained from the SPT bandwidth divided by the number of spectrum samples (1024 in the current version of OptSim).

Page 315: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 305

More precisely the ith sample of the power spectrum file contains the integral of Power Spectral Density in the frequency range [flo , fhi[, where:

flo = flowSPT + i·∆f - ∆f /2

fhi = flowSPT + i·∆f + ∆f /2

with flowSPT is the lowest frequency of SPT bandwidth and ∆f is the frequency sampling factor (SPT bandwidth / number of points).

Evaluating Maximum and Minimum Delay When your CCM introduces a group delay, the MATLAB m-file for the VBS pre-run simulation must evaluate the maximum and the minimum delay introduced by the component. These two values must be stored in the max_delay_value and min_delay_value variables.

Each component must be considered as a set of connections from some of the m optical inputs to some of the n optical outputs. In the most complex case each of the m optical inputs is connected to each of the n optical outputs; in a generic case we have k connections, where k ≤ m·n.

For each connection a delay curve over the SPT bandwidth may be defined (for the signal that goes from the input to the output of the connection). The evaluation of the minimum and maximum delay must be done in this way:

• For each connection c, evaluate the maximum tmax,c and the minimum tmin,c of the connection's delay curve.

• Evaluate the difference dc=tmax,c - tmin,c .

• Evaluate the maximum of the differences dc, varying c over the whole set of connections; let cmax be the corresponding connection.

• The tmax and tmin of the connection cmax are the tmax and tmin required.

For example consider a component with two optical inputs, I1 and I2 and two optical outputs O1 and O2, and consider the following maximum and minimum values of the delay over the connections (notice that I1 and O2 are not connected):

Connection Min delay on the connection (ps)

tmin,c

Max delay on the connection (ps)

tmax,c

Difference dc=tmax,c-tmin,c

I1 → O1 2 3 1

I2 → O2 1 2 1

I2 → O1 4 6 2

Since the third connection (I2→O1) has the greatest difference, the requested values are tmin = 4 ps and tmax = 6 ps.

Note on Measurement Components If the CCM simulates a measurement component, you have to choose with care the samples to be measured, to avoid the ones introducing boundary effects.

The measurement component should measure samples starting from the start_valid_samples time and stopping at the stop_valid_samples time.

S0

S1

Sstart Sstop

Sk-1

Sk

tstart_valid_samples

tstop_valid_samples

samplest

Figure 7. The starting and ending samples for measurement components

Page 316: 39865643 Optsim Guide

306 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

6.4 CCM Example This section shows you a step-by-step procedure to create and use a new CCM. In particular we will create and use a linear amplitude modulator.

The procedure refers to the OptSim example CCM\CCM_eam.moml installed in the example directory ProductInstDir\examples\optsim\sample_mode\CCM.

6.4.1 The Linear Amplitude Modulator CCM The CCM we are going to implement is an amplitude modulator with linear electro-optic characteristics (in terms of output power vs. applied voltage) and signal chirping.

Like any other standard modulator it has two inputs and one output. The optical input, opt_in, receives the optical signal Ein injected in the device to be modulated. The electrical input, ele_in, receives the electrical signal Vin used to modulate the Ein optical signal. The optical output, opt_out, gives the modulated optical signal Eout at the output of the device.

The optical signal Ein is multiplied by an amplitude factor depending on the input voltage Vin and the excess loss ELdB introduced by the modulator. The signal chirping is specified through the α parameter as defined in [1].

The output optical signal is therefore driven in the following way by the electric signal Vin:

( ) inj

in

EL

out EeVfEdB rr

ϑ⋅=−

2010 (1)

where:

outPln21 αϑ = (2)

2

outout EPr

= (3)

dtdPdtd

Pout

out

ϑ

α 2= (4)

( )

>

<<

<

=

%100,1

%1000,

100%

0,0

MV

MVVMV

Vf

in

inin

in

in (5)

Consequently the transmission is turned off for Vin ≤ 0 while it is at maximum for Vin ≥ (100 / M%). For example, if M% = 50%, the transfer function in terms of the output power vs. applied voltage is linear in the range between 0 and 2 V, and is hard-limited outside this range, as shown below.

Page 317: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 307

1.0 V 2.0 V Vin

Pout,max

Pout

The CCM has four parameters:

• M [perc]: the percentage of input power transmitted when 1 V is applied at the input; it is consequently related to the transfer function slope in the linear range. Allowed values: min 0; max 100; default 50.

• EL [dB]: the value of a constant extra loss introduced by the modulator, which is independent on the electrical input signal. Allowed values: min 0; max -; default 3 (dB).

• alpha [-]: the chirp factor as defined in [1]. Allowed values: min -; max -; default 0.

• attmod_SPT [dB]: the mean power reduction due to modulation introduced in SPT simulations. Allowed values: min -; max -; default 3.

Reference [1] F.Koyama and K. Iga, Frequency chirping in external modulators, J. Lightwave Technol., vol.6, no.1, pp.87-33, Feb.1988.

6.4.2 Setting up the OptSim Project Create a new OptSim project to design the network that will use the new CCM.

To draw the project network

• In the Time Domain section of the Simulation Parameters dialog window set the Variable Bandwidth Simulation to 0.1 THz (193.36 THz - 193.46 THz).

• Draw a Data Source named Datasource_br. Accept its default parameter values.

• Draw a CW Lorentzian Laser named CW_laser. Set its center frequency to 193.4 THz, set the FWHM to 0 MHz, the Laser Phase to Deterministic and the Initial Laser Phase to 0 rad.

• Draw a rectangular NRZ electrical driver named Driver_NRZ and set its high level to 1.

• Draw a probe named Optical_Probe component in the drawing area. Accept its default parameter values.

Now the project network should look like the following.

Page 318: 39865643 Optsim Guide

308 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

6.4.3 Using the CCM Wizard The first step is to use the CCM Wizard to define the main component characteristics and to generate from template the skeleton MATLAB m-files and help description file.

To start the CCM Wizard

1. In the OptSim editor window, choose the menu command Utilities > CCM Wizard, or click on the CCM Wizard button in the toolbar. The Attributes section of the tool appears.

2. In the Attributes section type ccmex in the Prefix field and eam in the Name field, open the Target Directory list and choose Current. Select the SPT and VBS options as supported simulations.

With these settings the CCM will be created with the name ccmex_eam and stored in the current project directory. The component will support both the SPT and VBS OptSim simulation techniques.

Click on IO Signals tab.

3. In the IO Signals section click on the Add button of the Input Signals group. The Input Signal Definition dialog window appears. Select Optical and type opt_in in the Name field. Click on OK.

4. Click again on the Add button of the Input Signals group, the Input Signal Definition dialog window appears. Select Electrical and type ele_in in the Name field. Click on OK.

Page 319: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 309

5. Click on the Add button of the Output Signals group, the Output Signal Definition dialog window appears. Select Optical and type opt_out in the Name field. Click on OK.

With these settings the CCM will have two inputs, optical and electrical, and one optical output.

Now click on the Parameters tab.

6. In the Parameters section click on the Add button. The Parameter Definition dialog window appears. Type M in the Name field; open the Type list and choose double; type perc in Unit and 20 in Default. Click on OK.

7. Click again on the Add button. The Parameter Definition dialog window appears. Type EL in the Name field; open the Type list and choose double; type dB in Unit and 3 in Default. Click on OK.

8. Click again on the Add button. The Parameter Definition dialog window appears. Type alpha in the Name field; open the Type list and choose double. Click on OK.

9. Click again on the Add button. The Parameter Definition dialog window appears. Type attmod_SPT in the Name field; open the Type list and choose double; type dB in Unit and 3 in Default. Click on OK.

With these settings the CCM will have four parameters: the M parameter in percent (default 50%); the EL and attmod_SPT parameters in dB (default 3 dB) and the alpha parameter with no unit (default 0).

Now click on the Sources tab.

Page 320: 39865643 Optsim Guide

310 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

10. In the Sources section, make sure that all the Generate options are selected. Then click on the Apply button of the window. The help description file and the skeleton MATLAB m-files are now generated from special OptSim templates.

Now we are ready to customize these files.

6.4.4 Customizing MATLAB m-files and Help File

SPT m-file In the Sources section of the CCM Wizard window, click on the Edit button of the SPT file group. This will open a MATLAB editor window with the MATLAB m-file related to the SPT simulation.

We recall that in this simulation technique signals are propagated inside the network as power spectra, taking into account component loss and noise. In the opt_in and opt_out vectors only power spectra samples must be propagated. Furthermore during the SPT simulation the CCM introduces a power reduction due to modulation (given by attmod_SPT parameter) in addition to the excess loss (EL parameter). Thus:

in

attmod_SPTEL

out EErr

⋅⋅=−−

1010 1010 (6)

After the comment: % Write MATLAB code here

Page 321: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 311

we write the following statements: % Average power reduction due to modulator Excess Loss excess_loss = 10^(-EL/10); % Average power reduction due to modulation mod_loss = 10^(-attmod_SPT/10); % Output power spectrum calculation opt_out = opt_in * excess_loss * mod_loss;

Save and close the file.

VBSp m-file In the Sources section of the CCM Wizard window, click on the Edit button of the VBSp file group. This will open a MATLAB editor window with the MATLAB m-file related to the VBS pre-run simulation.

In this first phase of VBS simulation technique signals are always propagated inside the network as power spectra, taking into account component loss and noise. The purpose of this simulation phase is to optimize the VBS run phase evaluating parameters that will be used during the time domain simulation (the VBS run phase).

Again in the opt_in and opt_out vectors only power spectra samples must be propagated. As for the SPT simulation the CCM introduces only a power reduction due to modulation (6), both on spectra samples and on the peak power.

After the comment: % Write MATLAB code here

we write the following statements: % Average power reduction due to modulator Excess Loss excess_loss = 10^(-EL/10); % Average power reduction due to modulation mod_loss = 10^(-attmod_SPT/10); % Output power spectrum and peak power calculation opt_out = opt_in * excess_loss * mod_loss; opt_out_peak_power = opt_in_peak_power * excess_loss * mod_loss;

Save and close the file.

VBS m-file In the Sources section of the CCM Wizard window, click on the Edit button of the VBS file group. This will open a MATLAB editor window with the MATLAB m-file related to the VBS (run phase) simulation.

In this phase of simulation we have to work in time domain. Now the vectors opt_in and opt_out contain optical time samples while the ele_in vector contains the electrical time samples.

Now the simulation behavior performed by this m-file must follow the law of formula (1) and (5) described in section 0. Thus after the comment:

% Write MATLAB code here

we have to write the following statements: % Average power reduction due to modulator Excess Loss excess_loss = 10^(-EL/20); % Output field for i = 1:num_samples fact = ele_in(i,1) * M/100; if (fact > 1) h = 1; elseif (fact <= 0) h = 0; else h = sqrt(fact); end

Page 322: 39865643 Optsim Guide

312 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

opt_out(i,1:polarization_mode) = ... excess_loss * h * opt_in(i,1:polarization_mode); end % Output power (the minimum is considered 1e-4) pow_out = max(sum(abs(opt_out).^2,2),1e-4); % Chirp phase_chirp = 0.5 * alpha * log(pow_out); for i = 1:polarization_mode opt_out(:,i) = opt_out(:,i) .* exp(complex(0,phase_chirp)); end

Save and close the file.

Help Description File In the Sources section of the CCM Wizard window, click on the Edit button of the Help file group. This will open an editor window with the HTML description file related to the component.

Between the HTML tags <cite> and </cite> we must write a short description of the component. This description will appears in the Choose Custom Component for MATLAB dialog window. For example we write the following lines:

<cite>This model implements an amplitude modulator CCM with linear electro-optic characteristics (in terms of output power vs. applied voltage) and signal chirping.</cite>

Below these tags we can write a longer component description, the input/output connection descriptions and the parameter descriptions. For sake of simplicity we do not write these descriptions here, see the help description file included in the OptSim example.

Save and close the help file. In the CCM Wizard window, click on the OK button to close the window. Now we are ready to draw and connect the CCM in our network.

6.4.5 Using the CCM Let's go back to the OptSim editor window editing our project.

To use a CCM

1. Drag a CCM model from the Custom Model subfolder inside the Sample-Mode folder. Drop it between the laser and the optical probe components.

2. Choose the popup menu command Properties on the icon. Left click the arrow head on the Custom Model file list at the top of the dialog.

Page 323: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 313

3. In the Available Blocks list click on the name ccmex_eam. Click the Load button to instantiate the selected model. You may use the Help button to view the HTML documentation of the ccmex_eam model.

4. The CCM parameters will appears after the model is loaded. In the Parameters list click on the alpha parameter then write 1 in the Value field. Select the console_mode option. In this way we will debug the CCM simulation behavior, before releasing it.

5. Click on OK to close the window.

Save the OptSim project.

6.4.6 Simulating the Project Let's simulate the project with the VBS simulation technique.

Page 324: 39865643 Optsim Guide

314 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

Click on the VBS button in the tool bar to start the VBS simulation technique. We set the console mode for the CCM so, after few seconds, a MATLAB console appears (Figure 8). This console refers to the VBS pre-run simulation phase.

Figure 8. The MATLAB console for the VBS pre-run simulation phase

The console shows you the MATLAB environment variables for the VBSp routine. When the prompt appears the input signals are just input in the routine. For example you can dump the vector related to the optical input signal (it contains the spectra samples of the optical signal). Just type:

opt_in

You can also plot the input optical signal against the frequency. Type: plot(frequency,opt_in)

Let's go on with the simulation executing the code written in the VBSp MATLAB routine. Type: run

The code is executed and the console replies with the message: CCM code executed

Now you can analyze the results of this routine or return the control to the OptSim simulator. Type: return

The MATLAB console is closed and the OptSim simulation proceeds.

Page 325: 39865643 Optsim Guide

OptSim User Guide Chapter 6: MATLAB( Cosimulation in Sample Mode •••• 315

Figure 9. The MATLAB console for the VBS run simulation phase

After few seconds another MATLAB console appears (Figure 9). This console refers to the VBS run simulation phase.

The console shows you the MATLAB environment variables for the VBS routine. Try to plot the electrical signal time sample with the command:

plot(time,ele_in)

We can also create auxiliary variables in the console, for example we can obtain the modulus of the complex optical time samples with the command:

opt_mod = abs(opt_in);

this creates a new vector variable named opt_mod. Now we can plot this new variable with the command: plot(time,opt_mod)

Let's go on with the simulation executing the code written in the VBS MATLAB routine. Type: run

The code is executed and the console replies with the message: CCM code executed

Type the following command to return the control to the OptSim simulator: return

The MATLAB console is closed and the OptSim simulation proceeds till the end.

Page 326: 39865643 Optsim Guide

316 •••• Chapter 6: MATLAB( Cosimulation in Sample Mode OptSim User Guide

6.5 Exchanging Signals by Files

6.5.1 How to Exchange Data with MATLAB® Thanks to the Recorder and Playback OptSim components it is possible to exchange sampled signals from OptSim to MATLAB and vice versa.

To make data exchange easier, some import/export MATLAB functions have been implemented both for electrical and optical signals.

These functions are available in the installation directory ProductInstDir\etc\matlab

These are the MATLAB routines:

• op_osgnr.m, reads an OptSim data file obtained simulating an Optical Recorder component. Running this function in MATLAB it is possible to get some MATLAB variables containing the sampled signal and the corresponding sampling instants. Both single and dual polarization modes are supported.

• op_esgnr.m, it is similar to the previous routine but it is used just for electrical signals. These signal files are generated from Electrical Recorder component simulation.

• op_osgnw.m, writes a signal data file from MATLAB variables containing signal information.

The generated file has the DAT extension and its format is compatible with OptSim.

This data file can be used as an optical source for an OptSim simulation simply specifying its name in the Optical Playback component.

• op_esgnw.m, it is similar to the previous routine but it is used just for electrical signals. The generated file can be used with the Electrical Playback component for subsequent simulations.

For more details on the OptSim data file format and on the Recorder and Playback components usage, please look at the descriptions in the Components Library manual.

For more details on the MATLAB routine usage, please read the m-files help.

Page 327: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 317

Chapter 7: SPICE Cosimulation in Sample-Mode

The OptSim Custom Components are a way to extend the OptSim component library where an external executable program becomes an OptSim component managed in a transparent way for all editor and simulator capabilities.

OptSim custom components may be divided into three categories:

• Custom Components for using with SPICE (CCS), where the external program is a SPICE circuit file that will be executed in SPICE supplied with OptSim distribution.

• Custom Component for using with MATLAB® (CCM), where the external program is a MATLAB routine

• Custom Component Executable (CCE), where the external program is a generic executable program

This chapter describes how to work with CCS and how to create a new one.

7.1 The Custom Component for using with SPICE

The Custom Component for using with SPICE (CCS) is an OptSim component whose behavior during the simulation is described by a SPICE circuit file.

OptSim's simulation process performs the project simulation until the propagating signal reaches the CCS. Then it starts the built-in SPICE engine passing the electrical signal input and launching the SPICE circuit routine associated with the electrical component being modeled. The input signals to CCS are converted into current or voltage sources for the SPICE circuit described by the circuit file. When it finishes the SPICE simulation, the OptSim simulation process takes the CCS output signal, converts into current or voltage at given component or nodes and continues the project simulation. The name of the CCS input signals are translated into current or voltage sources for the Spice circuit to be simulated. The name of the CCS output signals are translated into currents or voltages to tap on output.

Page 328: 39865643 Optsim Guide

318 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

OptSim SIMULATION

MODEL

CCS

Signal Input Files

Signal Output Files

CCS CONTROLS

CCS TRANSFER FUNCTION

OptSim SIMULATOR SCHEDULER

Input/Output Control Files

Controls Signals

Figure 1 The CCS theory of operation

As you can see from Fig. 1, the communication between the CCS and the OptSim simulator is made through data files. The simulator writes the input control and signal files, then invokes the CCS action and finally reads the output control and signal files. When the CCS is invoked it reads the input signal files and performs the action according to the data written in the input control files, and writes the output signal files (and also the output control file in case of errors).

CCS Composition The CCS is made of the following elements:

• a component description file, i.e. an ASCII file with obs extension, where are described the simulation techniques in which the component will be able to work, the component parameters and the input/output connections (see Section 7.2 for the grammar rules of this file)

• the circuit file that describes a SPICE circuit to be modeled

7.1.1 CCS Component Description Each CCS component description file contains the description of one component only.

The component name takes the same name of the component description file (with extension obs). The component name is an ASCII printable character string, without blank, tab, new line, whose length cannot exceed 31 characters.

General Rules • Files are formatted by line

• No blank lines are allowed

• The first line is mandatory and it identifies the file type

• All comment lines must have a pound sign character “#” in the first column

• Only blank and tab separators are allowed

• Only exponential notation is allowed for numbers (for example 10.0 or 0.1 or -12.388888E+002)

• All identifiers cannot be longer than 31 ASCII characters

Page 329: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 319

Grammar Notation used is EBNF (Extended Backus Naur Form)

• [ item ] stands for optional item occurring only once

• item stands for optional item occurring any number of times

• ( tem_a | item_b) stands for items that can occur as alternative

• Bold stands for language keywords

• Italic stands for rules (non-terminal symbols)

• Plain stands for identifiers and names ObsVersion 1 # comment_line ## [ SourceFile spicecce Unit 120 ] ExeBlock Simulation VBS Parameters String spice_circuit Default circuit_name String spice_options Default spice_options Int save_workspace Default 0 Inputs Electric input_name Outputs Electric output_name

Description 1 ::= grammar_version

Source File Information

The source file information section is mandatory. For CCS, the source file name is always spicecce which calls SPICE engine during execution.

spicecce ::= filename It is the executable file name. In this case it must have the value spicecce

120 ::= kind It is a numerical constant that specifies that the file is an executable. In this case it must have the value 120.

Block Parameters

In this section it's possible to specify the parameters of the component. These parameters will appear in the parameters dialog window of the component. For CCS, the following type of parameters is available:

• String, string parameter

• Int, integer parameter

circuit_name ::= string The name of the Spice circuit file, with extension .cir . If the circuit file is not in the same project directory, the full path has to be specified.

spice_options ::= string The Spice options to be used to simulate the CCS.

save_workspace ::= int If this parameter is defined and it is assigned the value 1, the input/output files to/from the Spice engine will be saved in the project simulation results directory ( xv_sim_<project_name> ). This option can be useful when debugging a new circuit, if the user wants to run it offline he can just invoke the command:

spice3f5 spicecce.cir

Page 330: 39865643 Optsim Guide

320 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

where spice3f5 is the name of the Spice engine executable distributed with OptSim (it has to be part of the path) and spicecce.cir is the name of the entry circuit file of the OptSim-Spice cosimulation.

Block Input/Output

This section defines the I/O of the component. The CCS deals with electrical signals only. Each I/O signal can be defined as:

• Electric, for electrical signal

input_name ::= string output_name ::= string The name of the input/output signal, i.e. an ASCII printable character string, without blank, tab, new line.

Input Signals

• The name of the signal is case-insensitive.

• The first letter denotes current source (I) or voltage source (V).

• The description of the source lies between the first letter and the first underscore _

• The connection nodes across the sources are separated by underscores. In other words, the first node of the source connection is specified between the first and second underscores, the second node of the source connection is specified between the second underscore and the end of the signal name. As an example, the line “Electric Ibias_0_p” indicates an electrical input current with source description “bias” that is connected between nodes 0 and p.

• If only one node is specified for voltage, the other node is assumed ground (0). For example, “Electric Vsource_p” denotes electric voltage source connected between node “p” and the ground.

Output Signals

• The name of the signal is case-insensitive.

• The first letter denotes current (I) or voltage (V).

• The tapping nodes across voltage sources are separated by underscores. For example, the line “Electric V_node1_node2” indicates an electrical voltage to be tapped across nodes node1 and node2.

• If only one node is specified for voltage, the other node is assumed ground (0). For example, “Electric V_pf” denotes electric voltage between node “pf” and ground.

• For current source, I_component name implies current flowing inside a component. For example, “I_R1” implies current inside resistor R1 is to be tapped.

Example

ObsVersion 1 # This is the file example of the Spice cosimulation # for an opamp Sallen-Key low-pass filter ## SourceFile spicecce Unit 120 ExeBlock

Page 331: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 321

Simulation VBS Parameters String spice_circuit Default laser.cir String spice_options Default METHOD=Gear Inputs Electric Ibias_0_p Outputs Electric V_pf

7.1.2 Guidelines for Writing SPICE Circuit Files The user wishing to use CCS is assumed to have knowledge of SPICE. A detailed overview of SPICE and circuit files is given in the Appendix. For quick reference, the following summary can help:

• The circuit files only contain the topology description of the circuit (the netlist).

• The circuit file should not contain any control directives to the SPICE engine itself since the CCS co-simulation takes care of calling the SPICE engine.

• The first line of the circuit file is considered part of the circuit and it is not skipped. For this reason it should not contain the circuit name.

• Some of the allowed keywords starting with “.” are:

.include (specify full path) .subckt

.ends

.model

• The following keywords are not allowed: .save

.print

.plot

.four

any of the analysis type keywords (like, .ac, .dc, .disto,. noise, .pz, .sens, .tf, .tran)

7.2 Using a CCS A CCS can be used in a project (or in a compound component) like any other OptSim component.

To use a CCE

1. Drag a Custom Component for SPICE (CCS) model from the Custom Models

folder in the Sample-Mode models tree. Drop it on the spot of the design area where you wish to place it.

2. Choose the menu command Properties on the icon.

3. Choose the CCS name in the popup menu appearing in the top row of the dialog with the default value “Model Not Specified”.

4. Press the Load button to load the CCS. The model input/output ports and parameters will be loaded from the CCS definition file .obs

5. Specify SPICE circuit file name (mandatory), SPICE and save workspace options (if any).

Page 332: 39865643 Optsim Guide

322 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

A brief review of SPICE is given in the Appendix at the end of this chapter. For examples on using CCS, please see Chapter 1 of the Application Notes and Examples volume of the OptSim manuals.

Page 333: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 323

7.3 Appendix Copyright Notice

Copyright (c) 1985-1991 The Regents of the University of California.

All rights reserved.

IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

7.3.1 Overview SPICE is a general-purpose circuit simulation program for nonlinear dc, nonlinear transient, and linear ac analyses. Circuits may contain resistors, capacitors, inductors, mutual inductors, independent voltage and current sources, four types of dependent sources, lossless and lossy transmission lines (two separate implementations), switches, uniform distributed RC lines, and the five most common semiconductor devices: diodes, BJTs, JFETs, MESFETs, and MOSFETs.

The SPICE3 version is based directly on SPICE 2G.6. While SPICE3 is being developed to include new features, it continues to support those capabilities and models which remain in extensive use in the SPICE2 program.

SPICE has built-in models for the semiconductor devices, and the user need specify only the pertinent model parameter values. The model for the BJT is based on the integral-charge model of Gummel and Poon; however, if the Gummel- Poon parameters are not specified, the model reduces to the simpler Ebers-Moll model. In either case, charge-storage effects, ohmic resistances, and a current-dependent output conductance may be included. The diode model can be used for either junction diodes or Schottky barrier diodes. The JFET model is based on the FET model of Shichman and Hodges. Six MOSFET models are implemented: MOS1 is described by a square-law I-V characteristic, MOS2 is an analytical model, while MOS3 is a semi-empirical model; MOS6 is a simple analytic model accurate in the short-channel region; MOS4 and MOS5 are the BSIM (Berkeley Short-channel IGFET Model) and BSIM2. MOS2, MOS3, and MOS4 include second-order effects such as channel-length modulation, subthreshold conduction, scattering-limited velocity saturation, small-size effects, and charge-controlled capacitances.

7.3.2 Analysis at Different Temperatures All input data for SPICE is assumed to have been measured at a nominal temperature of 27°C, which can be changed by use of the TNOM parameter on the .OPTION control line. This value can further be overridden for any device which models temperature effects by specifying the TNOM parameter on the model itself. The circuit simulation is performed at a temperature of 27°C, unless overridden by a TEMP parameter on the .OPTION control line. Individual instances may further override the circuit temperature through the specification of a TEMP parameter on the instance.

Page 334: 39865643 Optsim Guide

324 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

Temperature dependent support is provided for resistors, diodes, JFETs, BJTs, and level 1, 2, and 3 MOSFETs. BSIM (levels 4 and 5) MOSFETs have an alternate temperature dependency scheme which adjusts all of the model parameters before input to SPICE. For details of the BSIM temperature adjustment, see and.

Temperature appears explicitly in the exponential terms of the BJT and diode model equations. In addition, saturation currents have a built-in temperature dependence. The temperature dependence of the saturation current in the BJT models is determined by:

where k is Boltzmann's constant, q is the electronic charge, Eg is the energy gap which is a model parameter, and XTI is the saturation current temperature exponent (also a model parameter, and usually equal to 3).

The temperature dependence of forward and reverse beta is according to the formula:

where T1 and T0 are in degrees Kelvin, and XTB is a user-supplied model parameter. Temperature effects on beta are carried out by appropriate adjustment to the values of F, ISE, R, and ISC (spice model parameters BF, ISE, BR, and ISC, respectively).

Temperature dependence of the saturation current in the junction diode model is determined by:

where N is the emission coefficient, which is a model parameter, and the other symbols have the same meaning as above. Note that for Schottky barrier diodes, the value of the saturation current temperature exponent, XTI, is usually 2.

Temperature appears explicitly in the value of junction potential, φ(in spice PHI), for all the device models. The temperature dependence is determined by:

where k is Boltzmann's constant, q is the electronic charge, Na is the acceptor impurity density, Nd is the donor impurity density, Ni is the intrinsic carrier concentration, and Eg is the energy gap.

Temperature appears explicitly in the value of surface mobility, µ0 (or UO), for the MOSFET model. The temperature dependence is determined by:

Page 335: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 325

The effects of temperature on resistors is modeled by the formula:

where T is the circuit temperature, T0 is the nominal temperature, and TC1 and TC2 are the first- and second-order temperature coefficients.

7.3.3 General Structure and Conventions The circuit to be analyzed is described to SPICE by a set of element lines, which define the circuit topology and element values: the netlist. The circuit will be included in a main simulation circuit generated by OptSim containing the run, input and output control lines. For this reason the circuit file provided by the user doesn’t have to contain any run control line. In particular the first line is not considered a title and is not skipped, and the last line doesn’t have to be ".END". The order of the remaining lines is arbitrary (except, of course, that continuation lines must immediately follow the line being continued).

Each element in the circuit is specified by an element line that contains the element name, the circuit nodes to which the element is connected, and the values of the parameters that determine the electrical characteristics of the element. The first letter of the element name specifies the element type. The format for the SPICE element types is given in what follows. The strings XXXXXXX, YYYYYYY, and ZZZZZZZ denote arbitrary alphanumeric strings. For example, a resistor name must begin with the letter R and can contain one or more characters. Hence, R, R1, RSE, ROUT, and R3AC2ZY are valid resistor names. Details of each type of device are supplied in a following section.

Fields on a line are separated by one or more blanks, a comma, an equal ('=') sign, or a left or right parenthesis; extra spaces are ignored. A line may be continued by entering a '+' (plus) in column 1 of the following line; SPICE continues reading beginning with column 2.

A name field must begin with a letter (A through Z) and cannot contain any delimiters.

A number field may be an integer field (12, -44), a floating point field (3.14159), either an integer or floating point number followed by an integer exponent (1e-14, 2.65e3), or either an integer or a floating point number followed by one of the following scale factors:

T = 1012 G = 109 Meg = 106 K = 103 mil = 25.4 10-6

m =10-3 u = 10-6 n = 10-9 p = 10-12 f = 10-15

Letters immediately following a number that are not scale factors are ignored, and letters immediately following a scale factor are ignored. Hence, 10, 10V, 10Volts, and 10Hz all represent the same number, and M, MA, MSec, and MMhos all represent the same scale factor. Note that 1000, 1000.0, 1000Hz, 1e3, 1.0e3, 1KHz, and 1K all represent the same number.

Nodes names may be arbitrary character strings. The datum (ground) node must be named '0'. Note the difference in SPICE3 where the nodes are treated as character strings and not evaluated as numbers, thus '0' and '00' are distinct nodes in SPICE3 but not in SPICE2. The circuit cannot contain a loop of voltage sources and/or inductors and cannot contain a cut-set of current sources and/or capacitors. Each node in the circuit must have a dc path to ground. Every node must have at least two connections except for transmission line nodes (to permit unterminated transmission lines) and MOSFET substrate nodes (which have two internal connections anyway).

Page 336: 39865643 Optsim Guide

326 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

Comments General Form:

* <any comment>

Examples:

* RF=1K Gain should be 100

*Check open-loop gain and phase margin

The asterisk in the first column indicates that this line is a comment line. Comment lines may be placed anywhere in the circuit description. Note that SPICE3 also considers any line with leading white space to be a comment.

Device Models General form:

.MODEL MNAME TYPE(PNAME1=PVAL1 PNAME2=PVAL2 ... )

Examples:

.MODEL MOD1 NPN (BF=50 IS=1E-13 VBF=50)

Most simple circuit elements typically require only a few parameter values. However, some devices (semiconductor devices in particular) that are included in SPICE require many parameter values. Often, many devices in a circuit are defined by the same set of device model parameters. For these reasons, a set of device model parameters is defined on a separate .MODEL line and assigned a unique model name. The device element lines in SPICE then refer to the model name.

For these more complex device types, each device element line contains the device name, the nodes to which the device is connected, and the device model name. In addition, other optional parameters may be specified for some devices: geometric factors and an initial condition (see the following section on Transistors and Diodes for more details).

MNAME in the above is the model name, and type is one of the following fifteen types:

R Semiconductor resistor model

C Semiconductor capacitor model

SW Voltage controlled switch

CSW Current controlled switch

URC Uniform distributed RC model

LTRA Lossy transmission line model

D Diode model

Page 337: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 327

NPN NPN BJT model

PNP PNP BJT model

NJF N-channel JFET model

PJF P-channel JFET model

NMOS N-channel MOSFET model

PMOS P-channel MOSFET model

NMF N-channel MESFET model

PMF P-channel MESFET model

Parameter values are defined by appending the parameter name followed by an equal sign and the parameter value. Model parameters that are not given a value are assigned the default values given below for each model type. Models, model parameters, and default values are listed in the next section along with the description of device element lines.

Subcircuits A subcircuit that consists of SPICE elements can be defined and referenced in a fashion similar to device models. The subcircuit is defined in the input file by a grouping of element lines; the program then automatically inserts the group of elements wherever the subcircuit is referenced. There is no limit on the size or complexity of subcircuits, and subcircuits may contain other subcircuits. An example of subcircuit usage is given in \\*(AA. .SUBCKT

General form:

.SUBCKT subnam N1 &ltN2; N3 ...>

Examples:

.SUBCKT OPAMP 1 2 3 4

A circuit definition is begun with a .SUBCKT line. SUBNAM is the subcircuit name, and N1, N2, ... are the external nodes, which cannot be zero. The group of element lines which immediately follow the .SUBCKT line define the subcircuit. The last line in a subcircuit definition is the .ENDS line (see below). Control lines may not appear within a subcircuit definition; however, subcircuit definitions may contain anything else, including other subcircuit definitions, device models, and subcircuit calls (see below). Note that any device models or subcircuit definitions included as part of a subcircuit definition are strictly local (i.e., such models and definitions are not known outside the subcircuit definition). Also, any element nodes not included on the .SUBCKT line are strictly local, with the exception of 0 (ground) which is always global. .ENDS General form:

.ENDS &ltSUBNAM;>

Page 338: 39865643 Optsim Guide

328 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

Examples:

.ENDS OPAMP

The "Ends" line must be the last one for any subcircuit definition. The subcircuit name, if included, indicates which subcircuit definition is being terminated; if omitted, all subcircuits being defined are terminated. The name is needed only when nested subcircuit definitions are being made. Subcircuit Calls General form:

XYYYYYYY N1 &ltN2; N3 ...> SUBNA

Examples:

X1 2 4 17 3 1 MULTI

Subcircuits are used in SPICE by specifying pseudo-elements beginning with the letter X, followed by the circuit nodes to be used in expanding the subcircuit.

Combining Files: .INCLUDE Lines General form:

.INCLUDE /users/spice/common/filename

Examples:

.INCLUDE /users/spice/common/wattmeter.cir

Frequently, portions of circuit descriptions will be reused in several input files, particularly with common models and subcircuits. In any spice input file, the ".include" line may be used to copy some other file as if that second file appeared in place of the ".include" line in the original file. There is no restriction on the file name imposed by spice beyond those imposed by the local operating system.

7.3.4 Components Data fields that are enclosed in less-than and greater-than signs ('< >') are optional. All indicated punctuation (parentheses, equal signs, etc.) is optional but indicate the presence of any delimiter. Further, future implementations may require the punctuation as stated. A consistent style adhering to the punctuation shown here makes the input easier to understand. With respect to branch voltages and currents, SPICE uniformly uses the associated reference convention (current flows in the direction of voltage drop).

Elementary Devices

Resistors General form:

RXXXXXXX N1 N2 VALUE

Examples:

R1 1 2 100

RC1 12 17 1K

N1 and N2 are the two element nodes. VALUE is the resistance (in ohms) and may be positive or negative but not zero.

Page 339: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 329

Semiconductor Resistors General form:

RXXXXXXX N1 N2 <VALUE> <MNAME> <L=LENGTH> <W=WIDTH> <TEMP=T>

Examples:

RLOAD 2 10 10K

RMOD 3 7 RMODEL L=10u W=1u

This is the more general form of the resistor presented in section 6.1, and allows the modeling of temperature effects and for the calculation of the actual resistance value from strictly geometric information and the specifications of the process. If VALUE is specified, it overrides the geometric information and defines the resistance. If MNAME is specified, then the resistance may be calculated from the process information in the model MNAME and the given LENGTH and WIDTH. If VALUE is not specified, then MNAME and LENGTH must be specified. If WIDTH is not specified, then it is taken from the default width given in the model. The (optional) TEMP value is the temperature at which this device is to operate, and overrides the temperature specification on the .OPTION control line.

Semiconductor Resistor Model (R) The resistor model consists of process-related device data that allow the resistance to be calculated from geometric information and to be corrected for temperature. The parameters available are: Name Parameter Units Default Example

TC1 first order temperature coeff. /°C 0.0 -

TC2 second order temperature coeff. /°C2 0.0 -

RSH sheet resistance /q - 50

DEFW default width meters 1.e-6 2.e-6

NARROW narrowing due to side etching meters 0.0 1.e-7

TNOM parameter measurement temperature °C 27 50

The sheet resistance is used with the narrowing parameter and L and W from the resistor device to determine the nominal resistance by the formula

DEFW is used to supply a default value for W if one is not specified for the device. If either RSH or L is not specified, then the standard default resistance value of 1k Ω is used. TNOM is used to override the circuit-wide value given on the

Page 340: 39865643 Optsim Guide

330 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

.OPTIONS control line where the parameters of this model have been measured at a different temperature. After the nominal resistance is calculated, it is adjusted for temperature by the formula:

Capacitors General form:

CXXXXXXX N+ N- VALUE <IC=INCOND>

Examples:

CBYP 13 0 1UF

COSC 17 23 10U IC=3V

N+ and N- are the positive and negative element nodes, respectively. VALUE is the capacitance in Farads.

The (optional) initial condition is the initial (time-zero) value of capacitor voltage (in Volts). Note that the initial conditions (if any) apply 'only' if the UIC option is specified on the .TRAN control line.

Semiconductor Capacitors General form:

CXXXXXXX N1 N2 <VALUE> <MNAME> <L=LENGTH> <W=WIDTH> <IC=VAL>

Examples:

CLOAD 2 10 10P

CMOD 3 7 CMODEL L=10u W=1u

This is the more general form of the Capacitor presented in section 6.2, and allows for the calculation of the actual capacitance value from strictly geometric information and the specifications of the process. If VALUE is specified, it defines the capacitance. If MNAME is specified, then the capacitance is calculated from the process information in the model MNAME and the given LENGTH and WIDTH. If VALUE is not specified, then MNAME and LENGTH must be specified. If WIDTH is not specified, then it is taken from the default width given in the model. Either VALUE or MNAME, LENGTH, and WIDTH may be specified, but not both sets.

Semiconductor Capacitor Model (C) The capacitor model contains process information that may be used to compute the capacitance from strictly geometric information. Name Parameter Units Default Example

CJ junction bottom capacitance F/meters2 - 5.e-5

CJSW junction sidewall capacitance F/meters - 2.e-11

DEFW default device width meters 1.e-6 2.e-6

NARROW narrowing due to side etching meters 0.0 1.e-7

Page 341: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 331

The capacitor has a capacitance computed as

Inductors General form:

LYYYYYYY N+ N- VALUE <IC=INCOND>

Examples:

LLINK 42 69 1UH

LSHUNT 23 51 10U IC=15.7MA

N+ and N- are the positive and negative element nodes, respectively. VALUE is the inductance in Henries.

The (optional) initial condition is the initial (time-zero) value of inductor current (in Amps) that flows from N+, through the inductor, to N-. Note that the initial conditions (if any) apply only if the UIC option is specified on the .TRAN analysis line.

Coupled (Mutual) Inductors General form:

KXXXXXXX LYYYYYYY LZZZZZZZ VALUE

Examples:

K43 LAA LBB 0.999

KXFRMR L1 L2 0.87

LYYYYYYY and LZZZZZZZ are the names of the two coupled inductors, and VALUE is the coefficient of coupling, K, which must be greater than 0 and less than or equal to 1. Using the 'dot' convention, place a 'dot' on the first node of each inductor.

Switches General form:

SXXXXXXX N+ N- NC+ NC- MODEL <ON><OFF>

WYYYYYYY N+ N- VNAM MODEL <ON><OFF>

Examples:

s1 1 2 3 4 switch1 ONs2 5 6 3 0 sm2 off

Switch1 1 2 10 0 smodel1

w1 1 2 vclock switchmod1

W2 3 0 vramp sm1 ON

wreset 5 6 vclck lossyswitch OFF

Nodes 1 and 2 are the nodes between which the switch terminals are connected. The model name is mandatory while the initial conditions are optional. For the voltage controlled switch, nodes 3 and 4 are the positive and negative controlling nodes respectively. For the current controlled switch, the controlling current is that through the specified voltage source. The direction of positive controlling current flow is from the positive node, through the source, to the negative node.

Page 342: 39865643 Optsim Guide

332 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

Switch Model (SW/CSW) The switch model allows an almost ideal switch to be described in SPICE. The switch is not quite ideal, in that the resistance can not change from 0 to infinity, but must always have a finite positive value. By proper selection of the on and off resistances, they can be effectively zero and infinity in comparison to other circuit elements. The parameters available are:

Name Parameter Units Default Switch

VT threshold voltage Volts 0.0 S

IT threshold current Amps 0.0 W

VH hysteresis voltage Volts 0.0 S

IH hysteresis current Amps 0.0 W

RON on resistance 1.0 both

ROFF off resistance 1/GMIN* both

*(See the .OPTIONS control line for a description of GMIN, its default value results in an off-resistance of 1.0e+12 ohms.)

The use of an ideal element that is highly nonlinear such as a switch can cause large discontinuities to occur in the circuit node voltages. A rapid change such as that associated with a switch changing state can cause numerical roundoff or tolerance problems leading to erroneous results or timestep difficulties. The user of switches can improve the situation by taking the following steps:

First, it is wise to set ideal switch impedances just high or low enough to be negligible with respect to other circuit elements. Using switch impedances that are close to "ideal" in all cases aggravates the problem of discontinuities mentioned above. Of course, when modeling real devices such as MOSFETS, the on resistance should be adjusted to a realistic level depending on the size of the device being modeled.

If a wide range of ON to OFF resistance must be used in the switches (ROFF/RON &gt1e;+12), then the tolerance on errors allowed during transient analysis should be decreased by using the .OPTIONS control line and specifying TRTOL to be less than the default value of 7.0. When switches are placed around capacitors, then the option CHGTOL should also be reduced. Suggested values for these two options are 1.0 and 1e-16 respectively. These changes inform SPICE3 to be more careful around the switch points so that no errors are made due to the rapid change in the circuit.

7.3.5 Voltage and Current Sources

Independent Sources General form:

VXXXXXXX N+ N- <DC<> DC/TRAN VALUE> <AC <ACMAG <ACPHASE>>>

+ <DISTOF1 <F1MAG <F1PHASE>>> <DISTOF2 <F2MAG <F2PHASE>>>

Page 343: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 333

IYYYYYYY N+ N- <<DC> DC/TRAN VALUE> <AC <ACMAG <ACPHASE>>>

+ <DISTOF1 <F1MAG <F1PHASE>>> <DISTOF2 <F2MAG <F2PHASE>>>

Examples:

VCC 10 0 DC 6

VIN 13 2 0.001 AC 1 SIN(0 1 1MEG)

ISRC 23 21 AC 0.333 45.0 SFFM(0 1 10K 5 1K)

VMEAS 12 9

VCARRIER 1 0 DISTOF1 0.1 -90.0

VMODULATOR 2 0 DISTOF2 0.01

IIN1 1 5 AC 1 DISTOF1 DISTOF2 0.001

N+ and N- are the positive and negative nodes, respectively. Note that voltage sources need not be grounded. Positive current is assumed to flow from the positive node, through the source, to the negative node. A current source of positive value forces current to flow out of the N+ node, through the source, and into the N- node. Voltage sources, in addition to being used for circuit excitation, are the 'ammeters' for SPICE, that is, zero valued voltage sources may be inserted into the circuit for the purpose of measuring current. They of course have no effect on circuit operation since they represent short-circuits.

DC/TRAN is the dc and transient analysis value of the source. If the source value is zero both for dc and transient analyses, this value may be omitted. If the source value is time-invariant (e.g., a power supply), then the value may optionally be preceded by the letters DC.

ACMAG is the ac magnitude and ACPHASE is the ac phase. The source is set to this value in the ac analysis. If ACMAG is omitted following the keyword AC, a value of unity is assumed. If ACPHASE is omitted, a value of zero is assumed. If the source is not an ac small-signal input, the keyword AC and the ac values are omitted.

DISTOF1 and DISTOF2 are the keywords that specify that the independent source has distortion inputs at the frequencies F1 and F2 respectively (see the description of the .DISTO control line). The keywords may be followed by an optional magnitude and phase. The default values of the magnitude and phase are 1.0 and 0.0 respectively.

Any independent source can be assigned a time-dependent value for transient analysis. If a source is assigned a time-dependent value, the time-zero value is used for dc analysis. There are five independent source functions: pulse, exponential, sinusoidal, piece-wise linear, and single-frequency FM. If parameters other than source values are omitted or set to zero, the default values shown are assumed. (TSTEP is the printing increment and TSTOP is the final time (see the .TRAN control line for explanation)).

Pulse General form:

PULSE(V1 V2 TD TR TF PW PER)

Examples:

VIN 3 0 PULSE(-1 1 2NS 2NS 2NS 50NS 100NS)

Parameter Default value Units

V1 (initial value) Volts or Amps

V2 (pulsed value) Volts or Amps

Page 344: 39865643 Optsim Guide

334 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

TD (delay time) 0.0 seconds

TR (rise time) TSTEP seconds

TF (fall time) TSTEP seconds

PW (pulse width) TSTOP seconds

PER(period) TSTOP seconds

A single pulse so specified is described by the following table:

Time Value

0 V1

TD V1

TD+TR V2

TD+TR+PW V2

TD+TR+PW V2 V1

TSTOP V1

Intermediate points are determined by linear interpolation.

Sinusoidal General form:

SIN(VO VA FREQ TD THETA)

Examples:

VIN 3 0 SIN(0 1 100MEG 1NS 1E10)

Parameters Default value Units

Page 345: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 335

VO (offset) Volts or Amps

VA (amplitude) Volts or Amps

FREQ (frequency) 1/TSTOP Hz

TD (delay) 0.0 seconds

THETA (damping factor) 0.0 1/seconds

The shape of the waveform is described by the following table: Time Value

0 to TD VO

TD to TSTOP

Exponential General Form:

EXP(V1 V2 TD1 TAU1 TD2 TAU2)

Examples:

VIN 3 0 EXP(-4 -1 2NS 30NS 60NS 40NS)

Parameter Default value Units

V1 (initial value) Volts or Amps

V2 (pulsed value) Volts or Amps

TD1 (rise delay time) 0.0 seconds

TAU1 (rise time constant) TSTEP seconds

Page 346: 39865643 Optsim Guide

336 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

TD2 (fall delay time) TD1+TSTEP seconds

TAU2 (fall time TSTEP seconds

The shape of the waveform is described by the following table:

Time Value

0 to TD1 V1

TD1 to TD2

TD2 to TSTOP

Piece-Wise Linear General Form:

PWL(T1 V1 &ltT2; V2 T3 V3 T4 V4 ...>)

Examples:

VCLOCK 7 5 PWL(0 -7 10NS -7 11NS -3 17NS -3 18NS -7 50NS -7)

Each pair of values (Ti, Vi) specifies that the value of the source is Vi (in Volts or Amps) at time=Ti. The value of the source at intermediate values of time is determined by using linear interpolation on the input values.

Single-Frequency FM General Form:

SFFM(VO VA FC MDI FS)

Examples:

V1 12 0 SFFM(0 1M 20K 5 1K)

Parameter Default value Units

Page 347: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 337

VO (offset) Volts or Amps

VA (amplitude) Volts or Amps

FC (carrier frequency) 1/TSTOP Hz

MDI (modulation index)

FS (signal frequency) 1/TSTOP Hz

The shape of the waveform is described by the following equation:

Linear Dependent Sources SPICE allows circuits to contain linear dependent sources characterized by any of the four equations

i = g v v = e v i = f i v = h i

where g, e, f, and h are constants representing transconductance, voltage gain, current gain, and transresistance, respectively.

Linear Voltage-Controlled Current Sources General form:

GXXXXXXX N+ N- NC+ NC- VALUE

Examples:

G1 2 0 5 0 0.1MMHO

N+ and N- are the positive and negative nodes, respectively. Current flow is from the positive node, through the source, to the negative node. NC+ and NC- are the positive and negative controlling nodes, respectively. VALUE is the transconductance (in mhos).

Linear Voltage-Controlled Voltage Sources General form:

EXXXXXXX N+ N- NC+ NC- VALUE

Examples:

E1 2 3 14 1 2.0

N+ is the positive node, and N- is the negative node. NC+ and NC- are the positive and negative controlling nodes, respectively. VALUE is the voltage gain.

Page 348: 39865643 Optsim Guide

338 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

Linear Current-Controlled Current Sources General form:

FXXXXXXX N+ N- VNAM VALUE

Examples:

F1 13 5 VSENS 5

N+ and N- are the positive and negative nodes, respectively. Current flow is from the positive node, through the source, to the negative node. VNAM is the name of a voltage source through which the controlling current flows. The direction of positive controlling current flow is from the positive node, through the source, to the negative node of VNAM. VALUE is the current gain.

Linear Current-Controlled Voltage Sources General form:

HXXXXXXX N+ N- VNAM VALUE

Examples:

HX 5 17 VZ 0.5K

N+ and N- are the positive and negative nodes, respectively. VNAM is the name of a voltage source through which the controlling current flows. The direction of positive controlling current flow is from the positive node, through the source, to the negative node of VNAM. VALUE is the transresistance (in ohms).

Non-linear Dependent Sources General form:

BXXXXXXX N+ N- <I=EXPR> <V=EXPR>

Examples:

B1 0 1 I=cos(v(1))+sin(v(2))

B1 0 1 V=ln(cos(log(v(1,2)^2)))-v(3)^4+v(2)^v(1)

B1 3 4 I=17

B1 3 4 V=exp(pi^i(vdd))

N+ is the positive node, and N- is the negative node. The values of the V and I parameters determine the voltages and currents across and through the device, respectively. If I is given then the device is a current source, and if V is given the device is a voltage source. One and only one of these parameters must be given.

The small-signal AC behavior of the nonlinear source is a linear dependent source (or sources) with a proportionality constant equal to the derivative (or derivatives) of the source at the DC operating point.

The expressions given for V and I may be any function of voltages and currents through voltage sources in the system. The following functions of real variables are defined:

abs asinh cosh sin

acos atan exp sinh

acosh atanh ln sqrt

Page 349: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 339

asin cos log tan

The function "u" is the unit step function, with a value of one for arguments greater than one and a value of zero for arguments less than zero. The function "uramp" is the integral of the unit step: for an input x, the value is zero if x is less than zero, or if x is greater than zero the value is x. These two functions are useful in sythesizing piece-wise non-linear functions, though convergence may be adversely affected.

The following standard operators are defined:

+ - * / ^ unary –

If the argument of log, ln, or sqrt becomes less than zero, the absolute value of the argument is used. If a divisor becomes zero or the argument of log or ln becomes zero, an error will result. Other problems may occur when the argument for a function in a partial derivative enters a region where that function is undefined.

To get time into the expression you can integrate the current from a constant current source with a capacitor and use the resulting voltage (don't forget to set the initial voltage across the capacitor). Non-linear resistors, capacitors, and inductors may be synthesized with the nonlinear dependent source. Non-linear resistors are obvious. Non-linear capacitors and inductors are implemented with their linear counterparts by a change of variables implemented with the nonlinear dependent source. The following subcircuit will implement a nonlinear capacitor:

.Subckt nlcap pos neg

* Bx: calculate f(input voltage)

Bx 1 0 v = f(v(pos,neg))

* Cx: linear capacitance

Cx 2 0 1

* Vx: Ammeter to measure current into the capacitor

Vx 2 1 DC 0Volts

* Drive the current through Cx back into the circuit

Fx pos neg Vx 1

.ends

Non-linear inductors are similar.

7.3.6 Transmission Lines

Lossless Transmission Lines General form:

TXXXXXXX N1 N2 N3 N4 Z0=VALUE <TD=VALUE> <F=FREQ <NL=NRMLEN>>

+ &ltIC;=V1, I1, V2, I2>

Examples:

T1 1 0 2 0 Z0=50 TD=10NS

N1 and N2 are the nodes at port 1; N3 and N4 are the nodes at port 2. Z0 is the characteristic impedance. The length of the line may be expressed in either of two forms. The transmission delay, TD, may be specified directly (as TD=10ns,

Page 350: 39865643 Optsim Guide

340 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

for example). Alternatively, a frequency F may be given, together with NL, the normalized electrical length of the transmission line with respect to the wavelength in the line at the frequency F. If a frequency is specified but NL is omitted, 0.25 is assumed (that is, the frequency is assumed to be the quarter-wave frequency). Note that although both forms for expressing the line length are indicated as optional, one of the two must be specified.

Note that this element models only one propagating mode. If all four nodes are distinct in the actual circuit, then two modes may be excited. To simulate such a situation, two transmission-line elements are required. (see the example in \\*(AA for further clarification.)

The (optional) initial condition specification consists of the voltage and current at each of the transmission line ports. Note that the initial conditions (if any) apply 'only' if the UIC option is specified on the .TRAN control line.

Note that a lossy transmission line (see below) with zero loss may be more accurate than than the lossless transmission line due to implementation details.

Lossy Transmission Lines General form:

OXXXXXXX N1 N2 N3 N4 MNAME

Examples:

O23 1 0 2 0 LOSSYMOD

OCONNECT 10 5 20 5 INTERCONNECT This is a two-port convolution model for single-conductor lossy transmission lines. N1 and N2 are the nodes at port 1; N3 and N4 are the nodes at port 2. Note that a lossy transmission line with zero loss may be more accurate than than the lossless transmission line due to implementation details.

Lossy Transmission Line Model (lTRA) The uniform RLC/RC/LC/RG transmission line model (referred to as the LTRA model henceforth) models a uniform constant-parameter distributed transmission line. The RC and LC cases may also be modeled using the URC and TRA models; however, the newer LTRA model is usually faster and more accurate than the others. The operation of the LTRA model is based on the convolution of the transmission line's impulse responses with its inputs.

The LTRA model takes a number of parameters, some of which must be given and some of which are optional. Name Parameter Units/Type Default Example

R resistance/length ohms/unit 0.0 0.2

L inductance/length henrys/unit 0.0 9.13e-9

G conductance/length mhos/unit 0.0 0.0

C capacitance/length farads/unit 0.0 3.65e-12

LEN lenght of line no default 1.0

REL breakpoint control arbitrary unit 1 0.5

Page 351: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 341

ABS breakpoint control 1 5

NOSTEPLIMIT don't limit timestep to less than line delay flag not set set

NOCONTROL don't do complex timestep control flag not set set

LININTERP use lineair interpolation flag not set set

MIXEDINTERP use lineair when quadratic seems bad not set set

COMPACTREL special reltol for history compaction flag RELTOL 1.0e-3

COMPACTABS special abstol for history compaction ABSTOL 1.0e-9

TRUNCNR use Newton-Raphson method for timestep control flag not set set

TRUNCDONTCUT don't limit timestep to keep impulse-response errors low flag not set set

The following types of lines have been implemented so far: RLC (uniform transmission line with series loss only), RC (uniform RC line), LC (lossless transmission line), and RG (distributed series resistance and parallel conductance only). Any other combination will yield erroneous results and should not be tried. The length LEN of the line must be specified.

NOSTEPLIMIT is a flag that will remove the default restriction of limiting time-steps to less than the line delay in the RLC case. NOCONTROL is a flag that prevents the default limiting of the time-step based on convolution error criteria in the RLC and RC cases. This speeds up simulation but may in some cases reduce the accuracy of results. LININTERP is a flag that, when specified, will use linear interpolation instead of the default quadratic interpolation for calculating delayed signals. MIXEDINTERP is a flag that, when specified, uses a metric for judging whether quadratic interpolation is not applicable and if so uses linear interpolation; otherwise it uses the default quadratic interpolation. TRUNCDONTCUT is a flag that removes the default cutting of the time-step to limit errors in the actual calculation of impulse-response related quantities. COMPACTREL and COMPACTABS are quantities that control the compaction of the past history of values stored for convolution. Larger values of these lower accuracy but usually increase simulation speed. These are to be used with the TRYTOCOMPACT option, described in the .OPTIONS section. TRUNCNR is a flag that turns on the use of Newton-Raphson iterations to determine an appropriate timestep in the timestep control routines. The default is a trial and error procedure by cutting the previous timestep in half. REL and ABS are quantities that control the setting of breakpoints.

The option most worth experimenting with for increasing the speed of simulation is REL. The default value of 1 is usually safe from the point of view of accuracy but occasionally increases computation time. A value greater than 2 eliminates all breakpoints and may be worth trying depending on the nature of the rest of the circuit, keeping in mind that it might not be safe from the viewpoint of accuracy. Breakpoints may usually be entirely eliminated if it is expected the circuit will not display sharp discontinuities. Values between 0 and 1 are usually not required but may be used for setting many breakpoints.

COMPACTREL may also be experimented with when the option TRYTOCOMPACT is specified in a .OPTIONS card. The legal range is between 0 and 1. Larger values usually decrease the accuracy of the simulation but in some cases improve speed. If TRYTOCOMPACT is not specified on a .OPTIONS card, history compaction is not attempted and

Page 352: 39865643 Optsim Guide

342 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

accuracy is high. NOCONTROL, TRUNCDONTCUT and NOSTEPLIMIT also tend to increase speed at the expense of accuracy.

Uniform Distributed RC Lines (lossy) General form:

UXXXXXXX N1 N2 N3 MNAME L=LEN <N=LUMPS>

Examples:

U1 1 2 0 URCMOD L=50U

URC2 1 12 2 UMODL l=1MIL N=6

N1 and N2 are the two element nodes the RC line connects, while N3 is the node to which the capacitances are connected. MNAME is the model name, LEN is the length of the RC line in meters. LUMPS, if specified, is the number of lumped segments to use in modeling the RC line (see the model description for the action taken if this parameter is omitted).

Uniform Distributed RC Model (URC)

The URC model is derived from a model proposed by L. Gertzberrg in 1974. The model is accomplished by a subcircuit type expansion of the URC line into a network of lumped RC segments with internally generated nodes. The RC segments are in a geometric progression, increasing toward the middle of the URC line, with K as a proportionality constant. The number of lumped segments used, if not specified for the URC line device, is determined by the following formula:

The URC line is made up strictly of resistor and capacitor segments unless the ISPERL parameter is given a non-zero value, in which case the capacitors are replaced with reverse biased diodes with a zero-bias junction capacitance equivalent to the capacitance replaced, and with a saturation current of ISPERL amps per meter of transmission line and an optional series resistance equivalent to RSPERL ohms per meter.

Name Parameter Units Default Example Area

1 K Propagation Constant - 2.0 1.2 -

2 FMAX Maximum Frequency of interest Hz 1.0G 6.5Meg -

3 RPERL Resistance per unit length 1000 10 -

4 CPERL Capacitance per unit length F/m 1.0e-15 1pF -

5 ISPERL Saturation Current per unit length A/m 0 - -

Page 353: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 343

6 RSPERL Diode Resistance per unit length 0 - -

7.3.7 Transistors and Diodes The area factor used on the diode, BJT, JFET, and MESFET devices determines the number of equivalent parallel devices of a specified model. The affected parameters are marked with an asterisk under the heading 'area' in the model descriptions below. Several geometric factors associated with the channel and the drain and source diffusions can be specified on the MOSFET device line.

Two different forms of initial conditions may be specified for some devices. The first form is included to improve the dc convergence for circuits that contain more than one stable state. If a device is specified OFF, the dc operating point is determined with the terminal voltages for that device set to zero. After convergence is obtained, the program continues to iterate to obtain the exact value for the terminal voltages. If a circuit has more than one dc stable state, the OFF option can be used to force the solution to correspond to a desired state. If a device is specified OFF when in reality the device is conducting, the program still obtains the correct solution (assuming the solutions converge) but more iterations are required since the program must independently converge to two separate solutions. The .NODESET control line serves a similar purpose as the OFF option. The .NODESET option is easier to apply and is the preferred means to aid convergence.

The second form of initial conditions are specified for use with the transient analysis. These are true 'initial conditions' as opposed to the convergence aids above. See the description of the .IC control line and the .TRAN control line for a detailed explanation of initial conditions.

Junction Diodes General form:

DXXXXXXX N+ N- MNAME <AREA>> <OFF> <IC=VD> <TEMP>

Examples:

DBRIDGE 2 10 DIODE1

DCLMP 3 7 DMOD 3.0 IC=0.2

N+ and N- are the positive and negative nodes, respectively. MNAME is the model name, AREA is the area factor, and OFF indicates an (optional) starting condition on the device for dc analysis. If the area factor is omitted, a value of 1.0 is assumed. The (optional) initial condition specification using IC=VD is intended for use with the UIC option on the .TRAN control line, when a transient analysis is desired starting from other than the quiescent operating point. The (optional) TEMP value is the temperature at which this device is to operate, and overrides the temperature specification on the .OPTION control line.

Diode Model (D) The dc characteristics of the diode are determined by the parameters IS and N. An ohmic resistance, RS, is included. Charge storage effects are modeled by a transit time, TT, and a nonlinear depletion layer capacitance which is determined by the parameters CJO, VJ, and M. The temperature dependence of the saturation current is defined by the parameters EG, the energy and XTI, the saturation current temperature exponent. The nominal temperature at which these parameters were measured is TNOM, which defaults to the circuit-wide value specified on the .OPTIONS control line. Reverse breakdown is modeled by an exponential increase in the reverse diode current and is determined by the parameters BV and IBV (both of which are positive numbers). Name Parameter Units Default Example Area

1 IS saturation current A 1.0e-14 1.0e-14 *

Page 354: 39865643 Optsim Guide

344 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

2 RS ohmic resistance 0 10 *

3 N emission coefficient - 1 1.0

4 TT transit-time sec 0 0.1ns

5 CJO zero-bias junction capacitance F 0 2pF *

6 VJ junction potential V 1 0.6

7 M grading coefficient - 0.5 0.5

8 EG activation energy eV 1.11

1.11 Si

0.69 Sbd

0.67Ge

9 XTI saturation-current temp. exp - 3.0 3.0jn

2.0Sbd

10 KF flicker noise coefficient - 0

11 AF flicker noise exponent - 1

12 FC coefficient for forward-bais depletion capacitance formula - 0.5

13 BV reverse breakdown voltage V infinite 40.0

14 IBV current at breakdown voltage A 1.0e-3

15 TNOM parameter measurement temperature °C 27 50

Bipolar Junction Transistors (BJTs) General form:

QXXXXXXX NC NB NE <NS> MNAME <AREA> <OFF> <IC=VBE, VCE> <TEMP=T>

Examples:

Q23 10 24 13 QMOD IC=0.6, 5.0

Page 355: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 345

Q50A 11 26 4 20 MOD1

NC, NB, and NE are the collector, base, and emitter nodes, respectively. NS is the (optional) substrate node. If unspecified, ground is used. MNAME is the model name, AREA is the area factor, and OFF indicates an (optional) initial condition on the device for the dc analysis. If the area factor is omitted, a value of 1.0 is assumed. The (optional) initial condition specification using IC=VBE, VCE is intended for use with the UIC option on the .TRAN control line, when a transient analysis is desired starting from other than the quiescent operating point. See the .IC control line description for a better way to set transient initial conditions. The (optional) TEMP value is the temperature at which this device is to operate, and overrides the temperature specification on the .OPTION control line.

BJT Models (NPN/PNP) The bipolar junction transistor model in SPICE is an adaptation of the integral charge control model of Gummel and Poon. This modified Gummel-Poon model extends the original model to include several effects at high bias levels. The model automatically simplifies to the simpler Ebers-Moll model when certain parameters are not specified. The parameter names used in the modified Gummel-Poon model have been chosen to be more easily understood by the program user, and to reflect better both physical and circuit design thinking.

The dc model is defined by the parameters IS, BF, NF, ISE, IKF, and NE which determine the forward current gain characteristics, IS, BR, NR, ISC, IKR, and NC which determine the reverse current gain characteristics, and VAF and VAR which determine the output conductance for forward and reverse regions. Three ohmic resistances RB, RC, and RE are included, where RB can be high current dependent. Base charge storage is modeled by forward and reverse transit times, TF and TR, the forward transit time TF being bias dependent if desired, and nonlinear depletion layer capacitances which are determined by CJE, VJE, and MJE for the B-E junction , CJC, VJC, and MJC for the B-C junction and CJS, VJS, and MJS for the C-S (Collector-Substrate) junction. The temperature dependence of the saturation current, IS, is determined by the energy-gap, EG, and the saturation current temperature exponent, XTI. Additionally base current temperature dependence is modeled by the beta temperature exponent XTB in the new model. The values specified are assumed to have been measured at the temperature TNOM, which can be specified on the .OPTIONS control line or overridden by a specification on the .MODEL line.

The BJT parameters used in the modified Gummel-Poon model are listed below. The parameter names used in earlier versions of SPICE2 are still accepted.

Modified Gummel-Poon BJT Parameters

Name Parameter Units Default Example Area

1 IS transport saturation current A 1.0e-16 1.0e-15 *

2 BF ideal maximum forward beta - 100 100

3 NF forward current emission coefficient - 1.0 1

4 VAF forward Early voltage V infinite 200

5 IKF corner for forward beta high current roll-off A infinite 0.01 *

6 ISE B-E leakage saturation current A 0 1.0e-13 *

Page 356: 39865643 Optsim Guide

346 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

7 NE B-E leakage emission coefficient - 1.5 2

8 BR ideal maximum reverse beta - 1 0.1

9 NR reverse current emission coefficient - 1 1

10 VAR reverse Early voltage V infinite 200

11 IKR corner for reverse beta high current roll-off A infinite 0.01 *

12 ISC leakage saturation current A 0 8

13 NC leakage emission coefficient - 2 1.5

14 RB zero bias base resistance 0 100 *

15 IRB current where base resistance falls halfway to its min value A infinte 0.1 *

16 RBM minimum base resistance at high currents RB 10 *

17 RE emitter resistance 0 1 *

18 RC collector resistance 0 10 *

19 CJE B-E zero-bias depletion capacitance F 0 2pF *

20 VJE B-E built-in potential V 0.75 0.6

21 MJE B-E junction exponential factor - 0.33 0.33

22 TF ideal forward transit time sec 0 0.1ns

23 XTF coefficient for bias dependence of TF - 0

24 VTF voltage describing VBC

dependence of TF V infinite

Page 357: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 347

25 ITF high-current parameter

for effect on TF A 0 *

26 PTF excess phase at freq=1.0/(TF*2PI) Hz deg 0

27 CJC B-C zero-bias depletion capacitance F 0 2pF *

28 VJC B-C built-in potential V 0.75 0.5

29 MJC B-C junction exponential factor - 0.33 0.5

30 XCJC fraction of B-C depletion capacitance

connected to internal base node - 1

31 TR ideal reverse transit time sec 0 10ns

32 CJS zero-bias collector-substrate capacitance F 0 2pF *

33 VJS substrate junction built-in potential V 0.75

34 MJS substrate junction exponential factor - 0 0.5

35 XTB forward and reverse beta

temperature exponent - 0

36 EG energy gap for temperature

effect on IS eV 1.11

37 XTI temperature exponent for effect on IS - 3

38 KF flicker-noise coefficient - 0

39 AF flicker-noise exponent - 1

40 FC coefficient for forward-bias - 0.5

Page 358: 39865643 Optsim Guide

348 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

depletion capacitance formula

41 TNOM Parameter measurement temperature °C 27 50

Junction Field-Effect Transistors (JFETs) General form:

JXXXXXXX ND NG NS MNAME <AREA> <OFF> <IC=VDS, VGS> <TEMP>

Examples:

J1 7 2 3 JM1 OFF

ND, NG, and NS are the drain, gate, and source nodes, respectively. MNAME is the model name, AREA is the area factor, and OFF indicates an (optional) initial condition on the device for dc analysis. If the area factor is omitted, a value of 1.0 is assumed. The (optional) initial condition specification, using IC=VDS, VGS is intended for use with the UIC option on the .TRAN control line, when a transient analysis is desired starting from other than the quiescent operating point. See the .IC control line for a better way to set initial conditions. The (optional) TEMP value is the temperature at which this device is to operate, and overrides the temperature specification on the .OPTION control line.

JFET Models (NJF/PJF) The JFET model is derived from the FET model of Shichman and Hodges. The dc characteristics are defined by the parameters VTO and BETA, which determine the variation of drain current with gate voltage, LAMBDA, which determines the output conductance, and IS, the saturation current of the two gate junctions. Two ohmic resistances, RD and RS, are included. Charge storage is modeled by nonlinear depletion layer capacitances for both gate junctions which vary as the -1/2 power of junction voltage and are defined by the parameters CGS, CGD, and PB.

Note that in Spice3f and later, a fitting parameter B has been added.

Name Parameter Units Default Example Area

1 VTO threshold voltage (VT0) V -2.0 -2.0

2 BETA transconductance parameter ( ) transconductance parameter A/V2 1.0e-4 1.0e-3 *

3 LAMBDA channel-length modulation

parameter ( ) 1/V 0 1.0e-4

4 RD drain ohmic resistance 0 100 *

5 RS source ohmic resistance 0 100 *

6 CGS zero-bias G-S junction capacitance (Cgs) F 0 5pF *

Page 359: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 349

7 CGD zero-bias G-D junction capacitance (Cgs) F 0 1pF *

8 PB gate junction potential V 1 0.6

9 IS gate junction saturation current (IS) A 1.0e-14 1.0e-14 *

10 B doping tail parameter - 1 1.1

11 KF flicker noise coefficient - 0

12 AF flicker noise exponent - 1

13 FC coefficient for forward-bias - 0.5

14 TNOM parameter measurement temperature °C 27 50

MOSFETs General form:

MXXXXXXX ND NG NS NB MNAME <L=VAL> <W=VAL> <AD=VAL> <AS=VAL>

+ <PD=VAL> <PS=VAL> <NRD=VAL> <NRS=VAL> <OFF>

+ <IC=VDS, VGS, VBS> <TEMP=T>

Examples:

M1 24 2 0 20 TYPE1

M31 2 17 6 10 MODM L=5U W=2U

M1 2 9 3 0 MOD1 L=10U W=5U AD=100P AS=100P PD=40U PS=40U

ND, NG, NS, and NB are the drain, gate, source, and bulk (substrate) nodes, respectively. MNAME is the model name. L and W are the channel length and width, in meters. AD and AS are the areas of the drain and source diffusions, in m2. Note that the suffix U specifies microns (1e-6 m) and P sq-microns (1e-12 m2). If any of L, W, AD, or AS are not specified, default values are used. The use of defaults simplifies input file preparation, as well as the editing required if device geometries are to be changed. PD and PS are the perimeters of the drain and source junctions, in meters. NRD and NRS designate the equivalent number of squares of the drain and source diffusions; these values multiply the sheet resistance RSH specified on the .MODEL control line for an accurate representation of the parasitic series drain and source resistance of each transistor. PD and PS default to 0.0 while NRD and NRS to 1.0. OFF indicates an (optional) initial condition on the device for dc analysis. The (optional) initial condition specification using IC=VDS, VGS, VBS is intended for use with the UIC option on the .TRAN control line, when a transient analysis is desired starting from other than the quiescent operating point. See the .IC control line for a better and more convenient way to specify transient initial conditions. The (optional) TEMP value is the temperature at which this device is to operate, and overrides the temperature specification on the .OPTION control line. The temperature specification is ONLY valid for level 1, 2, 3, and 6 MOSFETs, not for level 4 or 5 (BSIM) devices.

Page 360: 39865643 Optsim Guide

350 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

MOSFET Models (NMOS/PMOS) SPICE provides four MOSFET device models, which differ in the formulation of the I-V characteristic. The variable LEVEL specifies the model to be used:

LEVEL=1 -> Shichman-Hodges LEVEL=2 -> MOS2 LEVEL=3 -> MOS3, a semi-empirical model LEVEL=4 -> BSIM LEVEL=5 -> new BSIM LEVEL=6 -> MOS6

The dc characteristics of the level 1 through level 3 MOSFETs are defined by the device parameters VTO, KP, LAMBDA, PHI and GAMMA. These parameters are computed by SPICE if process parameters (NSUB, TOX, ...) are given, but user-specified values always override. VTO is positive (negative) for enhancement mode and negative (positive) for depletion mode N-channel (P-channel) devices. Charge storage is modeled by three constant capacitors, CGSO, CGDO, and CGBO which represent overlap capacitances, by the nonlinear thin-oxide capacitance which is distributed among the gate, source, drain, and bulk regions, and by the nonlinear depletion-layer capacitances for both substrate junctions divided into bottom and periphery, which vary as the MJ and MJSW power of junction voltage respectively, and are determined by the parameters CBD, CBS, CJ, CJSW, MJ, MJSW and PB. Charge storage effects are modeled by the piecewise linear voltages-dependent capacitance model proposed by Meyer. The thin-oxide charge-storage effects are treated slightly different for the LEVEL=1 model. These voltage-dependent capacitances are included only if TOX is specified in the input description and they are represented using Meyer's formulation.

There is some overlap among the parameters describing the junctions, e.g. the reverse current can be input either as IS (in A) or as JS (in A/m2). Whereas the first is an absolute value the second is multiplied by AD and AS to give the reverse current of the drain and source junctions respectively. This methodology has been chosen since there is no sense in relating always junction characteristics with AD and AS entered on the device line; the areas can be defaulted. The same idea applies also to the zero-bias junction capacitances CBD and CBS (in F) on one hand, and CJ (in F/m2) on the other. The parasitic drain and source series resistance can be expressed as either RD and RS (in ohms) or RSH (in ohms/sq.), the latter being multiplied by the number of squares NRD and NRS input on the device line.

A discontinuity in the MOS level 3 model with respect to the KAPPA parameter has been detected. The supplied fix has been implemented in Spice3f2 and later. Since this fix may affect parameter fitting, the option "BADMOS3" may be set to use the old implementation (see the section on simulation variables and the ".OPTIONS" line).

SPICE level 1, 2, 3 and 6 parameters:

Name Parameter Units Default Example

1 LEVEL model index - 1

2 VTO zero-bias threshold voltage (VT0) V 0.0 1.0

3 KP transconductance parameter A/V2 2.0e-5 3.1e-5

4 GAMMA bulk threshold parameter ( ) V1/2 0.0 0.37

5 PHI surface potential ( ) V 0.6 0.65

Page 361: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 351

6 LAMBDA channel-length modulation

(MOS1 and MOS2 only) ( ) 1/V 0.0 0.02

7 RD drain ohmic resistance 0.0 1.0

8 RS source ohmic resistance 0.0 1.0

9 CBD zero-bias B-D junction capacitance F 0.0 20fF

10 CBS zero-bias B-S junction capacitance F 0.0 20fF

11 IS bulk junction saturation current (IS) A 1.0e-14 1.0e-15

12 PB bulk junction potential V 0.8 0.87

13 CGSO gate-source overlap capacitance

per meter channel width F/m 0.0 4.0e-11

14 CGDO gate-drain overlap capacitance

per meter channel width F/m 0.0 4.0e-11

15 CGBO gate-bulk overlap capacitance

per meter channel length F/m 0.0 2.0e-10

16 RSH drain and source diffusion

sheet resistance /q 0.0 10.0

17 CJ zero-bias bulk junction bottom cap.

per sq-meter of junction area F/m2 0.0 2.0e-4

18 MJ bulk junction bottom grading coeff. - 0.5 0.5

19 CJSW zero-bias bulk junction sidewall cap.

per meter of junction perimeter F/m 0.0 1.0e-9

Page 362: 39865643 Optsim Guide

352 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

20 MJSW bulk junction sidewall grading coeff. - 0.50(level1)

0.33(level2,3)

21 JS bulk junction saturation current

per sq-meter of junction area A/m2 1.0e-8

22 TOX oxide thickness meter 1.0e-7 1.0e-7

23 NSUB substrate doping 1/cm3 0.0 4.0e15

24 NSS surface state density 1/cm2 0.0 1.0e10

25 NFS fast surface state density 1/cm2 0.0 1.0e10

26 TPG

type of gate material:

+1 opp. to substrate

-1 same as substrate

0 Al gate

- 1.0

27 XJ metallurgical junction depth meter 0.0 1

28 LD lateral diffusion meter 0.0 0.8

29 UO surface mobility cm2/Vs 600 700

30 UCRIT critical field for mobility

degradation (MOS2 only) V/cm 1.0e4 1.0e4

31 UEXP critical field exponent in

mobility degradation (MOS2 only) - 0.0 0.1

32 UTRA transverse field coeff. (mobility)

(deleted for MOS2) - 0.0 0.3

Page 363: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 353

33 VMAX maximum drift velocity of carriers m/s 0.0 5.0e4

34 NEFF total channel-charge (fixed and

mobile) coefficient (MOS2 only) - 1.0 5.0

35 KF flicker noise coefficient - 0.0 1.0e-26

36 AF flicker noise exponent - 1.0 1.2

37 FC coefficient for forward-bias

depletion capacitance formula - 0.5

38 DELTA width effect on threshold voltage

(MOS2 and MOS3) - 0.0 1.0

39 THETA mobility modulation (MOS3 only) 1/V 0.0 0.1

40 ETA static feedback (MOS3 only) - 0.0 1.0

41 KAPPA saturation field factor (MOS3 only) - 0.2 0.5

42 TNOM parameter measurement temperature °C 27 50

The level 4 and level 5 (BSIM1 and BSIM2) parameters are all values obtained from process characterization, and can be generated automatically. J. Pierret describes a means of generating a 'process' file, and the program Proc2Mod provided with SPICE3 converts this file into a sequence of BSIM1 ".MODEL" lines suitable for inclusion in a SPICE input file. Parameters marked below with an * in the l/w column also have corresponding parameters with a length and width dependency. For example, VFB is the basic parameter with units of Volts, and LVFB and WVFB also exist and have units of Volt-µ meter The formula

is used to evaluate the parameter for the actual device specified with

and

Note that unlike the other models in SPICE, the BSIM model is designed for use with a process characterization system that provides all the parameters, thus there are no defaults for the parameters, and leaving one out is considered an error. For an example set of parameters and the format of a process file, see the SPICE2 implementation notes.

Page 364: 39865643 Optsim Guide

354 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

SPICE BSIM (level 4) parameters:

Name Parameter Units l/w

VFB flat-band voltage V *

PHI surface inversion potential V *

K1 body effect coefficient V1/2 *

K2 drain/source depletion charge-sharing coefficient - *

ETA zero-bias drain-induced barrier-lowering coefficient - *

MUZ zero-bias mobility cm2/V-s

DL shortening of channel m

DW narrowing of channel m

U0 zero-bias transverse-field mobility degradation coefficient V-1 *

U1 zero-bias velocity saturation coefficient m/V *

X2MZ sens. of mobility to substrate bias at vds=0 cm2/V2-s *

X2E sens. of drain-induced barrier lowering effect to substrate bias V-1 *

X3E sens. of drain-induced barrier lowering effect to drain bias at Vds=Vdd V-1 *

X2U0 sens. of transverse field mobility degradation effect to substrate bias V-2 *

X2U1 sens. of velocity saturation effect to substrate bias mV-2 *

MUS mobility at zero substrate bias and at Vds=Vdd cm2/V2-s

X2MS sens. of mobility to substrate bias at Vds=Vdd cm2/V2-s *

Page 365: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 355

X3MS sens. of mobility to drain bias at Vds=Vdd cm2/V2-s *

X3U1 sens. of velocity saturation effect on drain bias at Vds=Vdd mV-2 *

TOX gate oxide thickness m

TEMP temperature at which parameters were measured C

VDD measurement bias range V

CGDO gate-drain overlap capacitance per meter channel width F/m

CGSO gate-source overlap capacitance per meter channel width F/m

CGBO gate-bulk overlap capacitance per meter channel length F/m

XPART gate-oxide capacitance-charge model flag -

N0 zero-bias subthreshold slope coefficient - *

NB sens. of subthreshold slope to substrate bias - *

ND sens. of subthreshold slope to drain bias - *

RSH drain and source diffusion sheet resistance /q

JS source drain junction current density A/m2

PB built in potential of source drain junction V

MJ Grading coefficient of source drain junction -

PBSW built in potential of source, drain junction sidewall V

MJSW grading coefficient of source drain junction sidewall -

CJ Source drain junction capacitance per unit area F/m2

Page 366: 39865643 Optsim Guide

356 •••• Chapter 7: SPICE( Cosimulation in Sample-Mode OptSim User Guide

CJSW source drain junction sidewall capacitance per unit length F/m

WDF source drain junction default width m

DELL Source drain junction length reduction m

XPART = 0 selects a 40/60 drain/source charge partition in saturation, while XPART=1 selects a 0/100 drain/source charge partition.

ND, NG, and NS are the drain, gate, and source nodes, respectively. MNAME is the model name, AREA is the area factor, and OFF indicates an (optional) initial condition on the device for dc analysis. If the area factor is omitted, a value of 1.0 is assumed. The (optional) initial condition specification, using IC=VDS, VGS is intended for use with the UIC option on the .TRAN control line, when a transient analysis is desired starting from other than the quiescent operating point. See the .IC control line for a better way to set initial conditions.

MESFETs General form:

ZXXXXXXX ND NG NS MNAME <AREA> <OFF> <IC=VDS, VGS>

Examples:

Z1 7 2 3 ZM1 OFF

MESFET Models (NMF/PMF)

The MESFET model is derived from the GaAs FET model of Statz et al. The dc characteristics are defined by the parameters VTO, B, and BETA, which determine the variation of drain current with gate voltage, ALPHA, which determines saturation voltage, and LAMBDA, which determines the output conductance. The formula are given by:

Two ohmic resistances, RD and RS, are included. Charge storage is modeled by total gate charge as a function of gate-drain and gate-source voltages and is defined by the parameters CGS, CGD, and PB. Name Parameter Units Default Example Area

1 VTO pinch-off voltage V -2.0 -2.0

2 BETA transconductance parameter A/V2 1.0e-4 1.0e-3 *

3 B doping tail extending parameter 1/V 0.3 0.3 *

Page 367: 39865643 Optsim Guide

OptSim User Guide Chapter 7: SPICE( Cosimulation in Sample-Mode •••• 357

4 ALPHA saturation voltage parameter 1/V 2 2 *

5 LAMBDA channel-length modulation parameter 1/V 0 1.0e-4

6 RD drain ohmic resistance 0 100 *

7 RS source ohmic resistance 0 100 *

8 CGS zero-bias G-S junction capacitance F 0 5pF *

9 CGD zero-bias G-D junction capacitance F 0 1pF *

10 PB gate junction potential V 1 0.6

11 KF flicker noise coefficient - 0

12 AF flicker noise exponent - 1

13 FC coefficient for forward-bias

depletion capacitance formula - 0.5

Page 368: 39865643 Optsim Guide

358 •••• Chapter 8: Getting Started with Block Mode and Transient Simulations OptSim User Guide

Chapter 8: Getting Started with Block Mode and Transient Simulations

This chapter introduces OptSim’s block mode simulations through a simple step-by-step example of modeling and simulating an optical link. Basic features of OptSim will be highlighted in the example. For more details on any of these features and on more advanced capabilities, please read the other sections of the user manual and the models reference manual.

An example is illustrated, where the procedures used to define a link topology, simulate it, and view the results are given. Note that this procedure describes just one way of doing it. The virtually unlimited combinations of components, parameters, and simulation options which OptSim support means that the precise procedures used depends upon the system being designed and simulated and the user’s preferences.

8.1 The tour The first step is to start OptSim. This is accomplished by choosing OptSim from the Window’s Start Menu/Program Files entry, double-clicking on the OptSim icon, or executing the OptSim executable from a command line. When OptSim opens, the graphical user interface (GUI) should look like Figure 1.

On the top portion of the OptSim GUI are the menu bar, the editing toolbar and the simulation toolbar. On the left hand side of the OptSim GUI are the models. The large space in the middle is the topology editing area. Multiple topologies can be opened simultaneously and editing within this space.

8.1.1 Laying out the Design Topology

To start creating a new link topology, press the New button. This opens a new topology window pane in the topology editing area of the GUI.

Now, to start laying out a topology, drag required components from the left of the GUI into the drawing space using right button of your mouse. For this example, let’s choose the PRBS Generator. Now, drag it using the cursor to the drawing area, and release the right mouse button where you would like to drop the icon. Since the signal path is from

Page 369: 39865643 Optsim Guide

OptSim User Guide Chapter 8: Getting Started with Block Mode and Transient Simulations •••• 359

left to right, it is best to put the starting icons on the left of the screen. There will be a question mark sign on the icon indicating that you have yet to set parameters for the component just placed. You can access these parameters by selecting this component, right clicking the mouse and opening “Properties.” After setting up the parameters (by clicking “OK” on properties dialog box), the question mark sign will go away.

Figure 1: OptSim GUI

Now, we need to place an Electrical Signal Generator block after the PRBS Generator block to produce an electrical signal representation of the binary signal output from the PRBS Generator to drive the laser. Click on the Electrical Signal Generator icon in the left toolbar, and then move the mouse to the right of the PRBS Generator icon in the drawing area, and left-click. The icon for the Electrical Signal Generator is dropped onto the drawing area.

Page 370: 39865643 Optsim Guide

360 •••• Chapter 8: Getting Started with Block Mode and Transient Simulations OptSim User Guide

Now we want to connect the Electrical Signal Generator icon to the PRBS Generator icon. Right click the mouse at the output port of signal generator and connect it to the input port of PRBS generatorl while keeping the mouse button pressed. Now release the mouse button and connection is made.

Now, we want to place a laser after the Electrical Signal Generator. In this example, we are laying out a direct modulated system, so click on the Direct Modulated Laser icon in the left toolbar. Then place the icon to the right of the Electrical Signal Generator icon.

Next, place and connect a Nonlinear Fiber icon to the right of the Direct Modulated Laser icon.

Next, place and connect an Optical Power Normalizer icon to the right of the Nonlinear Fiber icon. This will be used to set the input power level to the receiver for the purposes of generating a BER vs. received optical power plot.

Next, place and connect a Receiver icon to the right of the Optical Power Normalizer icon.

Now, to the right of the Receiver icon, place the BER Tester icon and connect the Receiver icon output to the top BER Tester icon input. Then, connect the PRBS Generator icon output to the bottom BER Tester icon input.

By now we have connected a basic link, but we haven’t provided any means of displaying signal waveforms yet. So, let’s add some plot icons. Place the Signal Analyzer icon above and to the right of the Nonlinear Fiber icon, and then connect the output of the Nonlinear Fiber icon to the input of the Signal Analyzer icon.

Place the Eye Diagram Analyzer icon above and to the right of the Receiver icon, and then connect the output of the Receiver icon to the input of the Eye Diagram Analyzer icon. You may also add other plot icons to plot the signals and eye diagrams and spectra at other points in the link.

Figure 2. Completed Link Topology

Page 371: 39865643 Optsim Guide

OptSim User Guide Chapter 8: Getting Started with Block Mode and Transient Simulations •••• 361

Now that we have the topology defined, the topology should look similar to Figure 2. Now we need to check and set the component parameters. For this example, we will use the default parameters for most of the components. You may view and edit these by right clicking on the component icon whose parameters you wish to edit. First of all, we want to set up the link for a sweep simulation which produces a BER vs. received optical power plot. To do this, we will sweep the average output optical power (AvePowerOut) parameter of the Optical Power Normalizer block. Right click on the Optical Power Normalizer icon. Make up a variable name, say “averecpower”, and put it in the value box for the AvePowerOut parameter. This dialog is shown in Figure 3. Next click OK to apply this change.

Figure 3. Optical Power Normalizer Properties

Next, click the Edit Symbols icon in the top toolbar. After the Symbol Table Editor dialog box opens, click the Add button to add a new variable name to the symbol table. Then enter “averecpower” in the Name box. You may give it a default value such as –20. This is important for the simulating the link in a single run simulation, but if we are performing a parameter scan it will not matter. Then click Accept Symbol. This dialog is shown in Figure 4. Now click OK to close the Symbol Table Editor.

Page 372: 39865643 Optsim Guide

362 •••• Chapter 8: Getting Started with Block Mode and Transient Simulations OptSim User Guide

Figure 4. Symbol Table Editor

The Save Topology button may be pressed to save the topology into a file for later retrieval and use. Regardless of whether the user explicitly does this prior to a simulation, the topology is always saved in a separate file at the start of each simulation run.

8.1.2 Parameter Scan Dialog Window: Setting up Parameter Scans In order to scan a project file over a range of parameters, one needs to perform a parameter scan. The variables that will be scanned are defined in the symbol table as explained earlier. The parameter scan can be activated by clicking on the Scan button (or from the Run -> Scan Variable menu option). The parameter scan window dialog box appears as shown in Fig. 5. The user selects from a pull down list desired scan variables for the Inner Loop Variable and Outer Loop Variable. The user also needs to specify the Starting Value, End Value and Increment for inner and outer loop variables. Meta prefixes can also be specified in order to identify plots and data files for corresponding iterations and scans. The user can specify number of Statistical Runs if the project contained any parameter having statistical distribution. A user can enable animation with desired hold time from the run simulation window. In this case, during the simulation the model undergoing simulation will be highlighted. The statistics log (Log Statistics), if enabled, will be stored for subsequent access.

A list of Symbols and online Help can be viewed from within the parameter scan dialog window.

Page 373: 39865643 Optsim Guide

OptSim User Guide Chapter 8: Getting Started with Block Mode and Transient Simulations •••• 363

Figure 5. Parameter Scan Dialog Window

We are now ready to perform a simulation. To produce the BER vs. received optical power curve, we need to perform a parameter scan simulation. To do this, press the Perform Parameter Scan button or select Scan Variable from the Run menu. The dialog is shown in Figure 6. Then fill in the Inner Iteration portion of the form with the values for our simulation. Set the Variable Name to be the variable used in the AvePowerOut parameter of the Optical Power Normalizer (“averecpower” if the suggested name was used), provide a Starting Value of –15, an Ending Value of –21, and an Increment value of –2. To have all simulation output files uniquely identifiable for this simulation run, put a unique name in the Scan Meta Prefix block, such as “scan1_”. When nothing is entered for the prefix, the default of “lstmp” is used. To uniquely identify the simulation outputs for each scan iteration, enter an Iteration Meta Prefix value such as “_i”. Now click OK to save this information and start the scan simulation. Leaving the Iteration Meta Prefix value empty will cause the signal plots to not be generated, just the BER curve. By setting the Plotting Mode, you can also override the settings of the plot icons in the topology to control whether their plots are saved to disk for later retrieval, saved and displayed on the screen automatically when generated, or not generated or saved at all.

Page 374: 39865643 Optsim Guide

364 •••• Chapter 8: Getting Started with Block Mode and Transient Simulations OptSim User Guide

Figure 6. Scan Variable Simulation Parameters

If you wish to stop the simulation while it is in process, click the Stop Simulation button or select Stop Simulation from the Run menu.

8.1.3 Simulation Run Dialog Window: Setting up a Single Simulation Run

If it is desired to simulate the link just once with the defined parameters (i.e., do not sweep any parameters), then you may click the Simulate Link button or choose Go from the Run menu after all the parameters are defined for the simulation. The simulation will be performed once with the specified parameters. The Simulation Parameters dialog which opens asks for the output file prefix. Set this to a unique value to have your simulation results saved to files beginning with this unique file prefix. When nothing is entered for the prefix, the default of “lstmp” is used. By setting the Plotting Mode, you can also override the settings of the plot icons in the topology to control whether their plots are saved to disk for later retrieval, saved and displayed on the screen automatically when generated, or not generated or saved at all. Figure 7 shows the dialog window for single run simulation.

Page 375: 39865643 Optsim Guide

OptSim User Guide Chapter 8: Getting Started with Block Mode and Transient Simulations •••• 365

Figure 7. Run Simulation Dialog Window

A user can enable animation with desired hold time from the run simulation window. In this case, during the simulation the model undergoing simulation will be highlighted.

Block Mode Simulation Parameters As shown in Fig. 7, the simulation parameter window has three sets of parameters: General parameters, parameters for Multiple Iteration Simulations and the Global Symbols.

As mentioned earlier, the simulation parameters from General tab allow setting appropriate simulation prefix and selection of plotting mode for the simulation results.

The parameters that are grouped under the Multiple Iteration Simulations are particularly useful when the entire topology is to be iterated a number of times, as is often done in order to capture the transient behavior. Figure 8 shows its dialog box.

Page 376: 39865643 Optsim Guide

366 •••• Chapter 8: Getting Started with Block Mode and Transient Simulations OptSim User Guide

Figure 8. Simulation Parameters for Multiple Iteration Simulations

The user enters the number of iterations and the desired Time Step Per Iteration.

Figure 9 shows the simulation parameters grouped under the Global Symbols tab.

Page 377: 39865643 Optsim Guide

OptSim User Guide Chapter 8: Getting Started with Block Mode and Transient Simulations •••• 367

Figure 9. Global Symbols for the Topology under Simulation

Add and Delete buttons are used to add or delete the global parameters used for the topology to be simulated.

The View Graphs button in the upper toolbar may be clicked to show all the simulation output plots which have been created and are available for viewing. This opens a file selection dialog that can be used to navigate your file system to find all plots that have been generated by various OptSim simulations. To view plots generated during the most recent simulation, you may double-click on the plot icons which generate the plots you wish to view.

8.1.4 Viewing Simulated Signal Summaries After the simulation is over, double clicking the left mouse button while the cursor is over a component’s input or output port displays a summary of the signal information generated at that node in the most recent simulation. This summary information includes the average signal value, noise, signal start time and duration, sampling rate, wavelength (for optical signals), number of bits, and bitrate. Additionally, when a simulation involves multiple variable scans, statistical runs, or repetition loops, each of the signals generated for each iteration is summarized and identified. The summary

Page 378: 39865643 Optsim Guide

368 •••• Chapter 8: Getting Started with Block Mode and Transient Simulations OptSim User Guide

information is stored in a file whose name is generated using the file prefix of the relevant simulation run, the name and the output port number of the component which generated the signal, and the suffix “.sum”.

When the Global Preference Suppress signal summaries in scans is selected (see menu item Options->Global Preferences…), the signal summary feature is disabled in parameter scans. This is useful for long parameter scans in which many statistical simulation runs or parameter scans are performed, leading to significant memory usage by the signal summary logging. By disabling the signal summary feature, memory can be conserved.

8.1.5 Viewing Plots Generated by Simulation After plots are generated by plot icons or other component icons that generate plots (e.g., BER Tester, Bi-Directional Fiber), they may be accessed from the topology editor window by double-clicking on the desired icon while in Select Mode. To access plots generated in other simulation runs beside the most recent simulation run, the View Plot icon (or Graph->View menu item) may be pressed to open a file selection dialog to locate and select the desired plot file(s).

Note that plotting by plot icons can be configured to save, save and display immediately, or not plot at all. These can be set individually by the plot icons or globally for all plot icons in a topology at the start of a simulation. The global setting at the start of a simulation only applies to the so-called plot icons, not to other icons such as the BER Tester that also generate plots.

Page 379: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 369

Chapter 9: Block Mode Simulations: Signal Types and Representations

Underlying all the physical modeling in OptSim are the representations of the different signals that represent binary information, electrical signals and optical signals. The purpose of every model in OptSim is to create or manipulate signals, convert from one signal type to another, or display signals as output. In order to understand the OptSim environment and its simulation results thoroughly, it is thus essential to understand a number of facts about the various signals. These include not only the particular quantities that OptSim computes, but also the level of detail with which each quantity is modeled. Moreover, a number of quantities may be represented in several forms, notably the noise associated with electrical and optical signals. Understanding the strengths and weaknesses of each representation allows the user to make an appropriate choice for any particular simulation problem.

In this chapter, we concentrate on the physical and mathematical aspects of the signal types. Users wishing to write their own models also need to read chapter on User Models, which details the actual C++ data structures with which the signals are implemented.

Section 7.4 of this chapter describes simulation of transients in the block mode. Generally speaking, the notion of time that is used in transient simulation is on a scale that is several orders of magnitude larger than the time scales that associated with information carrying bits in an optical signal. Microseconds to several milliseconds usually cover the time scale in which interesting transient effects occur. Transient simulations are based on the Wavelength-domain simulation approach discussed in [1].

9.1 Discrete Representations of Signals The three fundamental types of signals in OptSim are Binary Signals, Electrical Signals and Optical Signals. In the real world, binary signals are naturally viewed as discrete quantities – a sequence of binary digits – and we can represent a binary signal as a sequence , 1kb k n= K , where kb = 0 or 1 for each value of k . However, electrical and optical signals are continuous quantities – the voltage at a point in a circuit, or the optical power incident on a fiber are defined at every moment in time. So in a theoretical treatment we would typically write ( )V t for a voltage and ( )tE for the vector electric field component of an optical signal for any value of time t . In a numerical simulation tool, however, we cannot store or process a continuous signal since memory and computational time are both finite resources. Instead, continuous functions are sampled at discrete positions in time and space. So numerically, the voltage is represented as a sequence of discrete values ( )k kV V t=% , representing the value of the true continuous quantity at the discrete times kt .

Typically, the sampling times are equally spaced: kt k t= ∆ , and although this is by no means essential, it is always the case in OptSim’s models. This fundamental idea is illustrated in Fig. 1. The upper diagram shows a continuous curve

Page 380: 39865643 Optsim Guide

370 •••• Chapter 9: Block Mode Simulations: Signal Types and Representations OptSim User Guide

representing the optical signal emitted by a direct modulated laser. The lower diagram shows a sampled representation of the same signal with a sampling interval of 115et −∆ = s.

Continuous Signal

x10-10

Time (s)

0 2 4 6 8 10 12 14 16 18

x10-4Si

gnal

Mag

nitu

de (W

)

1

2

3

4

5

6

7

8

9

Page 381: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 371

Sampled Signal, ∆t=5e-11 s

x10-10

Time (s)

0 2 4 6 8 10 12 14 16 18

x10-4

Sign

al M

agni

tude

(W)

1

2

3

4

5

6

7

8

9

Fig.1. Continuous (top) and sampled (bottom) representations of a real signal

The fundamental assumption underlying a sampled representation is that provided the sampling rate 1/sf t= ∆ is sufficiently high, the continuous signal is well-approximated by the discrete samples. Roughly speaking, we require that the sampling rate sf be significantly larger than the bandwidth of any signal being modeled. These ideas are made precise by the “Nyquist Theorem” as we discuss below. Generally, the sampling rate is something the user has to control for him or herself by setting the sampling rate appropriately – if the sampling rate is too low, OptSim models can still produce answers but they will be inaccurate; if the sampling rate is too high, the results will be accurate but the simulation will consume unnecessarily large amounts of memory and time. This is not a significant burden – the default sampling rates in the models are appropriate starting points for the majority of simulations and the user quickly learns when adjustments are required.

9.1.1 Time and Frequency Domain Representations As suggested by the preceding discussion, OptSim is a time-domain simulation tool. That is, the fundamental physical quantities are principally represented as functions of discrete time over a finite time window that is sampled at intervals

t∆ . In most cases, the signals carry no spatial information, though there are important exceptions. The time-domain representation is not chosen arbitrarily, but is the most natural representation for a simulator using physics-based models at the level of fiber links. The situation is different at microscopic or very large scales: a detailed device modeling tool using beam propagation methods models electromagnetic fields as detailed spatial functions with no time dependence, while a finite-difference time domain tool gives equal emphasis to temporal and spatial evolution, again for detailed modeling of a single device. At macroscopic scales above the link level, a network modeling tool might represent optical signals simply as powers on a fixed frequency grid with no encoded signals. RSoft Design Group provides tools for all these regimes, but the middle-level representation used by OptSim has several advantages for link-level work. The elimination of spatial information through the assumption of single-mode propagation allows models that can be solved quickly allowing large complicated topologies to be handled quickly. (In a few models, most notably the Multimode Fiber and VCSEL model, spatial information is required for accurate modeling. Modal profiles are generated

Page 382: 39865643 Optsim Guide

372 •••• Chapter 9: Block Mode Simulations: Signal Types and Representations OptSim User Guide

internally using the model parameters.) However, retaining detailed temporal information allows us to incorporate important effects such as dispersion, nonlinearity and complex laser evolution, and permits the calculation and display of critical properties such as eye diagrams, optical and electrical power spectra and bit error rates. It should be noted however, that where spatial information is critical, such as in multi-mode fiber modeling, OptSim provides the option of the Multimode Simulation Platform or of directly calling RSoft’s device-level packages.

Continous and Discrete Fourier Transforms While OptSim’s fundamental representations are based in the time-domain, many of the signal manipulations and display functions are naturally expressed in the frequency or Fourier domain. For example, filtering of electrical and optical signals is a trivial operation in frequency space, and the ability to output signal spectra is a basic facility of the program. The time and frequency domain representations of a signal are connected by Fourier transform (FT) relations. For example, we can define the frequency representation of a continuous voltage signal as

( ) ( ) -2e djtV f V t tπ∞

−∞

= ∫ ,

(1)

with the inverse transform given by

( ) ( ) 2e djfV t V f fπ

−∞

= ∫.

(2)

(We will use the same symbols to denote quantities in either space and distinguish them by their arguments).

To handle the discrete signals used in OptSim, the definitions in Eqs (1) – (2) must be modified to the so-called Discrete Time Fourier Transform (DTFT):

( ) ( ) -2ˆ e kjft

kk

V f V t π∞

=−∞

= ∑,

(3)

and its associated inverse transform

( ) ( ) 2

/ 2ˆ e ds

k

s

f jftk f

V t V f fπ

−= ∫

(4)

where we have used a caret (^) to distinguish the DTFT from its continuous counterpart.

Note that since the sum in Eq. (3) is over an infinite number of time samples, the discrete transform ( )V f is a

continuous function of frequency even though ( )kV t is a discrete function of time. However, the discreteness in time has the consequence that the DTFT is a periodic function:

( ) 2ˆ ˆV f V f

tπ = + ∆ ,

(5) and conventionally is plotted in the range [ ]/ , /t tπ π− ∆ ∆ or [ ]0,2 / tπ ∆ .

Equation (3) is still unsuitable for numerical modeling, since it contains an infinite sum whereas the computer can only store a finite number of time samples. Instead, we define the Discrete Fourier Transform (DFT) with the finite sum:

Page 383: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 373

( ) ( )

1-2

0e i k

Njf t

i kk

V f V t π−

=

=∑%

,

(6)

where we have introduced the tilde (~) to denote DFT functions. The voltage samples are now restricted to the range 0 to 1N − , as as a result the frequency is also forced to become a discrete quantity taking on the values

2 2, 1, ,N N

iif i

N t= = − +

∆K

.

(7) The sampled function ( )kV t and its DFT ( )iV f% thus each have N independent values. Note also, that with the restriction to frequency values in Eq. (7), the DFT simplifies to a scale-invariant form, independent of the sampling time

t∆ :

12

0e

Njik

i kk

V V π−

=

=∑%

.

(8) This form is ideal for numerical transformation of a sampled vector of values kV but a naive evaluation of the sum for each value of i is unnecessarily computationally expensive with complexity O(N2). Computer scientists in the 1960’s discovered that the DFT could be evaluated by “divide-and-conquer” methods with a much faster algorithm of complexity O(NlogN). This method became known as the Fast Fourier Transform (FFT) and numerous developments have led to modern algorithms that are very fast indeed. While FFT codes now exist for any value of the number of samples N , the best performance is obtained when 2mN = for some positive integer m . As a result, all sampled signals in OptSim are restricted to sequences with lengths that are a power of 2. Since the terms are commonly confused, let us emphasize the distinction between the DFT and FFT – an FFT is an algorithm or computational routine (one of many), that implements the mathetical formula in Eq. (8), which is named the DFT.

The Nyquist Sampling Theorem and discrete Fourier representations To conclude our brief summary of discrete Fourier transforms, we discuss the most important result of discrete sampling theory, the Nyquist Sampling Theorem, which provides a precise statement about the accuracy of a sampled representation.

Fig. 2 shows a schematic of the Fourier transform ( )V f of an idealized continuous signal ( )V t . Note that the

transform is band-limited to a bandwidth B . (In discussions of the sampling theorem it is convenient and standard to

define bandwidths in terms of the positive part of the spectrum). In Fig. 3, we show the DTFT ( )V f for the same

signal sampled at the rate 1/sf t= ∆ . The new spectrum consists of copies of the original transform, scaled vertically

by 1/ t∆ and repeated periodically at intervals sf . Now observe that the inverse discrete time transform in Eq. (4)

involves an integral only over the finite range [ ]/ 2, / 2s sf f− . Since the continuous FT in Fig. 2 vanishes outside this frequency domain, we see that the inverse DTFT for this case is exactly equivalent to the continuous inverse Fourier transform, modulo a trivial scale factor t∆ ,. This implies that sampling the original signal at the rate sf involves no loss of information at all – the original continuous signal may be recovered by the inverse DTFT.

Page 384: 39865643 Optsim Guide

374 •••• Chapter 9: Block Mode Simulations: Signal Types and Representations OptSim User Guide

Fig. 2: Fourier transform of an idealized continuous signal of bandwidth B.

Fig.3: Discrete time Fourier transform (DTFT) corresponding to the Fourier transform in Fig. 2, when the original signal is sampled at the rate fs /2>B.

Now consider the situation for a lower sampling rate / 2sf B< illustrated in Fig. 4. The plot on the left is a construction showing the locations of the shifted copies of the original transform. The resultant spectrum DTFT obtained from this construction is shown in the right-hand panel. The form of the DTFT within the domain

[ ]/ 2, / 2s sf f− is now markedly different to the original spectrum and so the inverse DTFT cannot recover the original signal.

.

Fig.4: a) Geometric construction and b) DTFT of signal in Fig. 2 when sampled at the rate fs/2<B.

Guided by these diagrams we are led to the following statement of the Nyquist Sampling Theorem:

• Any continuous signal ( )V t , band-limited below a frequency B, can be completely recovered from the

sampled signal ( )kV t , where kt k t= ∆ and the sampling rate 1/sf t= ∆ satisfies 2sf B> .

Page 385: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 375

This fundamental result allows us to have great confidence in models based on sampled signals, provided we check that the sampling rate is high enough to contain all the relevant bandwidth.

The phenomenon seen in Fig. 4, in which signal power is essentially “folded back” into the wrong frequency bands is known as “aliasing” and appears whenever a signal is sampled at an insufficient rate. Its appearance can be understood when it is recalled that both the continuous and discrete time Fourier transforms satisfy versions of Parseval’s theorem:

( ) ( )

( ) ( )

2 2

2/ 22

/ 2

d d ,

ˆ d ,s

s

f

k fk

V t t V f f

V t t V f f

∞ ∞

−∞ −∞∞

−=−∞

=

= ∆

∫ ∫

∑ ∫

(9)

These equations state the total energy in the signal is conserved under both continuous and discrete time Fourier transforms. If a signal is sampled at an insufficient rate with 2sf B< , then some of the energy of the continuous

transform falls outside the range [ ]/ 2, / 2s sf f− . So to satisfy the discrete time form of Parseval’s theorem, the

spectrum within the frequency band[ ]/ 2, / 2s sf f− must be distorted to restore the “missing” energy. Figure 5 shows two example spectra produced by sampling an optical pulse spectrally broadened by self-phase modulation. The dashed curve shows the spectrum for an insufficient sampling rate which overestimates the energy in the spectral wings due to aliasing, while the solid curve illustrates the spectrum for a sampling rate four times higher. (Note that the spectrum is indeed plotted over a range four times larger). It is now clear how to check the sampling rate of a simulation – a PlotSpectrum block is used to obtain the spectrum of an optical or electrical signal. If the spectrum has non negligible values at the boundary of the window, the sampling rate must be increased.

Fig..5: Spectrum of a Gaussian pulse strongly broadened by self-phase modulation (SPM). The dashed curve shows the result for an insufficient sampling rate producing aliasing in the spectral wings.

Page 386: 39865643 Optsim Guide

376 •••• Chapter 9: Block Mode Simulations: Signal Types and Representations OptSim User Guide

In the form stated above, the sampling theorem applies to an infinite sequence of samples at times kt for all integers k .

As we have seen however, numerical models are based on a finite number N samples of a time window of length N t∆ . These pictures are connected by imagining the sampled signal within the time window to be repeated periodically with period N t∆ . The sampling theorem then applies to this periodic signal. Provided the time window is long enough to capture all physical effects in the various models, the assumption of a periodic signal has few impacts. At certain places in the manual, we highlight situations in which the periodic assumption must be handled with care. See the documentation on the Direct Modulated Laser for an important example.

9.2 Fundamental Signal Types Having discussed the general properties of discrete-time sampled signals we now turn to the details of the particular signals used in OptSim. There are three basic types – Binary Signals which are used for holding and manipulating binary information; Electrical Signals which describe voltages and currents in the DC and RF domain; and Optical Signals which are used to describe all the light propagation effects in OptSim. The three signal types share common information such as bit rates, sample rates and time offsets allowing for convenient conversion between them. However, as well as possessing certain information distinct to each type, the Electrical and Optical signals each support a variety of representations suitable for different physical problems and different types of analysis. We now describe each type in order of increasing complexity.

9.2.1 Binary Signals The representation of binary information is the simplest signal type in OptSim. As discussed above, a binary signal is naturally expressed as an arbitrary sequence kb of values 0 and 1. Although, it is not common to consider the Fourier Transform of a binary signal, OptSim’s binary signals are still restricted to have power of 2 lengths for compatibility with electrical and optical signals. A binary signal of length 25 is indicated in Fig. 6a where the x-axis is simply the index k . Typically, a binary signal is at some point encoded into an electrical signal and thus the bit rate RB in bits per second is also required to completely specify a binary signal. With a bit rate specified, the binary signal appears as in Fig. 6b where the x-axis now denotes time. Finally, whereas the signal in Fig. 6b begins at time 0t = s, it is sometimes useful to choose a different start time st t= , in order to model delays between different signals.

Fig.6 Binary signals of length 25 of a) arbitrary bit rate and b) bit rate BR=10 GHz.

Thus a binary signal in OptSim is completely described by the sequence kb of length 2mN = , accompanied by the bit

rate RB and start time st . Binary signals are generated by the PRBS_Generator model which can create a variety of

Page 387: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 377

patterns such as maximal length pseudo-random binary sequences, and special patterns such as alternating 0’s and 1’s, constant patterns or user specified patterns.

9.2.2 Electrical Signals Electrical signals are intended to represent voltages and currents in the RF domain, for example the voltage used to drive a modulator or laser, or the current generated at a photodetector. Since voltages and currents are real quantities, an electrical signal in OptSim is a real-valued time-sampled function ( )kV t . As well as the sampled vector kV , the signal

is characterized by the number of points 2mN = , a sampling rate 1/cf t= ∆ and start time st , and a flag indicating whether the signal is to be considered as a voltage or current. By default, electrical signals are considered as voltages, though in certain cases the current representation is useful. For instance, the Direct Modulated Laser may be driven by a current source from the Electrical Signal Generator, the Photodetector is modeled as a current source, and the Electrical Amplifier converts current signals to voltage signals. An example is shown in Fig. 7, representing the binary signal in Fig. 6b encoded as a voltage.

Fig.7: RZ-encoded voltage signal of the binary signal in Fig. 6.

For electrical signals, the Fourier transform is defined as

( ) ( ) -2e djtV f V t tπ∞

−∞

= ∫ ,

(10) with the corresponding DFT

1

2

0e

Njik

i kk

V V π−

=

=∑% .

(11) In these equations, note the convention used in OptSim for electrical signals of a negative sign in the exponent of the forward transform. The sign convention is important since it impacts the phase definitions of filter functions – user-defined filter functions must use the same sign convention.

Power Spectral Density Function As ( )V t is a real function of time, the transformed quantities are guaranteed to be Hermitian such that

*( ) ( )V f V f= − and *k N kV V −=% % . Thus the electrical signal is completely described by the positive frequency part of

the spectrum – the power spectral density function 2| ( ) |V f is symmetric, and it is conventional to plot the “one-sided”

Page 388: 39865643 Optsim Guide

378 •••• Chapter 9: Block Mode Simulations: Signal Types and Representations OptSim User Guide

power spectral density 2 2( ) | ( ) | | ( ) |P f V f V f= + − . The two representations are illustrated in Fig. 8. Note the change in vertical scale between the left and right plots.

Fig.8: Equivalent two-sided and one-sided electrical power spectral density

The discrete function defined as

( ) 2

i iP f V=% % ,

(12) the squared amplitude of the DFT voltage, is the natural analogue of the continuous power spectral density ( )P f but is termed an “estimator” for the actual spectral density function. This is because the discrete nature of the sampled signal introduces windowing effects so that the equality ( ) ( )i iP f P f=% holds exactly only in the limit

N → ∞ . This problem can be alleviated by coarse binning or filtering the signal, and several models in OptSim provide facilities for these procedures. Figure 9 illustrates this issue for the case of an optical spectrum output from a direct modulated laser. (The same issues apply for the power spectra of optical and electrical signals). Figure 9a shows the numerical spectrum when the signal is sampled at the rate cf = 2.56 THz ( t∆ =0.39 ps). When the signal

is sampled at a rate of only /16cf (Fig. 9b), the spectral density estimator fluctuates wildly. If the same low rate spectrum is replotted with the frequency points binned in groups of 8, the smooth spectrum in Fig. 9c is generated. The dotted line indicates that it is close to the original spectrum generated at the high sampling rate. For further details, the reader should consult any introductory text on digital signal processing theory.

Fig.9: Laser output sampled at a) high rate, b) low rate, c) low rate, with binning (dashed line reproduces the curve in plot a).

Page 389: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 379

Electrical signals and noise Many components can introduce noise into an electrical signal. In the optical communications context the most obvious sources are shot noise in photodetectors and thermal noise in electrical amplifiers. Since in many systems, electrical noise is the dominant degradation, powerful representations of noise are critical to accurate system modeling.

Monte-Carlo representation Electrical noise in OptSim is incorporated with the signal using one of two complementary representations. The more direct way is the simple addition of a stochastic component to the sampled signal. So a “quiet” electrical signal could be converted to a noisy one as follows:

nse qte ˆk k kV V σξ= +

(13)

where kξ is a real Gaussian random variable of zero mean and unit variance and σ is a suitable standard deviation. The initial and final signals might appear as in Fig. 10. This unified representation in which signal and noise are represented as a single sampled vector is very general since it allows any form of noise to be added. For instance, a process like that of Eq. (13) could be applied using a non-Gaussian noise source, or noise could be added in the frequency domain allowing sources with complicated spectral profiles. Frequently in this manual, we refer to this representation as the Monte-Carlo (MC) description of noise. The principal disadvantage of the MC approach is that the signal and noise are intertwined permanently – once noise has been added to the signal there is no way of perfectly separating the two. Only by filtering the combined signal can the noise be manipulated further.

Fig.10: a) NRZ electrical signal emitted from signal generator and b) the same signal after addition of thermal noise in MC representation.

Quasi-Analytic representation To escape this permanent intertwining, it is sometimes useful to represent the noise as a separate component from the “pure” signal. A reasonable approach would be to introduce a normalized Gaussian noise source and assign a single standard deviation to represent the strength of the noise at all times kt . For some noise sources, however, the strength of the added noise is dependent on the instantaneous signal. The shot noise in a photodetector, for instance, is much larger for a received “one” than a received “zero”. To account for these situations we can create a vector of discrete time noise standard deviations, to complement the pure signal vector. Thus the whole signal representation is written:

, 0 1kk

k

vE k N

σ

= = −

K

Page 390: 39865643 Optsim Guide

380 •••• Chapter 9: Block Mode Simulations: Signal Types and Representations OptSim User Guide

(14)

in terms of the signal samples kv and the noise samples kσ . Since the instantaneous noise is expressed as a standard deviation in Eq. (14), this can be considered an ensemble representation of the noise. If required, a particular instance of the actual voltage – signal plus noise – can be generated using the relation

ˆk k k kV v σ ξ= + .

(15)

Fig. 11 shows the electrical signal produced by a receiver where the photodetector shot noise is the dominant impairment. The left panel shows the separate signal and noise vectors with an obvious correlation between the strength of the noise and signal. The right hand panel shows the combined signal obtained from Eq. (15), confirming that the noise is stronger in the “ones”.

Separating the noise and signal in this fashion is very useful for certain bit error rate calculations using the so-called “Quasi-Analytical” technique. Providing the noise is well-approximated by a Gaussian source and that the receiver noise is the dominant impairment, one can efficiently calculate the contribution of each individual bit to the overall bit error rate. With the Monte-Carlo representation, the extraction of bit error rates is considerably more involved and requires the simulation of a longer bit stream for equivalent accuracy, particularly if the system has strong intersymbol interference effects. These issues are discussed in full in the documentation for OptSim’s BERTester model.

For convenience, we will also use the term “Quasi-Analytical” to denote the representation in Eq. (14).

Fig.11: Quasi-analytic treatment of electrical noise. a) Separate values for signal and std. dev. b) Combined signal generated according to Eq. (15).

The separate representation of signal and noise has two important limitations. Firstly, since the noise is essentially described as a power (or square root of power), we retain no information about its correlation function. It is therefore impossible to filter the noise in any sensible fashion. Secondly, it is only appropriate if the noise can truly be considered locally Gaussian. An important situation for which this is not the case, is the nonlinear processing of amplified spontaneous emission in a nonlinear optical fiber. During propagation, four-wave mixing and other nonlinearities can impart a highly non-Gaussian character to the noise. When the optical signal is detected and converted to an electrical signal, the noise should continue to be non-Gaussian assuming that the ASE contribution outweighs thermal and shot noise effects, and the Monte-Carlo representation is then required to account for the noise correctly.

9.2.3 Optical Signals A complete description of an optical signal requires specifying the vector components of the electric and magnetic fields as a function of time and the three position coordinates. As indicated earlier, such a detailed description is impossible for a link-level tool such as OptSim since the time and memory resources required would be enormous. Since the majority of the optical components in OptSim are waveguide devices of some form or other, it is natural to expand the fields in terms of waveguide modes. Most components utilize only one or perhaps a few modes, so this represents an enormous

Page 391: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 381

simplification as the problem is reduced to the evolution of a few mode amplitudes along the propagation path. As OptSim is a time-domain tool, the appropriate representation is to describe the amplitude of the electric field for a small window in time. The amplitude in this window evolves as the signal progresses along the spatial path. If for now we assume the field to be lineary polarized along the x-axis (an approximation we remove later,) we thus write the electric field as

( ) ( ) ( )ˆ ,t x f x y E t=E .

(16)

in terms of the amplitude function ( )E t and mode profile ( , )f x y .

Slowly-varying envelope representation As the true electric field must be a real function, the spectrum of the signal ( )E t define in Eq. (16) must be Hermitian, as we saw earlier for the electrical signals. Figure 12 illustrates that a new problem arises for optical signals. The center frequency 0f of an optical signal is of order 200 THz, but the typical bandwidth of communications signals is at most a few hundred GigaHertz. Hence a huge region of the spectrum far below the center frequency is essentially empty, and it would be most wasteful in time and memory to represent the field using the same “baseband” representation as was appropriate for the electrical signals.

Fig.12: Schematic of the spectrum for the optical electric field

Instead, we separate the time scales of the optical field into a fast harmonic part rotating at the center frequency 0f , and

a “slowly-varying envelope” function ( )A t as follows:

( ) ( ) ( )0 02 2*e ejf t jf tE t A t A tπ πγ − = + .

(17)

The “envelope function” ( )A t has a spectrum centered close to zero frequency and an acceptable bandwidth in the

range of 10’s-100’s of GigaHertz, and is thus suitable for modeling. This envelope’s spectrum ( )A f is indicated schematically in Fig. 13. The spectral band from the positive frequency part of Fig. 12 has been shifted to zero frequency; the bandwidth f∆ is the same in both figures. As is apparent from Eq. (17), the envelope ( )A t must be a complex function and therefore its spectrum is non-Hermitian.

Page 392: 39865643 Optsim Guide

382 •••• Chapter 9: Block Mode Simulations: Signal Types and Representations OptSim User Guide

The scaling factor γ in Eq. (17) allows us to choose convenient units for the amplitude function. It is conventional to

define γ such that the squared amplitude ( ) 2A t has units of Watts. Thus the average optical power in a signal during

a time period T is given simply by

( ) 2opt

0

1 dT

P A t tT

= ∫

(18)

Fig.13: Schematic spectrum for the envelope function corresponding to Fig. 12. The positive band from Fig. 12 is shifted to the base band, and is in general asymmetric.

The Fourier transform of the optical signal is defined as

( ) ( ) 2

e djft

A f A t tπ∞

−∞= ∫ .

(19) Note in Eq. (19) that OptSim uses a positive sign convention in the exponent, opposite to the sign used for electrical signals. With this definition, negative frequencies in ( )A f correspond to the wavelength band below 0f . Of course, the same sign change also appears in the definition of the DFT for optical signals. To summarize the description so far, a single optical signal is specified by a vector of complex numbers of length

2mN = accompanied by a center frequency 0f or free-space wavelength 0 0/c fλ = and the sampling time t∆ . As

for electrical signals, it is useful to add a start time 0t to allow for signal delays.

Single-band and Multiple-band Representations Fig. 14 illustrates a situation that frequently arises in WDM optical simulations. The system consists of four optical channels whose spacing far exceeds their individual bandwidths. In this case the amplitude function might be written

( ) ( ) ( ) ( ) ( )31 2 - 2- 2 - 20 1 2 3e e e i f ti f t i f tA t a t a t a t a tπ δπ δ π δ= + + + ,

(20)

where the amplitude functions ( )iA t describe the individual channels and the detunings iδ indicate their spacing from

the first channel 0a . However, since the total amplitude function ( )A t spans all four channels and the spaces between them, it is clear from Fig. 14 that the majority of its spectral range is empty. In simulating the propagation of this signal down a fiber, the bulk of the numerical work would be devoted to the frequency bands between the signals, apparently wasting significant effort. We refer to this representation of a signal containing several signals as the Single-Band mode.

Page 393: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 383

Fig.14: Single-band representation for several optical channels.

The diagram in Fig. 15 shows an alternative treatment of this problem, in which the single amplitude function is truly replaced by four separate functions. Thus rather than using Eq. (20), we replace the original expansion of the electric field in Eq. (17) by the expression

( ) ( ) ( ) ( ) ( ) ( )0 1 0 13

*-2 2

0e e ,k kj f t j f t

k k k kk

E t A t A t f x yπ δ π δγ + +

=

= + ∑ ,

(21) and treat the four amplitudes ( )kA t as separate entities. Figure 15 indicates the increased efficiency of this representation since the intervening portions of the spectrum are not modeled. This approach is referred to as the Multiple-Band representation.

While it is generally faster to model WDM systems using the multiple-band representation, it is not without cost. Firstly, the equations for nonlinear models such as the optical fibers become considerably more complex due to a proliferation of terms. For example, a Kerr nonlinearity term that appears as 2| ( ) |A tφ γ= in single-band mode, is replaced by

expressions such as 2 2| ( ) | 2 | ( ) |i i jk iA t A tφ

≠= + ∑ in multiple-band mode. The additional terms impose a simulation

burden that may outweigh the efficiency advantages of multiple-band mode if the channel spacings are not too great. More importantly, the multiple-band representation is incapable of modeling the effects of four-wave mixing (FWM) which results from a coherent interaction between the different channels. Figure 16 shows two output spectra from a WDM simulation performed using both representations. The left-hand result, obtained from single-band mode, shows new peaks generated through FWM that are absent from the right-hand multiple-band plot. This issue is discussed in depth in the documentation for the Nonlinear Fiber Model. The WDM models in OptSim allow the user to specify which representation is required so that an appropriate compromise between speed and accuracy may be selected.

Page 394: 39865643 Optsim Guide

384 •••• Chapter 9: Block Mode Simulations: Signal Types and Representations OptSim User Guide

Fig.15: Multiple-band representation for the optical channels in Fig. 14.

Fig.16: Output spectra for 4 channel problem. a) Single-band mode generates FMW sidebands. b) Multiple-band mode produces no sidebands.

Internally, a signal in multiple-band mode is represented in terms of a “linked-list” of single-band signals.

Polarization Polarization of the optical signal plays a critical role in system performance through such effects as polarization mode dispersion (PMD) and polarization-dependent loss (PDL), and it is essential to incorporate the vector nature of the field into the optical signal representation. For the vast majority of optical components in communications systems, it is

acceptable to work with only the transverse components of the field ( ) ( ),x yE t E t -- the longitudinal component

( )zE t is typically negligible and may be recovered from the transverse components anyway. Thus the (single-band) envelope representation for the field is extended to the vector form:

( ) ( ) ( ) ( ) ( ) ( ) 0 0 0 0* *2 2 2 2ˆ ˆ, e e e ejf t jf t jf t jf t

x x y yf x y x A t A t y A t A tπ π π πγ − − = + + + E t ,

(22) and it is convenient to define the vector envelope quantity

Page 395: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 385

( ) ( )( )

A x

y

A tt

A t

=

,

(23) The two-component column in Eq. (23) is referred to as the “Jones vector” representation. Internally, the two components are represented by parallel complex arrays. Since many models have no polarization dependence, by default OptSim creates optical signals with a nominal x polarization and reserves no memory for the y part of the signal. This saves the models from unnecessarily repeating identical calculations on both polarizations. The additional polarization component is created when an x -polarized signal encounters either a Polarization Transformer model or an optical fiber with PMD effects activated. Certain optical sources can also create arbitrary polarization states.

Noise As with the electrical signal, we require a description of noise for optical signals. The principal source of optical noise in fiber links is Amplified Spontaneous Emission (ASE). This is a form of noise appearing in optical amplifiers, both erbium doped fiber amplifiers (EDFA) and Raman amplifiers (RA). As a consequence of quantum mechanics, any optical gain process is accompanied by the “spontaneous emission” of random photons across a broad wavelength band. The spontaneous emission noise spectrum has a shape and strength dependent on both the amplifying medium and properties of the pump laser and has an extent of typically hundreds of nanometers. Unfortunately, the noise emitted from one amplifier experiences gain at subsequent amplifiers along with the signal channels and significant power can accumulate in the ASE spectrum. ASE thus presents a central constraint on system design. Figure 17 shows the output of an EDFA with several signal channels on a broad noise background.

Fig.17: EDFA output spectrum with four signal channels at 1530-1560 nm, plus broadband ASE

Noise Bins Representation Fig. 17 reveals an important characteristic of the ASE spectrum – in addition to its broad extent, the spectral density varies relatively slowly with frequency as compared to the detailed spectral features of the signals and may be considered as a locally white noise source with a slowly-varying envelope. Moreover, the ASE is not influenced by the information-bearing part of the signal – it is not necessary to account for pattern dependence as it was for the electrical shot noise. Thus the ASE is most naturally represented as a power spectral density function and can be sampled on a much coarser frequency grid than the signal channels, permitting huge savings in time and memory. This power representation on a coarse frequency grid is commonly referred to as a series of “noise bins”.

Page 396: 39865643 Optsim Guide

386 •••• Chapter 9: Block Mode Simulations: Signal Types and Representations OptSim User Guide

ASE spectra are generated by the EDFA and Bidirectional Fiber (for Raman amplification) models and by the Noise Adder. The latter is a convenience model that allows noise properties to be specified independently of any amplification.

Stochastic (Monte-Carlo) Noise Representation When discussing electrical noise, we observed that on occasion it is necessary to incorporate the noise directly as a stochastic component of the signal. In particular, we noted that this is the case if the dominant noise source is ASE that has been processed nonlinearly in an optical fiber. If it is necessary to treat the electrical noise stochastically for a problem involving ASE, then it is certainly also necessary to treat the optical noise stochastically. To transfer ASE noise from the spectral density to a stochastic picture an operation is performed as follows:

( )( )

( ) ( )( ) ( )

1ASE2

1ASE2

ˆ

ˆ

xx k k kx k

yy k y k k k

A f P f fA f

A f A f P f f

η

η

+ ∆ → + ∆

,

(24) where ASE ( )kP f f∆ is the ASE noise power contained in a range f∆ around the signal sample frequency jf , and

f∆ is the sampling rate of the signal. Note that usually the noise bin spectrum must be interpolated to obtain the value

ASE ( )kP f . The terms ,ˆ x ykη are complex Gaussian noise sources with the expectation values

* * *0,k l k l k l klη η η η η η δ= = = . In Eq. (24), the ASE power ASE ( )kP f f∆ is shared equally between the two

signal polarizations -- the power in the noise bins assumed to be unpolarized. In a future version of OptSim, it will be possible to specify other polarization properties for the noise.

Fig.18: 1540-nm EDFA output signal both before and after the addition of ASE noise via a Noise Adder

Page 397: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 387

Fig.19. EDFA ASE output spectrum after passing through a Noise Adder, illustrating the removal of in-band ASE power for each of

the four signals of Fig. 17.

In addition to producing noise spectra, the Noise Adder model may be used to merely transfer ASE noise from the noise bin picture to the stochastic picture as described by Eq. (24). Figure 18 shows the 1540-nm output signal from Fig. 17 in the time domain, both before and after the addition of the in-band ASE noise via a Noise Adder. The signal now has a random contribution, resulting in a considerably noisier waveform. Furthermore, as illustrated in Fig. 19, the noise bins within the signal channels are now set to zero. If such a signal is launched into a fiber, the signal and noise within the signal bands interact nonlinearly to produce effects such as parametric amplification of the noise near each channel. In contrast, there is no interaction between the signals and the portion of the noise remaining in the power bins. (More accurately, this is the case for the Nonlinear Fiber Model. The Bidirectional Fiber Model does account for the noise bin-signal interaction in order to correctly model Raman amplification.) Nevertheless, observe in Fig. 19 that the noise bins outside the signal bands have not been removed or disabled. This is important as the noise in these regions still contributes to amplifier saturation and might also be converted to the MC representation subsequently.

CW optical signals The representation of CW optical signals is an important special case. CW signals are generated by the CW Laser model and are used in several places in OptSim such as for pump sources for optical amplifiers or laser inputs to external modulator models. Representing a CW signal by a time-sampled vector is highly redundant since no information is required beyond the wavelength of the signal, the signal power, the polarization state, a linewidth and a reference phase. Thus by default, a CW signal is stored simply in terms of these parameters – wavelength, power, polarization, linewidth and phase – saving in time and memory. If a CW signal is combined coherently with a conventional optical signal, in a multiplexer for instance, OptSim requires that both signals are specified in the full sampled representation. Therefore, the CW Laser model provides a signalType parameter to toggle the representation.

9.3 General Comments In representing both electrical and optical signals, it is apparent that a number of choices exist – noise may be represented stochastically or with a distinct time-sampled (electrical) or frequency-sampled power vector; optical signals may possess a single component or two polarizations, and may represent multiple channels in a single band or a sequence of multiple bands. By default, OptSim components are designed to use the representations which are the simplest in terms of use and functionality, and of memory. Thus for instance, a default optical signal contains only the x -polarized part of the signal and possesses no ASE power spectrum, and a default CW optical signal is stored in the simple power representation. The models provide functionality and options to enable the enhanced functionality when required – a y component to the optical field appears when the signal is rotated by a Polarization Transformer, and noise bins are automatically generated if the signal passes through a Noise Adder or amplifier. The flexibility and variety of signal representations thus allows the user to achieve the best balance between computational efficiency and simulation accuracy for the application at hand.

Page 398: 39865643 Optsim Guide

388 •••• Chapter 9: Block Mode Simulations: Signal Types and Representations OptSim User Guide

9.4 Transient Simulations

9.4.1 Background Block-mode simulations fall into two categories, namely: the static and transient regimes. In the static regime the user is interested in the steady state or static behavior of the system under study. Parameter scanning is also covered in this regime. On the other hand, in the transient regime the user is more interested in the transitional periods between two steady state conditions. In other words, the user is interested in the dynamic behavior of the network when changes, whether planned or unplanned, take place in the system under study. Dynamic changes in the network are not instantaneous. Therefore, in order to get useful information out of the simulation it is necessary to simulate a realistic time frame. From a simulation point of view, this translates to several iterations or runs of the system under study with differing boundary conditions to capture the dynamic changes. Generally speaking, the notion of time that is used in transient simulation is on a scale that is several orders of magnitude larger than the time scales that associated with information carrying bits in an optical signal. Microseconds to several milliseconds usually cover the time scale in which interesting transient effects occur. Transient simulations are based on the Wavelength-domain simulation approach discussed in [1]. In OptSim the Block-Mode Run Window specifies two global simulation parameters that are extremely important when studying transient effects. These parameters are iterations and Time Step Per Iteration. They are available on the Multiple Iterations Simulation tab of the Run Window. The former determines how many simulation iterations (i.e. how many times the system will be executed) will be executed. The latter determines the incremental time difference between each run of the system. Transient models usually care about these values and implicitly make use of them in their algorithms. For instance, the Time Step Per Iteration parameter is used by the Transient EDFA model to solve the time-dependent atomic population inversion equation that is discussed below. For this reason, under some circumstances care should be taken when setting this value. Some additional details are given below. For normal non parameter scanning single-rate simulations the system schedules and fires each model once in a deterministic sequence determined by the connection pattern and the models. For systems with feedback loops, and in particular ring networks, each block is necessarily fired more than once during the course of a single simulation event. This places additional constraints on the simulation of these systems. There are two related issues that this multiple firing of the blocks must address. First, in order to avoid deadlock situations at the beginning of the simulation, delay blocks are used to satisfy the required initial inputs of some blocks. Second, because of the delays and initial guesses, it takes a minimum number of iterations before the system reaches the steady state in which the state of the system is independent of the number of iterations. Even though several iterations may be necessary before the equilibrium state is reached, the desired results are normally obtained from the outputs of the final executed iteration. In OptSim, this simulation approach is easily extended to the simulation of slowly changing boundary conditions (aperiodic boundary conditions) in a system. This allows us to study power transient effects in transparent all-optical networks. In these cases, an output data point is collected for each execution of the system. This type of simulation is the essence of the transient regime that was mentioned above. OptSim Block-Mode engine includes a number of transient specific blocks (i.e. blocks dedicated to the transient regime). However, the simulation of transient effects in a system typically includes both transient specific blocks and dual purpose blocks that are used in both the transient and the static regimes. The underlying assumptions specific to the wavelength-domain simulation [1] approach gracefully allow for this mixture of basic building blocks. The MUX/DEMUX (WDM filtering models) and the optical switch models discussed below are normally safe to use in the transient regime.

9.4.2 Time Step and Spectral Bin Size The time step as specified by the Time Step Per Iteration parameter is the single most important parameter in the transient simulation regime. It ultimately determines whether or not the simulation makes physical sense. As pointed out above, simulating transient effects in a system require several iterations to capture the notion of time using the Synchronous Data Flow (SDF) [2] model of computation. Each iteration represents a time step in the simulation event. A

Page 399: 39865643 Optsim Guide

OptSim User Guide Chapter 9: Block Mode Simulations: Signal Types and Representations •••• 389

large simulation time frame requires many iterations, and can therefore take an extremely long time to execute. A primary objective in simulations is always to reduce computation time. To achieve this object the user is often faced with a tradeoff between computation time and accurary. It turns out that very often we are not so concerned with spectral details when simulating transient effects. Therefore, a very coarse sampling of the spectrum is usually acceptable. The results that are obtained using the coarse sampling are generally less accurate, but the incremental errors are usually acceptable during the initial investigative stages of a study.

9.4.3 Time Step Constraints The most obvious time step dependency is the inverse relationship between simulation time step and total simulation time. Therefore, the tendency is to use as large a time step as possible. However, there are two fundamental constraints affecting the size of the time step. The first, and most critical is that, the time step size should be small enough to capture effects with very fast response time. For example, if feedback loops are included then the propagation delay time of signals around the loop should be considered when setting a simulation time step. More generally, care must be taken to ensure either that physical effects are accounted for or prudently neglected in the simulation. The other constraint is of a mathematical nature. The time-dependent population inversion equation is solved using the fourth-order Runge Kutta algorithm. In general, larger step size results in a larger mathematical error and vice versa. In fact, if the time step size exceeds a certain maximum the algorithm may miss important effects occurring on smaller time scales, leading to mathematical errors that can be difficult to trace in some cases. Also, if the input powers exceed a certain maximum or the dynamic changes in the network take place too rapidly the algorithm may fail to produce correct results. A smaller time step and thus, a longer total simulation time may be the only way to ensure correctness in such cases. Consequently, an understanding of the physical and mathematical constraints associated with the system and the algorithms implemented in the simulation, respectively, is often a prerequisite for getting useful results from a transient simulation.

9.4.4 Signal Summaries for Transient Simulations The system automatically limits the number of Signal Summaries per port to 10 for transient simulations. As mentioned before, a transient simulation topology will normally be executed for a relatively large number of simulation iterations. Without some automatic means of limiting the number of Signal Summaries, an extremely large amount of memory could be allocated for storing these summaries. Also, the information listing will be excessively large and difficult to process. The Signal Summaries are generated at regular intervals by dividing the total number of simulation iterations by 10. The relative time that each Signal Summary was generated is also provide so that the user can use the information to study how the signal outputs change with time.

9.5 References [1] I. Roudas et al., “Wavelength-Domain Simulation of Multiwavelength Optical Networks,” Selected Topics in Quantum Electronics, March/April 2000. [2] The Ptolemy Project, http://ptolemy.eecs.berkeley.edu.

Page 400: 39865643 Optsim Guide
Page 401: 39865643 Optsim Guide

OptSim User Guide Chapter 10: Multimode Simulations: Transverse Mode Profiles •••• 391

Chapter 10: Multimode Simulations: Transverse Mode Profiles

This chapter discusses the extension of OptSim’s optical signal representation to describe transverse mode profiles.

10.1 Introduction In the previous chapter, optical signals are described via a time-varying amplitude function and a transverse mode profile. In single-mode systems, it is sufficient to consider only the amplitude function, with the effects of transverse mode variations included implicitly within the models for each single-mode component. For multimode systems, where the mode-coupling between components must be computed on a signal-by-signal basis, this separation is no longer appropriate, and explicit transverse mode shapes must be included as part of the OptSim optical signal. Depending on the device from which the signal is output, these profiles may range from simple spot modes to linearly polarized fiber modes.

Since multimode simulation can introduce complex situations not ordinarily encountered during single-mode simulation, there is a troubleshooting section at the end of this chapter

10.2 Complete Optical Signal Representation For single-mode simulations, it is sufficient to consider only the time-varying amplitude of a particular mode. Multimode systems, however, with their complicated mode couplings between components, demand that each mode’s transverse shape be explicitly accounted for within the optical field representation. In this case, OptSim includes transverse mode profiles for both polarizations as part of the optical signal. These profiles will generally vary depending on the component from which they are generated. For example, vertical-cavity surface-emitting lasers (VCSELs) can often be characterized by Laguerre-Gaussian modes. Typically, the multimode output of a given component can be treated at a single wavelength with all transverse modes mutually orthogonal.

As described in Chapter 6 of the OptSim User Guide Vol. I, optical-signal information within OptSim is generally stored as time-domain field values in the X and Y polarizations. Expanding upon this treatment, the complete representation of an optical field for a single mode, including unique shapes for the X and Y polarizations, is:

2 2ˆ ˆ( ) ( ) ( , ) . . ( ) ( , ) . .j f t j f to ox x y yE t x A t x y e c c y A t x y e c cπ πγ ψ ψ− − = ⋅ + + ⋅ +

(1)

Page 402: 39865643 Optsim Guide

392 •••• Chapter 10: Multimode Simulations: Transverse Mode Profiles OptSim User Guide

where γ is a scaling factor, fo is the optical carrier frequency, t is time, x is the X coordinate, y is the Y coordinate, and c.c. denotes complex conjugate. The field amplitudes for the X and Y polarizations are Ax(t) and Ay(t), respectively, while the normalized transverse mode profiles for the X and Y polarizations are ( , )x x yψ and ( , )y x yψ , respectively. The profiles are normalized to ensure that the full optical power is carried inside the amplitude functions. In most cases, the mode profiles for the X and Y polarizations will be identical, but for generality, OptSim allows them to be specified separately.

OptSim supports a wide range of transverse mode profiles, depending on the component from which the optical modes originate. These mode shapes include gridded modes, donut and spot modes, Laguerre- and Hermite-Gaussian modes, and linearly polarized (LP) fiber modes. Below we describe each of the supported profiles in more detail. Multimode fiber modes are also supported, and are described in Chapter 12 of the OptSim Models Reference.

10.3 Gridded Modes Gridded modes are described via a one- or two-dimensional array of complex data values. These modes are typically generated from a data file. The data files do not need to be normalized, as OptSim performs this step automatically.

A two-dimensional gridded mode is described by a set of complex field values over a rectangular grid of points. This grid is bounded along the x and y dimensions by [xmin,xmax] and [ymin,ymax], respectively. Field values outside of this domain are set to zero, and values at positions between grid points are calculated via interpolation.

A one-dimensional gridded mode is described on a cylindrical coordinate system, with complex values specified on a radial grid bounded by [rmin,rmax]. Field values outside of this radial domain are set to zero, and intermediate values are determined by interpolation. The field’s azimuthal dependence is assumed to be sinusoidal. The field as a function of radius r and azimuth φ is:

cos( ) , 0

( , ) ( )sin( ) , 0

L lr f r

L lφ

ψ φ αφ

≥= ⋅ ⋅ <

(2)

where α is a normalization constant, f(r) is the radial field dependence described by the one-dimensional data array, l is the azimuthal index, and L = |l|.

The format for one- and two-dimensional field files is as follows. The first one or more lines of the field file may be optional directives for displaying the data in WinPlot, and, if specified, can be considered as comments and ignored. They begin with a slash ('/') character and can be identified and parsed by that characteristic. The first non-directive line contains five standard fields which are:

• The number of data points in the X direction (or radial direction, for one-dimensional fields)

• The X (or radial) coordinate of the first data point

• The X (or radial) coordinate of the last data point

• The Z coordinate at which the field is sampled (can be ignored and safely set to zero)

• The subformat, which is the string OUTPUT_AMP_PHASE_3D for field data on an XY grid (two-dimensional data), or OUTPUT_AMP_PHASE for field data on a radial grid (one-dimensional data).

For two-dimensional fields, a second non-directive line contains three entries which are:

• The number of data points in the Y direction

• The Y coordinate of the first data point

• The Y coordinate of the last data point

Following the above header information is the actual field data in column format, with each row representing information at a different x (or radial) coordinate. The interpretation of each column depends on the field type. For one-dimensional fields, column one holds the field amplitude and column two holds the phase. For two-dimensional fields,

Page 403: 39865643 Optsim Guide

OptSim User Guide Chapter 10: Multimode Simulations: Transverse Mode Profiles •••• 393

there are two columns for each data point along the Y direction (i.e., for n data points along Y, there will be 2n columns). The first column in each pair holds the field amplitude and the second holds the phase.

10.4 Donut and Spot Modes The simplest analytical transverse mode shapes are the donut and spot modes. The donut mode may be described as:

cos( ) , 0

,sin( ) , 0( , )

0 , ,

min max

min max

L lr r r

L lrr r r r

φα

φψ φ ≥

⋅ ≤ ≤ <= < >

(3)

where α is a normalization constant, rmin is the minimum radius, and rmax is the maximum radius. Outside of these bounds, the field is zero; inside, the field is a sinusoidal function of azimuth, where l is the azimuthal index and L = |l|. Spot modes are simply donut modes with rmin = 0. Figure 1 depicts examples of both donut and spot modes.

Figure 1: Plots of uniform transverse mode types: donut mode (left) and spot mode (right).

10.5 Laguerre-Gaussian Modes Laguerre-Gaussian (LG) modes [1] are extensions of the simple Gaussian mode shape to higher order modes in a cylindrical coordinate system, and are often used to describe the transverse mode shapes at the output of a VCSEL [2]. They are characterized by azimuthal index l, radial index m, spot size wo, and radius of curvature Ro. For fixed values of wo and Ro, the family of LG modes for different azimuthal and radial indices are mutually orthogonal. The analytical representation of the mode LGml is:

/ 22 2 2 2

2 2 2cos( ) , 02 2( , ) exp expsin( ) , 0

Ll

ml moo o o

L lr r r rr L jL lRw w w

φπψ φ αφλ

≥= ⋅ ⋅ ⋅ − ⋅ ⋅ <

(4)

where α is a normalization constant, L = |l|, λ is the field wavelength, and lmL is a generalized Laguerre polynomial.

At the beam waist, the inverse of Ro is zero, indicating a flat phase front. At any distance to the left or right of the waist

Page 404: 39865643 Optsim Guide

394 •••• Chapter 10: Multimode Simulations: Transverse Mode Profiles OptSim User Guide

(along the axis of propagation), the beam begins to diverge and Ro becomes finite. Figure 2 illustrates representative mode shapes (at the beam waist) for modes LG00, LG22, LG03, and LG13.

Figure 2: Plots of different Laguerre-Gaussian modes. Proceeding clockwise from the upper left: LG00, LG22, LG03, and LG13.

10.6 Hermite-Gaussian Modes Hermite-Gaussian (HG) modes [1] have also been used to characterize the mode outputs of vertical-cavity lasers [3],[4]. They are analogous to LG modes, except that they are defined on a rectangular coordinate system. Thus a mode’s X- and Y- dependencies each have their own spot size and radius of curvature. Further, instead of a radial and azimuthal index, we have an X index l and a Y index m. As with the LG modes, for fixed values of the spot sizes and radii of curvature, the HG profiles at different indices form an orthogonal set of modes. The analytical representation for mode HGlm is:

Page 405: 39865643 Optsim Guide

OptSim User Guide Chapter 10: Multimode Simulations: Transverse Mode Profiles •••• 395

2 2

2

2 2

2

2( , ) exp exp

2exp exp

lm lox oxox

moy oyoy

x x xx y H jw Rw

y y yH jw Rw

πψ αλ

πλ

= ⋅ ⋅ − ⋅ ⋅

⋅ − ⋅

(5)

where wox and woy are the X and Y spot sizes, respectively, and Rox and Roy are the X and Y radii of curvature, respectively. Hl and Hm are Hermite polynomials. Figure 3 depicts modes HG13, HG14, HG20, and HG53.

Figure 3: Plots of different Hermite-Gaussian modes. Proceeding clockwise from the upper left: HG13, HG14, HG20, and HG53.

10.7 LP Modes Analytical forms for linearly polarized (LP) modes are obtained from the weakly index-guided waveguide approximation. They also have been used extensively to model the optical outputs of semiconductor lasers, including

Page 406: 39865643 Optsim Guide

396 •••• Chapter 10: Multimode Simulations: Transverse Mode Profiles OptSim User Guide

VCSELs [5],[6]. Derivation of the LP mode solutions can be found in any standard waveguide text [7].[8]. For a cylindrical dielectric waveguide with core material index Ncore, cladding index Nclad, and core radius rcore, there will be a finite number of modes. Each mode is characterized by an azimuthal index l and radial index m. Setting L = |l|, the mode LPlm is described by:

( ) ,

cos( ) , 0( , ) ( )

( ) , sin( ) , 0( )

L core

lm LL core

L

J r r rL l

r J aK r r r L l

K a

κφ

ψ φ κγ φκ

≤ ≥ = ⋅ ⋅ > <

(6)

where JL is the Lth order Bessel function of the first kind, and KL is the Lth order Bessel function of the second kind. κ and γ are eigenvalues for this mode, as determined from the weakly index-guided waveguide approximation. These eigenvalues are determined from the following two equations:

1 1( ) ( )( ) ( )

L core L core

L core L core

K r J rK r J r

γ γ κκ

γ κ− −= −

(7)

( )2

2 2 2 22core cladn nπκ γ

λ + = ⋅ −

(8)

where λ is the field wavelength. For a given set of mode indices and waveguide parameters (Ncore, Nclad, and rcore), OptSim automatically determines the corresponding eigenvalues at a given wavelength. When using LP modes to describe profiles in structures that are not cylindrical dielectric waveguides, Ncore, Nclad, and rcore may be treated as fitting parameters. Note that if the field wavelength is cut-off (i.e., there is no guided mode at the requested wavelength and mode indices), OptSim will return a field value of zero at all points.

Figure 4 illustrates LP01, LP11, and LP21 modes. The core radius is 3 microns, the core index is 3.5, and the cladding index is 3.4. As can be seen, the LP01 mode is very similar to a Gaussian mode shape. The other two profiles are often used to describe non-uniform donut modes.

Page 407: 39865643 Optsim Guide

OptSim User Guide Chapter 10: Multimode Simulations: Transverse Mode Profiles •••• 397

Figure 4: Plots of LP modes at 850-nm for a waveguide with 3-micron core radius, 3.5 core index, and 3.4 cladding index. Clockwise from the upper left: LP01, LP11, LP21.

10.8 Troubleshooting There are several common pitfalls that arise with multimode simulation that we will attempt to address here. Because multimode simulation requires the analysis of both the temporal and the spatial aspects of optical fields, simulations can consume vast amounts of memory and time. In fact, the majority of problems are related to these two areas.

Problem: My spatial simulations are taking too long.

Solution: Reduce the domain size, increase the grid spacing, or lower the accuracy settings.

Discussion: OptSim describes spatial fields in a number of ways, as seen in the Transverse Mode Profiles portion of the documentation. Key to this description are two quantities: the domain and the grid spacing.

Domain The domain describes the area over which the spatial field is valid. Strictly speaking, the field is still defined outside the domain; however, most spatial calculations are performed only over the domain region. Often, the domain is set to an excessively large value. Graphically, this manifests itself as a spatial field surround by a lot of zeros (Figure 5).

Page 408: 39865643 Optsim Guide

398 •••• Chapter 10: Multimode Simulations: Transverse Mode Profiles OptSim User Guide

Figure 5: Excessively large domain (±50 µm in both the x and y directions).

When the field is described numerically (e.g., a gridded field), oversizing the domain can result in a waste of memory as thousands of zeros are repetitively stored. It also wastes computing resources as thousands of needless calculations are performed on field values with null values. There are several ways to overcome this problem. The most obvious is to manually reduce the domain. All of the optical source models have settings to override the default domain. The impact of this override can be viewed with the Test function.

Optical Source Spatial Domain Parameters Spatial_Modes : spatial_effects on Spatial_Modes : mode_default_domain no Spatial_Modes : mode_width_x 40 Spatial_Modes : mode_ width_y 40

Similarly, the multimode fiber domain can be adjusted when the model is used in the analytical mode. This serves to specify the region over which all of the fiber’s transverse spatial modes are defined.

Multimode Fiber Spatial Domain Parameters General : spatial_effects on General : operational_mode analytical Spatial_Modes : mode_default_domain no Spatial_Modes : mode_width_x 25 Spatial_Modes : mode_ width_y 25

Figure 6 depicts the same field as Figure 5 with the domain reduced:

Figure 6: Reduced domain.

The free-space propagation component of the spatial coupler model sometimes creates output fields with unreasonably large domains. For this reason, the spatial coupler model includes a parameter reduce_field that scans the periphery of a spatial field and progressively strips off zeros. Beware, however, that because this operation is performed on a point-by-point basis, it can sometimes be more time consuming than simply allowing the simulation to run to completion with the oversized domain.

Grid Spacing

Page 409: 39865643 Optsim Guide

OptSim User Guide Chapter 10: Multimode Simulations: Transverse Mode Profiles •••• 399

Another problem arises when the grid spacing is set too finely. Because simulations must perform calculations numerically, transverse field profiles must be defined on a numerical grid. The accuracy of a calculation is largely a function of the spacing between grid points. When a field is described analytically (e.g., Laguerre-Gaussian modes), the grid spacing describes the points at which the analytical formulation is sampled. As expected, the smaller the spacing between grid points, the longer a simulation will take to complete. Unfortunately, this is an example of the classic trade-off between speed and accuracy. While the multimode models attempt to determine an appropriate grid spacing by default, the user has the option to manually increase or decrease these values as he sees fit. The optical source and multimode fiber models have the following parameters that can be set as required:

Optical Source Grid Spacing Parameters Spatial_Modes : spatial_effects on Spatial_Modes : mode_default_grid no Spatial_Modes : mode_dx 0.25 Spatial_Modes : mode_ dy 0.25

Multimode Fiber Grid Spacing Parameters General : spatial_effects on General : operational_mode analytical Spatial_Modes : mode_default_grid no Spatial_Modes : mode_dx 0.25 Spatial_Modes : mode_ dy 0.25

Figure 7 depicts the same field with two different grid settings.

Figure 7: Grid spacing set to 3 microns (left), 1 micron (right).

Finally, many of the multimode models have an accuracy parameter that can be set to low, medium, or high. A low setting will produce coarse results, but they will be produced very quickly. A high setting has the opposite effect. Figure 8 shows the spatial analyzer model used in plot_type=total mode, using both the low and high settings, while Figure 9 shows the encircled flux model with various accuracy settings.

Page 410: 39865643 Optsim Guide

400 •••• Chapter 10: Multimode Simulations: Transverse Mode Profiles OptSim User Guide

Figure 8: Spatial plot with accuracy=low (left), accuracy=high (right).

Figure 9: Encircled flux plot with accuracy=low (left), accuracy=high (right). Notice the smoother curved areas on the right.

Problem: I am getting error and/or warning messages related to memory allocation or virtual memory.

Page 411: 39865643 Optsim Guide

OptSim User Guide Chapter 10: Multimode Simulations: Transverse Mode Profiles •••• 401

Figure 10: Some representative memory error/warning messages.

Solution: If the error/warning is coming from the Windows operating system itself (e.g., Figure 10, top), try increasing the amount of virtual memory or add additional RAM. Virtual memory can be increased on the Windows platform through the following sequence using the Start menu:

Start->Settings->Control Panel->System->Advanced->Performance Options->Change

The Initial Size and Maximum Size fields should be increased.

If the the error/warning is coming from OptSim (Figure 10, bottom), try the above as well. If the error persists, it is likely that you have completely exhausted your maximum virtual memory allocation. If you receive a memory-related error and are in doubt about its origin, please contact RSoft Design Group.

Discussion: The spatial calculations performed by OptSim are very memory intense. Reasonable results can be obtained by restricting the domain and grid spacing, as discussed in the previous section. However, sometimes this is not an option, and access to more virtual memory than Windows allocates by default is required.

Problem: My graphs look “grainy” or “jagged.”

Solution: Increase the accuracy setting in the appropriate models. If this does not help, then it is possible that the fields themselves are intrinsically “grainy.” In this case, reducing the grid spacing should improve matters.

Problem: I am getting warning messages telling me to use CW optical sources.

Solution: The encircled flux and spatial analyzer models require CW sources under certain conditions. Refer to the model documentation for an in-depth explanation.

Problem: The overfilled launch spatial field option in the optical source models takes extremely long to load.

Solution: Set the mode_default_grid_spacing to no and increase the grid spacing mode_dx and mode_dy.

Problem: I don’t like the default color scheme of my field plots.

Solution: Please see the Appendix below on Color Scales.

10.9 Appendix: Color Scales Color scale files provide a means to customize data presentation using RSoft products. All RSoft products, including OptSim and ModeSYS, are capable of producing large amounts of data, and choosing which data to present, and how to present it according to needs and taste is an important issue.

Page 412: 39865643 Optsim Guide

402 •••• Chapter 10: Multimode Simulations: Transverse Mode Profiles OptSim User Guide

Scale files are located in the directory <rsoft_dir>\RLOTDIR). Several default scale files are included, as well as several example files. You can also create and add your own custom files.

10.9.1 What are Scale Files? A scale file is a color lookup table which is used to graphically display 2D data sets. It has three main components: a data range, a color lookup table, and a color shades value.

Figure 11: A simple fiber mode profile as seen in WinPLOT, along with the default scale file used by OptSim (block mode) and

ModeSYS to display field profiles.

Data Range Each color scale is defined for a specific range. For example, most default color scales in OptSim (block mode), ModeSYS and BeamPROP have a range of [0,1], and FullWAVE a range of [-1,1]. The scale file used to display the fiber mode shown in Figure 11 is defined over a range of [0,1]. The scale is set by the highest and lowest values in the first column. The rest of the numbers serve as documentation of the value range of each color.

Note that a numerical value which lies outside the defined range of a scale file will be plotted with a default color. For values which are greater than the defined range, White is used, and for values which are less than the defined range, Black is used.

Color Lookup Table Along with a data range, a color scale file also includes a color lookup table. The range for each color step equals the total range of the scale file divided by the number of rows, or color steps, minus one. Each color is then active when the plot value is in the incremental range for that row. For example, an 11 row scale between 0 and 1 would have 10 color ranges plus a color for the value 1, or a different color for 0-0.1, 0.1-0.2, 0.2-0.3, …0.9-1, and 1. The color scale shown in Figure 11 is defined by 6 colors, and assigns the color Magenta to the range 0.0-0.2, Blue to the range 0.2-0.4, …, and Red to the value 1.0.

Note that the maximum number of color steps is 101.

Page 413: 39865643 Optsim Guide

OptSim User Guide Chapter 10: Multimode Simulations: Transverse Mode Profiles •••• 403

Color Shades Upon close examination of the colors shown in Fig. 11, it may seem that they do not agree with the definition of the Color Lookup Table above, but, in fact, the program is blending the colors together. This effect is achieved through the use of Color Shades. This setting is not contained in the scale file, but can be set for each plot individually.

The Color Shades number sets the number of interpolated points between each defined color. For example, setting this option equal to 4 results in 4 color points interpolated between each defined color point. This option can be very useful for reducing display related CPU usage during simulations, especially for slower systems. Fig. 12 shows the effect of changing the color scale number. More details about how to define this parameter will be given later on in this document when the usage of scale files is discussed.

Figure 12: Effect of the color shade number. a) Color shades = 1 b) Color shades = 4 c) Color shades = 32.

10.9.2 Using Color Scales There are three ways to change the scale file or color shades used to render a multi-color plot:

Setting the scale file during a simulation You can change the scale file used to render contour plots shown in a simulation window by first accessing the Simulation Parameters window, clicking on the Display… button, clicking the Scale File… button, and then choosing the desired scale file. Note that you can also directly type in the scale file name. Also, you cannot change the scale file used for a XY Contour plot.

To set the number of color shades used, use the Color Shades field in the Display Properties box.

Changing the scale file after a simulation has completed You can change the scale file used to display computed results in a completed simulation window by choosing View/Display/Options/Color Scale from the pull-down menu, and then selecting the desired scale file. Note that you cannot change the number of color shades used after a simulation has completed.

Changing the scale file in a WinPLOT window. To change the scale file used to display data in a WinPLOT window, first open a saved plot. This can be done via the View Graphs icon in the CAD interface or through your computers OS (Windows, Linux, etc). Once the plot is opened, select Options/3D Data Display/Options/Color Scale from the pull-down menu, and choose the desired .scl file. To make this change permanent, you should save the file after making the change.

You can change the number of color shades used by selecting Options/3D Data Display/Options/Color Shades.

Note: For advanced users, you can make these changes directly in the Edit Window. Use the ‘/cscl“FILE”’ command to se the color scale, and the ‘/cnum#’ command to set the color shades. If you want more information about WinPLOT commands, please consult the WinPLOT manual.

Page 414: 39865643 Optsim Guide

404 •••• Chapter 10: Multimode Simulations: Transverse Mode Profiles OptSim User Guide

10.9.3 Scale File Format Several color scale files are included in the RSoft distribution. The user can utilize these files for data presentation, or create customized scale files. Scale files are text based files which can be created/modified in any text editor, and should be saved in directory <rsoft_dir>\RPLOTDIR.

A scale file consists of several rows of number/color combinations. The number of rows determines the number of color steps in the scale. The scale file format is:

Min Value Color

.

.

Max Value Color

The first column contains the range information, and the second column contains the color lookup information. As stated before, the range information is only specified by the first and last line, or min and max value. The other numbers only serve to document the color ranges. There are two ways to specify the color information in a scale file:

Using Predefined Color Keywords You can use one of several predefined keywords to specify a color in a scale file. The color keywords currently recognized are shown in Fig. 13.

Figure 13: The predefined color keywords currently recognized with their corresponding RGB values.

An example of this type of color scale is the OptSim (block mode) and ModeSYS default scale shown in Fig. 11.

Using RGB Values If a color you wish to use is not defined be a color keyword, you can directly input RGB values for the desired color. The values accepted range from 0 to 255. The first column is the R value, the second the G value, and the third the B value.

Example: The scale file fireice.scl, which is included in the distribution, is defined via RGB values.

Page 415: 39865643 Optsim Guide

OptSim User Guide Chapter 10: Multimode Simulations: Transverse Mode Profiles •••• 405

Figure 14: The color scale file fireice.scl which is defined through the use of RGB values. This file can be found in the directory <rsoft_dir>/RPLOTDIR.

10.9.4 Additional Example A color scale file can be used to create a line contour plot. An example of a line contour plot is shown in Fig. 15. To create this plot, a scale file with 101 color ranges was used. Most ranges are defined by the color White, but a few, namely [0,.01], [.10,.11], [.20,.21], etc. are set to the color Black. Therefore only field values which lie in these color ranges will be displayed in black, and the remaining values will be displayed in white. This color scheme results in the desired line contour plot.

Figure 15: A simple fiber mode profile displayed as a line contour plot along with the color scale file used.

Page 416: 39865643 Optsim Guide

406 •••• Chapter 10: Multimode Simulations: Transverse Mode Profiles OptSim User Guide

10.10 References [1] A. E. Siegman, Lasers (University Science Books, Sausolito, 1986).

[2] S. A. Riyopoulos, D. Dialetis, J. Liu, and B. Riely, “Generic representation of active cavity VCSEL eigenmodes by optimized waist Gauss-Laguerre modes,” IEEE Journal on Selected Topics in Quantum Electronics, 7, 312 (2001).

[3] V. N. Morozov, J. A. Neff, and H. Zhou, “Analysis of vertical-cavity surface-emitting laser multimode behavior,” IEEE Journal of Quantum Electronics, 33, 980 (1997).

[4] G. C. Wilson, D. M. Kuchta, J. D. Walker, and J. S. Smith, “Spatial hole burning and self-focusing in vertical-cavity surface-emitting laser diodes,” Applied Physics Letters, 64, 542 (1994).

[5] J. Dellunde, M. C. Torrent, J. M. Sancho, and K. A. Shore, “Statistics of transverse mode turn-on dynamics in VCSEL’s,” IEEE Journal of Quantum Electronics, 33, 1197 (1997).

[6] P. V. Mena, J. J. Morikuni, S.-M. Kang, A. V. Harton, and K. W. Wyatt, “A comprehensive circuit-level model of vertical-cavity surface-emitting lasers,” Journal of Lightwave Technology, 17, 2612 (1999).

[7] M. S. Sodha and A. K. Ghatak, Inhomogeneous Optical Waveguides (Plenum Press, New York, 1977).

[8] B. E. A. Saleh and M. C. Teich, Fundamentals of Photonics (John Wiley & Sons, New York, 1991).

Page 417: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 407

Chapter 11: Block Mode User Models

Users may add their own block-mode models that are directly called by OptSim. This chapter discusses the programming interface and the procedure for creating and using dynamically linked libraries for these block-mode user models.

11.1 Overview Block-mode user models may be created and added to the OptSim environment for use in simulations in concert with OptSim’s provided models. This is done by performing the following steps:

• writing the model executable in C++ and compiling it into a dynamic link library

• defining the model parameters in a text file (*.DTA file)

• using the model within OptSim via the block-mode CCE component

User models accept the defined component parameters and input signal data from OptSim and return the output signal data back to OptSim. These data are provided in data structures defined in the lsuser.h header file, which can be found in the subdirectory /products/optsim/block_mode/usermod of the RSoft installation directory along with the user model library file.

11.2 Header/Library Files In the directory /products/optsim/block_mode/usermod of the RSoft installation directory, header and library files are provided for use in creating user models. The file lsuser.h is the main header file which must be included in any C++ source file which accesses the OptSim environment as a block-mode user model. This file defines data structures which are passed between OptSim and the model, as well as function prototypes for working with these data structures. The files lsuser.lib, ls_intermed.lib, ls_sigs.lib, and ls_symtab.lib (lsuser.a, ls_intermed.a, ls_sigs.a, and ls_symtab.a on UNIX systems) are the main library files which must be linked with any C++ program which accesses the OptSim environment.

The header and library files are subject to revision by RSoft Design Group, and new releases of OptSim may come with revised user model files which reflect internal changes and enhancements to OptSim. To be consistent with these internal changes, all user models should be recompiled whenever there is a change in the header and/or library user model files.

Page 418: 39865643 Optsim Guide

408 •••• Chapter 11: Block Mode User Models OptSim User Guide

11.3 Calling Conventions There are four functions which may be provided for each user model: the model function, the initialization function, the cleanup function, and the test function. The model function is the routine which performs the simulation of the model. The initialization function is called at the beginning of a simulation to initialize the model for the simulation. The cleanup function is called after the simulation completes to allow the model to clean up any static memory. The test function is the routine which is called when the Test button is pressed in the component parameter dialog. This routine is designed to test the parameters and show the user some results which indicate the model's behavior using the given parameters. The user must decide what this function should do, as each model may have different test output.

The calling convention for all of the model functions is as follows: LS_Export short UserExtMod(SimData *simdata, ComponentData *compdata, Nodelist

*innodes, Nodelist *outnodes, char *&msg)

The user model should return a short value, which is the error status of the model's execution. The enumerated values NOERROR, WARNING, and YESERROR are used to define the error status at the function's exit.

LS_Export is specified at the beginning of the line to tell the compiler and linker to export the command in the DLL file so that OptSim can access it.

The name of the function must be unique among all user models. In the above example, this is given as UserExtMod, but it must actually be given a name that uniquely identifies the model executable routine provided by the user and ends in the appropriate suffix depending on what type of routine it is. The model entry routine ends in "_entry", the model test routine ends in "_test", the model initialization routine ends in "_init", and the model cleanup routine ends in "_cleanup".

The first parameter passed into the function is a pointer to a collection of information about the simulation. Class functions are provided as defined in lsuser.h to obtain information about the simulation through this pointer.

The second parameter passed into the function is a pointer to a collection of information about the component. Class functions are provided in OptSim as defined in lsuser.h for the user model to use to access information about the component, such as parameters, through this pointer.

The third parameter passed into the function is a linked list of "nodes", also known as "ports." These are the input ports into the model. At each port, an input signal may be present. The input signals may be of different types, and the type is specified by the Nodelist structure. The signal data structures are documented in the lsuser.h file. The user model must not modify or delete any of the signal or node structures passed into it from OptSim. The user model may copy the data from these structures into temporary working structures which it should delete prior to exit, or it may use the provided library functions to copy the input signal data to the output ports and operate on the output signal data.

The fourth parameter passed into the function is a second linked list of "nodes", also known as "ports." These are the output ports of the model. At each port, a space to hold a pointer to an output signal is provided. Each output signal must be created by the user model using one of the functions provided by OptSim. The signal data structures are documented in the lsuser.h file. The type of signal expected at the output is also specified in the Nodelist structure. If the user model is designed to operate on and produce different types of signals depending on the input signal types or the parameters set by the user, the output signal type may be different than that specified by the Nodelist structure. In that case, the user model must reset the signal type field of the Nodelist structure.

The fifth and final parameter is a pointer to a character array. This is used by the user model to pass error and warning messages back to OptSim after the simulation. If there is no error or warning message, it should return with a NULL pointer. If there is a message to be returned, the address of the static memory holding the message should be returned. For example, the following code segments may be used to pass error messages back to OptSim:

msg = "ERROR: improper input signal format\n";

or

static char returnmessage[255];

Page 419: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 409

sprintf(returnmessage, "ERROR: value is %g, should be less than %g\n", value1, value2);

msg = returnmessage;

11.4 Library Functions OptSim provides a number of functions for the block-mode user model routines to use. This section lists those routines, and gives instructions on their use. The routines for accessing parameters are described in the Parameters section of this chapter.

• Class SimData::InitUserModelInterface void InitUserModelInterface(void);

This function must be called at the start of the execution of the user routine. It initializes the user model interface so that the routines provided by OptSim may be used by their convenient prototypes as defined in the lsuser.h file and described in this section.

• Class SimData::StopRequested short StopRequested(void);

This function should be called periodically by models which may take more than a fraction of a second to complete their simulation in any circumstances. If the user has pressed the Stop button or requested the simulation to stop, this function will return true. Otherwise, it will return false.

• Class SimData::PlottingMode short PlottingMode(void);

This function should be called by models which produce plots. It returns the state of the plotting mode selection at the start of the simulation: DONOTPLOT, PLOTTOFILESONLY, DISPLAYALLPLOTS, or USEPLOTICONSETTINGS.

• Class SimData::SimInProcess short SimInProcess(void);

This function should be called by model routines which need to know whether they were called by an active simulation or by the Test function for a model. A true value is returned if the model was called as part of an active simulation.

• Class SimData::StatisticalSweeping short StatisticalSweeping(void);

This function should be called by model routines which need to know whether they were called by an active simulation performing a statistical simulation or not. A true value is returned if the model was called during a statistical sweeping simulation run.

• Class SimData::AppendModelMessage void AppendModelMessage(const char *);

This function allows the model to pass back an arbitrary string to OptSim such as an error or warning message. If this function is used, then no messages should be passed back to OptSim via the msg pointer.

• Class SimData::DisplayPlots short DisplayPlots(short save_or_display_plots);

This function should be called by model routines which need to know whether they should display plots or not. The correct plotting mode is returned based on the simulation option setting and the component icon setting (passed in as the variable save_or_display_plots). The returned value is one of the enumerated types DO_NOT_PLOT=0, PLOT_TO_FILES_ONLY, DISPLAY_ALL_PLOTS, USE_PLOT_ICON_SETTINGS.

Page 420: 39865643 Optsim Guide

410 •••• Chapter 11: Block Mode User Models OptSim User Guide

• Class ComponentData::SetLocalData void SetLocalData(void *newlocaldata);

This function should be called by model initialization routines which are setting aside static memory to be used by the model at each call during the course of the simulation run. This stores the address pointer of a piece of static memory so that calls to other routines which operate on this component data (such as the model routine and the cleanup routine) can utilize the static memory. The static memory may be any size and in any structure defined by the model.

• Class ComponentData::GetLocalData void *GetLocalData(void);

This function should be called by the model routine and cleanup routine when it is desired to access static memory created and stored by the initialization routine.

• Class ComponentData::GetName const char *GetName(void);

This function returns the user defined name of the component being simulated.

• Class ComponentData::GetType const char *GetType(void);

This function returns the component model type of the component being simulated. This is especially useful for routines which are shared between different model types to determine which model type is being simulated.

• Class ComponentData::ParameterExists short *ParameterExists(const char *name);

This function returns a value of true if the given parameter name exists for the current component. Otherwise, it will return a value of false.

• Class ComponentData::GetParamDouble double GetParamDouble(const char *name, double dflt);

This function returns a double value representing the current value of the named parameter. If the named parameter cannot be found in the component’s data structure, the default value (dflt) is returned.

• Class ComponentData::GetParamInt int GetParamInt(const char *name, int dflt);

This function returns an integer value representing the current value of the named parameter. If the named parameter cannot be found in the component’s data structure, the default value (dflt) is returned.

• Class ComponentData::GetParamString const char *GetParamString(const char *name, const char *dflt);

This function returns a string representing the current value of the named string parameter. If the named parameter cannot be found in the component’s data structure, the default value (dflt) is returned.

• Class ComponentData::GetParamEnum const char *GetParamEnum(const char *name, const char *dflt);

This function returns a string representing the current value of the named enumerated parameter. If the named parameter cannot be found in the component’s data structure, the default value (dflt) is returned.

• Class ComponentData::AddPlotRef short AddPlotRef(const char *filename, short plottype, const char *command, const SimData *simdata);

Page 421: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 411

This function adds a plot reference to the component specifying the name of the file which contains the plot, the plot type (0 = WinPlot, 1 = text file, 2 = other), the system command to use to view the plot if it is of type ‘other’, and a pointer to the SimData structure. The plot reference is necessary so that users can double-click on the icon in the topology editor after the simulation to view the plots created during the simulation.

• Class ComponentData::UpdatePlotRef short AddPlotRef(const char *filename, short plottype, const char *command, const SimData *simdata);

This function updates a plot reference in the given component with the given filename. The updated fields include the plot type, the system command to use to view the plot if it is of type ‘other’, and associated simulation data including sweep iteration and loop numbers.

• Class ComponentData::ClearPlotRefs void ClearPlotRefs(void);

This function clears all the plot references stored on the current component.

• FindFullSimFilename void FindFullSimFilename(const SimData *simdata, char *newfilename,

const char *filenamebase);

This routine should be used if it is desired to create a filename to use to write plot or simulation result files. In the char array newfilename, a filename is copied and returned to the user which consists of the simulation prefix, the given filenamebase, and suffixes for the iteration and loop numbers.

• SetStatusLineText void SetStatusLineText(const char *msg);

This routine allows the user model to display text on the status line of the graphical user interface.

• LS_SimLog void *LS_SimLog(const char *format, …);

This routine allows the user model to write entries into the simulation log which is accessible from the user interface. Routines called via the Test function should use the LS_TopLog command below.

• LS_TopLog void *LS_TopLog(const char *format, …);

This routine allows the user model to write entries into the topology editor log which is accessible from the user interface. This is primarily intended for routines which are called via the Test function for the model.

• LS_debug void *LS_debug(const char *format, …);

This routine allows the user model to write entries to a debugging log file named “log.txt” located in the same directory as the topology file. Note that this log file is separate from the simulation and topology log files.

• CreateBinSig int CreateBinSig(BinSig **newBinSig, int noPoints);

This routine creates a new BinSig structure which represents a binary signal with noPoints values in the sequence, and sets the provided newBinSig pointer to point to it. The structure holds an array of binary values of a length equal to the noPoints parameter value. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateBinSigFromElecSig int CreateBinSigFromElecSig(BinSig **newBinSig, ElecSig *esin);

Page 422: 39865643 Optsim Guide

412 •••• Chapter 11: Block Mode User Models OptSim User Guide

This routine creates a new BinSig structure which represents a binary signal that corresponds to the sequence length of the provided digital electrical signal structure, and sets the provided newBinSig pointer to point to it. Whenever a user model converts an input electrical signal to an output binary signal, this routine should be used to create the output binary signal structure. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateBinSigFromOpSig int CreateBinSigFromOpSig(BinSig **newBinSig, OpSig *osin);

This routine creates a new BinSig structure which represents a binary signal that corresponds to the sequence length of the provided digital optical signal structure, and sets the provided newBinSig pointer to point to it. Whenever a user model converts an input optical signal to an output binary signal, this routine should be used to create the output binary signal structure. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• DestroyBinSig int DestroyBinSig(BinSig **orgBinSig);

This routine frees the memory used by the given binary signal structure (BinSig). The user routine should never destroy an input signal structure provided by OptSim in the list of input ports. If there is an error destroying the structure, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyBinSig int CopyBinSig(BinSig *orgBinSig, BinSig **newBinSig);

This routine creates a new BinSig structure and copies the binary signal in the given BinSig structure into it. The copied structure is identical in content to the original structure. If there is an error creating or copying the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateElecSig int CreateElecSig(ElecSig **newElecSig, int noPoints);

This routine creates a new ElecSig structure which represents an electrical signal with noPoints complex values, and sets the provided newElecSig pointer to point to it. The structure holds an array of complex values of a length equal to the noPoints parameter value. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateElecSigFromBinSig int CreateElecSigFromBinSig(ElecSig **newElecSig, BinSig *bsin, int samplesperbit);

This routine creates a new ElecSig structure which represents an electrical signal that corresponds to the sequence length of the provided binary signal structure and the specified number of samples per bit. It sets the provided newElecSig pointer to point to the new structure. Whenever a user model converts an input binary signal to an output electrical signal, this routine should be used to create the output electrical signal structure. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateElecSigFromOpSig int CreateElecSigFromOpSig(ElecSig **newElecSig, OpSig *osin);

This routine creates a new ElecSig structure which represents an electrical signal that corresponds to the sequence length of the provided optical signal structure. It sets the provided newElecSig pointer to point to the new structure. Whenever a user model converts an input optical signal to an output electrical signal, this routine should be used to create the output electrical signal structure. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

Page 423: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 413

• DestroyElecSig int DestroyElecSig(ElecSig **orgElecSig);

This routine frees the memory used by the given electrical signal structure (ElecSig). The user routine should never destroy an input signal structure provided by OptSim in the list of input ports. If there is an error destroying the structure, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyElecSig int CopyElecSig(ElecSig *orgElecSig, ElecSig **newElecSig);

This routine creates a new ElecSig structure and copies the electrical signal in the given ElecSig structure into it. The new structure is pointed to by the newElecSig pointer, and is identical in content to the original structure. If there is an error creating or copying the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• ReSizeElecSig int ReSizeElecSig(ElecSig *orgElecSig, int noPoints);

This routine resizes the length of the given electrical signal by creating new complex arrays of length noPoints for the signal data and noise data and replacing the existing arrays with it. If there is an error creating the new arrays, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateOpSig int CreateOpSig(OpSig **newOpSig, int noPoints);

This routine creates a new OpSig structure which represents an optical signal with noPoints complex values, and sets the provided newOpSig pointer to point to it. The structure holds an array of complex values of a length equal to the noPoints parameter value. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateOpSigEy int CreateOpSigEy(OpSig *orgOpSig);

This routine creates a complex array representing the y polarization state of an optical signal and adds it to the given OpSig structure. This is necessary if it is desired to represent a signal with a polarization state other than x only. If there is an error creating the Ey array, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateOpSigFromElecSig int CreateOpSigFromElecSig(OpSig **newOpSig, ElecSig *esin);

This routine creates a new OpSig structure which represents an optical signal that corresponds to the sequence length of the provided electrical signal structure. It sets the provided newOpSig pointer to point to the new structure. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateOpSigFromBinSig int CreateOpSigFromBinSig(OpSig **newOpSig, BinSig *bsin, int samplesperbit);

This routine creates a new OpSig structure which represents an optical signal that corresponds to the sequence length of the provided binary signal structure and the specified number of samples per bit. It sets the provided newOpSig pointer to point to the new structure. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• DestroyOpSig int DestroyOpSig(OpSig **orgOpSig);

This routine frees the memory used by the given optical signal structure (OpSig). If the given optical signal structure represents a single wavelength signal in a multiwavelength signal array, only the given

Page 424: 39865643 Optsim Guide

414 •••• Chapter 11: Block Mode User Models OptSim User Guide

wavelength signal structure is destroyed, and the remaining wavelengths are left in the WDM optical signal structure. The user routine should never destroy an input signal structure provided by OptSim in the list of input ports. If there is an error destroying the structure, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• DestroyAllOpSig int DestroyAllOpSig(OpSig **orgOpSig);

This routine frees the memory used by the given optical signal structure (OpSig). The given optical signal structure should be the first structure in a multiwavelength signal array. The entire WDM signal structure is destroyed by this routine. The user routine should never destroy an input signal structure provided by OptSim in the list of input ports. If there is an error destroying the structure, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyOpSig int CopyOpSig(OpSig *orgOpSig, OpSig **newOpSig);

This routine creates a new OpSig structure and copies the optical signal in the given OpSig structure into it. The new structure is pointed to by the newOpSig pointer, and is identical in content to the original structure. This routine only copies a single wavelength signal, even if it is part of a multiwavelength signal array. If there is an error creating or copying the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyAllOpSig int CopyAllOpSig(OpSig *orgOpSig, OpSig **newOpSig);

This routine creates a new OpSig structure and copies the optical signal in the given OpSig structure into it. The new structure is pointed to by the newOpSig pointer, and is identical in content to the original structure. The given orgOpSig pointer must point to the first signal structure in a WDM signal array. This routine copies the entire multiwavelength signal array. If there is an error creating or copying the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• ReSizeOpSig int ReSizeOpSig(OpSig *orgOpSig, int noPoints);

This routine resizes the length of the given optical signal by creating a new complex array of length noPoints for each of the polarization states and replacing the existing arrays with it. If there is an error creating the new arrays, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreatePowerSpectrum int CreatePowerSpectrum(PowerSpectrum **newPowerSpectrum, int noPoints);

This routine creates a new PowerSpectrum structure which may represent the ASE noise of an optical signal with noPoints real values, and sets the provided newPowerSpectrum pointer to point to it. The structure holds an array of real values of a length equal to the noPoints parameter value. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• DestroyPowerSpectrum int DestroyPowerSpectrum (PowerSpectrum **origPowerSpectrum);

This routine destroys and frees the memory of a PowerSpectrum data structure. Only the given PowerSpectrum array is destroyed, and any others which it may point to are not destroyed. The user routine should never destroy a power spectrum structure provided by OptSim in the list of input ports. If there is an error destroying the structure, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• DestroyAllPowerSpectrum

Page 425: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 415

int DestroyAllPowerSpectrum (PowerSpectrum **origPowerSpectrum);

This routine destroys and frees the memory of all the PowerSpectrum data structures in the given list. The routine should be called with a pointer to the pointer of the first PowerSpectrum structure in the list. The user routine should never destroy a power spectrum structure provided by OptSim in the list of input ports. If there is an error destroying the structure, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyPowerSpectrum int CopyPowerSpectrum(PowerSpectrum *origPowerSpectrum,

PowerSpectrum **newPowerSpectrum);

This routine creates a new PowerSpectrum structure and copies the power spectrum in the given PowerSpectrum structure into it. The new structure is pointed to by the newPowerSpectrum pointer, and is identical in content to the original structure. This routine only copies a single power spectrum, even if it is part of a list of power spectrum structures. If there is an error creating or copying the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyAllPowerSpectrum int CopyAllPowerSpectrum (PowerSpectrum *origPowerSpectrum,

PowerSpectrum **newPowerSpectrum);

This routine creates a new PowerSpectrum structure and copies the power spectra in the given PowerSpectrum structure into it. The new structure is pointed to by the newPowerSpectrum pointer, and is identical in content to the original structure. The given origPowerSpectrum pointer must point to the first power spectrum structure in the list. This routine copies the entire list of PowerSpectrum structures. If there is an error creating or copying the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateOpSigExt int CreateOpSigExt (OpSigExt **newOpSigExt, int noPoints);

This routine creates a new OpSigExt structure which represents an optical signal with noPoints complex values, and sets the provided newOpSigExt pointer to point to it. The signal structure holds an array of complex values of a length equal to the noPoints parameter value. It also sets the pointer to the ASE noise spectra to NULL. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateOpSigExtNull int CreateOpSigExt (OpSigExt **newOpSigExt);

This routine creates a new OpSigExt structure which represents an optical signal with no OpSigs (signal structures) attached, and sets the provided newOpSigExt pointer to point to it. It also sets the pointer to the ASE noise spectra to NULL. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateOpSigExtFromBinSig int CreateOpSigExtFromBinSig (OpSigExt **newOpSigExt, BinSig *bsin, int samplesperbit);

This routine creates a new OpSigExt structure which represents an optical signal that corresponds to the sequence length of the provided binary signal structure and the specified number of samples per bit. It sets the provided newOpSigExt pointer to point to the new structure. The ASE noise spectra pointer is set to NULL. Whenever a user model converts an input binary signal to an output optical signal, this routine should be used to create the output optical signal structure. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CreateOpSigExtFromElecSig int CreateOpSigExtFromElecSig (OpSigExt **newOpSigExt, ElecSig *esin);

Page 426: 39865643 Optsim Guide

416 •••• Chapter 11: Block Mode User Models OptSim User Guide

This routine creates a new OpSigExt structure which represents an optical signal that corresponds to the sequence length of the provided electrical signal structure. It sets the provided newOpSigExt pointer to point to the new structure. The ASE noise spectra pointer is set to NULL. Whenever a user model converts an input electrical signal to an output optical signal, this routine should be used to create the output optical signal structure. If there is an error creating the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• DestroyOpSigExt int DestroyOpSigExt (OpSigExt **origOpSigExt);

This routine frees the memory used by the given extended optical signal structure (OpSigExt). The entire WDM signal structure including all OpSig and ASE noise PowerSpectrum structures is destroyed by this routine. The user routine should never destroy an input signal structure provided by OptSim in the list of input ports. If there is an error destroying the structure, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyOpSigExt int CopyOpSigExt (OpSigExt *orgOpSigExt, OpSigExt **newOpSigExt);

This routine creates a new OpSigExt structure and copies the optical signal in the given OpSigExt structure into it. The new structure is pointed to by the newOpSigExt pointer, and is identical in content to the original structure. This routine copies the entire multiwavelength signal array, including all optical signal OpSig and ASE noise PowerSpectrum structures. If there is an error creating or copying the structure, such as an out of memory error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyLogicalInfoOpSigToElecSig int CopyLogicalInfoOpSigToElecSig(OpSig *osin, ElecSig *esin);

This routine copies the logical signal information (such as bit rate, binary sequence pattern length, etc.) from the given optical signal to the given electrical signal. If there is an error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyLogicalInfoElecSigToOpSig int CopyLogicalInfoElecSigToOpSig(ElecSig *esin, OpSig *osin);

This routine copies the logical signal information (such as bit rate, binary sequence pattern length, etc.) from the given electrical signal to the given optical signal. If there is an error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyLogicalInfoBinSigToElecSig int CopyLogicalInfoBinSigToElecSig(BinSig *bsin, ElecSig *esin);

This routine copies the logical signal information (such as bit rate, binary sequence pattern length, etc.) from the given binary signal to the given electrical signal. If there is an error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• CopyLogicalInfoBinSigToOpSig int CopyLogicalInfoBinSigToOpSig(BinSig *bsin, OpSig *osin);

This routine copies the logical signal information (such as bit rate, binary sequence pattern length, etc.) from the given binary signal to the given optical signal. If there is an error, the returned value is YESERROR. Otherwise, the returned value is NOERROR.

• iFreq int iFreq(int n, int iFFT);

This routine is useful for finding the frequency represented by a particular indexed value in the frequency domain signal representation which is the signal returned by the FFT routine after transforming a time domain signal into the frequency domain. In the frequency domain representation, the frequencies are not stored linearly. The input parameter n gives the total number of values in the signal array, while the

Page 427: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 417

parameter iFFT gives the index value of the frequency domain signal array whose frequency is desired. iFFT should range from 1 to n. The returned value ranges from -(n/2)+1 to (n/2). The returned value may be converted to frequency values by multiplying it by the frequency step of the frequency domain signal representation and adding the center frequency of the frequency domain signal representation, which is 0 for baseband signals. (df=1/dt/n where df is the frequency step between samples of the frequency domain representation, dt is the time step between samples of the time domain signal representation, and n is the total number of samples in both the time and frequency domain signal representations.)

• iFFT int iFFT(int n, int iFreq);

This routine is the inverse of the iFreq routine. This routine is useful for finding the index of a particular frequency component in the frequency domain signal representation which is the signal returned by the FFT routine after transforming a time domain signal into the frequency domain. In the frequency domain representation, the frequencies are not stored linearly. The input parameter n gives the total number of values in the signal array, while the parameter iFreq gives the frequency index value which corresponds to the desired index of the frequency domain representation. iFreq should range from -(n/2)+1 to (n/2). The returned value ranges from 1 to n. The frequency index value may be converted from absolute frequency values by subtracting the center frequency of the frequency domain representation (which is 0 for baseband signal representations) and dividing by the frequency step of the frequency domain signal representation. (df=1/dt/n where df is the frequency step between samples of the frequency domain representation, dt is the time step between samples of the time domain signal representation, and n is the total number of samples in both the time and frequency domain signal representations.)

• FFT int FFT(double data[], int n, int isign, int flags);

This routine performs an FFT of the input data. The data array should actually be an array of complex values indexed from 1 to n cast as a double array. This is the same as a double array of length 2(n+1), where the first two values are 0 (indexed as 0 and 1, but unused in practice), and the rest of the values are alternating between the real value and the imaginary value.

For optical signals, the isign value should be 1 for a forward transform to the frequency domain from the time domain, and -1 for an inverse transform from the frequency domain to the time domain. For electrical signals, the isign value should be -1 for a forward transform transform to the frequency domain from the time domain, and 1 for an inverse transform from the frequency domain to the time domain.

There are a number of flags which may be defined by OR'ing them together (with the | symbol) to perform specified functions in conjunction with the FFT. The flags are defined as follows:

• FFT_POW2:

This tells the FFT routine to only use the first values of the array which can be indexed from 1 to nn, where nn is the largest power of 2 less than or equal to n.

FFT_SWAP: This tells the FFT routine to swap the order of the values after the transform to put them in linear indexed order. If this is set in a forward transform, the frequency domain signal representation will have frequency index -(n/2)+1 at array index 1, and frequency index (n/2) at array index n.

FFT_NORM: This tells the FFT routine to normalize the values. If this is set in an inverse transform, the time domain signal representation will automatically be divided by n.

FFT_WINDOW: This tells the FFT routine to use a cosine window function while performing the FFT.

Page 428: 39865643 Optsim Guide

418 •••• Chapter 11: Block Mode User Models OptSim User Guide

11.5 Parameters The list of component parameters and values are part of the ComponentData class. The user model should copy the parameters into local user variables for use in performing the model simulation. The parameters are provided to the user model for reference, and should not be modified or deleted by the user model. The parameter types and methods to access their values are itemized in this subsection. The example user model provided with the OptSim distribution demonstrates the proper way to access the parameters.

• DoubleType doublevalue = compdata->GetParamDouble("parametername",1.0);

• IntType intvalue = compdata->GetParamInt("parametername", 1);

• StringType charpointer = compdata->GetParamString("parametername","DefaultString");

• EnumType charpointer =compdata->GetParamEnum("parametername","DefaultValue");

The above routines may be used to access the parameter values. The value of the parameter is returned by the function. If the parameter is not found in the list of parameters, the specified default value is returned instead.

The actual C++ prototypes for these commands may be viewed in the lsuser.h file.

11.6 Signals The primary function of a block-mode user model is to operate on the input signal data to produce output signal data which represents the effect of the component being modeled on the signal which passes through it.

There are three primary block-mode signal types in OptSim: the optical signal, the electrical signal, and the binary signal. These signal data types are defined in the lsuser.h header file. They are discussed in further detail below. The signal data are presented to the user model by pointers in the list of input "nodes" or "ports". These pointers are the sigList field of the NodelistStruct structure. The type of signal data which the port contains is indicated by the value of the signalType field of the NodelistStruct structure. The values which the input ports' signalType field may contain are as follows: OpSigType, which represents an optical signal; ElecSigType, which represents an electrical signal; BinSigType, which represents a binary signal; and NoSigType, which indicates that the port by definition contains no signal.

The output port structures which are provided by OptSim do not contain any signal data; however, the ports are marked with the type of signal data which they should be provided with. This is indicated by the value of the signalType field of the NodelistStruct structure. The values which the output ports' signalType field may contain are as follows: OpSigType, which represents an optical signal; ElecSigType, which represents an electrical signal; BinSigType, which represents a binary signal; OpOrElecSigType, which means that the port may either contain an electrical signal or an optical signal at the model's discretion; UnknownSigType, which means that the port may contain any signal type at the model's discretion; and NoSigType, which indicates that the port by definition contains no signal. Because of the fact that the signal type of the output signals may be determined by the model depending on the initial setting of the signalType field, it is necessary that the user model set the signalType field to one of the following when a signal structure is attached to an output port prior to the model's return of control to OptSim: OpSigType, ElecSigType, BinSigType, or NoSigType. It is important that the model only attach the allowed signal types to the output port depending on the initial setting of the signalType field for that port.

11.6.1 OpSigExt The optical signal is represented by the OpSigExt data structure, defined in lsuser.h.

Page 429: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 419

An optical signal can be represented in one of several ways. The first is as a single optical wavelength channel. The second is as a linked list of separate optical wavelength channels. The third is as a single frequency band representation of multiple channels at different wavelengths. The fourth is as a combination of the above. A WDM optical signal contains separately modulated optical carriers at different wavelengths. The frequency bands of these separately modulated carriers may be separated from each other by significant amounts. In this case, the memory and computational requirements of simulating them can be reduced by representing each of them by a separate baseband signal representation with a carrier frequency parameter. The result is a linked list of separate optical wavelength channels. The time domain representation of the signal in this case is the baseband modulation of the optical carrier. In this representation, however, four wave mixing between different channels in the fiber model is not accounted for. This is because four wave mixing involves the frequency bands between the optical channels. To account for four wave mixing in the optical fiber, the single frequency band representation of multiple channels at different wavelengths is required. This is accomplished by creating a single frequency band in the frequency domain which contains all the frequency components of each of the individual modulated optical carriers, and shifting the entire frequency band to the baseband with a "carrier" frequency which is the center of the single frequency band representation. The time domain representation of the signal in this case is not as convenient, as it contains all the frequency components of all the WDM channels. To properly view the time domain baseband modulated signal at any of the optical carriers in this representation, the single frequency domain signal must first be filtered to separate the desired carrier from the rest by an optical filter.

In the multiple frequency band representation, in which each modulated optical carrier is represented by a separate baseband signal structure with a carrier frequency parameter in a linked list, the wavelengths of the list are ordered in increasing wavelength order. The linked list of structures begins with the lowest value of the optical carrier wavelength, and increases to the highest value.

The signal waveform (in the time domain) is represented as a complex optical field in the baseband. The signal can be represented as a pure x polarization state, in which case the signal is stored in the x polarization array, and the y polarization array is not present. This allows increased computational efficiency when polarization effects are not desired in the simulation. If there is any y polarization state to the signal, the x polarization portion is in the x polarization array while the y polarization portion is in the y polarization array. Depending on how many polarization states are present, the data are stored in one or two arrays of complex numbers in the OpSig structure, each of which is indexed from 1 to n where n is the number of complex data points.

The ASE noise present in the signal is represented as an ASE noise spectra array, in the PowerSpectrum structure pointed to by the OpSigExt structure. The array is an evenly sampled noise spectra with the defined center wavelength and resolution.

The OpSigExt structure contains the following public fields and member functions, whose meaning and use are described below:

• opsigList

Pointer to the list of optical signal datas (OpSig structs)

• ASEnoise

Pointer to the ASE noise spectrum (PowerSpectrum struct)

• void incrementDistance(double &dist);

Increments the distance traveled by the optical signals. The distance is specified via dist.

The OpSig structure contains the following public fields and member functions, whose meaning and use are described below. Note that the bitRate and RIN fields from earlier versions of LinkSIM have been removed, and these values must now be accessed via the appropriate member functions:

• prev

Pointer to the data of the previous channel (NULL if this is the first or only channel)

• next

Pointer to the data of the next channel (NULL if this is the last or only channel)

Page 430: 39865643 Optsim Guide

420 •••• Chapter 11: Block Mode User Models OptSim User Guide

• noPoints

Number of complex data points in the signal

• Ex

Complex optical signal in the x polarization, units of W1/2

• Ey

Optional complex optical signal in the y polarization, units of W1/2

• tStep

Time step (sampling period) between adjacent data points, sec

• startTime

Time of first data point in the array, sec

• wavelength

Wavelength of the signal, m

• SpatialX

A pointer (of type SpatialField) to the x polarization’s transverse mode profile (for multimode-compatible models only)

• SpatialY

A pointer (of type SpatialField) to the y polarization’s transverse mode profile (for multimode-compatible models only)

• int setRIN(const double &rin);

Sets the optical signal’s laser relative intensity noise equal to rin. Returns NOERROR on success, YESERROR on failure.

• int setLinewidth(const double &lw);

Sets the optical signal’s source linewidth equal to lw (in Hz). Returns NOERROR on success, YESERROR on failure.

• int setBitRate(const double &bitRate);

Sets the bit rate of the digital signal represented by the optical signal. The value is specified by bitRate. Returns NOERROR on success, YESERROR on failure.

• int setPatternLength(const int &patternLen);

Sets the number of bits represented by the optical signal. The value is specified by patternLen. Returns NOERROR on success, YESERROR on failure.

• const double getRIN() const;

Returns the optical signal’s relative intensity noise value.

• const double getLinewidth() const;

Returns the optical signal’s source linewidth (in Hz).

• const double getBitRate() const;

Returns the bit rate of the digital signal represented by the optical signal.

• const int getPatternLength() const;

Returns the number of bits represented by the optical signal.

• void incrementStartTime(const double &delt);

Page 431: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 421

Increments the signal start time by an amount equal to delt (in seconds).

• void shiftWavelength(const double &dellam);

Shifts the signal wavelength by an amount equal to dellam (in meters).

• int incrementDistance(const double &dist);

Increments the distance traveled by the optical signal. The distance is specified via dist. Returns NOERROR on success, YESERROR on failure.

• int addDispersion(const double &disp);

Increments the dispersion of the optical signal. The increment is specified by disp. Returns NOERROR on success, YESERROR on failure.

The PowerSpectrum structure contains the following public fields, whose meaning and use are described below:

• next

Pointer to the next PowerSpectrum struct if a linked list

• noPoints

Number of data points in power spectrum array

• powerSamples

Frequency domain power spectrum array, indexed from 1 to noPoints, W/Hz

• fStep

Frequency step (resolution) of spectrum array, Hz

• startFreq

Start frequency of spectrum, Hz

11.6.2 ElecSig The electrical signal is represented by the ElecSig data structure which is defined in lsuser.h.

The signal waveform (in the time domain) is represented as a complex array in the baseband. The complex data is stored in the array indexed from 1 to n where n is the number of complex data points. In general, the electrical signal should be real, so only the real portion of the signal should be used for most applications.

The electrical signal noise is represented as an array of standard deviations (sigma) indexed from 1 to n where n is the number of data points. The sigma array assumes gaussian statistics with the mean being the value of the (noiseless) signal in the samples array. While the array is complex, only the real portion of the array is meaningful. This corresponds to the signal representation used by the quasianalytical technique for treatment of noise in the simulation of communication systems [Jeruchim, Balaban, and Shanmugan, Simulation of Communication Systems. New York: Plenum. 1992]. This noise representation also permits the evaluation of signal dependent noise in optical communication systems.

The ElecSig structure contains the following public fields and member functions, whose meaning and use are described below. Note that the bitRate field from previous versions of LinkSIM has been removed, and its value must now be accessed via the appropriate member functions:

• noPoints

Number of complex data points in the signal and noise arrays

• samples

Complex electrical signal array, V

• tStep

Page 432: 39865643 Optsim Guide

422 •••• Chapter 11: Block Mode User Models OptSim User Guide

step (sampling period) between adjacent data points, sec

• startTime

Time of first data point in the array, sec

• sigma

Complex RMS noise voltage array, V

• signalType

VOLTAGE = 0, CURRENT = 1

• int setBitRate(const double &bitRate);

Sets the bit rate of the digital signal represented by the electrical signal. The value is specified by bitRate. Returns NOERROR on success, YESERROR on failure.

• int setPatternLength(const int &patternLen);

Sets the number of bits represented by the electrical signal. The value is specified by patternLen. Returns NOERROR on success, YESERROR on failure.

• const double getBitRate() const;

Returns the bit rate of the digital signal represented by the electrical signal.

• const int getPatternLength() const;

Returns the number of bits represented by the electrical signal.

11.6.3 BinSig The binary signal is represented by the BinSig data structure defined in lsuser.h.

The binary sequence is stored in an array indexed from 1 to n where n is the pattern length (which must be a power of 2). The zero'th element in the array is not used. This gives the total array size of n+1.

The BinSig structure contains the following public fields, whose meaning and use are described below:

• noPoints

Number of data points in the binary sequence

• bitSequence

Binary value array

• bitRate

Bit rate of the signal, bits/s

• startTime

Time of first data point in the array, sec

11.6.4 Working With Signals Signals should be operated on using the OptSim library functions provided for that purpose. Care should be taken when working with signals to follow the recommendations and cautionary statements provided in the documentation of these routines.

Also, when transforming between frequency and wavelength, the CSPEED parameter defined in the lsuser.h file should be used to be consistent with the speed of light defined in OptSim. Other convenient parameter definitions include M_PI for π (if it is not already defined by your compiler), and M_E for the mathematical constant e.

Page 433: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 423

11.7 Multimode Library Functions If you are licensed to use OptSim’s multimode modeling features, a number of multimode routines are provided for use in block-mode user models. The header file for these functions is spatialfield_user.h and can be found in the directory /products/optsim/block_mode/usermod. This section lists those routines, and gives instructions for their use. The routines are divided into two sets.

The first set contains routines used to create transverse mode profiles that can be assigned to an OpSig data structure’s SpatialX and SpatialY parameters:

• createDonutMode SpatialField *createDonutMode(int m, double Ra, double Rb);

This routine creates a donut mode with azimuthal index m, inner radius Ra, and outer radius Rb.

• createLGMode SpatialField *createLGMode(int m, int p, double wo, double iRo);

This routine creates a Laguerre-Gaussian mode with azimuthal index m, radial index p, spot-size parameter wo, and inverse radius of curvature iRo.

• createHGMode SpatialField *createHGMode(int p, int m, double wox, double woy, double iRox, double iRoy);

This routine creates a Hermite-Gaussian mode with x index p, y index m, x spot size wox, y spot size woy, x inverse radius of curvature iRox, and y inverse radius of curvature iRoy.

• createLPfiberMode SpatialField *createLPfiberMode(int l, int m, double Nclad, double Ncore, double Radius);

This routine creates an LP fiber mode with azimuthal index l, radial index m, fiber cladding index Nclad, fiber core index Ncore, and fiber core radius Radius.

• createGriddedField SpatialField *createGriddedField(double wavelength, SpatialField *pSF, SFDomain *window, int l_, int m_, double dx, double dy);

This routine creates a gridded field representation at the specified wavelength for the transverse mode profile pointed to by pSF. The remaining parameters are optional. l_ specifies the azimuthal index, m_ specifies the radial index, dx is the x grid spacing, and dy is the y grid spacing. Finally, the optional pointer window points to a domain data structure of type SFDomain which specifies the rectangular region over which the gridded field is defined. Variables of type SFDomain can be initialized as follows: SFDomain domain(xmin, xmax, ymin, ymax);

or

SFDomain *domain = new SFDomain(xmin, xmax, ymin, ymax);

where [xmin,xmax] specifies the x domain, and [ymin,ymax] specifies the y domain.

• createGriddedField SpatialField *createGriddedField(const char *file, int l_, int m_);

This routine creates a gridded field from data stored in the specified file. This file should have the format described in Chapter 9. Optionally, the user may also specify the azimuthal (l_) and radial (m_) indices.

• createGriddedRadialField SpatialField *createGriddedRadialField(const char *file, int l_, int m_);

Page 434: 39865643 Optsim Guide

424 •••• Chapter 11: Block Mode User Models OptSim User Guide

This routine creates a gridded radial field from data stored in the specified file. This file should have the format described in Chapter 9. Optionally, the user may also specify the azimuthal (l_) and radial (m_) indices.

The second set of multimode library routines is used to manipulate transverse mode profiles after they have been created:

• SpatialFieldInnerProduct void SpatialFieldInnerProduct(double &r, double &i, double wavelength, SpatialField *pSF1, SpatialField *pSF2, SFDomain *window, int use_conj, double dx_, double dy_);

This routine calculates the inner product of two mode profiles (pointed to by pSF1 and pSF2) at the specified wavelength. If pSF2 is NULL, then the self inner product of the first field is determined. The inner product’s real and imaginary values are returned in r and i, respectively. The remaining parameters are optional. window specifies a rectangular domain (see the discussion above for the function createGriddedField) over which to perform the calculation. use_conj should be set to FALSE if the inner product should be calculated without using the complex conjugate of the second field. Finally, dx_ and dy_ specify the grid-spacing used in the calculation.

• setSpatialFieldAmplitude void setSpatialFieldAmplitude(SpatialField *sf, double r, double i);

This routine is used to specify a complex value by which to scale a mode profile (pointed to by sf). r and i specify the real and imaginary parts of this value, respectively.

• getSpatialFieldAmplitude void getSpatialFieldAmplitude(SpatialField *sf, double &r, double &i);

This routine return the complex value being used to scale a mode profile (pointed to by sf). r and i return the real and imaginary parts of this value, respectively.

• setSpatialFieldShift void setSpatialFieldShift(SpatialField *sf, double x, double y);

This routine is used to specify x and y values by which to shift a mode profile.

• getSpatialFieldShift void getSpatialFieldShift(SpatialField *sf, double &x, double &y);

This function returns the x and y values by which a mode profile has been shifted.

• setSpatialFieldRotation void setSpatialFieldRotation(SpatialField *sf, double theta);

This function is used to specify an angle in radians (theta) by which to rotate a mode profile.

• getSpatialFieldRotation double getSpatialFieldRotation(SpatialField *sf);

This routine returns the rotation in radians of a mode profile.

• setSpatialFieldMode void setSpatialFieldMode(SpatialField *sf, int l, int m);

This routine is used to specify the azimuthal (l) and radial (m) indices of a mode profile.

• getSpatialFieldMode void getSpatialFieldMode(SpatialField *sf, int &l, int &m);

This routine returns the azimuthal (l) and radial (m) indices of a mode profile.

• setSpatialFieldXYDomain void setSpatialFieldXYDomain(SpatialField *sf, const SFDomain &window, const double &DX, const double &DY);

Page 435: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 425

This routine is used to specify the rectangular domain window (see the discussion above for the function createGriddedField) of a mode profile, as well as the desired x (DX) and y (DY) grid spacings.

• getSpatialFieldXYDomain void getSpatialFieldXYDomain(SpatialField *sf, SFDomain &dmn, double &DX, double &DY);

This routine returns the rectangular domain window (see the discussion above for the function createGriddedField) of a mode profile, as well as its x (dx) and y (dy) grid spacings.

• setSpatialFieldGrid void setSpatialFieldGrid(SpatialField *sf, double dx, double dy);

This routine is used to specify the x (dx) and y (dy) grid spacings for a mode profile.

• getSpatialFieldGrid void getSpatialFieldGrid(SpatialField *sf, double &dx, double &dy);

This routine returns the x (dx) and y (dy) grid spacings for a mode profile .

• NormalizeSpatialField void NormalizeSpatialField(SpatialField *sf, double wavelength, double norm_value, int norm_type);

If norm_type = POWER, this routine is used to normalize the self inner-product of a mode profile (via appropriate setting of its internal scaling factor) to the value norm_value at the specified wavelength. If norm_type = PEAK, this routine scales the mode profile such that it’s peak value equals norm_value.

• SpatialFieldValue void SpatialFieldValue(double &r, double &i, SpatialField *sf, double wavelength, double x, double y);

This routine returns the field value of a mode profile at the specified wavelength and (x,y) coordinates. r and i return the field value’s real and imaginary parts, respectively.

• getSpatialFieldLabel void getSpatialFieldLabel(SpatialField *sf, char *&lab);

This routine returns the built-in text label (lab) used to identify the type of mode represented by the mode profile pointed to by sf. Gridded modes return gridded, gridded radial modes return griddedradial, LP fiber modes return lpfiber, Laguerre-Gaussian modes return lg, Hermite-Gaussian modes return hg, and donut and spot modes return donut. Other labels that may arise are for built-in mode types.

• DestroySpatialField void DestroySpatialField(SpatialField *&sf);

This function destroys the mode profile specified by sf, deleting it from memory.

11.8 Compiling the Model On the Windows platform, OptSim block-mode user models may be compiled using Microsoft Visual Studio C++ or a comparable compiler. On UNIX platforms, a compiler such as g++ should be used. On Linux, g++296 should be used for compatibility purposes.

In compiling and linking a user model on a Windows platform, a dynamic link library (DLL) file must be created. There are several ways to do this. The best approach is to use a makefile such as those included in the /products/optsim/block_mode/usermod directory as examples.

For simple models which have only a few source code files, a command line or batch file approach may be sufficient for compilation. The following is the command to compile and link the DLL file with the Microsoft compiler (note the command is to be typed on a single line):

Page 436: 39865643 Optsim Guide

426 •••• Chapter 11: Block Mode User Models OptSim User Guide

cl -nologo -LD -Ox -G5 -MT -GX <usermod>.cpp lsuser.lib ls_sigs.lib ls_symtab.lib ls_intermed.lib

where <usermod>.cpp is the source code filename for the user model. If it is desired to link additional object or library files to the user model DLL file, they should also be included after the <usermod>.cpp entry. Additional command options, such as -Ox -G5 for optimization, should be added after -LD as necessary. See the compiler's documentation for details on its features and use. The above command will create <usermod>.dll, the actual name of which will be the same as the supplied C++ source file with the extension .dll instead of .cpp. This is the DLL file which OptSim will access.

The compiling command above can be put in a batch file for convenience when developing the user model. It may also be advantageous in debugging the user model to redirect the output of the cl command to a log file for convenience in reviewing the error messages generated by the compiler. Debugging may also be turned on in the compiler to aid in using the debugger that comes with the compiler to track down bugs in the user model.

In the /products/optsim/block_mode/usermod directory there is a simple batch file, mkuser.bat, which can be used to compile simple user models that depend on a single source file. For example, the user-model source file usermod1.cpp can be compiled with the command “mkuser usermod1”.

On UNIX systems, a dynamic library (.so) file must be created. As an example, the following are the commands to generate a Linux .so file using g++296, where <usermod>.cpp is the source-code filename for the user model:

g++296 –c –D__UNIX__ <usermod>.cpp

g++296 –shared –o lib<usermod>.so –W1,-soname,lib<usermod>.so \

<usermod>.o liblsuser.a libls_intermed.so libls_symtab.so \

libls_sigs.so

Note that all source-code files that include the file lsuser.h should be compiled on UNIX using the –D__UNIX__ flag, as in the example above.

Please contact RSoft Design Group for additional information on UNIX compilation.

11.9 Parameter Definition File The parameter definition file (.DTA file) defines all the component’s parameters and specifies defaults for them. It begins with the name of the component model. It is followed by a number of lines with keywords and values. The keyword MODELNAME is followed by the name of the model in OptSim, also called the model type. The keyword DLLFILE is followed by the name of the DLL file for the model. The keyword ENTRYNAMEROOT is followed by the main part of the entry names for the routines in the model. For example, if the model entry name is "mymodel_entry", then the keyword would be followed by "mymodel". The keyword FUNCTIONCODES is followed by one or more letters from the following: ETIC. E for entry (all models must have this), T for a test routine, I for a model initialization routine, C for a model cleanup routine, and V for a model that generates output plots. The keyword MODELABBREV is followed by the abbreviation of the model name used by the automatic model naming facility. The keyword TOOLTIP is followed by the phrase used by the tooltips when a mouse is placed over the model icon in the toolbar. This phrase must be in quotes.

The next line begins with the keyword NOTE and contains a string which is a description of the model. The values for MININPUTS, MAXINPUTS, MINOUTPUTS, MAXOUTPUTS, and NUMINEQNUMOUTNODES follow one per line, with each line starting with the appropriate keyword. These values specify the minimum and maximum allowed input nodes (ports) and output nodes (ports) of the component model, and whether the number of input nodes must equal the number of output nodes for the model or not. If there is a ratio of number of input to output ports which must be adhered to, the next line will start with the keyword PORTRATIO and will specify the ratio with the input port value first followed by the output port value. Next, the keyword NUMINPUTS is followed by the default number of inputs to the component. Next, the keyword NUMOUTPUTS is followed by the default number of outputs from the component.

Next, the keyword INSIGTYPES is followed by the signal types (see SigTypeEnum in lsuser.h) on each of the input nodes. Next, the keyword OUTSIGTYPES is followed by the signal types on each of the output nodes. For both the INSIGTYPES and OUTSIGTYPES entries, there must be at least as many signal types specified as the minimum number

Page 437: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 427

of nodes, unless EtcSigType, RepeatTwo, RepeatThree, or RepeatFour are used to specify what signal types should be used for additional nodes beyond those explicitly specified. EtcSigType instructs OptSim that all additional nodes should have the same signal type as the last one specified. RepeatTwo repeats the last two specified signal types for each set of two additional nodes. Likewise, RepeatThree and RepeatFour repeat the last three or four specified signal types for additional nodes. There may be as many signal types specified as the maximum number of nodes. If there are no input or output ports, the signal type NOSIGTYPE must be specified on the appropriate line.

Following that are the parameter entries, as described below. A parameter entry begins with the keyword PARAM followed by the name of the parameter and the type of parameter (see VariableTypeEnum). If the parameter is only valid for particular combinations of other component parameter values, then the next line contains the keyword REQUIRES followed by an expression indicating which parameters and their values that are required for the current parameter to be active. If the parameter is not active based on this expression, it will be grayed out in the parameter editing window. For an example, see the efilter.dta file in the MODELS directory.

On each of the following lines is a keyword followed by its value for all the portions of the parameter entry which are applicable, depending on the parameter type. For example, the keyword MINVALUE is followed by the minimum allowed value for the parameter; the keyword MAXVALUE is followed by the maximum allowed value for the parameter; the keyword VALUE is followed by the default value of the parameter; and the keyword UNITS is followed by the string representing the units for the parameter. The keyword ENDPARAM marks the end of the parameter entry. The lines of the parameter entry for each of the parameter types is documented below:

DoubleType PARAM <name> DoubleType

MINVALUE <scientific>

MAXVALUE <scientific>

VALUE <scientific | variable name | expression>

UNITS <string>

ENDPARAM

IntType PARAM <name> IntType

MINVALUE <integer>

MAXVALUE <integer>

VALUE <integer | variable name | expression>

UNITS <string>

ENDPARAM

ComplexType PARAM <name> ComplexType

MINVALUE <scientific>

MAXVALUE <scientific>

VALUE <complex scientific | variable name | expression>

UNITS <string>

ENDPARAM

CharType PARAM <name> CharType

MINVALUE <char>

MAXVALUE <char>

VALUE <char | variable name>

ENDPARAM

Page 438: 39865643 Optsim Guide

428 •••• Chapter 11: Block Mode User Models OptSim User Guide

StringType PARAM <name> StringType

VALUE <string | variable name>

ENDPARAM

EnumType PARAM <name> EnumType

VALUE <string>

FIELD <string> <string> <string> … <string>

ENDPARAM

DoubleArrayType (not presently editable in OptSim user interface) PARAM <name> DoubleArrayType

ROWS <integer>

COLS <integer>

ROWSTEP <scientific>

COLSTEP <scientific>

ROWSTEPTITLE <string>

COLSTEPTITLE <string>

ROWSTEPUNITS <string>

COLSTEPUNITS <string>

XUNITS <string>

YUNITS <string>

DATA

<scientific>

<scientific>

<scientific>

<scientific>

ENDPARAM

ComplexArrayType (not presently editable in OptSim user interface) PARAM <name> ComplexArrayType

ROWS <integer>

COLS <integer>

ROWSTEP <scientific>

COLSTEP <scientific>

ROWSTEPTITLE <string>

COLSTEPTITLE <string>

ROWSTEPUNITS <string>

COLSTEPUNITS <string>

XUNITS <string>

YUNITS <string>

DATA

<complex scientific>

<complex scientific>

Page 439: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 429

<complex scientific>

ENDPARAM

BinaryArrayType (not presently editable in OptSim user interface) PARAM <name> BinaryArrayType

ROWS <integer>

COLS <integer>

ROWSTEP <scientific>

COLSTEP <scientific>

ROWSTEPTITLE <string>

COLSTEPTITLE <string>

ROWSTEPUNITS <string>

COLSTEPUNITS <string>

XUNITS <string>

YUNITS <string>

DATA

<binary>

<binary>

<binary>

<binary>

ENDPARAM

11.10 Using Block-Mode User Models Once you have compiled your model into a dynamic library file and generated the parameter definition file, you can use the model with OptSim as follows:

1. Copy the dynamic library file into the directory /products/optsim/block_mode/usermodels of the RSoft installation. If you do not have access to this directory, copy the library into a directory that is part of your system PATH.

2. Copy the parameter definition file into the directory /products/optsim/block_mode/usermodels, or your User or Workgroup directories.

3. To place the model in an OptSim block-mode schematic, drag a CCE model from the Custom Models folder in the Block-Mode folder. Drop it on the spot of the design area where you wish to place it.

4. Choose the popup menu command Properties on the icon. Select the user model that you wish to instantiate from the combo box list (Available Blocks list) at the top of the Properties dialog (Figure 1). This list will initially display the Model Not Specified entry to indicate that a predefined user model is not yet instantiated.

5. In the Available Blocks list, click on the name of the user model you want.

6. Click on Load to instantiate the selected model. The ports and the parameters will be added to the model. To edit the model’s parameter definition file, click on Edit.

7. To change a parameter value, click in the value field to change its value and type in the new value. Repeat this operation for all the parameters you need to change.

Page 440: 39865643 Optsim Guide

430 •••• Chapter 11: Block Mode User Models OptSim User Guide

Figure 1. The Block-Mode CCE dialog window

To load a different user model, simply load a new model from the Available Blocks list. You can also change the parameters of the CCE like any other OptSim component.

To modify a CCE parameter, choose the popup menu command Properties on the CCE icon, click in the Value field of any parameter that you wish to change and enter the new value.

11.11 Examples In the /products/optsim/block_mode/usermod directory, two sets of files can be found corresponding to two different user model examples. Each example includes a makefile that can be used on Windows platforms in conjunction with the Microsoft Visual C++ tool nmake to build the corresponding model.

11.11.1 Example 1 This model represents a simple optical attenuator. The associated files are:

• usermod1.cpp the model source file

• usermod1.dta the model parameter-definition file

• usermod1.mak an nmake makefile

Page 441: 39865643 Optsim Guide

OptSim User Guide Chapter 11: Block Mode User Models •••• 431

11.11.2 Example 2 This model represents an electrical sine-wave generator. The associated files are:

• sinegen.cpp the model source file

• sinegen.dta the model parameter-definition file

• sinegen.mak an nmake makefile

Page 442: 39865643 Optsim Guide
Page 443: 39865643 Optsim Guide

OptSim User Guide Chapter 12: MATLAB( Cosimulation in Block Mode •••• 433

Chapter 12: MATLAB Cosimulation in Block Mode

Users may add their own block-mode MATLAB models that are directly called by OptSim. MATLAB is a product and registered trademark of The MathWorks, Inc. This chapter discusses the procedure for creating MATLAB M-file models that can be simulated with OptSim.

12.1 MATLAB User Model Overview MATLAB user models may be created and added to the OptSim environment for use in simulations in concert with OptSim’s provided models. This is done by performing the following steps:

• writing the model source code using the MATLAB M-file language

• defining the model parameters in a text file (*.DTA file)

• using the model within OptSim via the block-mode CCM component

MATLAB user models accept the defined component parameters and input signal data from OptSim and return the output signal data back to OptSim. These data are provided as MATLAB array cell data structures for the signals, variables for the model parameters and structured variable for the parameter types, directly created in the MATLAB environment to be easily accessed by the user M-file code. Example source code for a user model is provided with the MatCosim_LinAM.moml M-file amplitude modulator example.

12.2 Parameters The list of component parameters is defined in the .DTA file. The OptSim-MATLAB cosimulation interface creates the variables in the MATLAB environment with the same identifiers defined by the user in the *.DTA file.

The user parameters can be any of the following types:

• DoubleType

• IntType

• StringType

Page 444: 39865643 Optsim Guide

434 •••• Chapter 12: MATLAB( Cosimulation in Block Mode OptSim User Guide

12.3 Signals The primary function of a MATLAB user model is to operate on the input signal data to produce output signal data which represents the effect of the component being modeled on the signal which passes through it.

12.3.1 Input and Output Nodes There are three primary signal types in OptSim: the optical signal, the electrical signal, and the binary signal. The signal data are presented to the user model by cell array of input "nodes" or "ports" InNodeiwhere i ranges from 1 to noInNodes. The type of signal data which the port contains is indicated by the value of the signalType field of the InNode structure. The values which the input ports' signalType field may contain are as follows: SigTypeEnum.OpSigType, which represents an optical signal; SigTypeEnum.ElecSigType, which represents an electrical signal; SigTypeEnum.BinSigType, which represents a binary signal; ; and SigTypeEnum.NoSigType, which indicates that the port by definition contains no signal.

The output ports structures which are provided by OptSim do not contain any signal data; however, the ports are marked with the type of signal data which they should be provided with. This is indicated by the value of the signalType field of the OutNode structure. The values which the output ports' signalType field may contain are the same as the input ports. Because of the fact that the signal type of the output signals may be determined by the model depending on the initial setting of the signalType field, it is necessary that the user model set the signalType field to one of the following when a signal structure is attached to an output port prior to the model's return of control to OptSim: SigTypeEnum.OpSigType, SigTypeEnum.ElecSigType, SigTypeEnum.BinSigType, or SigTypeEnum.NoSigType. It is important that the model only attach the allowed signal types to the output port depending on the initial setting of the signalType field for that port.

12.3.2 Optical Signal The optical signal is represented by a structured array InNodei.Signal where i ranges from 1 to noInNodes and InNodei.SignalType is equal to SigTypeEnum.OpSigType.

An optical signal can be represented in one of several ways. The first is as a single optical wavelength channel. The second is as a linked list of separate optical wavelength channels. The third is as a single frequency band representation of multiple channels at different wavelengths. The fourth is as a combination of the above. A WDM optical signal contains separately modulated optical carriers at different wavelengths. The frequency bands of these separately modulated carriers may be separated from each other by significant amounts. In this case, the memory and computational requirements of simulating them can be reduced by representing each of them by a separate baseband signal representation with a carrier frequency parameter. The result is an array of separate optical wavelength channels. The time domain representation of the signal in this case is the baseband modulation of the optical carrier. In this representation, however, four wave mixing between different channels in the fiber model is not accounted for in the nonlinear fiber models. This is because four wave mixing involves the frequency bands between the optical channels. To account for four wave mixing in the optical fiber, the single frequency band representation of multiple channels at different wavelengths is required. This is accomplished by creating a single frequency band in the frequency domain which contains all the frequency components of each of the individual modulated optical carriers, and shifting the entire frequency band to the baseband with a "carrier" frequency which is the center of the single frequency band representation. The time domain representation of the signal in this case is not as convenient, as it contains all the frequency components of all the WDM channels. To properly view the time domain baseband modulated signal at any of the optical carriers in this representation, the single frequency domain signal must first be filtered to separate the desired carrier from the rest by an optical filter.

In the multiple frequency band representation, in which each modulated optical carrier is represented by a separate baseband signal structure with a carrier frequency parameter in a structured array, the wavelengths of the array are ordered in increasing wavelength order. The structured array begins with the lowest value of the optical carrier wavelength, and increases to the highest value.

The signal waveform (in the time domain) is represented as a complex optical field in the baseband. The signal can be represented as a pure x polarization state, in which case the signal is stored in the x polarization array, and the y

Page 445: 39865643 Optsim Guide

OptSim User Guide Chapter 12: MATLAB( Cosimulation in Block Mode •••• 435

polarization array is not present. This allows increased computational efficiency when polarization effects are not desired in the simulation. If there is any y polarization state to the signal, the x polarization portion is in the x polarization array while the y polarization portion is in the y polarization array. Depending on how many polarization states are present, the data are stored in one or two arrays of complex numbers in the Signal structure, each of which is indexed from 1 to n where n is the number of complex data points.

The ASE noise present in the signal is represented as an ASE noise spectra array, in the ASEnoise structure field of the Node structure. The array is an evenly sampled noise spectra with the defined center wavelength and resolution.

The Node structure for an optical signal contains the following fields, whose meaning and use are described below:

• Signal

Array of optical signal datas

• noSignals

Number of optical signals

• ASEnoise

Array of ASE noise spectra

• noASEnoises

Number of ASE noise spectra

The optical signal InNodei.Signal structure contains the following fields, whose meaning and use are described below:

• noPoints

Number of complex data points in the signal

• Ex

Complex optical signal in the x polarization, units of W1/2

• Ey

Optional complex optical signal in the y polarization, units of W1/2

• tStep

Time step (sampling period) between adjacent data points, sec

• startTime

Time of first data point in the array, sec

• bitRate

The bit rate of the digital signal represented by the waveform, units of bits/sec

• patternLength

Pseudo Random Bit Sequence pattern length in number of bits

• wavelength

Wavelength of the signal, m

• distance

distance traveled by the signal in the fiber

• accumDispersion

dispersion accumulated in the fiber

• RIN

Page 446: 39865643 Optsim Guide

436 •••• Chapter 12: MATLAB( Cosimulation in Block Mode OptSim User Guide

The laser relative intensity noise value

The InNodei.ASEnoise structure contains the following fields, whose meaning and use are described below:

• noPoints

Number of data points in power spectrum array

• powerSamples

Frequency domain power spectrum array, indexed from 1 to noPoints, W/Hz

• fStep

Frequency step (resolution) of spectrum array, Hz

• startFreq

Start frequency of spectrum, Hz

12.3.3 Electrical Signal The electrical signal is represented by a structured array InNodei.Signal where i ranges from 1 to noInNodes and InNodei.SignalType is equal to SigTypeEnum.ElecSigType.

The signal waveform (in the time domain) is represented as a complex array in the baseband. The complex data is stored in the array indexed from 1 to n where n is the number of complex data points. In general, the electrical signal should be real, so only the real portion of the signal should be used for most applications.

The electrical signal noise (in the quasianalytical representation) is represented as an array of standard deviations (sigma) indexed from 1 to n where n is the number of data points. The sigma array assumes gaussian statistics with the mean being the value of the (noiseless) signal in the samples array. While the array is complex, only the real portion of the array is meaningful. This corresponds to the signal representation used by the quasianalytical technique for treatment of noise in the simulation of communication systems [Jeruchim, Balaban, and Shanmugan, Simulation of Communication Systems. New York: Plenum. 1992]. The quasianalytical noise representation also permits the evaluation of signal-dependent noise in optical communication systems. For systems using the Monte Carlo representation, the noise will be embedded in the signal waveform, and the sigma array will be zero.

The Node structure for an electrical signal contains the following fields, whose meaning and use are described below:

• Signal

Array of electrical signal datas

• noSignals

Number of electrical signals

The electrical signal InNodei.Signal structure contains the following fields, whose meaning and use are described below:

• noPoints

Number of complex data points in the signal and noise arrays

• samples

Complex electrical signal array, V

• tStep

step (sampling period) between adjacent data points, sec

• bitRate

Bit rate of the digital signal represented, bits/s

• patternLength

Page 447: 39865643 Optsim Guide

OptSim User Guide Chapter 12: MATLAB( Cosimulation in Block Mode •••• 437

Pseudo Random Bit Sequence pattern length in number of bits

• startTime

Time of first data point in the array, sec

• sigma

Complex RMS noise voltage array, V

• noiseRep

noise representation

• signalType

VOLTAGE = 0, CURRENT = 1

The Matlab array noiseRepEnum contains the values that the field noiseRep of the electrical signal can assume:

• noiseRepEnum

Undefined = 0 QuasiAnalytical = 1 MonteCarlo = 2

12.3.4 Binary Signal The binary signal is represented a structured array InNodei.Signal where i ranges from 1 to noInNodes and InNodei.SignalType is equal to SigTypeEnum.BinSigType.

The binary sequence is stored in an array indexed from 1 to n where n is the pattern length (which must be a power of 2).

The binary signal structure InNodei.Signal contains the following fields, whose meaning and use are described below:

• noPoints

Number of data points in the binary sequence

• bitSequence

Binary value array

• bitRate

Bit rate of the signal, bits/s

• startTime

Time of first data point in the array, sec

12.4 MATLAB Cosimulation Parameter Definition File The user can define new M-file models creating their corresponding parameter definition file (.DTA file) in the directory /products/optsim/block_mode/usermodels, or their User or Workgroup directories.

The MATLAB cosimulation parameter definition file (.DTA file) defines all the component’s parameters and specifies defaults for them. The user may review the MATLAB cosimulation parameter file matlabmod1.dta provided with OptSim for reference (it is located in the directory /products/optsim/block_mode/usermodels). It begins with the name of the component model. It is followed by a number of lines with keywords and values. The keyword MODELNAME is followed by the name of the model in OptSim, also called the model type. The keyword DLLFILE is

Page 448: 39865643 Optsim Guide

438 •••• Chapter 12: MATLAB( Cosimulation in Block Mode OptSim User Guide

always followed by the value matcosim.dll. The keyword ENTRYNAMEROOT is always followed by matcosim. The keyword FUNCTIONCODES is always followed by E. The keyword MODELABBREV is followed by the abbreviation of the model name used by the automatic model naming facility. The keyword TOOLTIP is followed by the phrase used by the tooltips when a mouse is placed over the model icon in the toolbar. This phrase must be in quotes.

The next line begins with the keyword NOTE and contains a string which is a description of the model. The values for MININPUTS, MAXINPUTS, MINOUTPUTS, MAXOUTPUTS, and NUMINEQNUMOUTNODES follow one per line, with each line starting with the appropriate keyword. These values specify the minimum and maximum allowed input nodes (ports) and output nodes (ports) of the MATLAB component model, and whether the number of input nodes must equal the number of output nodes for the model or not. If there is a ratio of number of input to output ports which must be adhered to, the next line will start with the keyword PORTRATIO and will specify the ratio with the input port value first followed by the output port value. Next, the keyword NUMINPUTS is followed by the default number of inputs to the component. Next, the keyword NUMOUTPUTS is followed by the default number of outputs from the component.

Next, the keyword INSIGTYPES is followed by the signal types (OpSigType, ElecSigType or BinSigType) on each of the input nodes. Next, the keyword OUTSIGTYPES is followed by the signal types on each of the output nodes. For both the INSIGTYPES and OUTSIGTYPES entries, there must be at least as many signal types specified as the minimum number of nodes, unless EtcSigType, RepeatTwo, RepeatThree, or RepeatFour are used to specify what signal types should be used for additional nodes beyond those explicitly specified. EtcSigType instructs OptSim that all additional nodes should have the same signal type as the last one specified. RepeatTwo repeats the last two specified signal types for each set of two additional nodes. Likewise, RepeatThree and RepeatFour repeat the last three or four specified signal types for additional nodes. There may be as many signal types specified as the maximum number of nodes. If there are no input or output ports, the signal type NoSigType must be specified on the appropriate line.

Following that are the parameter entries always required by the MATLAB cosimulation, as described below. A parameter entry for the M-file name implementing the user model, represented by the keywords PARAM MfileName StringType, GROUP General, VALUE and ENDPARAM disposed on four different lines. A parameter entry for the path (relative or absolute) of the user code, represented by the keywords PARAM MfilePath StringType, GROUP General, VALUE and ENDPARAM disposed on four different lines. A parameter entry for the flag to save the MATLAB environment on a file, represented by the keywords PARAM SaveMatlabWorkspace EnumType, GROUP General, VALUE No, FIELD No Yes and ENDPARAM disposed on five different lines. A parameter entry for the name of the MATLAB environment file, represented by the keywords PARAM MatlabWorkspaceName StringType, GROUP General, REQUIRES SaveMatlabWorkspace:Yes, VALUE and ENDPARAM disposed on five different lines.

Following that are the parameter entries required by the user model. A parameter entry begins with the keyword PARAM followed by the name of the parameter and the type of parameter (see VariableTypeEnum). If the parameter is only valid for particular combinations of other component parameter values, then the next line contains the keyword REQUIRES followed by an expression indicating which parameters and their values that are required for the current parameter to be active. If the parameter is not active based on this expression, it will be grayed out in the parameter editing window.

On each of the following lines is a keyword followed by its value for all the portions of the parameter entry which are applicable, depending on the parameter type. For example, the keyword MINVALUE is followed by the minimum allowed value for the parameter; the keyword MAXVALUE is followed by the maximum allowed value for the parameter; the keyword VALUE is followed by the default value of the parameter; and the keyword UNITS is followed by the string representing the units for the parameter. The keyword ENDPARAM marks the end of the parameter entry. The lines of the parameter entry for each of the parameter types is documented below:

DoubleType PARAM <name> DoubleType

MINVALUE <scientific>

MAXVALUE <scientific>

VALUE <scientific | variable name | expression>

UNITS <string>

ENDPARAM

Page 449: 39865643 Optsim Guide

OptSim User Guide Chapter 12: MATLAB( Cosimulation in Block Mode •••• 439

IntType PARAM <name> IntType

MINVALUE <integer>

MAXVALUE <integer>

VALUE <integer | variable name | expression>

UNITS <string>

ENDPARAM

StringType PARAM <name> StringType

VALUE <string | variable name>

ENDPARAM

12.5 Using MATLAB Models Once you have generated the parameter definition file and MATLAB source code, you can use your MATLAB model with OptSim as follows:

1. Copy the parameter definition file into /products/optsim/block_mode/usermodels, or your User or Workgroup directories.

2. To place the model in an OptSim block-mode schematic, drag a CCM model from the Custom Models folder in the Block-Mode folder. Drop it on the spot of the design area where you wish to place it.

3. Choose the popup menu command Properties on the icon. Select the MATLAB model that you wish to instantiate from the combo box list (Available Blocks list) at the top of the Properties dialog (Figure 1). This list will initially display the Model Not Specified entry to indicate that a predefined MATLAB model is not yet instantiated.

4. In the Available Blocks list, click on the name of the MATLAB model you want.

5. Click on Load to instantiate the selected model. The ports and the parameters will be added to the model. To edit the model’s parameter definition file, click on Edit.

6. To change a parameter value, click in the value field to change its value and type in the new value. Repeat this operation for all the parameters you need to change. In particular, be sure to specify the MATLAB source code file via the parameters MfileName and MfilePath.

Page 450: 39865643 Optsim Guide

440 •••• Chapter 12: MATLAB( Cosimulation in Block Mode OptSim User Guide

Figure 1. The Block-Mode CCM dialog window

To load a different MATLAB model, simply load a new model from the Available Blocks list. You can also change the parameters of the CCM like any other OptSim component.

To modify a CCM parameter, choose the popup menu command Properties on the CCM icon, click in the Value field of any parameter that you wish to change and enter the new value.

Page 451: 39865643 Optsim Guide

OptSim User Guide Index •••• 441

Index

A Accuracy of BER and Q-factor Estimation 167 Adding Record Keeping Attributes to the Projects 56 Adding Texts to the Projects 54 Animation 18 Annotation 24 Appendix - SPICE 323 Application Notes and White Papers 157 Arithmetic Operators 144

B BER

FAQ 266 white paper 167

BER Estimation 228 Best Fit Laser Toolkit 150 Best-Fit Laser Toolkit 19 Best-Fit Laser Toolkit Window 150 Binary Signal 437, 376 BinSig 422 Birefringence

FAQ 265 Block Mode Signals 369 Block Mode Simulations 358 Block Mode User Models 407 Block-Mode Models 25 Block-Mode Repeat Loop 24

C CAD Environment 3 Calling a Sample Mode CCE 274 Calling Conventions 408 CCE Examples - Sample Mode 278 CCM 295

Console Mode 295 SPT m-file 302

CCM Example 306 CCM Wizard 19, 298

Changing Icons 49 Changing the Number of Component I/O Ports 32 Color Scales 401 Combining SPICE Files 328 Compiling the Model 425 Complete Optical Signal Representation 391 Compound Components 25, 107 Connect Menu 19 Contour Map 263 Correlation Diagrams 112, 194 Creating a New Project 71 Creating a Sample Mode CCE 272 Creating Compound Components 36 Creating Hierarchies 36 Custom Component for using with SPICE (CCS) 317 Custom Output and Sample Mode CCE 277 Customizing the Current Schematic 16 Customizing the GUI Layout 16 Customizing the Schematic View Style 16

D Data Browser 19 Data Display Options 200 Data Display Tool 181 Decorative Elements 25, 60 Delay Block 24 Design Area 8 Design Area / Layout Pane / Schematic Capture

Window 30 Design Properties 51 Diagram File 243 Directories Preferences 53 Discrete Representations of Signals 369 Displaying and Superimposing Diagrams 194 Displaying Results 182 Donut and Spot Modes 393 Draw Connection 31 Drawing a Link Topology 30 Drawing the Schematic 75 Dual Polarization 136

E EDFA

FAQ 265 Edit Component Parameters 34 Edit Global Variables (Symbol Table) 33 Edit Menu 12 ElecSig 421 Electrical Signal 436 Electrical Signal Diagram 226 Electrical Signal File 239 Electrical Signals 148, 377 Electrical Spectrum 234 Ellipse (Decorative Element) 62

Page 452: 39865643 Optsim Guide

442 •••• Index OptSim User Guide

Encrypt Component Parameters 14 Encrypt Data File 19 Encrypted Component Parameters 35 Encrypting Model Data Files 54 Exchange Data with MATLAB® 316 Exchanging Signals by Files 316 Explorer 8, 25 Export Curve 210 Export Diagram 210 Exporting Simulation Results 187 Expression Evaluator 19 Expressions in Component Parameters 144 Eye Diagram 227 Eye Opening 229

F FAQ

BER 266 birefringence 265 EDFA 265 PMD 265 Q-Estimator 266

FAQ on Electrical and Digital Components 266 FAQ on Fiber Properties and Models 265 FAQ on Measurement Components 266 FAQ on Optical Components 265 FAQ on other Miscellaneous Problems 267 Favorite Schematics 27 File Grammars 239 File Menu 9 Forbidden Topologies 142 Full VBS 131 Functions 145 Fundamental Signal Types 376 FWM Artifacts 138

G Generation of Project Reports 57 Getting Started with Block Mode and Transient

Simulations 358 Getting Started with Sample Mode Simulations 67 Global User Variables 23 Grammar of Sample Mode Charts Index 293 Grammar of Sample Mode Component Parameters for

CCE 288 Grammar of Sample Mode Electrical Time Samples

291 Grammar of Sample Mode Optical Power Spectrum

Files 292 Grammar of Sample Mode Optical Time Samples 291 Grammar of Sample Mode Output Simulation

Parameters from CCE 289 Grammar of Sample Mode Simulation Parameters for

CCE 286

Grammar Rules 239 Graph Menu 18 Gridded Modes 392

H Header/Library Files 407 Help Menu 20 Hermite-Gaussian Modes 394 Higher-Order Composite (HOC) Model 24, 39 Histogram on Electrical Signal Diagram 232 Histogram on Eye Diagram 230

I Image (Decorative Element) 60 Import Curve 210 Initialization Log File 18 Initialization of Settings 70 Inline Compound Component 24 Inline Hierarchy 23 Input and Output Nodes 434 Instance Parameter in HOC 44 Instantaneous Optical Frequency 217 Instantaneous Optical Power 213 Instantaneous Phase Deviation 215 Instantaneous Stokes Parameters 219 Invoking a Sample Mode CCE 274 Iterated Components 103

J Jitter 230

L Laguerre-Gaussian Modes 393 Laser Phase Noise 176 Laying out the Design Topology 358 Library Functions 409, 423 Line (Decorative Element) 63 Linear Amplitude Modulator CCM 306 Linear-Fiber VBS 130 Logging Menu 18 Logical Signal Diagram 238 Logical Signal File 241 Logical Signals 148 Loss-only Fiber VBS 130 LP Modes 395

M Main Toolbar 20 Markers 208 MATLAB m-Files 302 MATLAB Toolkits 19

Page 453: 39865643 Optsim Guide

OptSim User Guide Index •••• 443

MATLAB User Model 433 MATLAB Wizard 298 MATLAB Cosimulation in Block Mode 433 MATLAB Cosimulation in Sample Mode 295 Measurement List Window 190

Hierarchies 192 Measurement Window 201 Menu Bar 8, 9 Model ID 25 Model ID Tool 56 Model Palettes 26 Move 33 Multi-Component Parameter Edit 13 Multimode Simulations 391 Multiple Runs 98 MultiportFork Model 25

N Naming and Renaming Components 35 Negative Frequencies 149 Null Signal Model 25

O opexp Command 188 OpSigExt 418 Optical Frequency Deviation 217 Optical Power Diagram 213 Optical Power Spectral Density 149 Optical Signal 148, 380, 434 Optical Signal File 240 Optical Spectrum 219 Options Menu 16 OptSim Window 7 opzip Command 187 OSNR Evaluation 224 OSNR Values File 247

P Panner 29 Parameter Definition File 426, 437 Parameter Expressions 44 Parameter Scan 23 Parameter Scan Dialog Window in Block Mode 362 Parameter Scan Dialog Window in Sample Mode 100 Parameters 418, 433 Pause Simulation 23 Peak Searching 222, 236 Perform Simulation 22 Phase Deviation Diagram 215 Phase Noise 174 Polygon (Decorative Element) 63 Post-Processing Operations 214 Power Spectra of Sample Mode CCE 277

print Command 212 Pseudo-Random Functions 145

Q Q Factor Estimation 227 Q Surfaces Toolkit 257 Q-Estimator

FAQ 266

R Raman 80, 92 Random Parameters Seed 136 Rectangle (Decorative Element) 64 Reload User Libraries 19 Return Codes of Sample Mode CCE 274 rnd_gauss( ) 146 rnd_unif( ) 146 Run Menu 17 Run Tools Bar 8, 22

S Sample Mode CCE 269

Files 273 Messages 274

Sample Mode CCE Component Description 284 Sample Mode CCE Composition 270 Sample Mode CCE Types 270 Sample Mode CCS Component Description 318 Sample Mode CCS Composition 318 Sample Mode Custom Component Executable 269 Sample Mode Data Post-Processing and Display 181 Sample Mode Grammar Rules 284 Sample Mode Simulation Parameters 73 Sample Mode Simulation Strategies 68 Sample Mode Simulation Techniques and Features 127 Sample Mode User Models 269 Sample-Mode Iteration Loop 24 Sample-Mode Models 25 Scale Files 402 Scan Setup 18 Scan Setup Dialog Window 146 Scan Variable 17 Scattering Diagram 238 Schematic Log File 19 Select 31 Select and Connect 23 Selective Multi-Component Parameter Edit 13 Setting up a Single Block Mode Simulation Run 364 Setting up a Single Sample Mode Simulation Run 85 Setting up Block Mode Parameter Scans 362 Setting up Sample Mode Parameter Scans 96 Setting Up your First Simulation 69 Signals 418, 434

Page 454: 39865643 Optsim Guide

444 •••• Index OptSim User Guide

Simulation Accuracy 136 Simulation and Analysis 4 Simulation Log File 19 Simulation Log Window 143 Simulation Messages 143 Simulation Parameters 18 Simulation Parameters in Block Mode 365 Simulation Parameters in Sample Mode 131 Simulation Results 183 Simulation Run Dialog Window in Block Mode 364 Simulation Run Dialog Window in Sample Mode 85 Simulation Setup 139 Simulation Strategies 130 Simulation Techniques 127 Single Polarization 136 Spectral Propagation Technique (SPT) 128 Spectrum File 241 SPICE Analysis at Different Temperatures 323 SPICE Circuit Files 321 SPICE Components 328 SPICE Device Models 326 SPICE Elementary Devices 328 SPICE General Structure and Conventions 325 SPICE Overview 323 SPICE Subcircuits 327 SPICE Cosimulation in Sample-Mode 317 SPT

results 89 simulation 91

SPT Behavior of the Sample Mode CCE 275 SPT Data Display Toolkit 248 SPT Measurement Components 277 SPT Simulation 130 Spurious Tones in Amplitude Modulators 161 Starting OptSim 69 Status Bar 8 Stokes Parameters Diagram 219 Stop Simulation 23 String Parameters 48 Superimposing Diagrams 194 Surface Map 264 Symbol Table Editor 23 Symbol Table Expressions 48

T TDSS 157 Text Annotation Tool 54 Time and Frequency Domain Representations 371 Time Domain Split-Step (TDSS) 157 Title Bar 8 Tool Bar 8, 20 Toolbox 8, 23 Transient Simulations 358, 388 Transistors and Diodes in SPICE 343 Transmission Lines in SPICE 339

Transverse Mode Profiles 391 Troubleshooting Multimode Simulatio ns 397

U User Defined Functions 48 User Directory 53 User Libraries 25 User Libraries Organizer 19, 52 User Model Examples - Block Mode 430 Using a Sample Mode CCE 271 Using a Sample Mode CCS 321 Using Block-Mode User Models 429 Using Color Scales 403 Using MATLAB Models in Block Mode 439 Using OptSim GUI 7 Using the Data Display 92 Utility Menu 19

V Variable Bandwidth Simulation Technique (VBS) 128 VBS

results 92 VBS Behavior of the Sample Mode CCE 276 VBS Simulation 90 Vertex 23 View Menu 16 View Plots 23 View Results 23 Viewing Plots Generated by Simulation 36, 368 Viewing Simulated Signal Summaries 367 Viewing the Results 106 Voltage and Current Sources in SPICE 332

W White Papers 157

BER 167 phase noise 174 spurious tones 161

Window Menu 20 Workgroup Directory 53 Working With Signals 422

X XY Diagram 236 XY Diagram File 242

Z Zoom 33, 206