Program FUNC operates on variables in time-domain. The mode of operation of the program is controlled in the input data command FUNC.
Input data are read in free format, valid separators between the input values are <space>, <comma>, <tab>, <equal sign> or <carriage return>. The commands can be written both in lower and upper case letters. The operation of the program is controlled by the commands described below; some of the commands also need arguments.
| FUNC | Controls the mode of operation of the program. |
| INFIL1 | Input data file variable 1 |
| INFIL2 | Input data file variable 2 |
| DATA | Sets the data type, single or complex precision |
| FORMF1 | Format in which INFIL1 shall be read |
| FORMF2 | Format in which INFIL2 shall be read |
| CHECK_FORMF1 | Controls if FORMF1 shall be checked or not |
| CHECK_FORMF2 | Controls if FORMF2 shall be checked or not |
| UTFIL | Name of output data file |
| TYPE_UTFIL | Defines how to write the results in file UTFIL. |
| FORMUT | Format in which UTFIL shall be written |
| FIN | Input data vector |
| AMPL | Input data scalar |
| LAMBDA | Input data scalar |
| LENGTH | Input data scalar |
| DX | Input data scalar |
| XVALUES_INCREASING | Define how to treat the X-axle. |
| EOF | Command which terminates further input data reading |
| ABS | Calculates the absolute value of the Y-variable in INFIL1 |
| ADD | Adds the Y-variable in INFIL1 to the Y-variable in INFIL2 |
| ADD_C | Adds a scalar to the Y-variable in INFIL1 |
| ADDX_C | Adds a scalar to the X-variable in INFIL1 |
| AVERAGE | Calculates the average value of the Y-variable in INFIL1 |
| CABS | Calculates the complex absolute value of the complex Y-variable in INFIL1 |
| CIRCLE | Creates a variable describing a circle |
| CONJG | Calculates the complex conjugate of the complex Y-variable in INFIL1 |
| CONST | Creates a variable describing a horizontal line |
| COS | Creates a variable describing a cosinus variable. |
| CROSS-CORR | Calculates the cross-correlation function of INFIL1 and INFIL2 |
| DERIV_M | Creates the derivative of a variable |
| DIV | Divides the Y-variable in INFIL1 by the Y-variable in INFIL2 |
| FIT_X4_LEG | Fits a fourth order polynomial to the Y-variable in INFIL1 |
| HPASS1_0 | Filters the Y-variable in INFIL1 through a first order high-pass filter |
| HPASS2_0 | Filters the Y-variable in INFIL1 through a second order high-pass filter |
| INTEG_HEUN | Integrates a variable read from file |
| INTPL_L | Interpolates the Y-variable in INFIL1 linearly |
| INV | Inverts the Y-variable in INFIL1 |
| LPASS1_0 | Filters the Y-variable in INFIL1 through a first order low-pass filter. |
| LPASS2_0 | Filters the Y-variable in INFIL1 through a second order low-pass filter. |
| LPASS2_M | Filters the Y-variable in INFIL1 through a second order low-pass filter with variable cut-off frequency. |
| MEAN_M | Calculates the average value of INFIL1 in a sliding window |
| MED | Calculates the average value of the Y-variable in INFIL1 and the corresponding Y-variable in INFIL2 |
| MUL | Multiplies the Y-variable in INFIL1 by the Y-variable in INFIL2 |
| MUL_C | Multiplies the Y-variable in INFIL1 by a scalar |
| MULX_C | Multiplies the X-variable in INFIL1 by a scalar |
| NOISE_NORMAL | Creates a variable containing a normal distributed noise |
| PLINE_1 | Creates a variable describing a straight line |
| REDUCE | Filter a function by reducing the number of points describing the curve into a minimum |
| RMEAN | Filters the Y-variable INFIL1 by removing a sliding mean value. |
| RMS | Calculates the RMS-value of the Y-variable in INFIL1 |
| RS | The same as in RMS but does not calculate the average |
| SIN | Creates a variable describing a sine-wave |
| SPLINE | Interpolates the Y-variable in INFIL1 by splines |
| SPLINE_G | Interpolates the Y-variable in INFIL1 by B-splines |
| SPLINE_G_REL | Interpolates the Y-variable in INFIL1 by B-splines |
| SUB | Subtracts the Y-variable in INFIL2 from the Y-variable in INFIL1 |
| SUM | Totals all Y-values in INFIL1. |
| FIN(1) | = | Defines the start coordinat from where the interpolation begins. Default value: the first point in INFIL1. |
| FIN(2) | = | Defines the end coordinat from where the interpolation stops. Default value: the last point in INFIL1. |
| FIN(3) | = | Base cut-off angular frequency in [rad/s] |
| FIN(4) | = | Cut-off angular frequency in [rad/s], to be added on FIN(3) when large variations in input data occurs. |
| eps | = | Max deviation from the current curvature |
| epsg | = | Above this amplitude the error is calculated as a relative error |
| alfa | = | If the slope of the curve decreases under alfa the curve is considered to be purely horizontal. |
'(A,A)' = reads column 1 & 2
'(A,X,A)' = reads column 1 & 3
'(A,X,X,A)' = reads column 1 & 4
'(A,X,X,X,A)' = reads column 1 & 5
'(A,X,X,X,X,A)' = reads column 1 & 6
'(A,X,X,X,X,X,A)' = reads column 1 & 7
'(A,X,X,X,X,X,X,A)'= reads column 1 & 8
'(X,A,A)' = reads column 1 & 3
'(X,A,X,A)' = reads column 1 & 4
'(X,A,X,X,A)' = reads column 1 & 5
'(X,A,X,X,X,A)' = reads column 1 & 6
'(X,A,X,X,X,X,A)' = reads column 1 & 7
'(X,A,X,X,X,X,X,A)'= reads column 1 & 8
When DATA='CMPLX', file INFIL1 can be read in free format if FORMF1 is set equal to 'CMPLX'.
When FORMF1='CMPLX', the first four columns will be read from INFIL1.| NCOLS | = | Which implies that the number of columns in INFIL1 shall be checked with respect to the format given in FORMF1. If the number of columns disagree program FUNC will be interrupted and an error message will be written. |
| NO | = | Which implies no checking of input data file INFIL1 and format FORMF1. |
| NCOLS | = | Which implies that the number of columns in INFIL2 shall be checked with respect to the format given in FORMF2. If the number of columns disagree program FUNC will be interrupted and an error message will be written. |
| NO | = | Which implies no checking of input data file INFIL2 and format FORMF2. |
| CREATE | = | Start writing from the beginning of the file, erasing any potential previous data in the file. |
| APPEND | = | Start writing at the end of the file, old results on UTFIL will be kept. |
| IGNORE | = | Don't check the values in the X-axle, accept any values in any order. |
| CHECK_POSITIVE | = | Check that the values are strictly increasing. If not, an error will occur and the program will write an error message and then stop further execution. |
| CHECK_NEGATIVE | = | Check that the values are strictly decreasing. If not, an error will occur and the program will write an error message and then stop further execution. |
| FORCE_POSITIVE | = | Check that the values are strictly increasing. If not, program FUNC will skip all data which not are increasing. |
| FORCE_NEGATIVE | = | Check that the values are strictly decreasing. If not, program FUNC will skip all data which not are decreasing. |
The examples are divided into three groups:
- Creation of new curves
- Operations on one curve
- Operations on two curves
The files shall be given the extention .funcf to associate the files with program func in the gensys script genrun.
#
# Input data for program func
#
FUNC = sin
AMPL = 10. LAMBDA = 5. LENGTH = 49.9 DX = .2
#
UTFIL = test/sin_l5d2.sngl FORMUT = SNGL DATA = SNGL
#
Create a circle:
#
# Input data for program func
#
# Create a part of a circle
#
FUNC = circle
DX = .1
# x0, y0, R, x1, x2, side
FIN = 0., -400., 400.,-20., 20., +1.,
DATA = SNGL
UTFIL = ucat/circle.sngl FORMUT = SNGL TYPE_UTFIL = CREATE
EOF
Create a strait line:
#
# Input data for program func
#
FUNC = pline_1
DX = .1
# x1, y1, x2, y2
FIN = 27.238, -9.728, 32.438, -19.396,
DATA = SNGL
UTFIL = ucat/pline.sngl FORMUT = SNGL TYPE_UTFIL = CREATE
EOF
Create a normal distributed noise:
#
# Input data for program func
#
# Create a Normal distributed noise
# Fin(1)= Average value
# Fin(2)= Standard Deviation
#
FUNC = NOISE_NORMAL
fin = 0., 1., LENGTH = 140. DX = 0.1
DATA = SNGL
UTFIL= ver_test/Nnoise.sngl FORMUT= SNGL TYPE_UTFIL= CREATE
eof
#
# Input data for program func
#
#
FUNC = ADDX_C AMPL = -14
XVALUES_INCREASING = 'IGNORE'
INFIL1= ucat/cos_l5d2.sngl FORMF1 = '(a,a)' DATA = SNGL
UTFIL = ucat/cos_add.sngl FORMUT = SNGL TYPE_UTFIL = CREATE
EOF
Smoothing by splines:
#
# Input data for program func
#
FUNC = SPLINE_G
AMPL = .2 DX=0.1
#
XVALUES_INCREASING = 'FORCE_POSITIVE'
INFIL1= ver_test/puls2.sngl FORMF1= '(a,a)' DATA= SNGL
UTFIL = ver_test/psmooth.sngl FORMUT= SNGL TYPE_UTFIL= CREATE
EOF
Fitting a polynomial of degree 4 according to the least square method:
#
# Input data for program func
#
FUNC = FIT_X4_LEG
LENGTH = 10. DX = .2
INFIL1= ex1.print FORMF1 = '(a,a)' DATA = SNGL
UTFIL = ex1.print.fit FORMUT = SNGL TYPE_UTFIL = CREATE
eof
#
# Input data for program func
#
FUNC = ADD
INFIL1= ucat/cos_l5d1.sngl FORMF1 = '(a,a)' DATA = SNGL
INFIL2= ucat/cos_l5d2.sngl FORMF2 = '(a,a)' DATA = SNGL
UTFIL = ucat/cos_sum.sngl FORMUT = SNGL TYPE_UTFIL = CREATE
eof
Averaging two curves:
#
# Input data for program func
#
FUNC = MED
INFIL1= ucat/cos_l5d1.sngl FORMF1 = '(a,a)' DATA = SNGL
INFIL2= ucat/cos_l5d2.sngl FORMF2 = '(a,a)' DATA = SNGL
UTFIL = ucat/cos_med.sngl FORMUT = SNGL TYPE_UTFIL = CREATE
eof
Calc of cross-correlation:
#
# Input data for program func
#
FUNC = CROSS-CORR
#
XVALUES_INCREASING = 'CHECK_POSITIVE'
INFIL1= invar1.sngl FORMF1= '(a,a,x)' DATA= SNGL
INFIL2= invar2.sngl FORMF2= '(a,x,a)' DATA= SNGL
UTFIL = cross-corr.sngl FORMUT= SNGL TYPE_UTFIL= CREATE
EOF