Vectors
[Basic]


Detailed Description

All the vector management functions currently supported by the DSP library.

Benchmark on the AT32UC targets


Addition

This function adds two vectors and store the result into another one.

Relative functions:


Addition with saturation

This function adds two vectors and store the result into another one. It takes care of the saturation.

Relative functions:


Addition with a real

This function adds each items of a vector with a real number and store the result into another vector.

Relative functions:


Subtraction

This function subtracts two vectors and store the result into another one.

Relative functions:


Subtraction with a real

This function subtracts each items of a vector with a real number and store the result into another vector.

Relative functions:


Multiplication with a real

This function multiplies one vector with a real number and store the result into another vector.

Relative functions:


Division with a real

This function divides one vector with a real number and store the result into another vector.

Relative functions:


Multiplication with an integer

This function multiplies one vector with an integer and store the result into another vector.

Relative functions:


Division with an integer

This function divides one vector with an integer and store the result into another vector.

Relative functions:


Dot multiplication

This function multiplies two vectors point per point and store the result into another one.

Relative functions:


Dot division

This function divides two vectors point per point and store the result into another one.

Relative functions:


Power

These functions compute vect2^real.
Note:
The output will be limit in the range of the fixed point format used.
Relative functions:


Minimum

This function retrieves the minimum of a vector.

Relative functions:


Maximum

This function retrieves the maximum of a vector.

Relative functions:


Negate

This function negate a vector.

Relative functions:


Zero padding

This function zero pads the tail of the vector.

Relative functions:


Copy

This function copy a vector into another vector.

Relative functions:


Partial Convolution

This function performs a linear partial convolution between two discrete sequences. It returns a signal of a length equals to (vect2_size - vect3_size + 1) elements.
Note:
The two discrete sequences have to be scaled to avoid overflowing values.
All the vectors have to be 32-bits aligned.
Relative functions:


Convolution

This function performs a linear convolution between two discrete sequences. It returns a signal of a length equals to (vect2_size + vect3_size - 1) elements.
Note:
The two discrete sequences have to be scaled to avoid overflowing values.
All the vectors have to be 32-bits aligned.
Warning:
The output buffer of the function has to have at least a length of N + 2*M – 2 elements because of internal computations, where N is the length of the largest input buffer and M, the length of the smallest input buffer.
Relative functions:


Complex addition

This function add two complex vectors and store the result into another one.

Relative functions:


Complex subtraction

This function sub two complex vectors and store the result into another one.

Relative functions:


Complex absolute

This function returns the absolute value of a complex vector.

Relative functions:


Complex conjugate

This function returns the conjugate complex vector of the input.

Relative functions:



Functions

void dsp16_vect_add (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector additon function.
void dsp16_vect_add_and_sat (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector additon function.
void dsp16_vect_complex_abs (dsp16_t *vect1, dsp16_complex_t *vect2, int size)
 16-bit fixed point version of the complex vector absolute function.
void dsp16_vect_complex_add (dsp16_complex_t *vect1, dsp16_complex_t *vect2, dsp16_complex_t *vect3, int size)
 16-bit fixed point version of the complex vector additon function.
void dsp16_vect_complex_conj (dsp16_complex_t *vect1, dsp16_complex_t *vect2, int size)
 16-bit fixed point version of the complex vector conjugate function.
void dsp16_vect_complex_sub (dsp16_complex_t *vect1, dsp16_complex_t *vect2, dsp16_complex_t *vect3, int size)
 16-bit fixed point version of the complex vector subtraction function.
void dsp16_vect_conv (dsp16_t *vect1, dsp16_t *vect2, int vect2_size, dsp16_t *vect3, int vect3_size)
 16-bit fixed point version of the Convolution.
void dsp16_vect_convpart (dsp16_t *vect1, dsp16_t *vect2, int vect2_size, dsp16_t *vect3, int vect3_size)
 16-bit fixed point version of the Partial Convolution.
static void dsp16_vect_copy (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the copy function.
void dsp16_vect_dotdiv (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector dot division function.
void dsp16_vect_dotmul (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector dot multiplication function.
void dsp16_vect_intdiv (dsp16_t *vect1, dsp16_t *vect2, int size, int integer)
 16-bit fixed point version of the vector division with an integer.
void dsp16_vect_intmul (dsp16_t *vect1, dsp16_t *vect2, int size, int integer)
 16-bit fixed point version of the vector multiplication with an integer.
dsp16_t dsp16_vect_max (dsp16_t *vect1, int size)
 16-bit fixed point version of the vector maximum function.
dsp16_t dsp16_vect_min (dsp16_t *vect1, int size)
 16-bit fixed point version of the vector minimum function.
void dsp16_vect_neg (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the vector negate function.
void dsp16_vect_pow (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t real)
 16-bit fixed point version of the power function.
void dsp16_vect_realadd (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t real)
 16-bit fixed point version of the vector addition with a real number.
void dsp16_vect_realdiv (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t real)
 16-bit fixed point version of the vector division with a real number.
void dsp16_vect_realmul (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t real)
 16-bit fixed point version of the vector multiplication with a real number.
void dsp16_vect_realsub (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t real)
 16-bit fixed point version of the vector subtraction with a real number.
void dsp16_vect_sub (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector subtraction function.
static void dsp16_vect_zeropad (dsp16_t *vect1, int size, int num_zero)
 16-bit fixed point version of the zero padding function.
void dsp32_vect_add (dsp32_t *vect1, dsp32_t *vect2, dsp32_t *vect3, int size)
 32-bit fixed point version of the vector additon function.
void dsp32_vect_add_and_sat (dsp32_t *vect1, dsp32_t *vect2, dsp32_t *vect3, int size)
 32-bit fixed point version of the vector additon function.
void dsp32_vect_complex_abs (dsp32_t *vect1, dsp32_complex_t *vect2, int size)
 32-bit fixed point version of the complex vector absolute function.
void dsp32_vect_complex_add (dsp32_complex_t *vect1, dsp32_complex_t *vect2, dsp32_complex_t *vect3, int size)
 32-bit fixed point version of the complex vector additon function.
void dsp32_vect_complex_sub (dsp32_complex_t *vect1, dsp32_complex_t *vect2, dsp32_complex_t *vect3, int size)
 32-bit fixed point version of the complex vector subtraction function.
void dsp32_vect_conv (dsp32_t *vect1, dsp32_t *vect2, int vect2_size, dsp32_t *vect3, int vect3_size)
 32-bit fixed point version of the Convolution.
void dsp32_vect_convpart (dsp32_t *vect1, dsp32_t *vect2, int vect2_size, dsp32_t *vect3, int vect3_size)
 32-bit fixed point version of the Partial Convolution.
static void dsp32_vect_copy (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the copy function.
void dsp32_vect_dotdiv (dsp32_t *vect1, dsp32_t *vect2, dsp32_t *vect3, int size)
 32-bit fixed point version of the vector dot division function.
void dsp32_vect_dotmul (dsp32_t *vect1, dsp32_t *vect2, dsp32_t *vect3, int size)
 32-bit fixed point version of the vector dot multiplication function.
void dsp32_vect_intdiv (dsp32_t *vect1, dsp32_t *vect2, int size, int integer)
 32-bit fixed point version of the vector division with an integer.
void dsp32_vect_intmul (dsp32_t *vect1, dsp32_t *vect2, int size, int integer)
 32-bit fixed point version of the vector multiplication with an integer.
dsp32_t dsp32_vect_max (dsp32_t *vect1, int size)
 32-bit fixed point version of the vector maximum function.
dsp32_t dsp32_vect_min (dsp32_t *vect1, int size)
 32-bit fixed point version of the vector minimum function.
void dsp32_vect_neg (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the vector negate function.
void dsp32_vect_pow (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t real)
 32-bit fixed point version of the power function.
void dsp32_vect_realadd (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t real)
 32-bit fixed point version of the vector addition with a real number.
void dsp32_vect_realdiv (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t real)
 32-bit fixed point version of the vector division with a real number.
void dsp32_vect_realmul (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t real)
 32-bit fixed point version of the vector multiplication with a real number.
void dsp32_vect_realsub (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t real)
 32-bit fixed point version of the vector subtraction with a real number.
void dsp32_vect_sub (dsp32_t *vect1, dsp32_t *vect2, dsp32_t *vect3, int size)
 32-bit fixed point version of the vector subtraction function.
static void dsp32_vect_zeropad (dsp32_t *vect1, int size, int num_zero)
 32-bit fixed point version of the zero padding function.


Function Documentation

void dsp16_vect_add ( dsp16_t vect1,
dsp16_t vect2,
dsp16_t vect3,
int  size 
)

16-bit fixed point version of the vector additon function.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the addition.
vect2 A pointer on the 16-bit real vector that will be added with the other input vector (vect3).
vect3 A pointer on the 16-bit real vector that will be added with the other input vector (vect2).
size The size of the input buffers.

Definition at line 71 of file vect_dsp16_add.c.

00072 {
00073   typedef void (*add_kernel_opti_t)(dsp16_t *, dsp16_t *, dsp16_t *);
00074   static const add_kernel_opti_t add_end_kernel_opti[4] = {
00075     dsp16_vect_add_kernel_x0,
00076     dsp16_vect_add_kernel_x1,
00077     dsp16_vect_add_kernel_x2,
00078     dsp16_vect_add_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     vect1[n] = vect2[n] + vect3[n];
00085     vect1[n+1] = vect2[n+1] + vect3[n+1];
00086     vect1[n+2] = vect2[n+2] + vect3[n+2];
00087     vect1[n+3] = vect2[n+3] + vect3[n+3];
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   add_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00092 }

void dsp16_vect_add_and_sat ( dsp16_t vect1,
dsp16_t vect2,
dsp16_t vect3,
int  size 
)

16-bit fixed point version of the vector additon function.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the addition.
vect2 A pointer on the 16-bit real vector that will be added with the other input vector (vect3).
vect3 A pointer on the 16-bit real vector that will be added with the other input vector (vect2).
size The size of the input buffers.

Definition at line 78 of file vect_dsp16_add_and_saturate.c.

References DSP16_ADDITION.

Referenced by dac_reload_callback().

00079 {
00080   typedef void (*add_kernel_opti_t)(dsp16_t *, dsp16_t *, dsp16_t *);
00081   static const add_kernel_opti_t add_end_kernel_opti[4] = {
00082     dsp16_vect_add_kernel_x0,
00083     dsp16_vect_add_kernel_x1,
00084     dsp16_vect_add_kernel_x2,
00085     dsp16_vect_add_kernel_x3
00086   };
00087   int n;
00088 
00089   for(n=0; n<size-3; n+=4)
00090   {
00091     DSP16_ADDITION(n, "");
00092     DSP16_ADDITION(n+1, "");
00093     DSP16_ADDITION(n+2, "");
00094     DSP16_ADDITION(n+3, "");
00095   }
00096 
00097   // Jump on different functions depending on the length of the vectors to compute
00098   add_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00099 }

void dsp16_vect_complex_abs ( dsp16_t vect1,
dsp16_complex_t vect2,
int  size 
)

16-bit fixed point version of the complex vector absolute function.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieve the result.
vect2 A pointer on the 16-bit complex vector that will be computed.
size The size of the input buffer.

Definition at line 79 of file vect_dsp16_complex_abs.c.

References DSP16_COMPLEX_ABS, and dsp16_vect_complex_abs_kernel_x0().

Referenced by dsp_calculate_fft().

00080 {
00081   typedef void (*complex_abs_kernel_opti_t)(dsp16_t *, dsp16_complex_t *);
00082   static const complex_abs_kernel_opti_t complex_abs_end_kernel_opti[4] = {
00083     dsp16_vect_complex_abs_kernel_x0,
00084     dsp16_vect_complex_abs_kernel_x1,
00085     dsp16_vect_complex_abs_kernel_x2,
00086     dsp16_vect_complex_abs_kernel_x3
00087   };
00088   int n;
00089   S32 temp1, temp2;
00090 
00091   for(n=0; n<size-3; n+=4)
00092   {
00093     DSP16_COMPLEX_ABS(n, "");
00094     DSP16_COMPLEX_ABS(n+1, "");
00095     DSP16_COMPLEX_ABS(n+2, "");
00096     DSP16_COMPLEX_ABS(n+3, "");
00097   }
00098 
00099   // Jump on different functions depending on the length of the vectors to compute
00100   complex_abs_end_kernel_opti[size&0x3](&vect1[n], &vect2[n]);
00101 }

void dsp16_vect_complex_add ( dsp16_complex_t vect1,
dsp16_complex_t vect2,
dsp16_complex_t vect3,
int  size 
)

16-bit fixed point version of the complex vector additon function.

Parameters:
vect1 A pointer on the 16-bit complex vector that will recieved the result of the addition.
vect2 A pointer on the 16-bit complex vector that will be added with the other input vector (vect3).
vect3 A pointer on the 16-bit complex vector that will be added with the other input vector (vect2).
size The size of the input buffers.

Definition at line 72 of file vect_dsp16_complex_add.c.

References DSP16_COMPLEXADDITION.

00073 {
00074   typedef void (*complexadd_kernel_opti_t)(dsp16_complex_t *, dsp16_complex_t *, dsp16_complex_t *);
00075   static const complexadd_kernel_opti_t complexadd_end_kernel_opti[4] = {
00076     dsp16_vect_complexadd_kernel_x0,
00077     dsp16_vect_complexadd_kernel_x1,
00078     dsp16_vect_complexadd_kernel_x2,
00079     dsp16_vect_complexadd_kernel_x3
00080   };
00081   int n;
00082 
00083   for(n=0; n<size-3; n+=4)
00084   {
00085     DSP16_COMPLEXADDITION(n, "");
00086     DSP16_COMPLEXADDITION(n+1, "");
00087     DSP16_COMPLEXADDITION(n+2, "");
00088     DSP16_COMPLEXADDITION(n+3, "");
00089   }
00090 
00091   // Jump on different functions depending on the length of the vectors to compute
00092   complexadd_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00093 }

void dsp16_vect_complex_conj ( dsp16_complex_t vect1,
dsp16_complex_t vect2,
int  size 
)

16-bit fixed point version of the complex vector conjugate function.

Parameters:
vect1 A pointer on the 16-bit complex vector that will recieve the result.
vect2 A pointer on the 16-bit complex vector that will be computed.
size The size of the input buffer.

Definition at line 77 of file vect_dsp16_complex_conj.c.

References DSP16_COMPLEXCONJUGATE, and dsp16_vect_complexconj_kernel_x0().

Referenced by dsp16_trans_complexifft().

00078 {
00079   typedef void (*complexconj_kernel_opti_t)(dsp16_complex_t *, dsp16_complex_t *);
00080   static const complexconj_kernel_opti_t complexconj_end_kernel_opti[4] = {
00081     dsp16_vect_complexconj_kernel_x0,
00082     dsp16_vect_complexconj_kernel_x1,
00083     dsp16_vect_complexconj_kernel_x2,
00084     dsp16_vect_complexconj_kernel_x3
00085   };
00086   int n;
00087 
00088   for(n=0; n<size-3; n+=4)
00089   {
00090     dsp16_t temp;
00091 
00092     DSP16_COMPLEXCONJUGATE(n, "");
00093     DSP16_COMPLEXCONJUGATE(n+1, "");
00094     DSP16_COMPLEXCONJUGATE(n+2, "");
00095     DSP16_COMPLEXCONJUGATE(n+3, "");
00096   }
00097 
00098   // Jump on different functions depending on the length of the vectors to compute
00099   complexconj_end_kernel_opti[size&0x3](&vect1[n], &vect2[n]);
00100 }

void dsp16_vect_complex_sub ( dsp16_complex_t vect1,
dsp16_complex_t vect2,
dsp16_complex_t vect3,
int  size 
)

16-bit fixed point version of the complex vector subtraction function.

Parameters:
vect1 A pointer on the 16-bit complex vector that will recieved the result of the subtraction.
vect2 A pointer on the 16-bit complex vector that will be subtracted with the other input vector (vect3).
vect3 A pointer on the 16-bit complex vector that will be subtracted with the other input vector (vect2).
size The size of the input buffers.

Definition at line 72 of file vect_dsp16_complex_sub.c.

References DSP16_COMPLEXSUBITION.

00073 {
00074   typedef void (*complexsub_kernel_opti_t)(dsp16_complex_t *, dsp16_complex_t *, dsp16_complex_t *);
00075   static const complexsub_kernel_opti_t complexsub_end_kernel_opti[4] = {
00076     dsp16_vect_complexsub_kernel_x0,
00077     dsp16_vect_complexsub_kernel_x1,
00078     dsp16_vect_complexsub_kernel_x2,
00079     dsp16_vect_complexsub_kernel_x3
00080   };
00081   int n;
00082 
00083   for(n=0; n<size-3; n+=4)
00084   {
00085     DSP16_COMPLEXSUBITION(n, "");
00086     DSP16_COMPLEXSUBITION(n+1, "");
00087     DSP16_COMPLEXSUBITION(n+2, "");
00088     DSP16_COMPLEXSUBITION(n+3, "");
00089   }
00090 
00091   // Jump on different functions depending on the length of the vectors to compute
00092   complexsub_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00093 }

void dsp16_vect_conv ( dsp16_t vect1,
dsp16_t vect2,
int  vect2_size,
dsp16_t vect3,
int  vect3_size 
)

16-bit fixed point version of the Convolution.

Parameters:
vect1 A pointer on a 16-bits fixed-point vector corresponding to the output buffer.
vect2 A pointer on a 16-bits fixed-point vector of vect2_size elements corresponding to the first input buffer.
vect2_size The length of the first input buffer (must be greater or equals to 8).
vect3 A pointer on a 16-bits fixed-point vector of vect3_size elements corresponding to the second input buffer.
vect3_size The length of the second input buffer (must be greater or equals to 8)
Warning:
Due to its implementation, for the avr32-uc3 optimized version of the FIR, the output buffer (vect1) have to have a length of 4*n elements to avoid overflows.
Note:
You need the "Partial Convolution" module
the "Copy" module
the "Zero Padding" module

Definition at line 52 of file vect_convolution.c.

References dsp16_vect_convpart(), dsp16_vect_copy(), and dsp16_vect_zeropad().

00053 {
00054   if (vect2_size >= vect3_size)
00055     {
00056         // Zero-pads the begining of the vector
00057       dsp16_vect_zeropad(vect1, vect3_size-1, vect3_size-1);
00058         // Copy the rest of the vector
00059       dsp16_vect_copy(&vect1[vect3_size-1], vect2, vect2_size);
00060         // Zero-pads the tail of the vector
00061       dsp16_vect_zeropad(&vect1[vect2_size+vect3_size-1], vect3_size-1, vect3_size-1);
00062 
00063       dsp16_vect_convpart(vect1, vect1, vect2_size + 2*(vect3_size - 1), vect3, vect3_size);
00064     }
00065   else
00066     {
00067         // Zero-pads the begining of the vector
00068       dsp16_vect_zeropad(vect1, vect2_size-1, vect2_size-1);
00069         // Copy the rest of the vector
00070       dsp16_vect_copy(&vect1[vect2_size-1], vect3, vect3_size);
00071         // Zero-pads the tail of the vector
00072       dsp16_vect_zeropad(&vect1[vect3_size+vect2_size-1], vect2_size-1, vect2_size-1);
00073 
00074       dsp16_vect_convpart(vect1, vect1, vect3_size + 2*(vect2_size - 1), vect2, vect2_size);
00075     }
00076 }

void dsp16_vect_convpart ( dsp16_t vect1,
dsp16_t vect2,
int  vect2_size,
dsp16_t vect3,
int  vect3_size 
)

16-bit fixed point version of the Partial Convolution.

Parameters:
vect1 A pointer on a 16-bits fixed-point vector corresponding to the output buffer.
vect2 A pointer on a 16-bits fixed-point vector of vect2_size elements corresponding to the first input buffer.
vect2_size The length of the first input buffer (must be greater or equals to 4).
vect3 A pointer on a 16-bits fixed-point vector of vect3_size elements corresponding to the second input buffer.
vect3_size The length of the second input buffer (must be greater or equals to 8)
Warning:
Due to its implementation, for the avr32-uc3 optimized version of the FIR, the output buffer (vect1) have to have a length of 4*n elements to avoid overflows.

Definition at line 93 of file vect_dsp16_convpart.c.

Referenced by dsp16_filt_fir(), and dsp16_vect_conv().

00094 {
00095   typedef void (*convpart_kernel_opti_t)(dsp16_t *, dsp16_t *, int, dsp16_t *, int);
00096   static const convpart_kernel_opti_t convpart_kernel_opti[8] = {
00097       dsp16_vect_convpart_kernel_x0,
00098       dsp16_vect_convpart_kernel_x1,
00099       dsp16_vect_convpart_kernel_x2,
00100       dsp16_vect_convpart_kernel_x3,
00101       dsp16_vect_convpart_kernel_x4,
00102       dsp16_vect_convpart_kernel_x5,
00103       dsp16_vect_convpart_kernel_x6,
00104       dsp16_vect_convpart_kernel_x7
00105     };
00106 
00107   // Jump on different functions depending on the length of the partial convolution to compute
00108   convpart_kernel_opti[vect3_size&0x7](vect1, vect2, vect2_size - vect3_size + 1, vect3, vect3_size);
00109 }

static void dsp16_vect_copy ( dsp16_t vect1,
dsp16_t vect2,
int  size 
) [inline, static]

16-bit fixed point version of the copy function.

Parameters:
vect1 A pointer on the 16 bits real vector that will recieve data.
vect2 A pointer on the 16 bits real vector to be copied.
size The size of those vectors.

Definition at line 583 of file dsp_vectors.h.

Referenced by dsp16_resampling_compute(), dsp16_resampling_link(), and dsp16_vect_conv().

00583 { memcpy(vect1, vect2, size*sizeof(dsp16_t)); };

void dsp16_vect_dotdiv ( dsp16_t vect1,
dsp16_t vect2,
dsp16_t vect3,
int  size 
)

16-bit fixed point version of the vector dot division function.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the dot division.
vect2 A pointer on the 16-bit real vector that will be divided with the other input vector (vect3).
vect3 A pointer on the 16-bit real vector that will be divided with the other input vector (vect2).
size The size of the input buffers.

Definition at line 71 of file vect_dsp16_dotdiv.c.

References DSP16_QB.

00072 {
00073   typedef void (*dotdiv_kernel_opti_t)(dsp16_t *, dsp16_t *, dsp16_t *);
00074   static const dotdiv_kernel_opti_t dotdiv_end_kernel_opti[4] = {
00075     dsp16_vect_dotdiv_kernel_x0,
00076     dsp16_vect_dotdiv_kernel_x1,
00077     dsp16_vect_dotdiv_kernel_x2,
00078     dsp16_vect_dotdiv_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     vect1[n] = (((S32) vect2[n]) << DSP16_QB) / vect3[n];
00085     vect1[n+1] = (((S32) vect2[n+1]) << DSP16_QB) / vect3[n+1];
00086     vect1[n+2] = (((S32) vect2[n+2]) << DSP16_QB) / vect3[n+2];
00087     vect1[n+3] = (((S32) vect2[n+3]) << DSP16_QB) / vect3[n+3];
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   dotdiv_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00092 }

void dsp16_vect_dotmul ( dsp16_t vect1,
dsp16_t vect2,
dsp16_t vect3,
int  size 
)

16-bit fixed point version of the vector dot multiplication function.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the dot multiplication.
vect2 A pointer on the 16-bit real vector that will be multiplied with the other input vector (vect3).
vect3 A pointer on the 16-bit real vector that will be multiplied with the other input vector (vect2).
size The size of the input buffers.

Definition at line 71 of file vect_dsp16_dotmul.c.

References DSP16_QB.

Referenced by dsp_calculate_fft().

00072 {
00073   typedef void (*dotmul_kernel_opti_t)(dsp16_t *, dsp16_t *, dsp16_t *);
00074   static const dotmul_kernel_opti_t dotmul_end_kernel_opti[4] = {
00075     dsp16_vect_dotmul_kernel_x0,
00076     dsp16_vect_dotmul_kernel_x1,
00077     dsp16_vect_dotmul_kernel_x2,
00078     dsp16_vect_dotmul_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     vect1[n] = ((S32) vect2[n] * (S32) vect3[n]) >> DSP16_QB;
00085     vect1[n+1] = ((S32) vect2[n+1] * (S32) vect3[n+1]) >> DSP16_QB;
00086     vect1[n+2] = ((S32) vect2[n+2] * (S32) vect3[n+2]) >> DSP16_QB;
00087     vect1[n+3] = ((S32) vect2[n+3] * (S32) vect3[n+3]) >> DSP16_QB;
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   dotmul_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00092 }

void dsp16_vect_intdiv ( dsp16_t vect1,
dsp16_t vect2,
int  size,
int  integer 
)

16-bit fixed point version of the vector division with an integer.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 16-bit real vector that will be divided with the integer.
size The size of the buffers.
integer The integer to be divided with the vector (vect2).

Definition at line 71 of file vect_dsp16_intdiv.c.

References DSP16_INTDIVISION.

00072 {
00073   typedef void (*intdiv_kernel_opti_t)(dsp16_t *, dsp16_t *, int);
00074   static const intdiv_kernel_opti_t intdiv_end_kernel_opti[4] = {
00075     dsp16_vect_intdiv_kernel_x0,
00076     dsp16_vect_intdiv_kernel_x1,
00077     dsp16_vect_intdiv_kernel_x2,
00078     dsp16_vect_intdiv_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP16_INTDIVISION(n, "");
00085     DSP16_INTDIVISION(n+1, "");
00086     DSP16_INTDIVISION(n+2, "");
00087     DSP16_INTDIVISION(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   intdiv_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], integer);
00092 }

void dsp16_vect_intmul ( dsp16_t vect1,
dsp16_t vect2,
int  size,
int  integer 
)

16-bit fixed point version of the vector multiplication with an integer.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 16-bit real vector that will be multiplied with the integer.
size The size of the buffers.
integer The integer to be multiplied with the vector (vect2).

Definition at line 71 of file vect_dsp16_intmul.c.

References DSP16_INTMULTIPLICATION.

00072 {
00073   typedef void (*intmul_kernel_opti_t)(dsp16_t *, dsp16_t *, int);
00074   static const intmul_kernel_opti_t intmul_end_kernel_opti[4] = {
00075     dsp16_vect_intmul_kernel_x0,
00076     dsp16_vect_intmul_kernel_x1,
00077     dsp16_vect_intmul_kernel_x2,
00078     dsp16_vect_intmul_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP16_INTMULTIPLICATION(n, "");
00085     DSP16_INTMULTIPLICATION(n+1, "");
00086     DSP16_INTMULTIPLICATION(n+2, "");
00087     DSP16_INTMULTIPLICATION(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   intmul_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], integer);
00092 }

dsp16_t dsp16_vect_max ( dsp16_t vect1,
int  size 
)

16-bit fixed point version of the vector maximum function.

Parameters:
vect1 A pointer on the 16-bit real vector that is used to find its maximum.
size The size of the input buffer.
Returns:
The maximum of the vector (vect1).

Definition at line 73 of file vect_dsp16_max.c.

References DSP16_MAXIMUM, DSP16_QA, DSP16_QB, and DSP_Q_MIN.

Referenced by dsp16_filt_lpfirdesign(), and dsp_calculate_fft().

00074 {
00075   typedef dsp16_t (*max_kernel_opti_t)(dsp16_t *, dsp16_t);
00076   static const max_kernel_opti_t max_end_kernel_opti[4] = {
00077     dsp16_vect_max_kernel_x0,
00078     dsp16_vect_max_kernel_x1,
00079     dsp16_vect_max_kernel_x2,
00080     dsp16_vect_max_kernel_x3
00081   };
00082   int n;
00083   dsp16_t max = (dsp16_t) DSP_Q_MIN(DSP16_QA, DSP16_QB);
00084 
00085   for(n=0; n<size-3; n+=4)
00086   {
00087     DSP16_MAXIMUM(n, "")
00088     DSP16_MAXIMUM(n+1, "")
00089     DSP16_MAXIMUM(n+2, "")
00090     DSP16_MAXIMUM(n+3, "")
00091   }
00092 
00093   // Jump on different functions depending on the length of the vectors to compute
00094   return max_end_kernel_opti[size&0x3](&vect1[n], max);
00095 }

dsp16_t dsp16_vect_min ( dsp16_t vect1,
int  size 
)

16-bit fixed point version of the vector minimum function.

Parameters:
vect1 A pointer on the 16-bit real vector that is used to find its minimum.
size The size of the input buffer.
Returns:
The minimum of the vector (vect1).

Definition at line 73 of file vect_dsp16_min.c.

References DSP16_MINIMUM, DSP16_QA, DSP16_QB, DSP_Q_MAX, and min().

Referenced by dsp16_filt_lpfirdesign().

00074 {
00075   typedef dsp16_t (*min_kernel_opti_t)(dsp16_t *, dsp16_t);
00076   static const min_kernel_opti_t min_end_kernel_opti[4] = {
00077     dsp16_vect_min_kernel_x0,
00078     dsp16_vect_min_kernel_x1,
00079     dsp16_vect_min_kernel_x2,
00080     dsp16_vect_min_kernel_x3
00081   };
00082   int n;
00083   dsp16_t min = (dsp16_t) DSP_Q_MAX(DSP16_QA, DSP16_QB);
00084 
00085   for(n=0; n<size-3; n+=4)
00086   {
00087     DSP16_MINIMUM(n, "")
00088     DSP16_MINIMUM(n+1, "")
00089     DSP16_MINIMUM(n+2, "")
00090     DSP16_MINIMUM(n+3, "")
00091   }
00092 
00093   // Jump on different functions depending on the length of the vectors to compute
00094   return min_end_kernel_opti[size&0x3](&vect1[n], min);
00095 }

void dsp16_vect_neg ( dsp16_t vect1,
dsp16_t vect2,
int  size 
)

16-bit fixed point version of the vector negate function.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieve the result.
vect2 A pointer on the 16-bit real vector that will be negate.
size The size of the input buffer.

Definition at line 71 of file vect_dsp16_neg.c.

References DSP16_NEGATE.

00072 {
00073   typedef void (*neg_kernel_opti_t)(dsp16_t *, dsp16_t *);
00074   static const neg_kernel_opti_t neg_end_kernel_opti[4] = {
00075     dsp16_vect_neg_kernel_x0,
00076     dsp16_vect_neg_kernel_x1,
00077     dsp16_vect_neg_kernel_x2,
00078     dsp16_vect_neg_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP16_NEGATE(n, "");
00085     DSP16_NEGATE(n+1, "");
00086     DSP16_NEGATE(n+2, "");
00087     DSP16_NEGATE(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   neg_end_kernel_opti[size&0x3](&vect1[n], &vect2[n]);
00092 }

void dsp16_vect_pow ( dsp16_t vect1,
dsp16_t vect2,
int  size,
dsp16_t  real 
)

16-bit fixed point version of the power function.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 16-bit real vector that will be raised to the power 'real'.
size The size of the buffers.
real The real number used to raised to the power 'vect2'.
Note:
If the vector contains negative numbers, the result for these items will be DSP_Q_MIN.

Definition at line 71 of file vect_dsp16_pow.c.

References DSP16_POWER.

00072 {
00073   typedef void (*pow_kernel_opti_t)(dsp16_t *, dsp16_t *, dsp16_t);
00074   static const pow_kernel_opti_t pow_end_kernel_opti[4] = {
00075     dsp16_vect_pow_kernel_x0,
00076     dsp16_vect_pow_kernel_x1,
00077     dsp16_vect_pow_kernel_x2,
00078     dsp16_vect_pow_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP16_POWER(n, "");
00085     DSP16_POWER(n+1, "");
00086     DSP16_POWER(n+2, "");
00087     DSP16_POWER(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   pow_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], real);
00092 }

void dsp16_vect_realadd ( dsp16_t vect1,
dsp16_t vect2,
int  size,
dsp16_t  real 
)

16-bit fixed point version of the vector addition with a real number.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 16-bit real vector that will be added with the real number.
size The size of the buffers.
real The real number to be added with the vector (vect2).

Definition at line 71 of file vect_dsp16_realadd.c.

References DSP16_REALADDITION.

00072 {
00073   typedef void (*realadd_kernel_opti_t)(dsp16_t *, dsp16_t *, dsp16_t);
00074   static const realadd_kernel_opti_t realadd_end_kernel_opti[4] = {
00075     dsp16_vect_realadd_kernel_x0,
00076     dsp16_vect_realadd_kernel_x1,
00077     dsp16_vect_realadd_kernel_x2,
00078     dsp16_vect_realadd_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP16_REALADDITION(n, "");
00085     DSP16_REALADDITION(n+1, "");
00086     DSP16_REALADDITION(n+2, "");
00087     DSP16_REALADDITION(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   realadd_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], real);
00092 }

void dsp16_vect_realdiv ( dsp16_t vect1,
dsp16_t vect2,
int  size,
dsp16_t  real 
)

16-bit fixed point version of the vector division with a real number.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 16-bit real vector that will be divided with the real number.
size The size of the buffers.
real The real number to be divided with the vector (vect2).

Definition at line 71 of file vect_dsp16_realdiv.c.

References DSP16_QB.

Referenced by dsp_calculate_fft().

00072 {
00073   typedef void (*realdiv_kernel_opti_t)(dsp16_t *, dsp16_t *, dsp16_t);
00074   static const realdiv_kernel_opti_t realdiv_end_kernel_opti[4] = {
00075     dsp16_vect_realdiv_kernel_x0,
00076     dsp16_vect_realdiv_kernel_x1,
00077     dsp16_vect_realdiv_kernel_x2,
00078     dsp16_vect_realdiv_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     vect1[n] = (((S32) vect2[n]) << DSP16_QB) / (S32) real;
00085     vect1[n+1] = (((S32) vect2[n+1]) << DSP16_QB) / (S32) real;
00086     vect1[n+2] = (((S32) vect2[n+2]) << DSP16_QB) / (S32) real;
00087     vect1[n+3] = (((S32) vect2[n+3]) << DSP16_QB) / (S32) real;
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   realdiv_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], real);
00092 }

void dsp16_vect_realmul ( dsp16_t vect1,
dsp16_t vect2,
int  size,
dsp16_t  real 
)

16-bit fixed point version of the vector multiplication with a real number.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 16-bit real vector that will be multiplied with the real number.
size The size of the buffers.
real The real number to be multiplied with the vector (vect2).

Definition at line 71 of file vect_dsp16_realmul.c.

References DSP16_QB.

Referenced by dsp16_resampling_setup(), and generate_signal().

00072 {
00073   typedef void (*realmul_kernel_opti_t)(dsp16_t *, dsp16_t *, dsp16_t);
00074   static const realmul_kernel_opti_t realmul_end_kernel_opti[4] = {
00075     dsp16_vect_realmul_kernel_x0,
00076     dsp16_vect_realmul_kernel_x1,
00077     dsp16_vect_realmul_kernel_x2,
00078     dsp16_vect_realmul_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     vect1[n] = ((S32) vect2[n] * (S32) real) >> DSP16_QB;
00085     vect1[n+1] = ((S32) vect2[n+1] * (S32) real) >> DSP16_QB;
00086     vect1[n+2] = ((S32) vect2[n+2] * (S32) real) >> DSP16_QB;
00087     vect1[n+3] = ((S32) vect2[n+3] * (S32) real) >> DSP16_QB;
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   realmul_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], real);
00092 }

void dsp16_vect_realsub ( dsp16_t vect1,
dsp16_t vect2,
int  size,
dsp16_t  real 
)

16-bit fixed point version of the vector subtraction with a real number.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 16-bit real vector that will be subtracted with the real number.
size The size of the buffers.
real The real number to be subtracted with the vector (vect2).

Definition at line 71 of file vect_dsp16_realsub.c.

References DSP16_REALSUBTRACTION.

00072 {
00073   typedef void (*realsub_kernel_opti_t)(dsp16_t *, dsp16_t *, dsp16_t);
00074   static const realsub_kernel_opti_t realsub_end_kernel_opti[4] = {
00075     dsp16_vect_realsub_kernel_x0,
00076     dsp16_vect_realsub_kernel_x1,
00077     dsp16_vect_realsub_kernel_x2,
00078     dsp16_vect_realsub_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP16_REALSUBTRACTION(n, "");
00085     DSP16_REALSUBTRACTION(n+1, "");
00086     DSP16_REALSUBTRACTION(n+2, "");
00087     DSP16_REALSUBTRACTION(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   realsub_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], real);
00092 }

void dsp16_vect_sub ( dsp16_t vect1,
dsp16_t vect2,
dsp16_t vect3,
int  size 
)

16-bit fixed point version of the vector subtraction function.

Parameters:
vect1 A pointer on the 16-bit real vector that will recieved the result of the subtraction.
vect2 A pointer on the 16-bit real vector that will be subtracted with the other input vector (vect3).
vect3 A pointer on the 16-bit real vector that will be subtracted with the other input vector (vect2).
size The size of the input buffers.

Definition at line 71 of file vect_dsp16_sub.c.

00072 {
00073   typedef void (*sub_kernel_opti_t)(dsp16_t *, dsp16_t *, dsp16_t *);
00074   static const sub_kernel_opti_t sub_end_kernel_opti[4] = {
00075     dsp16_vect_sub_kernel_x0,
00076     dsp16_vect_sub_kernel_x1,
00077     dsp16_vect_sub_kernel_x2,
00078     dsp16_vect_sub_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     vect1[n] = vect2[n] - vect3[n];
00085     vect1[n+1] = vect2[n+1] - vect3[n+1];
00086     vect1[n+2] = vect2[n+2] - vect3[n+2];
00087     vect1[n+3] = vect2[n+3] - vect3[n+3];
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   sub_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00092 }

static void dsp16_vect_zeropad ( dsp16_t vect1,
int  size,
int  num_zero 
) [inline, static]

16-bit fixed point version of the zero padding function.

Parameters:
vect1 A pointer on the 16 bits real vector that has to be padded with zeros.
size The size of this vector.
num_zero The number of zeros to pad at the end of the vector.

Definition at line 555 of file dsp_vectors.h.

Referenced by dsp16_gen_dirac(), dsp16_resampling_setup(), and dsp16_vect_conv().

00555 { memset(vect1 + (size - num_zero)*sizeof(dsp16_t), 0, num_zero*sizeof(dsp16_t)); };

void dsp32_vect_add ( dsp32_t vect1,
dsp32_t vect2,
dsp32_t vect3,
int  size 
)

32-bit fixed point version of the vector additon function.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the addition.
vect2 A pointer on the 32-bit real vector that will be added with the other input vector (vect3).
vect3 A pointer on the 32-bit real vector that will be added with the other input vector (vect2).
size The size of the input buffers.

Definition at line 73 of file vect_dsp32_add.c.

00074 {
00075   typedef void (*add_kernel_opti_t)(dsp32_t *, dsp32_t *, dsp32_t *);
00076   static const add_kernel_opti_t add_end_kernel_opti[4] = {
00077     dsp32_vect_add_kernel_x0,
00078     dsp32_vect_add_kernel_x1,
00079     dsp32_vect_add_kernel_x2,
00080     dsp32_vect_add_kernel_x3
00081   };
00082   int n;
00083 
00084   for(n=0; n<size-3; n+=4)
00085   {
00086     vect1[n] = vect2[n] + vect3[n];
00087     vect1[n+1] = vect2[n+1] + vect3[n+1];
00088     vect1[n+2] = vect2[n+2] + vect3[n+2];
00089     vect1[n+3] = vect2[n+3] + vect3[n+3];
00090   }
00091 
00092   // Jump on different functions depending on the length of the vectors to compute
00093   add_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00094 }

void dsp32_vect_add_and_sat ( dsp32_t vect1,
dsp32_t vect2,
dsp32_t vect3,
int  size 
)

32-bit fixed point version of the vector additon function.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the addition.
vect2 A pointer on the 32-bit real vector that will be added with the other input vector (vect3).
vect3 A pointer on the 32-bit real vector that will be added with the other input vector (vect2).
size The size of the input buffers.

Definition at line 78 of file vect_dsp32_add_and_saturate.c.

References DSP32_ADDITION.

00079 {
00080   typedef void (*add_kernel_opti_t)(dsp32_t *, dsp32_t *, dsp32_t *);
00081   static const add_kernel_opti_t add_end_kernel_opti[4] = {
00082     dsp32_vect_add_kernel_x0,
00083     dsp32_vect_add_kernel_x1,
00084     dsp32_vect_add_kernel_x2,
00085     dsp32_vect_add_kernel_x3
00086   };
00087   int n;
00088 
00089   for(n=0; n<size-3; n+=4)
00090   {
00091     DSP32_ADDITION(n, "");
00092     DSP32_ADDITION(n+1, "");
00093     DSP32_ADDITION(n+2, "");
00094     DSP32_ADDITION(n+3, "");
00095   }
00096 
00097   // Jump on different functions depending on the length of the vectors to compute
00098   add_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00099 }

void dsp32_vect_complex_abs ( dsp32_t vect1,
dsp32_complex_t vect2,
int  size 
)

32-bit fixed point version of the complex vector absolute function.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieve the result.
vect2 A pointer on the 32-bit complex vector that will be computed.
size The size of the input buffer.

Definition at line 79 of file vect_dsp32_complex_abs.c.

References DSP32_COMPLEX_ABS, and dsp32_vect_complex_abs_kernel_x0().

00080 {
00081   typedef void (*complex_abs_kernel_opti_t)(dsp32_t *, dsp32_complex_t *);
00082   static const complex_abs_kernel_opti_t complex_abs_end_kernel_opti[4] = {
00083     dsp32_vect_complex_abs_kernel_x0,
00084     dsp32_vect_complex_abs_kernel_x1,
00085     dsp32_vect_complex_abs_kernel_x2,
00086     dsp32_vect_complex_abs_kernel_x3
00087   };
00088   int n;
00089   S64 temp1, temp2;
00090 
00091   for(n=0; n<size-3; n+=4)
00092   {
00093     DSP32_COMPLEX_ABS(n, "");
00094     DSP32_COMPLEX_ABS(n+1, "");
00095     DSP32_COMPLEX_ABS(n+2, "");
00096     DSP32_COMPLEX_ABS(n+3, "");
00097   }
00098 
00099   // Jump on different functions depending on the length of the vectors to compute
00100   complex_abs_end_kernel_opti[size&0x3](&vect1[n], &vect2[n]);
00101 }

void dsp32_vect_complex_add ( dsp32_complex_t vect1,
dsp32_complex_t vect2,
dsp32_complex_t vect3,
int  size 
)

32-bit fixed point version of the complex vector additon function.

Parameters:
vect1 A pointer on the 32-bit complex vector that will recieved the result of the addition.
vect2 A pointer on the 32-bit complex vector that will be added with the other input vector (vect3).
vect3 A pointer on the 32-bit complex vector that will be added with the other input vector (vect2).
size The size of the input buffers.

Definition at line 72 of file vect_dsp32_complex_add.c.

References DSP32_COMPLEXADDITION.

00073 {
00074   typedef void (*complexadd_kernel_opti_t)(dsp32_complex_t *, dsp32_complex_t *, dsp32_complex_t *);
00075   static const complexadd_kernel_opti_t complexadd_end_kernel_opti[4] = {
00076     dsp32_vect_complexadd_kernel_x0,
00077     dsp32_vect_complexadd_kernel_x1,
00078     dsp32_vect_complexadd_kernel_x2,
00079     dsp32_vect_complexadd_kernel_x3
00080   };
00081   int n;
00082 
00083   for(n=0; n<size-3; n+=4)
00084   {
00085     DSP32_COMPLEXADDITION(n, "");
00086     DSP32_COMPLEXADDITION(n+1, "");
00087     DSP32_COMPLEXADDITION(n+2, "");
00088     DSP32_COMPLEXADDITION(n+3, "");
00089   }
00090 
00091   // Jump on different functions depending on the length of the vectors to compute
00092   complexadd_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00093 }

void dsp32_vect_complex_sub ( dsp32_complex_t vect1,
dsp32_complex_t vect2,
dsp32_complex_t vect3,
int  size 
)

32-bit fixed point version of the complex vector subtraction function.

Parameters:
vect1 A pointer on the 32-bit complex vector that will recieved the result of the subtraction.
vect2 A pointer on the 32-bit complex vector that will be subtracted with the other input vector (vect3).
vect3 A pointer on the 32-bit complex vector that will be subtracted with the other input vector (vect2).
size The size of the input buffers.

Definition at line 72 of file vect_dsp32_complex_sub.c.

References DSP32_COMPLEXSUBITION.

00073 {
00074   typedef void (*complexsub_kernel_opti_t)(dsp32_complex_t *, dsp32_complex_t *, dsp32_complex_t *);
00075   static const complexsub_kernel_opti_t complexsub_end_kernel_opti[4] = {
00076     dsp32_vect_complexsub_kernel_x0,
00077     dsp32_vect_complexsub_kernel_x1,
00078     dsp32_vect_complexsub_kernel_x2,
00079     dsp32_vect_complexsub_kernel_x3
00080   };
00081   int n;
00082 
00083   for(n=0; n<size-3; n+=4)
00084   {
00085     DSP32_COMPLEXSUBITION(n, "");
00086     DSP32_COMPLEXSUBITION(n+1, "");
00087     DSP32_COMPLEXSUBITION(n+2, "");
00088     DSP32_COMPLEXSUBITION(n+3, "");
00089   }
00090 
00091   // Jump on different functions depending on the length of the vectors to compute
00092   complexsub_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00093 }

void dsp32_vect_conv ( dsp32_t vect1,
dsp32_t vect2,
int  vect2_size,
dsp32_t vect3,
int  vect3_size 
)

32-bit fixed point version of the Convolution.

Parameters:
vect1 A pointer on a 32-bits fixed-point vector corresponding to the output buffer.
vect2 A pointer on a 32-bits fixed-point vector of vect2_size elements corresponding to the first input buffer.
vect2_size The length of the first input buffer (must be greater or equals to 8).
vect3 A pointer on a 32-bits fixed-point vector of vect3_size elements corresponding to the second input buffer.
vect3_size The length of the second input buffer (must be greater or equals to 8)
Note:
You need the "Partial Convolution" module
the "Copy" module
the "Zero Padding" module

Definition at line 84 of file vect_convolution.c.

References dsp32_vect_convpart(), dsp32_vect_copy(), and dsp32_vect_zeropad().

00085 {
00086   if (vect2_size >= vect3_size)
00087     {
00088         // Zero-pads the begining of the vector
00089       dsp32_vect_zeropad(vect1, vect3_size-1, vect3_size-1);
00090         // Copy the rest of the vector
00091       dsp32_vect_copy(&vect1[vect3_size-1], vect2, vect2_size);
00092         // Zero-pads the tail of the vector
00093       dsp32_vect_zeropad(&vect1[vect2_size+vect3_size-1], vect3_size-1, vect3_size-1);
00094 
00095       dsp32_vect_convpart(vect1, vect1, vect2_size + 2*(vect3_size - 1), vect3, vect3_size);
00096     }
00097   else
00098     {
00099         // Zero-pads the begining of the vector
00100       dsp32_vect_zeropad(vect1, vect2_size-1, vect2_size-1);
00101         // Copy the rest of the vector
00102       dsp32_vect_copy(&vect1[vect2_size-1], vect3, vect3_size);
00103         // Zero-pads the tail of the vector
00104       dsp32_vect_zeropad(&vect1[vect3_size+vect2_size-1], vect2_size-1, vect2_size-1);
00105 
00106       dsp32_vect_convpart(vect1, vect1, vect3_size + 2*(vect2_size - 1), vect2, vect2_size);
00107     }
00108 }

void dsp32_vect_convpart ( dsp32_t vect1,
dsp32_t vect2,
int  vect2_size,
dsp32_t vect3,
int  vect3_size 
)

32-bit fixed point version of the Partial Convolution.

Parameters:
vect1 A pointer on a 32-bits fixed-point vector corresponding to the output buffer.
vect2 A pointer on a 32-bits fixed-point vector of vect2_size elements corresponding to the first input buffer.
vect2_size The length of the first input buffer (must be greater or equals to 4).
vect3 A pointer on a 32-bits fixed-point vector of vect3_size elements corresponding to the second input buffer.
vect3_size The length of the second input buffer (must be greater or equals to 8)

Definition at line 94 of file vect_dsp32_convpart.c.

Referenced by dsp32_filt_fir(), and dsp32_vect_conv().

00095 {
00096   typedef void (*convpart_kernel_opti_t)(dsp32_t *, dsp32_t *, int, dsp32_t *, int);
00097   static const convpart_kernel_opti_t convpart_kernel_opti[8] = {
00098       dsp32_vect_convpart_kernel_x0,
00099       dsp32_vect_convpart_kernel_x1,
00100       dsp32_vect_convpart_kernel_x2,
00101       dsp32_vect_convpart_kernel_x3,
00102       dsp32_vect_convpart_kernel_x4,
00103       dsp32_vect_convpart_kernel_x5,
00104       dsp32_vect_convpart_kernel_x6,
00105       dsp32_vect_convpart_kernel_x7
00106     };
00107 
00108   // Jump on different functions depending on the length of the partial convolution to compute
00109   convpart_kernel_opti[vect3_size&0x7](vect1, vect2, vect2_size - vect3_size + 1, vect3, vect3_size);
00110 }

static void dsp32_vect_copy ( dsp32_t vect1,
dsp32_t vect2,
int  size 
) [inline, static]

32-bit fixed point version of the copy function.

Parameters:
vect1 A pointer on the 32 bits real vector that will recieve data.
vect2 A pointer on the 32 bits real vector to be copied.
size The size of those vectors.

Definition at line 590 of file dsp_vectors.h.

Referenced by dsp32_vect_conv().

00590 { memcpy(vect1, vect2, size*sizeof(dsp32_t)); };

void dsp32_vect_dotdiv ( dsp32_t vect1,
dsp32_t vect2,
dsp32_t vect3,
int  size 
)

32-bit fixed point version of the vector dot division function.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the dot division.
vect2 A pointer on the 32-bit real vector that will be divided with the other input vector (vect3).
vect3 A pointer on the 32-bit real vector that will be divided with the other input vector (vect2).
size The size of the input buffers.

Definition at line 73 of file vect_dsp32_dotdiv.c.

References DSP32_QB.

00074 {
00075   typedef void (*dotdiv_kernel_opti_t)(dsp32_t *, dsp32_t *, dsp32_t *);
00076   static const dotdiv_kernel_opti_t dotdiv_end_kernel_opti[4] = {
00077     dsp32_vect_dotdiv_kernel_x0,
00078     dsp32_vect_dotdiv_kernel_x1,
00079     dsp32_vect_dotdiv_kernel_x2,
00080     dsp32_vect_dotdiv_kernel_x3
00081   };
00082   int n;
00083 
00084   for(n=0; n<size-3; n+=4)
00085   {
00086     vect1[n] = (((S64) vect2[n]) << DSP32_QB) / vect3[n];
00087     vect1[n+1] = (((S64) vect2[n+1]) << DSP32_QB) / vect3[n+1];
00088     vect1[n+2] = (((S64) vect2[n+2]) << DSP32_QB) / vect3[n+2];
00089     vect1[n+3] = (((S64) vect2[n+3]) << DSP32_QB) / vect3[n+3];
00090   }
00091 
00092   // Jump on different functions depending on the length of the vectors to compute
00093   dotdiv_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00094 }

void dsp32_vect_dotmul ( dsp32_t vect1,
dsp32_t vect2,
dsp32_t vect3,
int  size 
)

32-bit fixed point version of the vector dot multiplication function.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the dot multiplication.
vect2 A pointer on the 32-bit real vector that will be multiplied with the other input vector (vect3).
vect3 A pointer on the 32-bit real vector that will be multiplied with the other input vector (vect2).
size The size of the input buffers.

Definition at line 73 of file vect_dsp32_dotmul.c.

References DSP32_QB.

00074 {
00075   typedef void (*dotmul_kernel_opti_t)(dsp32_t *, dsp32_t *, dsp32_t *);
00076   static const dotmul_kernel_opti_t dotmul_end_kernel_opti[4] = {
00077     dsp32_vect_dotmul_kernel_x0,
00078     dsp32_vect_dotmul_kernel_x1,
00079     dsp32_vect_dotmul_kernel_x2,
00080     dsp32_vect_dotmul_kernel_x3
00081   };
00082   int n;
00083 
00084   for(n=0; n<size-3; n+=4)
00085   {
00086     vect1[n] = ((S64) vect2[n] * (S64) vect3[n]) >> DSP32_QB;
00087     vect1[n+1] = ((S64) vect2[n+1] * (S64) vect3[n+1]) >> DSP32_QB;
00088     vect1[n+2] = ((S64) vect2[n+2] * (S64) vect3[n+2]) >> DSP32_QB;
00089     vect1[n+3] = ((S64) vect2[n+3] * (S64) vect3[n+3]) >> DSP32_QB;
00090   }
00091 
00092   // Jump on different functions depending on the length of the vectors to compute
00093   dotmul_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00094 }

void dsp32_vect_intdiv ( dsp32_t vect1,
dsp32_t vect2,
int  size,
int  integer 
)

32-bit fixed point version of the vector division with an integer.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 32-bit real vector that will be divided with the integer.
size The size of the buffers.
integer The integer to be divided with the vector (vect2).

Definition at line 71 of file vect_dsp32_intdiv.c.

References DSP32_INTDIVISION.

00072 {
00073   typedef void (*intdiv_kernel_opti_t)(dsp32_t *, dsp32_t *, int);
00074   static const intdiv_kernel_opti_t intdiv_end_kernel_opti[4] = {
00075     dsp32_vect_intdiv_kernel_x0,
00076     dsp32_vect_intdiv_kernel_x1,
00077     dsp32_vect_intdiv_kernel_x2,
00078     dsp32_vect_intdiv_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP32_INTDIVISION(n, "");
00085     DSP32_INTDIVISION(n+1, "");
00086     DSP32_INTDIVISION(n+2, "");
00087     DSP32_INTDIVISION(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   intdiv_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], integer);
00092 }

void dsp32_vect_intmul ( dsp32_t vect1,
dsp32_t vect2,
int  size,
int  integer 
)

32-bit fixed point version of the vector multiplication with an integer.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 32-bit real vector that will be multiplied with the integer.
size The size of the buffers.
integer The integer to be multiplied with the vector (vect2).

Definition at line 71 of file vect_dsp32_intmul.c.

References DSP32_INTMULTIPLICATION.

00072 {
00073   typedef void (*intmul_kernel_opti_t)(dsp32_t *, dsp32_t *, int);
00074   static const intmul_kernel_opti_t intmul_end_kernel_opti[4] = {
00075     dsp32_vect_intmul_kernel_x0,
00076     dsp32_vect_intmul_kernel_x1,
00077     dsp32_vect_intmul_kernel_x2,
00078     dsp32_vect_intmul_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP32_INTMULTIPLICATION(n, "");
00085     DSP32_INTMULTIPLICATION(n+1, "");
00086     DSP32_INTMULTIPLICATION(n+2, "");
00087     DSP32_INTMULTIPLICATION(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   intmul_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], integer);
00092 }

dsp32_t dsp32_vect_max ( dsp32_t vect1,
int  size 
)

32-bit fixed point version of the vector maximum function.

Parameters:
vect1 A pointer on the 32-bit real vector that is used to find its maximum.
size The size of the input buffer.
Returns:
The maximum of the vector (vect1).

Definition at line 73 of file vect_dsp32_max.c.

References DSP32_MAXIMUM, DSP32_QA, DSP32_QB, and DSP_Q_MIN.

00074 {
00075   typedef dsp32_t (*max_kernel_opti_t)(dsp32_t *, dsp32_t);
00076   static const max_kernel_opti_t max_end_kernel_opti[4] = {
00077     dsp32_vect_max_kernel_x0,
00078     dsp32_vect_max_kernel_x1,
00079     dsp32_vect_max_kernel_x2,
00080     dsp32_vect_max_kernel_x3
00081   };
00082   int n;
00083   dsp32_t max = (dsp32_t) DSP_Q_MIN(DSP32_QA, DSP32_QB);
00084 
00085   for(n=0; n<size-3; n+=4)
00086   {
00087     DSP32_MAXIMUM(n, "")
00088     DSP32_MAXIMUM(n+1, "")
00089     DSP32_MAXIMUM(n+2, "")
00090     DSP32_MAXIMUM(n+3, "")
00091   }
00092 
00093   // Jump on different functions depending on the length of the vectors to compute
00094   return max_end_kernel_opti[size&0x3](&vect1[n], max);
00095 }

dsp32_t dsp32_vect_min ( dsp32_t vect1,
int  size 
)

32-bit fixed point version of the vector minimum function.

Parameters:
vect1 A pointer on the 32-bit real vector that is used to find its minimum.
size The size of the input buffer.
Returns:
The minimum of the vector (vect1).

Definition at line 73 of file vect_dsp32_min.c.

References DSP32_MINIMUM, DSP32_QA, DSP32_QB, DSP_Q_MAX, and min().

00074 {
00075   typedef dsp32_t (*min_kernel_opti_t)(dsp32_t *, dsp32_t);
00076   static const min_kernel_opti_t min_end_kernel_opti[4] = {
00077     dsp32_vect_min_kernel_x0,
00078     dsp32_vect_min_kernel_x1,
00079     dsp32_vect_min_kernel_x2,
00080     dsp32_vect_min_kernel_x3
00081   };
00082   int n;
00083   dsp32_t min = (dsp32_t) DSP_Q_MAX(DSP32_QA, DSP32_QB);
00084 
00085   for(n=0; n<size-3; n+=4)
00086   {
00087     DSP32_MINIMUM(n, "")
00088     DSP32_MINIMUM(n+1, "")
00089     DSP32_MINIMUM(n+2, "")
00090     DSP32_MINIMUM(n+3, "")
00091   }
00092 
00093   // Jump on different functions depending on the length of the vectors to compute
00094   return min_end_kernel_opti[size&0x3](&vect1[n], min);
00095 }

void dsp32_vect_neg ( dsp32_t vect1,
dsp32_t vect2,
int  size 
)

32-bit fixed point version of the vector negate function.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieve the result.
vect2 A pointer on the 32-bit real vector that will be negate.
size The size of the input buffer.

Definition at line 73 of file vect_dsp32_neg.c.

References DSP32_NEGATE.

00074 {
00075   typedef void (*neg_kernel_opti_t)(dsp32_t *, dsp32_t *);
00076   static const neg_kernel_opti_t neg_end_kernel_opti[4] = {
00077     dsp32_vect_neg_kernel_x0,
00078     dsp32_vect_neg_kernel_x1,
00079     dsp32_vect_neg_kernel_x2,
00080     dsp32_vect_neg_kernel_x3
00081   };
00082   int n;
00083 
00084   for(n=0; n<size-3; n+=4)
00085   {
00086     DSP32_NEGATE(n, "");
00087     DSP32_NEGATE(n+1, "");
00088     DSP32_NEGATE(n+2, "");
00089     DSP32_NEGATE(n+3, "");
00090   }
00091 
00092   // Jump on different functions depending on the length of the vectors to compute
00093   neg_end_kernel_opti[size&0x3](&vect1[n], &vect2[n]);
00094 }

void dsp32_vect_pow ( dsp32_t vect1,
dsp32_t vect2,
int  size,
dsp32_t  real 
)

32-bit fixed point version of the power function.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 32-bit real vector that will be raised to the power 'real'.
size The size of the buffers.
real The real number used to raised to the power 'vect2'.
Note:
If the vector contains negative numbers, the result for these items will be DSP_Q_MIN.

Definition at line 71 of file vect_dsp32_pow.c.

References DSP32_POWER.

00072 {
00073   typedef void (*pow_kernel_opti_t)(dsp32_t *, dsp32_t *, dsp32_t);
00074   static const pow_kernel_opti_t pow_end_kernel_opti[4] = {
00075     dsp32_vect_pow_kernel_x0,
00076     dsp32_vect_pow_kernel_x1,
00077     dsp32_vect_pow_kernel_x2,
00078     dsp32_vect_pow_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP32_POWER(n, "");
00085     DSP32_POWER(n+1, "");
00086     DSP32_POWER(n+2, "");
00087     DSP32_POWER(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   pow_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], real);
00092 }

void dsp32_vect_realadd ( dsp32_t vect1,
dsp32_t vect2,
int  size,
dsp32_t  real 
)

32-bit fixed point version of the vector addition with a real number.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 32-bit real vector that will be added with the real number.
size The size of the buffers.
real The real number to be added with the vector (vect2).

Definition at line 71 of file vect_dsp32_realadd.c.

References DSP32_REALADDITION.

00072 {
00073   typedef void (*realadd_kernel_opti_t)(dsp32_t *, dsp32_t *, dsp32_t);
00074   static const realadd_kernel_opti_t realadd_end_kernel_opti[4] = {
00075     dsp32_vect_realadd_kernel_x0,
00076     dsp32_vect_realadd_kernel_x1,
00077     dsp32_vect_realadd_kernel_x2,
00078     dsp32_vect_realadd_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP32_REALADDITION(n, "");
00085     DSP32_REALADDITION(n+1, "");
00086     DSP32_REALADDITION(n+2, "");
00087     DSP32_REALADDITION(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   realadd_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], real);
00092 }

void dsp32_vect_realdiv ( dsp32_t vect1,
dsp32_t vect2,
int  size,
dsp32_t  real 
)

32-bit fixed point version of the vector division with a real number.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 32-bit real vector that will be divided with the real number.
size The size of the buffers.
real The real number to be divided with the vector (vect2).

Definition at line 71 of file vect_dsp32_realdiv.c.

References DSP32_QB.

00072 {
00073   typedef void (*realdiv_kernel_opti_t)(dsp32_t *, dsp32_t *, dsp32_t);
00074   static const realdiv_kernel_opti_t realdiv_end_kernel_opti[4] = {
00075     dsp32_vect_realdiv_kernel_x0,
00076     dsp32_vect_realdiv_kernel_x1,
00077     dsp32_vect_realdiv_kernel_x2,
00078     dsp32_vect_realdiv_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     vect1[n] = (((S64) vect2[n]) << DSP32_QB) / (S64) real;
00085     vect1[n+1] = (((S64) vect2[n+1]) << DSP32_QB) / (S64) real;
00086     vect1[n+2] = (((S64) vect2[n+2]) << DSP32_QB) / (S64) real;
00087     vect1[n+3] = (((S64) vect2[n+3]) << DSP32_QB) / (S64) real;
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   realdiv_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], real);
00092 }

void dsp32_vect_realmul ( dsp32_t vect1,
dsp32_t vect2,
int  size,
dsp32_t  real 
)

32-bit fixed point version of the vector multiplication with a real number.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 32-bit real vector that will be multiplied with the real number.
size The size of the buffers.
real The real number to be multiplied with the vector (vect2).

Definition at line 71 of file vect_dsp32_realmul.c.

References DSP32_QB.

00072 {
00073   typedef void (*realmul_kernel_opti_t)(dsp32_t *, dsp32_t *, dsp32_t);
00074   static const realmul_kernel_opti_t realmul_end_kernel_opti[4] = {
00075     dsp32_vect_realmul_kernel_x0,
00076     dsp32_vect_realmul_kernel_x1,
00077     dsp32_vect_realmul_kernel_x2,
00078     dsp32_vect_realmul_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     vect1[n] = ((S64) vect2[n] * (S64) real) >> DSP32_QB;
00085     vect1[n+1] = ((S64) vect2[n+1] * (S64) real) >> DSP32_QB;
00086     vect1[n+2] = ((S64) vect2[n+2] * (S64) real) >> DSP32_QB;
00087     vect1[n+3] = ((S64) vect2[n+3] * (S64) real) >> DSP32_QB;
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   realmul_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], real);
00092 }

void dsp32_vect_realsub ( dsp32_t vect1,
dsp32_t vect2,
int  size,
dsp32_t  real 
)

32-bit fixed point version of the vector subtraction with a real number.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the operation.
vect2 A pointer on the 32-bit real vector that will be subtracted with the real number.
size The size of the buffers.
real The real number to be subtracted with the vector (vect2).

Definition at line 71 of file vect_dsp32_realsub.c.

References DSP32_REALSUBTRACTION.

00072 {
00073   typedef void (*realsub_kernel_opti_t)(dsp32_t *, dsp32_t *, dsp32_t);
00074   static const realsub_kernel_opti_t realsub_end_kernel_opti[4] = {
00075     dsp32_vect_realsub_kernel_x0,
00076     dsp32_vect_realsub_kernel_x1,
00077     dsp32_vect_realsub_kernel_x2,
00078     dsp32_vect_realsub_kernel_x3
00079   };
00080   int n;
00081 
00082   for(n=0; n<size-3; n+=4)
00083   {
00084     DSP32_REALSUBTRACTION(n, "");
00085     DSP32_REALSUBTRACTION(n+1, "");
00086     DSP32_REALSUBTRACTION(n+2, "");
00087     DSP32_REALSUBTRACTION(n+3, "");
00088   }
00089 
00090   // Jump on different functions depending on the length of the vectors to compute
00091   realsub_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], real);
00092 }

void dsp32_vect_sub ( dsp32_t vect1,
dsp32_t vect2,
dsp32_t vect3,
int  size 
)

32-bit fixed point version of the vector subtraction function.

Parameters:
vect1 A pointer on the 32-bit real vector that will recieved the result of the subtraction.
vect2 A pointer on the 32-bit real vector that will be subtracted with the other input vector (vect3).
vect3 A pointer on the 32-bit real vector that will be subtracted with the other input vector (vect2).
size The size of the input buffers.

Definition at line 73 of file vect_dsp32_sub.c.

00074 {
00075   typedef void (*sub_kernel_opti_t)(dsp32_t *, dsp32_t *, dsp32_t *);
00076   static const sub_kernel_opti_t sub_end_kernel_opti[4] = {
00077     dsp32_vect_sub_kernel_x0,
00078     dsp32_vect_sub_kernel_x1,
00079     dsp32_vect_sub_kernel_x2,
00080     dsp32_vect_sub_kernel_x3
00081   };
00082   int n;
00083 
00084   for(n=0; n<size-3; n+=4)
00085   {
00086     vect1[n] = vect2[n] - vect3[n];
00087     vect1[n+1] = vect2[n+1] - vect3[n+1];
00088     vect1[n+2] = vect2[n+2] - vect3[n+2];
00089     vect1[n+3] = vect2[n+3] - vect3[n+3];
00090   }
00091 
00092   // Jump on different functions depending on the length of the vectors to compute
00093   sub_end_kernel_opti[size&0x3](&vect1[n], &vect2[n], &vect3[n]);
00094 }

static void dsp32_vect_zeropad ( dsp32_t vect1,
int  size,
int  num_zero 
) [inline, static]

32-bit fixed point version of the zero padding function.

Parameters:
vect1 A pointer on the 32 bits real vector that has to be padded with zeros.
size The size of this vector.
num_zero The number of zeros to pad at the end of the vector.

Definition at line 562 of file dsp_vectors.h.

Referenced by dsp32_gen_dirac(), and dsp32_vect_conv().

00562 { memset(vect1 + (size - num_zero)*sizeof(dsp32_t), 0, num_zero*sizeof(dsp32_t)); };


Generated on Fri Feb 19 02:23:23 2010 for AVR32 UC3 - EVK1104 DSPLib Demo Documentation by  doxygen 1.5.5