We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all,
I tried the rfft for q31 fixed point. The scale of the output is different than what I thought.
I use 32 pt rfft. Input is constant 2^10=1024 (in Q31). The DC term output should be 2^10 * 2^5 / 2^4 = 2048 (in Q5.27), where multiplication of 2^5 is due to 32 pt fft, and division of 2^4 is due to input scale in each stage as mentioned below. All the terms other than DC one should be zeros.
However, my result for DC term is 1024 + j 0 (I expect 2048+j 0).
Anyone has any idea?
Paul
Code and results are attached.
Code:
For N point real data, you can use N point complex fft as you mentioned via adding imaginary part as zero. However if you use real fft, it actually calls for N/2 complex fft with some tricks.So the computational complexity is reduced.
But this is irrelevant to my scaling question…