I´m experimenting with FFt functions, and need to build up a 1034 twiddle factors table in radix 1.15 format.
The code I have to generate this table is the folowing:
[ float real, imag;
void main(){
int i, nn;
float frec ,pi;
nn = 1034;//array lenght
nn = nn/2;
pi = 4.0* atan(1.0);
frec = 2.0*pi*0.5/(float)nn;
for ( i=0; i<=nn-1; i++){
real = cos((float)i*frec); //real coefficients
imag = sin((float)i*frec); //imag coefficients
}
}]
Since the results are in float format, I need an algorithm to convert this array to radix 1.15, as requires the dsPICMIkroC FFT functions.
If there is someone who knows the matter, I´ll be glad to get the solution.
thanks,
Ricardo.
[/code]
Float_to_fix conversion
Re:
Hi, can anyone repost the answer given by zristic?elclerisi wrote:Thanks for your answer. It works all right.
Best regards.
I am new to FFT and I would like to understand how the twiddle factors are generated. I can understand the code from the thread starter however I cannot figure out how to represent the complex number in hex format, which I presume is in radix 1.15?
Please advise anyone. Thanks.
Re: Float_to_fix conversion
http://ww1.microchip.com/downloads/en/D ... 70049D.pdf
If you divide integer by 32768 you will get the value in radix point.
If you divide integer by 32768 you will get the value in radix point.
- Attachments
-
- Radix point
- Capture_498.jpg (76.01 KiB) Viewed 3780 times