sin_table_tools.c

来自「频率计 等精度频率计 可以用于频率测试的等精度频率计 可用的」· C语言 代码 · 共 24 行

C
24
字号
#include <stdio.h>
#include "math.h"
main()
{
    int i;float s;
    printf("--Copyright (C) 2007-2008 Unic Team\n");
    printf("--This module is the a lookup table for\n");
    printf("--sin wave. The input to the block is\n");
    printf("--the phase angle value and the output\n");
    printf("--is the 10 bit sin value.\n");
    printf("--Version:V1.0\n");
    printf("--Author:YUE KUN\n");
    printf("--Email:heroxue@126.com\n");
    printf("-----------------------------------------\n\n");
    printf("width=10;\ndepth=1024;\naddress_radix=dec;\ndata_radix=dec;\ncontent begin\n");
    for(i=0;i<1024;i++)
    {
        s = sin(atan(1)*8*i/1024);
        printf("%d : %d;\n",i,(int)((s+1)*1023/2));
    }
    printf("end;");
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?