Global TMW:
Login  |  Register          Free Newsletter Subscription
Subscribe
Email
Print
Reprint
Learn RSS

Equations shape AWG waveforms

To test a circuit or a system, you can use equations to produce repeatable, predictable waveforms on an arbitrary waveform generator.

Martin Rowe, Senior Technical Editor -- Test & Measurement World, 5/1/2001

When testing just about any circuit, you often need to subject your UUT to well-defined stimuli. To test a circuit or system under known, calculated conditions, you can create your own waveforms through equations and play those waveforms on an arbitrary waveform generator (AWG).

AWGs let you create waveforms from equations in many ways. Some bench AWGs, for example, let you build equations right on the instrument. Others require PC software to write the equations. Equation-writing software ranges from manufacturer-supplied waveform builders to spreadsheets, math packages, and text editors. After you create an equation, you either download it into the AWG, which compiles it into waveform points and stores the points in the instrument’s memory, or you compile the waveform and download its points from a file.

TMW01_05F4fig1.gif (25032 bytes)
Figure 1. Test an antilock-brake subsystem with a waveform that increases in frequency and amplitude over time. Courtesy of PC Instruments.

Suppose you wanted to generate a signal that tests an antilock-brake subsystem. The signal is a sine wave that linearly increases in both amplitude and frequency over time. Figure 1 shows the waveform that an AWG will produce from the equation below, which combines a swept-frequency sinewave with a ramp function.

wpe2B1.jpg (1434 bytes)

for 0 < t < T0
where

wpe2B2.jpg (1194 bytes)

and

wpe2B3.jpg (1178 bytes)


A0 = 0.5 V

f0 = 250 Hz
T0 = 1 s

A bench AWG may have built-in equation functions and a compiler that creates voltages from equations. Built-in functions include sine, cosine, pulse width, and exponential decay or rise. See “Waveforms and equations" for examples. These AWGs typically let you define a variable in terms of math functions and operators. See “Examples of real AWGs” for descriptions of how two instruments create waveforms from equations.

Once you write the waveform equation, you need to download it into your AWG. Some bench AWGs let you download equation scripts directly from Matlab or Mathcad into the instrument’s hard drive or a disk. The AWG then compiles the equation scripts and stores the data they produce in its memory. When you start the instrument, it sends the waveform, point-by-point, to its ADC and output filters.

Not all bench AWGs incorporate waveform compilers. In fact, board-level AWGs include neither compilers nor disk drives. They rely on a host computer to compile equations into waveform points and store them in files. For AWGs without compilers, you can develop your waveform equations with a spreadsheet or math-software package. You can produce the waveform in Figure 1 by calculating each point with a spreadsheet, creating a text file indicating amplitude vs. sample, and loading the data into the AWG’s memory. In effect, you create an array that represents amplitude vs. samples. Depending on your AWG and your application, you may need to use your PC software to scale your signal’s amplitude into volts or your AWG may do that for you.

You must also specify the AWG’s sample clock rate or the waveform’s time duration. With some AWGs, you specify the sample clock rate. In others, you specify the waveform’s time duration, and the instrument calculates the clock rate based on the time and number of samples.

If your bench AWG doesn’t compile equation scripts or you’re using a card-based AWG, you can still use math software packages to create a waveform’s points. Agilent VEE, for example, integrates Matlab scripts into graphical programs. National Instruments’ LabView has a graphical math toolkit from which you can generate equations, store them in files or arrays, and download them into an AWG.

The program in Figure 2 downloads a test waveform into an AWG at the start of a test session. Tom Melle, hardware test engineer at IBM (Raleigh, NC), developed a test that uses an equation in Agilent VEE to produce a disturbance on an AC power waveform. The disturbance is a decayed 400.35-Hz sine wave riding on a 60-Hz signal. The program calculates the points on the waveform, stores them in an array, and downloads them into an AWG. The AWG repeats the 1024-point waveform 10 times at 3-s intervals. In between sending the disturbances, the AWG produces clean AC waveforms. The AWG’s output drives a programmable power source, which powers the UUT. T&MW

TMW01_05F4fig2.gif (24152 bytes)
Figure 2. You can program the points in a waveform through equations in a programming language. Courtesy of IBM.

For more information

“Easy Waveform Creation using Math Entry on the 20xx Waveform Synthesizers,” Application Note AD-1048, Analogic, Peabody, MA, 1998. This note provides a math overview plus more than 30 waveform examples. It is available by contacting Analogic at 978-977-3000.  

“G Math—A New Paradigm for Mathematics,” National Instruments, Austin, TX. zone.ni.com, (click on Resource Library, LabView, General, and look under Tutorials). The tutorial provides examples of how to use LabView’s G Math Toolkit to create equations graphically.

“Waveform Creation Made Easy,” LeCroy, Chestnut Ridge, NY. www.lecroy.com/tutorials/WaveformCreation/WaveformCreation.html. This tutorial shows you how to use equations in the LW 420 AWG and gives examples for using equations to create 33 waveforms.

Martin Rowe has a BSEE from Worcester Polytechnic Institute and an MBA from Bentley College. Before joining T&MW in 1992, he worked for 12 years as a design engineer for manufacturers of semiconductor process equipment and as an applications engineer for manufacturers of measurement and control equipment. E-mail: m.rowe@tmworld.com.

Waveforms and equations

To find detailed explanations of how to build wavefforms with specific instruments, you can consult AWG user manuals as well as the documents listed under “For more information” (p. 62). These resources also include dozens of examples. Armed with a few basic equations, you can build complex waveforms. The syntax will vary from one AWG to another or from one programming language or math-software package to another. The concepts, though, apply to all instruments.

Sine wave: Amplitude = V • sin(2pft)

TMW01_05F4figA.gif (4395 bytes)       

Ramp function:  Amplitude = V step • t

TMW01_05F4figB.gif (1716 bytes)

where Vstep represents the voltage change per unit time.

Exponential decay: Amplitude = V • (1 – e t/tc)

TMW01_05F4figC.gif (1703 bytes)

where tc is the time constant.

Gaussian Pulse: Amplitude = Ve – 1/2 (( t – tm) / ts)2

TMW01_05F4figD.gif (1798 bytes)

where t represents time, tm defines the time location of the waveform’s peak, and ts defines the time from the peak to one standard deviation.

Linear frequency swept sine:

 TMW01_05F4figE.gif (11654 bytes)

 0501eq3.gif (4286 bytes)

With these equations as building blocks, you can construct more complex waveforms. For example, you can combine the ramp and swept-sine equations to form the antilock-brake waveform in Figure 1.

The analog waveforms I’ve described can help you test many circuits, but often you need digital signals. AWGs use various methods to create pulse trains or square waves. In general, AWGs create these signals through a step function where you define the transition times. You can use square waves and pulses as gates to activate and deactivate other signals.

To create a square wave, you can combine a step function with a sine function so the step function is high when the sine function is equal to or greater than zero, and low otherwise. That’s analogous to running a sine wave through a zero-crossing detector circuit. If you write scripts or programs to generate the square wave, you can use a for-next loop to control the square-wave’s state.

The waveform below combines a square wave, a cosine wave, and an exponential decay to simulate ringing when the square wave changes state.

TMW01_05F4figF.gif (2896 bytes)

Amplitude =  Step(sin(2pfsquare t)) + [Vringcos(2pfringttrans )]• [1–e–ttrans/tc]

where fsquare is the frequency of the square wave, Vring is the peak voltage of the ringing, fring is the frequency of the ringing, ttrans is the time since the square wave changed state, and tc is the time constant of the exponential decay.—Martin Rowe

Examples of real AWGs

Each AWG manufacturer uses a different method to create waveforms from equations. With a LeCroy LW 420, you use math functions and operators to create up to 16 equations. You assign each equation to a variable. To create the signal in Figure 1, you can set the entire equation equal to a single variable. You can also break the waveform’s equation into several variables and combine them in another equation. When you split an equation into variables that represent the equation’s components, you can use those components in other waveforms. You can individually test each variable.

The Tektronix AWG610 uses a C-like scripting language that includes “for-next” loops and “if-then-else” decisions. Listing 1 gives an example of how to use the scripting language to create a spread-spectrum clock. Each portion of the complete script resides not just in a separate variable, but in a separate file. You can store the files on a disk drive or on the AWG’s internal drive and reuse the waveforms in other test applications.—Martin Rowe

Listing 1
‘ 100MHz SSC: Spread Spectrum Clock
‘ Carrier function: Sine
‘ Modulation function: Triangle

‘ “SSC100B.wfm” Modulation waveform
‘ “SSC100F.wfm” Integration of mod. waveform
‘ “SSC100C.wfm” Carrier signal
‘ “SSC100S.wfm” Modulated signal

clock = 1e9 ‘Clock setting
ct = 100e6 ‘Center frequency
dur = 15e-6 ‘Duration per sweep cycle
fd = 0.625e6 ‘Frequency-to-Frequency amplitude
fm = 1/dur ‘Frequency for a sweep cycle

cyc = dur * ct
cyc = (cyc - int(cyc))
if cyc=0.5 or cyc=0.25 or cyc=0.125 or cyc=0.1 then
cyc = round(1/cyc)
else
cyc = 1
endif

—Courtesy of Tektronix

Email
Print
Reprint
Learn RSS

Talkback

We would love your feedback!

Post a comment

» VIEW ALL TALKBACK THREADS

Related Content

Related Content

 

By This Author

Sponsored Links



 
Advertisement
SPONSORED LINKS

More Content

  • Blogs
  • Podcasts

Blogs

  • Rick Nelson
    TAKING THE MEASURE

    July 1, 2008
    S-parameters are so yesterday
    Textbook amplifiers operate in linear mode and are easy to analyze. Unfortunately, it’s often ...
    More
  • Martin Rowe
    Rowe's and Columns

    May 28, 2008
    More on Bill and Dave
    In my January 11 posting, "Tell your Bill and Dave Stories," I asked if the HP Way still e...
    More
  • » VIEW ALL BLOGS RSS

Podcasts

Advertisements





NEWSLETTERS
Click on a title below to learn more.

Test Industry News (3 Times Per Month)
Machine-Vision & Inspection (Monthly)
Communications Test (Monthly)
Design, Test & Yield (Monthly)
Automotive, Aerospace & Defense (Monthly)
Instrumentation (Monthly)
Resource Center E-Alert (Monthly)
©2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy
Please visit these other Reed Business sites