首页    期刊浏览 2024年09月18日 星期三
登录注册

文章基本信息

  • 标题:A Waveform Generation Language for arbitrary waveform synthesis - used along with the HP 8770A Arbitrary Waveform Synthesizer on HP 9000 Series 200 and 300 computers - technical
  • 作者:Derrick T. Kikuchi
  • 期刊名称:Hewlett-Packard Journal
  • 印刷版ISSN:0018-1153
  • 出版年度:1988
  • 卷号:April 1988
  • 出版社:Hewlett-Packard Co.

A Waveform Generation Language for arbitrary waveform synthesis - used along with the HP 8770A Arbitrary Waveform Synthesizer on HP 9000 Series 200 and 300 computers - technical

Derrick T. Kikuchi

A Waveform Generation Language for Arbitrary Waveform Synthesis

THE WAVEFORM GENERATION LANGUAGE (WGL) was developed by Hewlett-Packard as a software tool for waveform design and analysis. Running on HP 9000 Series 200 and 300 Computers, it is the primary front-panel interface used to control the HP 8770A Arbitrary Waveform Synthesizer. Depending on whether you are a beginning user, a programmer, or an applications engineer, WGL can be approached in different ways.

The Beginning User's View

From the beginning user's viewpoint, WGL is a reverse Polish notation (RPN) calculator that can operate on entire waveforms in the same way that normal calculators operate on single numbers. Waveforms can be easily created using single-command operations. In all, there are over 100 commands at the user's disposal, but only the most demanding waveforms require the use of more than a few of them.

Waveforms are created by performing these operations on three basic building blocks: ramps, constants, and noise. For instance, a one-cycle sine wave can be created by the following steps: (1) RAMP [left brace]Create a ramp from - 1 to 1.[right brace] (2) PI* [left brace]Ramp between - [pi] and + [pi].[right brace] (3) SIN [left brace]Sine between - [pi] and + [pi].[right brace]

Line 1 initializes an array of elements with linearly increasing values from - 1 to + 1. Line 2 multiplies all element values by [pi] resulting in array element values from - [pi] to + [pi]. Line 3 takes the sine of all array element values.

The advantage of using RPN is that intermediate steps of waveform development are visible. The above sequence created y = sin(x). We can continue to operate on this waveform: (4) SQ [left brace]Yields y = sin.sup.2 (x).[right brace] (5) COS [left brace]Yields y = cos(sin.sup.2 (x)).[right brace]

Step by step, we can immediately see the effects of each operation. If we make a mistake, we can back up a step by simply typing UNDO.

The wasveforms that can be created by WGL are for the most part limited only by the user's imagination. Waveforms can be designed mathematically and/or graphically in both the frequency and time domains. This means that a waveform created in the time domain can be shaped in the frequency domain with a digital filter and then generated with the HP 8770A. In the frequency domain, spectral components are easily created, thereby allowing the user to generate extremely complex signals.

The Programmer's View

From the programmer's viewpont, WGL is a threaded interpretive language (TIL). Threaded interpreted languages accept source commands and execute them directly, rather than having to be compiled. TILs have the additional advantage that new commands can be created in terms of old commands. The new commands can in turn be used to create even higher-level commands.

For example, a new command called SINEWAVE could be created by simply typing: (6) DEFINE SINEWAVE (7) RAMP PI* SIN (8) END

This new command can now be used just like any other WGL command.

The flexibility for the user to expand and change the WGL language easily and the speed advantage that comes from efficient execution make TILs very attractive. But many TILs have a number of major limitations: simplistic data stacks that do not protect the user from putting too much data in or taking too much data out, very limited data types and a need for many duplicated commands to handle each data type, hard-to-read and clumsy program control constructs, and the inability to have commands that can accept input both interactively and programmatically.

WGL differs from other reverse Polish notation TILs (like Forth and Forth variants) in several ways. One is the existence of a universal data stack capable of handling any of the WGL data types: waveforms, numbers, and strings. The effect of an operation varies depending on the data on the stack so that addition (+) results in a single number when adding numbers but results in a waveform when adding waveforms. Thus, WGL can get away with having much fewer unique commands. Also, the data stack cannot be overflowed or underflowed, since it is managed like the stack in other RPN calculators.

Another WGL difference is that it keeps a program stack that is separate from the data stack. This eliminates accidental corruption of program flow information related to incorrect data manipulation. WGL also differs from RPN TILs in that program control structures aren't reversed. This eliminates hard-to-read constructs like: IF ELSE_STMT1 ELSE_STMT2 ELSE THEN_STMT1 THEN_STMT2 THEN In WGL, the construct reads: IFTRUE (THEN_STMT1 THEN_STMT2) IFFALSE (ELSE_STMT1 ELSE_STMT2)

A final major difference about WGL is that some of its commands can either interactively prompt for input or get their values from the data stack. For example, the SAVEWAVE command without any parameters will prompt the user for a filename. However, "filename" $ SAVEWAVE will cause SAVEWAVE to take its filename from the stack. The dollar sign ($) indicates that the next command requiring interactive input should instead get its information from the "script" currently on the data stack.

For the programmer, WGL is a highly structured language that has the flexibility and ease of use of a threaded interpreted language while incorporating philosophies that overcome deficiencies that TILs normally have. This leads to easily developed programs.

The Application Engineer's View

Finally, we look at WGL from the application engineer's view. WGL makes application development based on digital signal synthesis easy because of its fast prototyping capabilities. Fast prototyping is possible because WGL is a general-purpose tool that manages all of the low-level tasks associated with array manipulation. Combined with a rich command set and the ability to operate in both the frequency and the time domain, this makes WGL a very powerful tool.

Of course, it is always possible for experienced programmers to implement various test signals in the language of their choice. Typically, the more complex a test signal is, the more complex the program to generate it. If the signal cannot easily be represented with an equation, or if several variations of the signal are needed, the progrmmer's job becomes much more difficult. The high-level array manipulation commands and graphic interface of WGL make it easy to prototype a wide range of signals.

Let's prototype a signal for an application that requires damped sine wave to simulate the effects of electromagnetic pulses (EMP). The signal is represented by the following equation: where w is 2[pi] times the sine wave frequency and Q controls the decay rate. The signal needed has the following parameters: f = 1 MHz Q = 4 0 [is less than or =] t [is less than or =] 4.096 [mu]s By substituting these values into the equation for V(t), we can obtain:

This signal can be implemented in WGL with the following commands: (1) 4.096E-6 SECS CTX [left brace]Set array size[right brace] (2) RAMP 1+ 2/ -1.024 PI** EXP ? [left brace]Build decay envelope[right brace] (3) STORE A [left brace]Save decay envelope[right brace] (4) RAMP 1+ 2/ 8.192 PI** COS ? [left brace]Build 1-MHz sine wave[right brace] (5) A* ? [left brace]Damped sine wave[right brace] (6) DOWNLOAD GO [left brace]Generate actual signal[right brace]

Line 1 converts 4.096 [mu]s into the appropriate number of array elements. CTX uses this number to establish the working array size.

Line 2 produces the exponential decay envelope (see Fig. 1a). RAMP 1 + 2/ fills the array elements with linearly increasing values from 0 to 1. The array elements of line 2 are then multiplied by -1.024[pi]. EXP uses all the element values as exponents for e, resulting in the decay envelope.

Line 3 stores the decay envelope in waveform storage register A.

Line 4 produces the 1-MHz sine wave (Fig. 1b).

Line 5 multiplies the sine wave by the decay envelope, as in the original equation, resulting in the damped sine wave (Fig. 1c).

Line 6 sends the damped sine wave to the HP 8770A Arbitrary Waveform Synthesizer, where the waveform is generated.

In this application, the signal, a damped sine wave, is represented by a fairly simple equation. Why then couldn't we write a BASIC, Pascal, or C program to implement the equation? We could have. But let's look at the things we did not have to do or even worry about by prototyping in WGL: * We didn't have to dimension any arrays. * We didn't have to initialize any arrays. * We didn't create a FOR-NEXT loop to process the equation for 0 [is less than or =] t [is less than or =] 4.096 [mu]s. * We didn't have to increment the array element pointer to coincide with the increment of t. * We didn't have to scale the resulting data to the values required by the digital signal synthesis hardware. * We didn't have to write a graphics driver to see if the signal looked like the one we wanted. * We didn't have to debug the program(s). * We didn't have to write an instrument driver for the HP 8770A.

The Waveform Generation Language (WGL), therefore, is a tool easily approachable by a novice user and yet powerful enough to meet the programming and fast prototyping need s of today's sophisticated real-life signal requirements.

COPYRIGHT 1988 Hewlett Packard Company
COPYRIGHT 2004 Gale Group

联系我们|关于我们|网站声明
国家哲学社会科学文献中心版权所有