This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28335: 正弦波频率问题

Part Number: TMS320F28335


sin函数生成的正弦波和实际时间频率不一致,该怎么设置使其频率为真正的时间频率

#include "math.h"

#define PI 3.1415926 //定义圆周率
#define Fs 1000 //定义采样频率 Hz
#define F1 100 //信号频率 Hz
#define F2 20
#define Sample_points 500 //采样点数

float signal1[Sample_points];
float signal2[Sample_points];

int main(void)
{
int i;
float t;

for(i=0;i<Sample_points;i++)
{
t = i*1.0/Fs;

signal1[i] = sin(2*PI*F1*t);
signal2[i] = sin(2*PI*F2*t);
}

while(1);

}

通过这段代码产生的正弦波频率和实际频率并不一致