Data Sources

Curves are comprised of an X data vector and a Y data vector. The X and Y vectors can be read from a data file, defined as mathematical expressions, or entered as values. The X and Y vectors of a curve do not have to come from the same source. For instance, the data source for the X vector of a curve can be an ASCII file and the source for the Y vector of the same curve can be defined by an expression such as sqrt(x).

File as a Data Source

If File is selected as the source, the file panel is displayed, allowing you to select data files for the X and Y vectors.

Figure 1.

Math as a Data Source

If Math is selected as the source, the curve calculator is displayed, allowing you to define the vector mathematically.

Math as a source allows you to use additional curve vectors to plot a curve. In addition to the traditional X and Y vectors, you can use U and V vectors to perform operations on a curve at plotting time. As a result, only one curve is generated in the session. This is helpful any time that you want to create a curve and immediately apply a function (for example, a filter) to that curve.

Figure 2.
Curve Calculator
Curves can be defined mathematically using the curve calculator.
The curve calculator is displayed when Math is selected as the data source for a vector.
The curve calculator is formatted much like a scientific calculator. It consists of a number pad, basic algebraic and trigonometric functions, and, curve fitting, filtering, and signal-processing functions. Expressions can be typed directly into the vector field or entered by clicking selected numbers, functions, or operators on the curve calculator.
Once the expression is constructed, click Apply to plot the curve
Defining a range is a quick way of specifying a spread of values for a vector. Click Range to display the Range dialog.
See Defining a Range for more information.
Calculus Functions
Integrals and derivatives are displayed as:

Independent and dependent vectors must be supplied for both functions.

See Math Reference for a detailed description of each function and its purpose.

Signal Processing
Fast and discrete Fourier transforms, as well as windowing, power spectral density, and frequency response functions can be included in expressions.
Click Window to display the Window dialog.

Figure 3.
There are six different windowing functions available:
  • Hamming
  • Hanning
  • Kaiser-Bessel
  • Blackman-Harris
  • Parzen
  • Welch

See Math Reference for more information on integrals and derivatives.

Curves may be passed through two classes of filters, ideal or SAE. Click Filters... to display the Filter dialog box.

Figure 4.

Select either Ideal, SAE or SAE J211/1 from the Filter Class option menu.

There are four ideal filter types available:
  • low pass
  • high pass
  • band pass
  • band stop

For ideal filters, specify the type of filter and the cutoff frequency. Band pass and band stop filters require both a low and a high cutoff frequency. Click OK to insert the filter into the expression.

Any SAE filter class can be specified by modifying the entered filter class (60, 180, 600, or 1000) in the Y text field.

For SAE J211/1, select the padding type and direction.

Polynomial and exponential functions can be fit to curves. Click Fit... to display the Curve Fit dialog box.

Figure 5.
Select either a polynomial or an exponential function to fit to the curve. Up to a 20th order polynomial can be fit to a curve. Specify the order for the polynomial, then click OK.
Math Functions
The Functions... button displays a dialog box containing all available math functions. External functions or Templex functions can be registered in the program using *RegisterExternalFunction() or *RegisterTemplexFunction() in the preference file.

Any of the functions can be inserted into the current expression by selecting the function name from the list or by typing the name directly into the equation.

See the List of Standard Functions topic in the Math Reference help for more information.

External Functions
In addition to the built-in math functions and operators, external C-programs can also be called from within a math expression.
Calling an external function enables you to process plot data from within the program using your own set of specialized programs. For example, the external program can be a customized filter for manipulating plot data or a program that passes plot data to another application for processing.
External programs must be registered in the preferences file before they can be called from within a math expression. Registering an external program associates the program file with a function name. External programs can be registered in your own preferences file or in the global preferences file, making it available to everyone on the network.
See the Altair IPC for more information on writing and calling external C-programs from within a math expression.
See the *RegisterExternalFunction() statement in Preference Files help for more information on registering external functions in the preferences.mvw file.
Freezing Vectors
When a vector is defined by an expression, the program automatically recalculates the vector each time the expression is altered, in turn, updating the curve. If an expression contains a reference to another curve and the referenced curve changes, the program recalculates the vector and updates the curve containing the reference.

Vectors can be frozen so that the program does not recalculate the curve. When a vector is frozen, it is no longer dependent on a referenced curve, so changes made to other curves are not reflected in the frozen vector. Vectors can be unfrozen, making them once again subject to change. The X and Y vectors can be frozen independently of each other or together, freezing the entire curve. Frozen vectors are saved as data point values in session files.

Values as a Data Source

If Values is selected as the source, a table is displayed, allowing you to directly enter data point values.

Figure 6.