29 lines
544 B
C
29 lines
544 B
C
|
|
|
|
#ifndef __SINTABLE_H__
|
|
#define __SINTABLE_H__
|
|
|
|
#include "config.h"
|
|
|
|
#define TAB_SIZE1K 1000
|
|
#define TAB_SIZE2K 2000
|
|
#define TAB_SIZE4K 4000
|
|
|
|
#define TAB_SIZE256 256
|
|
#define TAB_SIZE1024 1024
|
|
#define TAB_SIZE4096 4096
|
|
|
|
#define USE_1DIV4_TAB 1 // 四分之一表格
|
|
|
|
#ifndef SIN_TAB_SIZE
|
|
#define SIN_TAB_SIZE TAB_SIZE4K // 定义域 (0 -- SIN_TAB_SIZE)
|
|
#endif
|
|
|
|
#define SIN_ITEM_MUTI 16384 // 值域范围(-SIN_ITEM_MUTI -- SIN_ITEM_MUTI)
|
|
|
|
// 获取正弦值
|
|
// GetSinValue(i) = sin(i*2PI/SIN_TAB_SIZE) * SIN_ITEM_MUTI
|
|
int GetSinValue(int angidx);
|
|
|
|
#endif
|