spLib
|
Data Structures | |
class | spSVector |
Vector type that contains the elements of short type. More... | |
class | spLVector |
Vector type that contains the elements of long type. More... | |
class | spFVector |
Vector type that contains the elements of float type. More... | |
class | spDVector |
Vector type that contains the elements of double type. More... | |
Macros | |
#define | SP_LOW_FLOAT_PRECISION SP_32BIT_PRECISION |
#define | SP_LONG_PRECISION SP_32BIT_PRECISION |
#define | SP_SHORT_PRECISION SP_16BIT_PRECISION |
#define | SP_CHAR_PRECISION SP_8BIT_PRECISION |
Enumerations | |
enum | spPrecision { SP_HIGHEST_PRECISION = 128 , SP_HIGH_DOUBLE_PRECISION = 72 , SP_DOUBLE_PRECISION = 64 , SP_LOW_DOUBLE_PRECISION = 48 , SP_HIGH_FLOAT_PRECISION = 34 , SP_FLOAT_PRECISION = 33 , SP_32BIT_PRECISION = 32 , SP_24BIT_PRECISION = 24 , SP_16BIT_PRECISION = 16 , SP_8BIT_PRECISION = 8 , SP_IGNORE_PRECISION = 0 , SP_UNKNOWN_PRECISION = 255 } |
enum | spComputeSpeed { SP_COMPUTE_SPEED_EXTREMELY_FAST = 35 , SP_COMPUTE_SPEED_VERY_FAST = 30 , SP_COMPUTE_SPEED_FASTER = 25 , SP_COMPUTE_SPEED_FAST = 20 , SP_COMPUTE_SPEED_NORMAL = 10 , SP_COMPUTE_SPEED_SLOW = 5 , SP_COMPUTE_SPEED_SLOWER = 4 , SP_COMPUTE_SPEED_VERY_SLOW = 3 , SP_COMPUTE_SPEED_EXTREMELY_SLOW = 2 , SP_COMPUTE_SPEED_UNKNOWN = -1 } |
The vector type is a type which is used as an argument or a return value of many signal processing functions of this library. Types of spSVector for short type, spLVector for long type, spFVector for float type and spDVector for double type are provided.
The memory of spSVector , spLVector , spFVector or spDVector can be allocated by the functions which have a prefix xsv, xlv, xfv or xdv respectively. If you don't use the vector anymore, you have to deallocate the memory by calling xsvfree() , xlvfree() , xfvfree() or xdvfree() .
Lock and unlock functions for the vector type, which are introduced from version 0.9, are important for fast computation. When you access the data array of the vector such as ->data
and ->imag
, you must lock the vector, i.e. must call lock function, before access. Since the unlocked vector has correct data only in the internal data structure which enables fast computation internally, fast computation can be realized by applying processing directly to the internal data structure which can be different from the data structure of the vector type. So, you have to unlock the vector before calling the function when you need fast computation (the initial allocated vector is normally locked). In the case of a function with multiple argument vectors, fast computation cannot be performed unless all the argument vectors are locked. Note that the gain of fast computation will be small when you call the unlock/lock functions many times, because the unlock/lock functions include big overhead on some environments. Therefore, calling multiple signal processing functions after unlocking the vector, then locking the vector is desirable.
#define SP_LOW_FLOAT_PRECISION SP_32BIT_PRECISION |
float type precision lower than normal float type
#define SP_LONG_PRECISION SP_32BIT_PRECISION |
long type precision.
#define SP_SHORT_PRECISION SP_16BIT_PRECISION |
short type precision.
#define SP_CHAR_PRECISION SP_8BIT_PRECISION |
char type precision.
enum spPrecision |
Indicates precision of computation.
enum spComputeSpeed |
Indicates speed of computation.