Objective of this first lab to understandg some of the basic use model of ADS PTolemy and understand the concept to using Sink, Interactive Control and Displays etc.
1. Create a new workspace from File->New->Workspace and make sure DSP library is selected in the library selection window as shown below
276
2. Open a new schematic cell and place following components from library
a. SineGen source from Numeric Sources library (note the blue colour stem which indicates that the output from SineGen would be of Float data type)
b. Numeric Sink from Sinks library
c. DF (Data Flow / PTolemy) controller from Common Components library. Note that DF controller has Numeric Start, Stop & Time Start, Stop which shall be used as per the blocks in the design.
Currently there are no Timed block in our design hence Time start & stop will be ignored.
3. Simulate the design by pressing F7 or Simulate icon
4. Insert a rectangular graph in the data display window and select N1 (name of the numeric sink, designers can rename the sink as they need) data to plot to observe the data as shown below.
Please note that Y-axis limits can be changed to +1.5 to -1.5 as shown below.
277
Notice the X-axis on the graph which mentioned Index (which is data sample index as per the RadiansPerSample setting in SineGen source)
5. Insert a TkPlot from Interactive Control and Displays library and connect it to the SineGen source as shown below. TkPlot is used to see the data on real time basis which is very useful before running a long simulation to make sure design is providing the expected results. Change the yRange on TkPlot to -1.5 1.5 to scale the Y-axis of the display window.
6. Click in Simulate icon and observe the TkPlot which will run in continuous mode till we click on Quit button as shown below. Once we click on Quit, normal data display with N1 result will appear.
Please note TkPlots are qualitative plots and not quantitative hence we can’t place markers etc for readout.
278
7. Now let us understand how signal / domain conversion can be performed to form a very basic mixed mode simulation. Place following components in the design:
a. Insert Timed sink and Spectrum Analyzer sink from Sinks library b. Insert Float to Timed converter from Signal converter library.
Modify following in the design:
a. Delete or Deactivate Tk Plot
b. Define TStep=1nsec in Float to Timed converter
c. Change the DefaultTimeStop=100nsec in the DF controller Once completed, schematic should look as below:
279
8. Simulate and add a new rectangular plot alongwith previously plotted N1 (Numeric sink) and select T1 (Timed Sink) and notice the time domain waveform with X-axis is denoted as time.
Add a new rectangular graph and plot S2 (Spectrum Analyzer) in dBm to see the 1-tone spectrum waveform
Notice that resolution of spectrum plot is not good and that is because we only have 100 sample point resolution i.e. 100nsec (Stop Time) /1nsec (Sampling Time) = 100.
Increase the DefaultTimeStop = 1024 nsec and observe the data display again and now Spectrum plot should be much nicer. More samples you have better will be the spectrum resolution
280
Lab2: Interactive Control
Let’s extend Lab1 to understand how can we add few dynamically changing effects on to our system design by using TkSlider component from Interactive Controls and Displays library.
1. Do following:
a. Insert TkPlot again (if deleted in earlier lab) or reactivate it (if deactivated earlier) b. Insert IID_Uniform noise source from Numeric Sources library
c. Insert Multiply (Mpy) and Adder (Add) from Numeric Math library d. Insert TkSlider from Interactive Controls and Displays library
e. Modify the DefaultTimeStop = 10 usec for good resolution in the spectrum plot with noise f. Connect them as shown below, essentially we are multiplying the IID_Uniform noise
amplitude with the TkSlider ranging values of 0.1 (min) to 1 (max) and same shall be mixed with our clean SineGen source to introduce Signal + Noise effect for our analysis.
281
2. Simulate the design and notice a slider bar with Identifier shown as Scale (which is same as in TkSlider component) and when we change the slider the TkPlot changes in real time….Click Quit once done and observe the data display plot.
282
References
1. J. B. Dennis, First Version Data Flow Procedure Language, Technical Memo MAC TM61, May 1975, MIT Laboratory for Computer Science.
2. E.A. Lee and D. G. Messerschmitt, "Static Scheduling of Synchronous Data Flow Programs for Digital Signal Processing," IEEE Trans. on Computers, vol. 36, no. 1, pp. 24-35, January 1987.
3. E.A. Lee and D. G. Messerschmitt, "Synchronous Data Flow," Proc. of the IEEE, vol. 75, no. 9, pp. 1235- 1245, September 1987.
4. R.M. Karp and R. E. Miller, "Properties of a Model for Parallel Computations: Determinancy, Termination, Queueing," SIAM Journal, vol. 14, pp. 1390-1411, November 1966.
283