Interactive Controls and Displays for ADS Ptolemy Simulation
The Interactive Controls and Display library components provide real-time simulation input control and animated plots of simulation results. Examples are given below to demonstrate use of these components.
The following table describes two ADS methods for simulating and viewing results.
| Method | Description |
|---|---|
| Interactive Controls and Displays | A quick and easy way to display results. They also give you a way to interactively change parameters while your simulation is running and display animated plots. Data is not saved. No post processing. |
| Data Display Window | Data is saved after simulation is complete. You open a Data Display window, choose a plot type, parameters to plot, and have many data manipulation options. |
| Note You can set up a schematic for both methods by placing an Interactive Controls and Displays component and a Sink component. | |
The interactive controls and displays were derived from a scripting language called Tool Command Language (Tcl) and the Tool Kit attached to TCL (Tk). Tcl or Tk are used in these ADS Ptolemy component names. Tcl is a language that was created to be easily embedded into applications. Tk is a graphical toolkit that makes creating user interfaces easier. Both were created by John Ousterhout while he was a professor at U.C. Berkeley. To explore this language further to write your own applications References provides resources regarding Tcl and Tk.
| Note To use Interactive Controls and Displays library components with the ADS tune mode, you must dismiss the Interactive Controls and Displays component between each tune with its pop-up dialog box. |
The following table lists the components available in the Interactive Controls and Displays Library.
Interactive Controls and Displays Library
| Component Name | Description |
|---|---|
| TkSlider | Interactive Slider |
| TkPlot | Plot Inputs versus Time |
| TkText | Display History of Input Values |
| TkShowValues | Input Values Display |
| TkXYPlot | Plot Y versus X Inputs |
| TkBarGraph | Bar Chart Display |
| LMS_CxTkPlot | Interactive Complex LMS Adaptive Filter |
| LMS_TkPlot | Interactive LMS Adaptive Filter |
| TkButtons | Interactive Buttons |
| TkBreakPt | Conditional Breakpoint |
| TkMeter | Bar Meters Display |
| TkShowBooleans | Booleans Display |
| TkBasebandEquivChannel | Baseband Equivalent Channel |
| TclScript | Invoke Tcl Script |
| TkEye | Eye Diagram |
| TkConstellation | IQ Constellation Diagram |
| TkHistogram | Histogram Diagram |
| TklQrms | Display rms value of input IQ signal |
| TkPower | Signal Power Display in dBm |
TkSlider and TkPlot Components
The following figure is taken from the design File > Example Project > DSP > dsp_demos_prj EYE.dsn. To run this example, copy the project ( File > Copy Project) to a directory for which you have write permission.
The EYE schematic uses an interactive control TkSlider component to adjust the amount of noise added to the pulse stream. Simulation results change instantly in an animated display provided by the TkPlot component. TkPlot simply plots one input on the Y-axis versus time, or sample number on the X-axis.
Schematic Using TkSlider and TkPlot Components (TkPlot is part of TkEye Subcircuit)
When you begin simulation of a design using TkSlider, a Control Panel dialog box shown in the following figure is displayed.
TkSlider is Interactively Controlled
At a minimum, the Pause and Quit buttons are shown. If the TKSlider PutInControlPanel default Yes is accepted, the slider control is available. (If you choose No for this parameter, a separate box will be displayed for each slider.)
With the slider control moved to the far left, 0.0 noise is added; the resulting clean eye-diagram plot is shown in the following figure.
Eye Diagram Plot with Noise at 0.0
If you move the slider so that Noise Magnitude is 0.37 as shown in the following figure, the animated plot changes instantly to display the poor eye diagram shown in the next figure. More or less noise can be added and results will be shown instantly.
Slider Control Moved to Add Noise
Eye Diagram Plot with Noise at 0.37
Placing multiple TKSlider components in a schematic will result in multiple sliders in the Control Panel. You can type a label for each by editing the parameters on-screen or double-clicking the component to bring up the component parameters dialog box.
Control Panel with Multiple TkSliders
TkText and TkShowValues Components
The TkText component simply displays a history of input values in text form.

The TkShowValues component displays only one value is at a time (rather than a history) in the Control Panel.

For component and parameter details, refer to Interactive Controls and Displays.
TkXYPlot Component
Several TkXYPlot components are placed in this design to show animated results where two inputs, X versus Y, are to be plotted.
The example in the following figure is from the File > Example Project > DSP > dsp_demos_prj EQ_16QAM.dsn. To use and simulate this example, copy the project (File > Copy Project) to a directory for which you have write permission. In this example TkXYPlot components are used to display constellation diagrams. The equalized constellation diagram is shown in the next figure.
For component and parameter details, refer to Interactive Controls and Displays.
Equalized 16 QAM System with Multipath and Phase Noise
TkXYPlot for Equalized Constellation Diagram
TkBarGraph Component
The TkBarGraph component displays input (multiple anytype) data in a bar graph format. Different inputs are assigned up to 12 different colors, then the colors are repeated. A TkBarGraph example is shown in the following figure.
TkBarGraph Display
For component and parameter details, refer to Interactive Controls and Displays.
LMS Adaptive Filter Components
There are two LMS adaptive filter components in the Interactive Controls and Displays library: LMS_CxTkPlot and LMS_TkPlot. LMS_CxTkPlot expects complex data and LMS_TkPlot expects real data.
The example shown in the following figure is from the File > Example Project > DSP > dsp_demos_prj EQ_16QAM.dsn. To use and simulate this example, copy the project (File > Copy Project) to a directory for which you have write permission.
LMS Adaptive Filter (Complex) Component in the 16 QAM System
Both LMS components implement an adaptive filter using the least-mean square algorithm, also know as the stochastic-gradient algorithm.
The size of the LMS filter is determined by the number of coefficients in the Taps parameter; the default gives an 8th-order, linear-phase lowpass filter. LMS supports decimation, but not interpolation.
The filter coefficients can be specified directly or read from a file. To load filter coefficients from a file, replace the default coefficients with the string < filename (use an absolute path name for the filename to allow the filter to work as expected regardless of the directory where the simulation process actually runs).
When used correctly, this LMS adaptive filter will adapt to try to minimize the mean-squared error of the signal at its error input. The output of the filter should be compared to (subtracted from) some reference signal to produce an error signal. That error signal should be fed back to the error input. The ErrorDelay parameter must equal the total number of delays in the path from the output of the filter back to the error input. This ensures correct alignment of the adaptation algorithm. The number of delays must be greater than 0 or the simulation will deadlock.
If the SaveTapsFile string is non-null, a file will be created with the name given by that string, and the final tap values will be stored there after the run has completed.
The plot generated from this design upon simulation is shown in the following figure.
Plot Resulting From LMS_CxTkPlot FilterTaps Parameter
For component and parameter details, refer to Interactive Controls and Displays.
TkButtons Component
Like TkSlider, TkButtons produces an output. The data type of the output is multiple anytype. TkButtons outputs 0.0 unless the corresponding button is pushed, when the output becomes the value assigned in the parameter Value. You can assign your own identifiers using strings for the corresponding parameter.

For component and parameter details, refer to Interactive Controls and Displays.
TkBreakPt Component'
With TkBreakPt you can pause or stop a simulation. Its principal use is to help debug simulations. You can stop the simulation based on a condition of the model's inputs.
For component and parameter details, refer to Interactive Controls and Displays.
TkMeter Component
TkMeter dynamically displays the value of any number of input signals (any type) on a set of bar meters. These values are displayed in the Control Panel.

For component and parameter details, refer to Interactive Controls and Displays.
TkShowBooleans Component
The TkShowBooleans component works similar to TkShowValues, except that a Boolean value of zero (false) or non-zero (true) is displayed in the Control Panel.

For component and parameter details, refer to Interactive Controls and Displays.
TkBasebandEquivChannel Component
The TkBasebandEquivChannel subcircuit, shown in the following figure, models a baseband equivalent channel with linear distortion, frequency offset, phase jitter, and additive white Gaussian noise. Many of the channel model parameters can be set dynamically.
TkBasebandEquivChannel accepts complex data and outputs the input signal plus distortions. To model linear distortion, such as intersymbol interference, the input signal is passed through a complex FIR filter with the taps set by LinearDistortionTaps. Frequency offset distortion is set by the Freq. Offset slider control. Similarly, the phase jitter amplitude (peak-to-peak, in degrees) is set by the Phase Jitter slider control while the phase jitter frequency is set by the PhaseJitterFrequencyHz parameter. The phase of frequency offset and phase jitter can be reset with the Reset Phase control button. The amplitude of the added complex white Gaussian noise is set by the Noise Power slider control.
TkBasebandEquivChannel Subnetwork
For component and parameter details, refer to Interactive Controls and Displays.
TclScript Component
TclScript reads a file containing Tcl commands. It can be used in a variety of ways, including using Tk to animate or control a simulation. Procedures and global variables will have been defined for use by the Tcl script by the time it is sourced; these enable the script to read inputs to the component or set output values. The Tcl script can optionally define a procedure to be called by ADS Ptolemy for every simulation of the component.
For component and parameter details, refer to Interactive Controls and Displays.
TkEye, TkConstellation, TkHistogram, TklQrms, and TkPower Components
These TclTk components generate an eye diagram, an IQ constellation diagram, a histogram diagram, a display of the rms value of the IQ input signal, and a signal power display in dBm, respectively.
For component and parameter details, refer to Interactive Controls and Displays.
References
- John K. Ousterhout, Tcl and the Tk Toolkit (Addison-Wesley Professional Computing) , Addison-Wesley Publishing Company. May 1994.
- Brent B. Welch, Practical Programming in Tcl & Tk , Prentice Hall: Englewood Cliffs, NJ. July 1997. 2nd Bk and cdr Edition.
- Mark Harrison and Michael J. McLennan, Effective Tcl/Tk Programming: Writing Better Programs in Tcl and Tk , Addison-Wesley Publishing Company. November 25, 1997.
The following web site is a good place to look for Tcl/Tk information:
http://www.yahoo.com/Computers_and_Internet/programming_and_development/languages/tcl_tk/
Privacy
Statement
|
Terms of Use
|
Legal |
Contact Us
|
© Agilent 2000-2008 ![]()











