sinus.c File Reference


Detailed Description

AVR32 ABDAC example application.

Application note:
AVR32120 - AVR32 ABDAC audio bitstream DAC driver example
Documentation
For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html.
Author:
Atmel Corporation: http://www.atmel.com
Support email: avr32@atmel.com
Revision
506
Date
2007-05-21 20:00:05 +0200 (Mon, 21 May 2007)

Definition in file sinus.c.

#include "sinus.h"

Include dependency graph for sinus.c:

Go to the source code of this file.

Functions

short sin_table (long rad)
 Function for looking up in the table and give a value for sin(x).

Variables

signed short sound_table [SINUS_SAMPLES]


Function Documentation

short sin_table ( long  rad  ) 

Function for looking up in the table and give a value for sin(x).

Parameters:
rad Position on the circle in radians.
Returns:
The sinus value of a given radian.

Definition at line 119 of file sinus.c.

References SINUS_SAMPLES, and sound_table.

Referenced by main().

00120 {
00121     long index = rad;
00122 
00123     if (index < 0) {
00124         index *= -1;
00125     }
00126 
00127     return sound_table[index % SINUS_SAMPLES];
00128 }


Variable Documentation

signed short sound_table[SINUS_SAMPLES]

Definition at line 50 of file sinus.c.

Referenced by sin_table().


Generated on Fri Mar 14 15:33:02 2008 for AVR32120 - AVR32 ABDAC audio bitstream DAC driver example by  doxygen 1.5.5