| spLib
    | 
Vector type that contains the elements of float type. More...
#include <sp/vector.h>

| Public Member Functions | |
| Text I/O for Vector (<sp/fileio.h>) | |
| spBool | fvreadfvector_txt (const char *filename, spFVector vector) | 
| spFVector | xfvreadfvector_txt (const char *filename) | 
| spBool | fvreadcol_txt (const char *filename, int col, spFVector vector) | 
| spFVector | xfvreadcol_txt (const char *filename, int col) | 
| spBool | fvwritefvector_txt (const char *filename, spFVector vector) | 
| Vector Modification for I/O (<sp/fileio.h>) | |
| float | fvmaxamp (spFVector vec) | 
| float | fvadjustamp (spFVector vec, float amp) | 
| float | fvlimitamp (spFVector vec, float amp) | 
| spFVector | xfvextractchannel (spFVector x, int channel, int num_channel) | 
| Vector Dump (<sp/fileio.h>) | |
| void | fvdump (spFVector vec) | 
| void | fvfdump (spFVector vec, FILE *fp) | 
| void | fvnfdump (FILE *fp,...) | 
| Memory Allocation and Deallocation | |
| spFVector | xfvalloc (long length) | 
| void | xfvfree (spFVector vector) | 
| spFVector | xfvallocul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvalloculfromv (spFVector x, long length) | 
| void | fvrfree (spFVector x) | 
| void | fvialloc (spFVector x) | 
| void | fvifree (spFVector x) | 
| spFVector | xfvriallocul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvrialloc (long length) | 
| spFVector | xfvrealloc (spFVector x, long length) | 
| Lock and Unlock | |
| spBool | fvisplugincomputable (spFVector x) | 
| spBool | fvislocked (spFVector x) | 
| spBool | fvlock (spFVector x) | 
| spBool | fvunlock (spFVector x) | 
| spBool | fvsetlock (spFVector x, spBool lock) | 
| spBool | fvsync (spFVector x) | 
| Complex Number Handling | |
| spFVector | xfvcplx (spFVector xr, spFVector xi) | 
| void | fvreal (spFVector x) | 
| void | fvimag (spFVector x) | 
| spFVector | xfvreal (spFVector x) | 
| spFVector | xfvimag (spFVector x) | 
| void | fvconj (spFVector x) | 
| spFVector | xfvconj (spFVector x) | 
| void | fvriswap (spFVector x) | 
| spFVector | xfvriswap (spFVector x) | 
| Data Copy | |
| void | fvcopy (spFVector y, spFVector x) | 
| void | fvrcopyi (spFVector y, spFVector x) | 
| void | fvicopyr (spFVector y, spFVector x) | 
| long | fvcopyfromarray (spFVector y, long y_offset, float *data, long length) | 
| long | fvcopyfromriarray (spFVector y, long y_offset, float *data, float *imag, long length) | 
| long | fvcopytoarray (spFVector x, long x_offset, float *data, long length) | 
| long | fvcopytoriarray (spFVector x, long x_offset, float *data, float *imag, long length) | 
| spFVector | xfvclone (spFVector x) | 
| spFVector | xfvcat (spFVector x, spFVector y) | 
| void | fvcat (spFVector x, spFVector y) | 
| Data Initialization | |
| spBool | fvinit (spFVector x, float m, float incr, float n) | 
| spFVector | xfvinit (float m, float incr, float n) | 
| spFVector | xfvinitul (spPlugin *plugin, float m, float incr, float n, spBool unlock_flag) | 
| spBool | fviinit (spFVector x, float m, float incr, float n) | 
| spBool | fvriinit (spFVector x, float m, float incr, float n) | 
| spFVector | xfvriinit (float m, float incr, float n) | 
| spFVector | xfvriinitul (spPlugin *plugin, float m, float incr, float n, spBool unlock_flag) | 
| Data Editing | |
| spFVector | xfvcut (spFVector x, long offset, long length) | 
| long | fvpaste (spFVector y, spFVector x, long y_offset, long x_length, spBool overlap) | 
| long | fvadd (spFVector y, long y_offset, spFVector x, long x_offset, long x_length, spBool overlap) | 
| void | fverase (spFVector x, long offset, long length, spBool inv) | 
| Data Modification | |
| void | fvset (spFVector x, float *data, long length) | 
| void | fviset (spFVector x, float *imag, long length) | 
| spFVector | xfvsetve (spPlugin *plugin, float *data, long length) | 
| spFVector | xfvset (float *data, long length) | 
| spFVector | xfvsetnew (float *data, long length) | 
| spBool | fvsetval (spFVector x, long index, float value) | 
| spBool | fvsetival (spFVector x, long index, float value) | 
| Absolute Value (<sp/vmath.h>) | |
| void | fvabs (spFVector x) | 
| spFVector | xfvabs (spFVector x) | 
| Square Root (<sp/vmath.h>) | |
| void | fvsqrt (spFVector x) | 
| spFVector | xfvsqrt (spFVector x) | 
| Square (<sp/vmath.h>) | |
| void | fvsquare (spFVector x) | 
| spFVector | xfvsquare (spFVector x) | 
| Sign Function (<sp/vmath.h>) | |
| void | fvsign (spFVector x) | 
| spFVector | xfvsign (spFVector x) | 
| Cumulative Sum (<sp/vmath.h>) | |
| void | fvcumsum (spFVector x) | 
| spFVector | xfvcumsum (spFVector x) | 
| Cumulative Product (<sp/vmath.h>) | |
| void | fvcumprod (spFVector x) | 
| spFVector | xfvcumprod (spFVector x) | 
| Differences (<sp/vmath.h>) | |
| void | fvcodiff (spFVector x, double coef) | 
| spFVector | xfvcodiff (spFVector x, double coef) | 
| #define | fvdiff(x) fvcodiff(x, 1.0); | 
| #define | xfvdiff(x) xfvcodiff(x, 1.0); | 
| Sum (<sp/vmath.h>) | |
| float | fvsum (spFVector x) | 
| float | fvisum (spFVector x) | 
| float | fvsqsum (spFVector x) | 
| float | fvabssum (spFVector x) | 
| Product (<sp/vmath.h>) | |
| float | fvprod (spFVector x) | 
| float | fvriprod (spFVector x, float *oiprod) | 
| Norm (<sp/vmath.h>) | |
| float | fvnorm (spFVector x, long p) | 
| Dot Product (<sp/vmath.h>) | |
| float | fvdot (spFVector x, spFVector y) | 
| void | fvcplxdot (spFVector x, spFVector y, float *re, float *im) | 
| Mean and Variance (<sp/vmath.h>) | |
| float | fvvar (spFVector x, float *mean) | 
| float | fvstd (spFVector x, float *mean) | 
| #define | fvmean(x) (fvsum(x) / (float)x->length) | 
| Minimum and Maximum (<sp/vmath.h>) | |
| float | fvmin (spFVector x, long *index) | 
| float | fvmax (spFVector x, long *index) | 
| void | fvscmin (spFVector x, float a) | 
| void | fvscmax (spFVector x, float a) | 
| void | fvelmin (spFVector x, spFVector y) | 
| void | fvelmax (spFVector x, spFVector y) | 
| Sort and Median (<sp/vmath.h>) | |
| void | fvsort (spFVector x) | 
| spFVector | xfvsort (spFVector x) | 
| spLVector | xfvsortidx (spFVector x) | 
| float | fvmedian (spFVector x) | 
| spFVector | xfvmedian (spFVector x, float *median) | 
| Zero-Crossing Count (<sp/vmath.h>) | |
| long | fvzerocross (spFVector x, int slope_sign) | 
| Phase Angle (<sp/vmath.h>) | |
| void | fvangle (spFVector x) | 
| spFVector | xfvangle (spFVector x) | 
| Trigonometric functions (<sp/vmath.h>) | |
| void | fvcos (spFVector x) | 
| spFVector | xfvcos (spFVector x) | 
| void | fvsin (spFVector x) | 
| spFVector | xfvsin (spFVector x) | 
| void | fvtan (spFVector x) | 
| spFVector | xfvtan (spFVector x) | 
| void | fvcosh (spFVector x) | 
| spFVector | xfvcosh (spFVector x) | 
| void | fvsinh (spFVector x) | 
| spFVector | xfvsinh (spFVector x) | 
| void | fvtanh (spFVector x) | 
| spFVector | xfvtanh (spFVector x) | 
| void | fvacos (spFVector x) | 
| spFVector | xfvacos (spFVector x) | 
| void | fvasin (spFVector x) | 
| spFVector | xfvasin (spFVector x) | 
| void | fvatan (spFVector x) | 
| spFVector | xfvatan (spFVector x) | 
| void | fvatan2 (spFVector y, spFVector x, spBool reverse) | 
| spFVector | xfvatan2 (spFVector y, spFVector x) | 
| Exponents and Logarithms (<sp/vmath.h>) | |
| void | fvexp (spFVector x) | 
| spFVector | xfvexp (spFVector x) | 
| void | fvlog (spFVector x) | 
| spFVector | xfvlog (spFVector x) | 
| void | fvlog10 (spFVector x) | 
| spFVector | xfvlog10 (spFVector x) | 
| void | fvdecibela (spFVector x) | 
| spFVector | xfvdecibela (spFVector x) | 
| void | fvdecibelp (spFVector x) | 
| spFVector | xfvdecibelp (spFVector x) | 
| void | fvundecibelp (spFVector x) | 
| spFVector | xfvundecibelp (spFVector x) | 
| void | fvdecibel (spFVector x) | 
| spFVector | xfvdecibel (spFVector x) | 
| void | fvundecibel (spFVector x) | 
| spFVector | xfvundecibel (spFVector x) | 
| Random Number (<sp/vmath.h>) | |
| void | fvrandun (spFVector x) | 
| spFVector | xfvrandunul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvrandun (long length) | 
| void | fvgauss (spFVector x, float mu, float sigma) | 
| spFVector | xfvgaussul (spPlugin *plugin, long length, float mu, float sigma, spBool unlock_flag) | 
| spFVector | xfvgauss (long length, float mu, float sigma) | 
| void | fvrandn (spFVector x) | 
| spFVector | xfvrandnul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvrandn (long length) | 
| Vector Operation (<sp/voperate.h>) | |
| void | fvoper (spFVector a, const char *op, spFVector b) | 
| spFVector | xfvoper (spFVector a, const char *op, spFVector b) | 
| void | fvscoper (spFVector a, const char *op, float t) | 
| spFVector | xfvscoper (spFVector a, const char *op, float t) | 
| void | fvcplxoper (spFVector a, const char *op, float tr, float ti) | 
| spFVector | xfvcplxoper (spFVector a, const char *op, float tr, float ti) | 
| Element Reorder (<sp/voperate.h>) | |
| spFVector | xfvremap (spFVector x, spLVector map) | 
| Element Extraction (<sp/voperate.h>) | |
| spLVector | xfvfind (spFVector x) | 
| spFVector | xfvfindv (spFVector x) | 
| Element Comparison (<sp/voperate.h>) | |
| void | fvsceval (spFVector x, const char *op, float t) | 
| spFVector | xfvsceval (spFVector x, const char *op, float t) | 
| spLVector | xfvscfind (spFVector x, const char *op, float t) | 
| spFVector | xfvscfindv (spFVector x, const char *op, float t) | 
| Blackman Window for Vector (<sp/window.h>) | |
| void | fvblackman (spFVector vec) | 
| spFVector | xfvblackmanul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvblackman (long length) | 
| void | fvnblackman (spFVector vec) | 
| spFVector | xfvnblackmanul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvnblackman (long length) | 
| Hamming Window for Vector (<sp/window.h>) | |
| void | fvhamming (spFVector vec) | 
| spFVector | xfvhammingul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvhamming (long length) | 
| void | fvnhamming (spFVector vec) | 
| spFVector | xfvnhammingul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvnhamming (long length) | 
| Hanning Window for Vector (<sp/window.h>) | |
| void | fvhanning (spFVector vec) | 
| spFVector | xfvhanningul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvhanning (long length) | 
| void | fvnhanning (spFVector vec) | 
| spFVector | xfvnhanningul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvnhanning (long length) | 
| Hann Window for Vector (<sp/window.h>) | |
| void | fvhann (spFVector vec) | 
| spFVector | xfvhannul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvhann (long length) | 
| void | fvnhann (spFVector vec) | 
| spFVector | xfvnhannul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvnhann (long length) | 
| Gaussian Window for Vector (<sp/window.h>) | |
| void | fvgausswinex (spFVector vec, float alpha) | 
| spFVector | xfvgausswinexul (spPlugin *plugin, long length, float alpha, spBool unlock_flag) | 
| spFVector | xfvgausswinex (long length, float alpha) | 
| void | fvgausswin (spFVector vec) | 
| spFVector | xfvgausswinul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvgausswin (long length) | 
| void | fvngausswinex (spFVector vec, float alpha) | 
| spFVector | xfvngausswinexul (spPlugin *plugin, long length, float alpha, spBool unlock_flag) | 
| spFVector | xfvngausswinex (long length, float alpha) | 
| void | fvngausswin (spFVector vec) | 
| spFVector | xfvngausswinul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvngausswin (long length) | 
| Rectangular Window for Vector (<sp/window.h>) | |
| void | fvnboxcar (spFVector vec) | 
| spFVector | xfvnboxcarul (spPlugin *plugin, long length, spBool unlock_flag) | 
| spFVector | xfvnboxcar (long length) | 
| Data Fields | |
| long | length | 
| float * | data | 
| float * | imag | 
| Related Symbols | |
| (Note that these are not member symbols.) | |
| #define | fvnums(x, length, value) fvinit(x, (float)(value), 0.0, (float)(length)) | 
| #define | fvzeros(x, length) fvnums(x, length, 0.0) | 
| #define | fvones(x, length) fvnums(x, length, 1.0) | 
| #define | fvinums(x, length, value) fviinit(x, (float)(value), 0.0, (float)(length)) | 
| #define | fvizeros(x, length) fvinums(x, length, 0.0) | 
| #define | fviones(x, length) fvinums(x, length, 1.0) | 
| #define | fvrinums(x, length, value) fvriinit(x, (float)(value), 0.0, (float)(length)) | 
| #define | fvrizeros(x, length) fvrinums(x, length, 0.0) | 
| #define | fvriones(x, length) fvrinums(x, length, 1.0) | 
| #define | xfvnums(length, value) xfvinit((float)(value), 0.0, (float)(length)) | 
| #define | xfvnumsul(plugin, length, value, unlock_flag) xfvinitul(plugin, (float)(value), 0.0, (float)(length), unlock_flag) | 
| #define | xfvzeros(length) xfvnums(length, 0.0) | 
| #define | xfvzerosul(plugin, length, unlock_flag) xfvnumsul(plugin, length, 0.0, unlock_flag) | 
| #define | xfvones(length) xfvnums(length, 1.0) | 
| #define | xfvonesul(plugin, length, unlock_flag) xfvnumsul(plugin, length, 1.0, unlock_flag) | 
| #define | xfvnull() xfvalloc(0) | 
| #define | xfvnullul(plugin, unlock_flag) xfvallocul(plugin, 0, unlock_flag) | 
| #define | xfvrinums(length, value) xfvriinit((float)(value), 0.0, (float)(length)) | 
| #define | xfvrinumsul(plugin, length, value, unlock_flag) xfvriinitul(plugin, (float)(value), 0.0, (float)(length), unlock_flag) | 
| #define | xfvrizeros(length) xfvrinums(length, 0.0) | 
| #define | xfvrizerosul(plugin, length, unlock_flag) xfvrinumsul(plugin, length, 0.0, unlock_flag) | 
| #define | xfvriones(length) xfvrinums(length, 1.0) | 
| #define | xfvrionesul(plugin, length, unlock_flag) xfvrinumsul(plugin, length, 1.0, unlock_flag) | 
| #define | fvunset(x) fvset(x, NULL, 0) | 
| #define | fviunset(x) fviset(x, NULL, 0) | 
| File I/O for Vector (<sp/fileio.h>) | |
| spFVector | xfvreadfsignal (const char *filename, long headlen, int swap) | 
| spBool | fvwritefsignal (const char *filename, spFVector vector, int swap) | 
| #define | xfvreadfvector(filename, swap) xfvreadfsignal((filename), 0, (swap)) | 
| #define | fvwritefvector(filename, vector, swap) fvwritefsignal(filename, vector, swap) | 
Vector type that contains the elements of float type.
Actually, This is a typedefed type by typedef struct _spFVector *spFVector;. To allocate memory for spFVector, call a function with prefix xfv such as xfvalloc() , xfvinit() , etc. To deallocate memory, call xfvfree() . 
Allocates memory for spFVector and sets it in the lock/unlock state.
Allocates memory for spFVector and updates its lock/unlock state by using the status of the input vector.
Allocates memory of both the real and imaginary parts for spFVector and sets it in the lock/unlock state.
| spFVector xfvrialloc | ( | long | length | ) | 
Allocates memory of both the real and imaginary parts for spFVector.
Expands the size of the vector and resets the expanded elements to 0.
x for success, SP_NODATA for failure.    Checks whether the vector is ready for plugin-based computation.
Sets the vector in the locked/unlocked state without data synchronization.
Synchronizes the vector data (->data and ->imag) with the internal data without changing the locked/unlocked state.    
Creates a new vector whose real and imaginary parts are xr and xi , respectively.    
| void fvreal | ( | spFVector | x | ) | 
Deallocates the imaginary part of x if it exists.    
| void fvimag | ( | spFVector | x | ) | 
Sets the imaginary part of x as the real part.    
| void fvconj | ( | spFVector | x | ) | 
Takes the complex conjugate of x.    
| void fvriswap | ( | spFVector | x | ) | 
Swaps the real part of x for the imaginary part.    
Creates a new vector whose real and imaginary parts are the imaginary and real parts of x respectively.    
Copies data of x to y . The imaginary part of x is not copied unless y->imag != NULL.    
Copies data of the real part of x to the imaginary part of y .    
Copies data of the imaginary part of x to the real part of y .    
| long fvcopyfromarray | ( | spFVector | y, | 
| long | y_offset, | ||
| float * | data, | ||
| long | length ) | 
Copies data of the array data to the target location y_offset of y .    
| long fvcopyfromriarray | ( | spFVector | y, | 
| long | y_offset, | ||
| float * | data, | ||
| float * | imag, | ||
| long | length ) | 
Copies the complex array of the real part data and the imaginary part imag to the target location y_offset of y .    
| long fvcopytoarray | ( | spFVector | x, | 
| long | x_offset, | ||
| float * | data, | ||
| long | length ) | 
Copies data extracted from x_offset of x to the array data .    
| long fvcopytoriarray | ( | spFVector | x, | 
| long | x_offset, | ||
| float * | data, | ||
| float * | imag, | ||
| long | length ) | 
Copies data extracted from x_offset of x to the complex array of the real part data and the imaginary part imag .    
Appends data of y to a new vector which is a clone of x.    
Initialize the vector x so that the elements range from m to n using incr as the increment between elements.    
| spFVector xfvinit | ( | float | m, | 
| float | incr, | ||
| float | n ) | 
Creates a new vector ranging from m to n using incr as the increment between elements.    
Creates a new plugin-based vector ranging from m to n using incr as the increment between elements.    
Initialize the imaginary part of the vector x so that the elements range from m to n using incr as the increment between elements.    
Initialize the real and imaginary parts of the vector x so that the elements of both parts range from m to n using incr as the increment between elements.    
| spFVector xfvriinit | ( | float | m, | 
| float | incr, | ||
| float | n ) | 
Creates a new vector whose real and imaginary parts range from m to n using incr as the increment between elements.    
Creates a new plugin-based vector whose real and imaginary parts range from m to n using incr as the increment between elements.    
Extracts data of length from offset of x .    
Pastes data of x cropped with x_length to the target location y_offset of y . The argument overlap determines whether the overlap addition is performed in pasting data.    
| long fvadd | ( | spFVector | y, | 
| long | y_offset, | ||
| spFVector | x, | ||
| long | x_offset, | ||
| long | x_length, | ||
| spBool | overlap ) | 
Pastes data of x_length extracted from x_offset of x to the target location y_offset of y . The argument overlap determines whether the overlap addition is performed in pasting data.    
Erases data of length from offset . The argument inv determines whether the erasing location is inverted.    
| void fvset | ( | spFVector | x, | 
| float * | data, | ||
| long | length ) | 
Sets the address of data to x->data .    
| void fviset | ( | spFVector | x, | 
| float * | imag, | ||
| long | length ) | 
Sets the address of imag to x->imag .    
Sets the address of data to data of a plugin-based new vector.    
| spFVector xfvset | ( | float * | data, | 
| long | length ) | 
Sets the address of data to data of a new vector.    
| spFVector xfvsetnew | ( | float * | data, | 
| long | length ) | 
Creates a new vector whose real part is a clone of data .    
Copies a value to the location of index of the real part of x .    
Copies a value to the location of index of the imaginary part of x .    
Initialize the vector x so that the elements within length are all value .    
Initialize the vector x so that the elements within length are all zeros.    
Initialize the vector x so that the elements within length are all ones.    
Initialize the imaginary part of the vector x so that the elements within length are all value .    
Initialize the imaginary part of the vector x so that the elements within length are all zeros.    
Initialize the imaginary part of the vector x so that the elements within length are all ones.    
Initialize the real and imaginary parts of the vector x so that the elements of both parts are all value .    
Initialize the real and imaginary parts of the vector x so that the elements of both parts are all zeros.    
Initialize the real and imaginary parts of the vector x so that the elements of both parts are all ones.    
Creates a new vector whose elements within length are all value .    
| 
 | related | 
Creates a new plugin-based vector whose elements within length are all value .    
Creates a new vector whose elements within length are all zeros.    
| 
 | related | 
Creates a new plugin-based vector whose elements within length are all zeros.    
Creates a new vector whose elements within length are all ones.    
| 
 | related | 
Creates a new plugin-based vector whose elements within length are all ones.    
| 
 | related | 
Creates a new null vector.
| 
 | related | 
Creates a new null plugin-based vector.
Creates a new vector whose real and imaginary parts are all value .    
| 
 | related | 
Creates a new plugin-based vector whose real and imaginary parts are all value .    
Creates a new vector whose real and imaginary parts are all zeros.
| 
 | related | 
Creates a new plugin-based vector whose real and imaginary parts are all zeros.
Creates a new vector whose real and imaginary parts are all ones.
| 
 | related | 
Creates a new plugin-based vector whose real and imaginary parts are all ones.
| 
 | related | 
Sets x->data to NULL.    
| 
 | related | 
Sets x->imag to NULL.    
| long length | 
| float* data |