SPRAAK
Functions
sspmod_fun_eval.c File Reference

Mathematical transformations of parameters. More...

Functions

void spr_fun_eval_free (SprSspInfo *Info)
 
int spr_fun_eval_setup (SprSspInfo *Info, const char **descript, void *aux_info)
 
int spr_fun_eval_process (SprSspInfo *Info, const void *frame_in, void *frame_out)
 
void spr_fun_eval_reset (SprSspInfo *Info, SprSspStatus *action)
 

Detailed Description

Mathematical transformations of parameters.

Evaluate a simpel mathematical function (no if's or loops).


[fun_eval]
var <var_name> ...
Define all variables. When defined, the variables named '_fname', '_nfr', '_vlen', '_nchan', '_fshift', '_sf' are automatically set to the current file name, the number of frames in the file, ...
const <expr> ...
Evaluate constant expression (independant from the input data, executed once when setting up the module).
output <fname>
Write the output of the print statement to this headerless file.
eval_code:
Start an eval code block (executed for each frame).
reset_code:
Start a reset code block (executed before processing a new file).
init_code:
Start an initialisation code block (executed once when setting up this module).
eval <expr> ...
A simple expressions to calculate the output frame from the input frame. The final result has to be stored in the variable 'ovec'.
goto <label>
An unconditional jump (e.g. for if ... then ... else ... constructions, or the break in a for/while loop). You can jump from one code block (init,reset,eval) to another code block.
print <str_or_expr> ...
A print statement. The items to print must be seperated by commas. The items are either strings (surrounded by \"\\") or expressions (for which the value is printed).
if<expr> print <str_or_expr> ...
[matches expressions]
A conditional print statement.
if<expr> goto <label>
[matches expressions]
A conditional jump (see the unconditional jump for more details).
if<expr> eval <expr> ...
[matches expressions]
A conditional expression.
if<expr> <expr> ...
[matches expressions]
A conditional expression.
label <name>
Define a label to jump to.
example ivec=<expr> ...
Example of an input frame, used to calclutate the output vector length. By default a vector containing all ones is used.
<expr> ...
Expression in a code block (eval, reset, or init).

Author
Kris Demuynck
Date
07 May 1995
Revision History:
07/05/1995 - KD
creation
12/03/2019 - KD
added flow control statements, print statements, reset code
See also
ssp_master.c, feval.c