|
<< Click to Display Table of Contents >> 8.3 Sine, Capacitor, Ramp & Exponential waveforms |
![]() ![]()
|
Sine, Capacitor, Ramp, and Exponential waveforms can be automatically generated using State label equations. These are special state label equations that generate both the waveform and the state values at the same time. See Section 1.3 Generating Waveforms and States with Equations for general information on label equations.
This is an older method of generating analog waveform data and these equations generate "one-time" results (the generated events react thereafter the same as if you had manually drawn these events). Unlike the Waveform Equation Blocks described in the previous section (Section 8.2: Waveform Equation Blocks for editable Analog waveforms ), the original equation cannot be changed to change the waveform, only the individual events can be edited.
For all the functions shown in this section, there is also an optional last parameter that can specify the number of points to use when drawing the waveform. For example, the first equation could also be written as SinStart(5,20,100,40) to indicate that 40 points should be used to draw the waveform. If no points are specified the tool will decide how many points to use. The sampling frequency can also be forced to be a particular value for all new signals when the Enforce as Sampling Period check box is checked in the the Edit Text and Edge Grids dialog.
Generate the Analog State Label equations:
|

|
Sine Wave Equations
|
SinStart([amplitudeV], [period], [duration])
|
||
|
Sin([amplitudeV], [period], [duration])
|
||
|
SinEnd([amplitudeV], [period], [duration])
|
Capacitor Equations
|
CapCharge([amplitude], [RC], [duration])
|
||
|
CapDischarge([amplitude], [RC], [duration])
|
Ramp Waveforms
|
Ramp([StartV], [EndV], [Duration])
|
Exponential Waveforms
|
Exponential(amplitudeV, exponent, duration, offset)
|
Setting the Sampling Frequency of an Analog Label Equation
You can set the sampling frequency when you create an analog signal using the optional numberOfPoints parameter. If not specified, numberOfPoints defaults to a value that tends to yield a relatively smooth curve. But when you have a specific sampling frequency requirement for your analog signal, you will need to override the default. Below is an example using the Sin() function.
To create a 3V sine wave with frequency of 5MHz, a sampling frequency of 100MHz and 400 ns duration, the following calculations must be performed:
period = 1/frequency = 1/5MHz = 200 ns
sampling period = 1/sampling frequency = 1/100MHz = 10 ns
numberOfPoints = duration/sampling period = 400 ns / 10 ns = 40
The final equation to create this signal would be:
//Sin(amplitudeV, period, duration,numberOfPoints)
Sin(3, 200, 400,40)
Enforcing the Sampling Frequency of Analog Label Equations:
Normally, the analog label equations pick a sampling frequency that will result in a smooth curve. This often results in a waveform with a lot of points very close together. There is a way to force the sampling period to be a specific time interval.
|
|
|
|
|
|