Atmel Software Framework

simulator_examples/dsp32_vectors/vectors_example.c File Reference

32-bit vectors program test

Copyright (c) 2011-2012 Atmel Corporation. All rights reserved.

#include <avr32/io.h>
#include "compiler.h"
#include "board.h"
#include "dsp.h"
#include "dsp_debug.h"
#include "sysclk.h"
#include "cycle_counter.h"

Data Structures

struct  s_item_menu
 

Macros

#define CHECK_CONDITIONS(x_cond)
 
#define NUMBER_OF_MENU_ITEM   14
 
#define VECT1_SIZE   16
 
#define VECT2_SIZE   16
 
#define VECT3_SIZE   16
 

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[])
 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:
if (!(x_cond)) { \
return -1; \
}
return
Definition: avr32/applications/uc3-audio-player/main.c:244
#define NUMBER_OF_MENU_ITEM   14
#define VECT1_SIZE   16

Referenced by main().

#define VECT2_SIZE   16
#define VECT3_SIZE   16

typedef int(* fct_item_menu)(int *)

int addition ( int *  size)

Function to perform Vector Addition.

Parameters
sizePointer to store output Vector Size
int convolution ( int *  size)

Function to perform Vector Convolution.

Parameters
sizePointer to store output Vector Size
int copy ( int *  size)

Function to perform Vector Copy.

Parameters
sizePointer to store output Vector Size
int dot_division ( int *  size)

Function to perform Vector Dot Division.

Parameters
sizePointer to store output Vector Size
int dot_multiplication ( int *  size)

Function to perform Vector Dot Multiplication.

Parameters
sizePointer to store output Vector Size
int main ( int  argc,
char *  argv[] 
)

Main Function.

Note
the call to sysclk_init() will disable all non-vital peripheral clocks, except for the peripheral clocks explicitly enabled in conf_clock.h.

References s_item_menu::action, dsp32_debug_sprintf(), dsp_debug_initialization, FOSC0, i, item_menu, sysclk_init(), s_item_menu::title, and VECT1_SIZE.

int maximum ( int *  size)

Function to find Vector Maximum.

Parameters
sizePointer to store output Vector Size
int minimum ( int *  size)

Function to find Vector Minimum.

Parameters
sizePointer to store output Vector Size
int negate ( int *  size)

Function to perform Vector Negation.

Parameters
sizePointer to store output Vector Size
int partial_convolution ( int *  size)

Function to perform Partial Convolution.

Parameters
sizePointer to store output Vector Size
int power ( int *  size)

Function to perform Vector Power operation.

Parameters
sizePointer to store output Vector Size
int real_division ( int *  size)

Function to perform Vector Real Division.

Parameters
sizePointer to store output Vector Size
int real_multiplication ( int *  size)

Function to perform Vector Real Multiplication.

Parameters
sizePointer to store output Vector Size
int subtraction ( int *  size)

Function to perform Vector Subtraction.

Parameters
sizePointer to store output Vector Size
int zero_padding ( int *  size)

Function to perform Zero Padding to Vector.

Parameters
sizePointer to store output Vector 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
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