Next: Specify a transfer function
Up: Filter Analysis and Design
Previous: Syntax
Contents
Variables and Expressions
A string of characters can can be used as a FA variable identifier
if it has the following properties:
- it is not a FA keyword;
- it starts with a letter (A to Z or a to z);
- it contains only letters and figures.
Specifically, note that a, b, c, d, f,
g, h k, m, and w, as well as their uppercase
equivalents, are all FA keywords, and hence cannot be used as variable
identifiers.
The variables represent real numbers or expressions and can in turn be
used in expressions, for instance:
y = 2 * x + sin(z);
output: y;
x = 1;
z = 2;
output: y;
produces the following output.
2.9093
Table 1 shows the available mathematical functions.
Table 1:
FA mathematical functions that can be used in expressions.
+
|
binary addition |
-
|
binary subtraction |
* |
binary multiplication |
^ |
binary power |
sin(x)
|
sine of x
|
cos(x)
|
cosine of x
|
tan(x)
|
tangent of x
|
asin(x)
|
arc sine of x
|
acos(x)
|
arc cosine of x
|
atan(x)
|
arc tangent of x
|
log(x)
|
natural logarithm of x
|
log10(x)
|
logarithm with base 10 of x
|
abs(x)
|
absolute value of x
|
sqrt(x)
|
square root of x
|
exp(x)
|
ex
|
cn(x, k)
|
Jacobi cn of x
with modulus k
|
sn(x, k)
|
Jacobi sn of x
with modulus k
|
dn(x, k)
|
Jacobi dn of x
with modulus k
|
|
The functions sn, cn, and dn are the Jacobian elliptic functions.
A number of FA variables have a predefined value, although it is possible
to set them to any other value. Some of these have a special
meaning for FA, which is explained in appropriate sections. The predefined
FA variables are in Table 2.
Table 2:
Predefined FA variables.
|
Next: Specify a transfer function
Up: Filter Analysis and Design
Previous: Syntax
Contents
2009-06-03