|
硬汉举了几个例子. 比如50HZ 出现在51点上,75HZ 出现在76个点上.还例举了公式Fn =(n − 1)xFs/N
我仿真出来的结果75HZ 的峰值就出现在第75个点, 变成FFT 出来的结果是74HZ了?
int32_t main(void)
{
uint16_t i;
arm_status status;
float32_t maxValue;
status = ARM_MATH_SUCCESS;
for(i=0; i<1024; i++)
{
testInput_f32_10khz[i*2+1] = 0;
//50hz 1000hz
testInput_f32_10khz[i*2] = arm_sin_f32(2*3.1415926f*75*i/1024);
}
/* Process the data through the CFFT/CIFFT module */
arm_cfft_f32(&arm_cfft_sR_f32_len1024, testInput_f32_10khz, ifftFlag, doBitReverse);
/* Process the data through the Complex Magnitude Module for
calculating the magnitude at each bin */
arm_cmplx_mag_f32(testInput_f32_10khz, testOutput, fftSize);
/* Calculates maxValue and returns corresponding BIN value */
arm_max_f32(testOutput, fftSize, &maxValue, &testIndex);
|
|