cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
3,717 Views
Registered: ‎10-13-2016

doubt on giving input as fixed point to fft

Jump to solution

hi I am new to this field in vhdl and using vivado for first time.

 

i am customizing my FFT Ip core with following details

Data format: Fixed point,
Scaling Option: scaled,

Rounding Modes: Truncation,
Input Data width: 16,
Phase Factor width: 16,
Output ordering Option: Natural Order
the input s_axis_tdata has real and imaginary bit of 16 bit.

 

I have input data as decimal value eg:-22.000000    464.000000    46.000000    -431.000000

how do i convert the above value to fixed point format which the FFT IP core takes

And i want to  put this value inside the block ram.. so that i can take 16 bit input directly from ram

 

i am using fixed point to use less hardware in fpga.

 

plz answer to my queries

thank u

1 Solution

Accepted Solutions
Highlighted
Teacher
Teacher
6,668 Views
Registered: ‎03-31-2012

max of abs is 512.344, 32767/512.344 = 63.955 which is the scale you should use.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

View solution in original post

0 Kudos
8 Replies
Highlighted
Teacher
Teacher
3,682 Views
Registered: ‎03-31-2012

gaonkar@123 as long as your numbers are within the range [-32768 ... 32767] you can just use the integer portion of the numbers you have as input to the FFT block.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Highlighted
Adventurer
Adventurer
3,677 Views
Registered: ‎10-13-2016

what about the fractional part.

eg my input in decimal is 145.158 what will the equivalent 16 bit fixed point value be for fft ip input for real and imaginary???

0 Kudos
Highlighted
Teacher
Teacher
3,671 Views
Registered: ‎03-31-2012

gaonkar@123 figure out the max value(s) in your input and find a scale value which adjusts that value to 32767 then take the integer parts of the results. This will use the dynamic range of the FFT maximally.

IOW, if the maximum of the absolute value is 4000 multiple all numbers with 8.192 (=32768 /4000). This will shift all the fractional numbers you can use into the integer range.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Highlighted
Adventurer
Adventurer
3,664 Views
Registered: ‎10-13-2016

my maximum negative value is -427.123

 

and max positive value is 512.344

 

than what should my scaling be??

0 Kudos
Highlighted
Teacher
Teacher
6,669 Views
Registered: ‎03-31-2012

max of abs is 512.344, 32767/512.344 = 63.955 which is the scale you should use.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

View solution in original post

0 Kudos
Highlighted
Adventurer
Adventurer
3,644 Views
Registered: ‎10-13-2016

i have done with it..but my matlab result and vhdl simulation result are not maching

0 Kudos
Highlighted
Teacher
Teacher
3,636 Views
Registered: ‎03-31-2012

did you scale the output back ? FFT(a*x(t)) == a*FFT(x(t))

 

 

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Highlighted
Adventurer
Adventurer
3,574 Views
Registered: ‎10-13-2016

hi.

 

i scaled it back.. my matlab and vhdl results are matching but real output of vhdl is coming as negation of real value of matlab.

all though the imaginary values of both are matching.

 

what may be the problem??

 

thank u.

0 Kudos