Why does the amplitude have halved by using arm_rfft_q15 ?
I was trying to use arm_rfft_q15 .In the CMSIS documentation for arm_rfft_q15, it says the output format is Q7.9 and 6 bits should be upscaled when the input RFFT size is 128 .
Why does the amplitude have halved by using arm_rfft_q15 ?
uint16_t i;
float32_t testout[128],testoutf[128],amplitude;
arm_rfft_instance_q15 SS;
static q15_t testInput_q15[128];
static q15_t testOutput[256];
arm_rfft_init_q15(&SS,128,0,1);
for(i=0;i<128;i++)
{
testInput_q15[i]= arm_sin_q15(256*i);
}
arm_rfft_q15(&SS, testInput_q15, testOutput);
for(i=0;i<128;i++)
{
testoutf[i]= (float32_t)testOutput[i]/512;
}
arm_cmplx_mag_f32(testoutf,testout,64);
amplitude=testout[1]/64;
