Signal calculator
   SIGVIEW Help Home


By choosing System control/Signal calculator option from the main menu or pressing graphic toolbar button, you can start one of the most useful tools in SIGVIEW, the Signal calculator.

Just as a standard calculator is used for calculating expressions with numbers, SIGVIEWs calculator can be used to combine signals or instruments in different arithmetic or signal analysis expressions. You can use it, for example, to add or subtract two signals or spectrums or to perform different cross-spectrum calculations.

graphic

Usage

In the upper left box,  the names of all existing signal or instrument windows (loaded signals, FFT results, etc.) in your SIGVIEW workspace  will be shown. You can choose to display all windows, only instruments or only signal-like windows (containing sequences of values).

As the alternative to choosing windows in the list, you can also do it graphically:
Below the list, you see a graphical display of your workspace, just as in Control Window. By simply clicking on an icon, the corresponding window will be added to the expression window on the right side. If certain window is not suitable to be added to the current position in the expression, your mouse cursor will change to graphicand you will not be able to add it to the expression.

The list box on the right side will contain the new expression for the evaluation.

At the bottom of this dialog, various buttons with all available calculator functions are shown. Only functions which are available in the given context will be enabled. For example, only after you add a signal window to your expression, a binary function buttons like "+", "-", "/",... will be enabled.

You can move signals from the left to the right box (include them in the expression) by double-clicking their names or selecting them and pressing the ‘>> button. For example, to subtract two signals, simply select the name of the first one, press >> button to add it to the expression, then press - button, and finally add the second signal to your expression.

Important note: Longer arithmetic expressions will be calculated in the order listed in the expression box and not according to the mathematical operator precedence. For example, the expression sqrt(A) + log(B) * C will be calculated as (sqrt(A) + log(B)) * C. The expression A+B*C+D+E*F will be calculated as ((((A+B)*C)+D)+E)*F.

When you create the complete signal expression, click OK to create the result signal. It will be linked to all windows included in the expression and will recalculate and redraw each time they change. In case that one of expression windows is deleted, the calculator window will be frozen and will keep its last values.

Functions

Unary functions (can be applied to a one signal or instrument window)

·    sqrt (square root)
·    log (log10)
·    ln (loge)
·    x^2 (squared)
·    abs (absolute value)
·    2* (multiply with 2)
·    10* (multiply with 10)
·    (1/2)* (multiply with 1/2 i.e. divide with 2)
·    (1/10)* (multiply with 1/10 i.e. divide with 10)
·     sin, cos, tan, atan: trigonometric functions

Binary functions (can be applied to two signal or instrument windows)

·    * (multiply)
·    / (divide)
·    + (plus)
·    -  (minus)                                
·    Cross-correlation
·    Convolution (convolutes first signal with the second one)
·    Smooth with (smooth first signal by using the second one as a weighting function)
·    Cross spectrum
·    Cross coherence
·    Cross gain
·    Phase shift
·    Relative spectrum (dBr) Complex-FFT
·    Inverse-FFT
·    Complex-FFT

Order Analysis functions [PRO version only]

·    Convert TO Order Signal
·     Convert FROM Order Signal

For further information about Order Analysis functions, see Order Analysis chapter
      
If only simple arithmetic binary functions (*, /, +, -) are used, you can freely mix instrument and signal windows in the expression.

If you include two signals of different lengths in a binary operation (for example you subtract one signal from another one), SIGVIEW will use only a part of the longer signal (starting from its first sample) which has the length of the shorter signal.


Examples

Here are some examples of calculator expressions.

1. Simple arithmetic operation on spectrums.

You have loaded two signals, calculated their spectrums and you have the following workspace:
graphic

Now, you would like to subtract two calculated spectrums to get some information about their differences. To do it, create the following expression in the Signal calculator:

graphic

The resulting window will contain th requested difference between spectrums.

graphic


2. Combining instruments and signals in one expression

You would like to subtract mean value of a signal from all signal values (normalization). First, you would calculate signal mean by using the appropriate instrument:

graphic

Then, you would create the following expression in the Signal calculator:

graphic

The result will be a new signal calculated as requested:

graphic


2. Instrument-only expressions

You can also have expressions containing only instrument windows. The result of such expressions will also be a new instrument window.

In this example, we calculate RMS of two signals and then create a new instrument containing their difference:

graphic

graphic


3. Complex expressions

There a practically no limitations for creating calculator expressions. Here are some examples:

f = A^2 + abs(B) - B^2
graphic


Subtract spectrum of one signal from its cross spectrum with another signal
graphic


Calculate log-values of both real and imag spectrum and then perform inverse FFT
graphic
Signal calculator