Atmel Software Framework

examples/dsp32_vectors/vectors_example.c File Reference
#include <avr32/io.h>
#include "compiler.h"
#include "board.h"
#include "dsp.h"
#include "dsp_debug.h"
#include "pm.h"
#include "cycle_counter.h"

Data Structures

struct  s_item_menu
 

Macros

#define CHECK_CONDITIONS(x_cond)
 
#define CHECK_CONDITIONS_ALL(x_cond)
 
#define VECT1_SIZE   256
 
#define VECT2_SIZE   256
 
#define VECT3_SIZE   256
 

Typedefs

typedef int(* fct_item_menu )(int *)
 

Functions

int addition (int *size)
 Function to perform Vector Addition. More...
 
int convolution (int *size)
 Function to perform Vector Convolution. More...
 
int copy (int *size)
 Function to perform Vector Copy. More...
 
int dot_division (int *size)
 Function to perform Vector Dot Division. More...
 
int dot_multiplication (int *size)
 Function to perform Vector Dot Multiplication. More...
 
int main (int argc, char *argv[])
 The main function. More...
 
int maximum (int *size)
 Function to find Vector Maximum. More...
 
int minimum (int *size)
 Function to find Vector Minimum. More...
 
int negate (int *size)
 Function to perform Vector Negation. More...
 
int partial_convolution (int *size)
 Function to perform Partial Convolution. More...
 
int power (int *size)
 Function to perform Vector Power operation. More...
 
int real_division (int *size)
 Function to perform Vector Real Division. More...
 
int real_multiplication (int *size)
 Function to perform Vector Real Multiplication. More...
 
int subtraction (int *size)
 Function to perform Vector Subtraction. More...
 
int zero_padding (int *size)
 Function to perform Zero Padding to Vector. More...
 

Variables

s_item_menu item_menu []
 
A_ALIGNED dsp32_t vect1 [VECT1_SIZE]
 
A_ALIGNED dsp32_t vect2 [VECT2_SIZE]
 
A_ALIGNED dsp32_t vect3 [VECT3_SIZE]
 

#define CHECK_CONDITIONS (   x_cond)
Value:
{ \
}
#define CHECK_CONDITIONS_ALL(x_cond)
Definition: examples/dsp32_vectors/vectors_example.c:126

Referenced by addition(), convolution(), copy(), dot_division(), dot_multiplication(), maximum(), minimum(), negate(), partial_convolution(), power(), real_division(), real_multiplication(), and subtraction().

#define CHECK_CONDITIONS_ALL (   x_cond)
Value:
if (!(x_cond)) \
{ \
dsp32_debug_printf("The condition '" #x_cond "' is not verified. (line %i)\n", __LINE__); \
return -1; \
}
return
Definition: avr32/applications/uc3-audio-player/main.c:244
int dsp32_debug_printf(const char *format,...)
This function is the printf version for 32-bit Q formatted signed numbers.
Definition: dsp_debug_printf.c:379

typedef int(* fct_item_menu)(int *)

int addition ( int *  size)

Function to perform Vector Addition.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_add(), Get_sys_count, vect1, VECT1_SIZE, vect2, VECT2_SIZE, vect3, and VECT3_SIZE.

int convolution ( int *  size)

Function to perform Vector Convolution.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_conv(), Get_sys_count, vect1, VECT1_SIZE, vect2, VECT2_SIZE, vect3, and VECT3_SIZE.

int copy ( int *  size)

Function to perform Vector Copy.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_copy(), Get_sys_count, vect1, VECT1_SIZE, vect2, and VECT2_SIZE.

int dot_division ( int *  size)

Function to perform Vector Dot Division.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_dotdiv(), Get_sys_count, vect1, VECT1_SIZE, vect2, VECT2_SIZE, vect3, and VECT3_SIZE.

int dot_multiplication ( int *  size)

Function to perform Vector Dot Multiplication.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_dotmul(), Get_sys_count, vect1, VECT1_SIZE, vect2, VECT2_SIZE, vect3, and VECT3_SIZE.

int maximum ( int *  size)
int minimum ( int *  size)

Function to find Vector Minimum.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_min(), Get_sys_count, vect1, VECT1_SIZE, vect2, and VECT2_SIZE.

int negate ( int *  size)

Function to perform Vector Negation.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_neg(), Get_sys_count, vect1, VECT1_SIZE, vect2, and VECT2_SIZE.

int partial_convolution ( int *  size)

Function to perform Partial Convolution.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_convpart(), Get_sys_count, vect1, VECT1_SIZE, vect2, VECT2_SIZE, vect3, and VECT3_SIZE.

int power ( int *  size)

Function to perform Vector Power operation.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_pow(), Get_sys_count, vect1, VECT1_SIZE, vect2, VECT2_SIZE, vect3, and VECT3_SIZE.

int real_division ( int *  size)

Function to perform Vector Real Division.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_realdiv(), Get_sys_count, vect1, VECT1_SIZE, vect2, VECT2_SIZE, vect3, and VECT3_SIZE.

int real_multiplication ( int *  size)

Function to perform Vector Real Multiplication.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_realmul(), Get_sys_count, vect1, VECT1_SIZE, vect2, VECT2_SIZE, vect3, and VECT3_SIZE.

int subtraction ( int *  size)

Function to perform Vector Subtraction.

Parameters
sizePointer to store output Vector Size

References CHECK_CONDITIONS, dsp32_debug_printf(), dsp32_vect_sub(), Get_sys_count, vect1, VECT1_SIZE, vect2, VECT2_SIZE, vect3, and VECT3_SIZE.

int zero_padding ( int *  size)

Function to perform Zero Padding to Vector.

Parameters
sizePointer to store output Vector Size

References dsp32_debug_printf(), dsp32_vect_zeropad(), Get_sys_count, vect1, and VECT1_SIZE.

s_item_menu item_menu[]
Initial value:
= {
{ "Addition", addition },
{ "Subtraction", subtraction },
{ "Multiplication with real", real_multiplication },
{ "Division with real", real_division },
{ "Dot multiplication", dot_multiplication },
{ "Dot division", dot_division },
{ "Power", power },
{ "Minimum", minimum },
{ "Maximum", maximum },
{ "Negate", negate },
{ "Copy", copy },
{ "Zero padding", zero_padding },
{ "Convolution", convolution },
{ "Partial convolution", partial_convolution }
}
int convolution(int *size)
Function to perform Vector Convolution.
Definition: examples/dsp32_vectors/vectors_example.c:414
int copy(int *size)
Function to perform Vector Copy.
Definition: examples/dsp32_vectors/vectors_example.c:381
int real_multiplication(int *size)
Function to perform Vector Real Multiplication.
Definition: examples/dsp32_vectors/vectors_example.c:230
int negate(int *size)
Function to perform Vector Negation.
Definition: examples/dsp32_vectors/vectors_example.c:363
int real_division(int *size)
Function to perform Vector Real Division.
Definition: examples/dsp32_vectors/vectors_example.c:249
int subtraction(int *size)
Function to perform Vector Subtraction.
Definition: examples/dsp32_vectors/vectors_example.c:211
int partial_convolution(int *size)
Function to perform Partial Convolution.
Definition: examples/dsp32_vectors/vectors_example.c:438
int dot_division(int *size)
Function to perform Vector Dot Division.
Definition: examples/dsp32_vectors/vectors_example.c:287
int power(int *size)
Function to perform Vector Power operation.
Definition: examples/dsp32_vectors/vectors_example.c:306
int maximum(int *size)
Function to find Vector Maximum.
Definition: examples/dsp32_vectors/vectors_example.c:344
int dot_multiplication(int *size)
Function to perform Vector Dot Multiplication.
Definition: examples/dsp32_vectors/vectors_example.c:268
int addition(int *size)
Function to perform Vector Addition.
Definition: examples/dsp32_vectors/vectors_example.c:192
int zero_padding(int *size)
Function to perform Zero Padding to Vector.
Definition: examples/dsp32_vectors/vectors_example.c:399
int minimum(int *size)
Function to find Vector Minimum.
Definition: examples/dsp32_vectors/vectors_example.c:325

Referenced by main().

Initial value:
= {
DSP32_Q(0.012010),
DSP32_Q(0.059717),
DSP32_Q(0.101397),
DSP32_Q(0.0583150),
DSP32_Q(0.0000000),
DSP32_Q(0.0921177),
DSP32_Q(0.0951057),
DSP32_Q(0.0884270),
DSP32_Q(0.0732020),
DSP32_Q(0.515080),
}
#define DSP32_Q(fnum)
Convert a float into a 32-bit signed fixed-point type.
Definition: dsp_types.h:301
Initial value:
= {
DSP32_Q(0.5),
DSP32_Q(0.101397),
DSP32_Q(0.110140),
DSP32_Q(0.076849),
DSP32_Q(-0.794687),
DSP32_Q(-0.113757),
DSP32_Q(-0.250267),
DSP32_Q(-0.389747),
DSP32_Q(-0.509602),
DSP32_Q(-0.587785),
}
#define DSP32_Q(fnum)
Convert a float into a 32-bit signed fixed-point type.
Definition: dsp_types.h:301

Referenced by addition(), convolution(), dot_division(), dot_multiplication(), dsp16_vect_convpart(), dsp32_vect_convpart(), main(), partial_convolution(), power(), real_division(), real_multiplication(), and subtraction().