Generate/EDIT5.gif Generate Signal


The Generate Signal option in the Edit menu and in the general toolbar is used to create signals from a mathematical set of equations.

Entering the Signal Expression

The signal entry uses a simple ASCII multiline editor.

Generate/8991.gif Generate/8992.gif Generate/8993.gif You can use the Cut, Copy, and Paste items to move text about or to paste in the formula if you placed it into the clipboard via another program.

All of the functions and constants available within AutoSignal can be accessed via a special Function Insert help.

You can define as many constants as you want. For example, SQRT2PI=SQRT(2*PI) would be defined on one line and used in subsequent lines. Constant expressions are evaluated once and the numeric result is stored. Any assignment to a variable other than F1-F25 and Y is assumed to be a constant. Any expression containing X or XYINDEX must be assigned either to an F1-F25 expression or to Y. F1-F25 and Y expressions are compiled and are evaluated once for each data point. The Y expression must always be the last line in the signal expression. The following is a simple signal example that generates one random sinusoid. There are five constants and a single Y= signal expression

SRATE=5000

NYQ=SRATE/2

AMP=50+50*RANDOM

FREQ=NYQ*(0.01+0.09*RANDOM)

PHASE=2*PI*RANDOM

Y=AMP*SIN(2*PI*X*FREQ+PHASE)

The following example generates three random sinusoids and uses F1-F3 functions.

SRATE=5000

NYQ=SRATE/2

AMP1=50+50*RANDOM

AMP2=50+50*RANDOM

AMP3=50+50*RANDOM

FREQ1=NYQ*(0.0166667+0.15*RANDOM)

FREQ2=NYQ*(0.1666667+0.1666667*RANDOM);

FREQ3=NYQ*(0.3333333+0.15*RANDOM);

PHASE1=2*PI*RANDOM

PHASE2=2*PI*RANDOM

PHASE3=2*PI*RANDOM

F1=AMP1*SIN(2*PI*X*FREQ1+PHASE1)

F2=AMP2*SIN(2*PI*X*FREQ2+PHASE2)

F3=AMP3*SIN(2*PI*X*FREQ3+PHASE3)

Y=F1+F2+F3

Using Derivative Functions

The first derivative function is DX(Fn) where n is from 1 to 25 and references an F1 to F25 expression. The second derivative function is DX2(Fn). The following example is for the first derivative of a sine function:

F1=100*SIN(2*PI*X*5000+PI/2)

Y=DX(F1)

Using Integration Functions

The primary integration function is AIP(n,start,end,prec). It first seeks to achieve the target precision using a successive step Gaussian Quadrature. If this is unsuccessful, a Romberg procedure follows. If the Romberg fails to achieve the desired precision, an Adaptive Quadrature procedure is used. The following example uses the AIP() function to generate the cumulative of the Log-Normal distribution:

LOWER=1E-8

F1=LN($/2.1)/5.2

F2=EXP(-0.5*F1*F1)

Y=100*AIP(F2,LOWER,X,1E-6)

Note that the $ symbol is used as the variable of integration. In this example, the second function expression is integrated with $ ranging from a lower limit to X, to a precision of 6 significant figures. Infinite limits are supported although you must use the -INF and INF constants in order to automatically trigger the transforms.

Gaussian Quadrature Functions

The Romberg and Adaptive Quadrature algorithms are generally much slower than the Gaussian Quadrature procedure. For numerically intense integrations, you may wish to restrict the integration to the Gaussian Quadrature procedure. This is done by using the QIP(n,start,end,prec) function.

Validation

A signal expression is extensively validated before it is compiled. If there is a math or parser error, you will be given a clear indication of the error and the cursor will be placed at the location where the validation failed.

Generated X Values

The X Minimum, X Increment, and X Maximum fields are used to create the X values that will be used for the generated signal. The output is limited to 65536 values.

Adding White Noise

To automatically add white noise to the generated signal, enter a value in the Gaussian Noise % field. Gaussian noise with a standard deviation of this % of the data series standard deviation is added at the conclusion of the signal generation.

Reading a Signal

Use the Read button to read a signal from disk. Signal files are binary and must be created within the program.

Saving a Signal

Use the Save button to save a signal to disk. A signal is always validated before a Save is made.

AutoSignal Graph

When the signal is successfully validated, the generated signal is plotted in an AutoSignal Graph.

Generate/8943.gif The List Data option lists the index, x, y values of the generated signal. The listing uses the AutoSignal text viewer facility.

Generate/8941.gif The Copy Data to Clipboard option copies the x and y values of the generated signal to the clipboard. Formats include full precision binary (for spreadsheets such as Excel) and ASCII (for pasting into text editors).

Generate/8942.gif The Save Data to Disk option writes the x and y values of the generated signal to a supported file format. These formats include ASCII, Excel 97, Excel 95, Lotus WK3, Lotus WK1, SPSS, or Systat.

Generate/8910.gif Close the graph with the OK button in order to be offered an option to update the main data table with the generated signal.

Generate/8911.gif Close the graph with the Cancel button to be returned to the signal entry dialog.

Sample Signals

The program includes the following sample signal files:

· sample0.sig: 3 random amplitude and phase sinusoids spread randomly in three frequency ranges across Nyquist range, 1024 points, 10% white noise

· sample1.sig: 3 random amplitude and phase sinusoids spread randomly in three frequency ranges across lower half of Nyquist range, 1024 points, 10% white noise

· sample2.sig: 3 random amplitude and phase sinusoids spread randomly in three frequency ranges across lower half of Nyquist range, 48 points, 10% white noise

· sample3.sig: 4 sequential random amplitude, frequency, and phase sinusoids in Nyquist range, 1024 points, 10% white noise, 256 pts per sinusoid

· sample4.sig: 3 random amplitude and phase sinusoids spread randomly in three frequency ranges across lower quarter of Nyquist range, 256 points, 10% white noise

· sample5.sig: 3 random amplitude and phase sinusoids spread randomly in three frequency ranges across lower quarter of Nyquist range, 256 points, 10% white noise, random linear baseline

· sample6.sig: 1 random amplitude, frequency, phase sinusoid in Nyquist range, 1024 points, 50% white noise

· sample7.sig: 12 random amplitude and phase sinusoids spread randomly in 12 frequency ranges across lower half of Nyquist range, 1024 points, 10% white noise

· sample8.sig: 24 random amplitude and phase sinusoids spread randomly in 24 frequency ranges across lower half of Nyquist range, 1024 points, 10% white noise

· sample9.sig: chirp signal with increasing frequency with random rate, 1001 points, 5% white noise

· sample10.sig: chirp signal with decreasing frequency with random rate, 1001 points, 5% white noise

· sample11.sig: mixed chirp signal with both increasing and decreasing frequencies, shared random rate, 1001 points, 5% white noise

One generated example of each of these signals is also included in the last worksheet in sample.xls. These represent signals that were used for testing many of the procedures within AutoSignal. You may want to begin your exploration of AutoSignal by importing these signals with the Generate Signal option, or by importing the sample data sets using the File menu's Import option and sample.xls.

Note that these nine signal functions correspond closely with options 0 to 11 in the asig1.dll sample automation DLL.



INDEX Exit AutoSignal Editor