By selecting the “System control/Signal calculator” option from the main menu or pressing the 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, SIGVIEW’s 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 spectra or to perform different cross-spectrum calculations.
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 will 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 a certain window is not suitable to be added to the current position in the expression, your mouse cursor will change to and 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 button 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 the ‘>>’ button to add it to the expression, then press the ‘-’ 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 the event that one of the expression windows is deleted, the calculator window will be frozen and will retain its last values.
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)
• Convolution (convolutes first signal with the second one)
• Smooth with (smooth first signal by using the second one as a weighting function)
Order Analysis functions [PRO version only]
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.
Below are some examples of calculator expressions:
1. Simple arithmetic operation on spectra
You have loaded two signals, calculated their spectra and you have the following workspace:
Now, you would like to subtract two calculated spectra to get some information about their differences. To do so, create the following expression in the Signal calculator:
The resulting window will contain the requested difference between spectra.
2. Combining instruments and signals in one expression.
You would like to subtract the mean value of a signal from all signal values (normalisation). Firstly, you would calculate signal mean by using the appropriate instrument:
Then, you would create the following expression in the Signal calculator:
The result will be a new signal calculated as requested:
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 the RMS of two signals and then create a new instrument containing their difference:
3. Complex expressions.
There are practically no limitations for creating calculator expressions. Here are some examples:
f = A^2 + abs(B) - B^2
Subtract spectrum of one signal from its cross spectrum with another signal
Calculate log-values of both real and image spectrum and then perform inverse FFT