cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
4,192 Views
Registered: ‎12-07-2016

Run dma_ex_fft_v2_0 project error. FFT calculation results and the real value is completely different

Jump to solution

Hello,

I'am trying to running AR# 58582 Example Design -Zynq-based FFT co-processor using the ASI DAM.

The links:  https://china.xilinx.com/support/answers/58582.html

 

I did this experiment exactly as 'tutorial.txt' explained.But FFT calculation results and the real value is completely different.

 

I ran a 32-point FFT. The inputs and outputs are as follows

QQ截图20161207175714.png

 

QQ截图20161207175427.png 

 

Is there any need to modify the project? The project source file is in the attachment. @

 

 

 

0 Kudos
Reply
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
7,008 Views
Registered: ‎08-02-2011

Hello,

 

Well remember that Matlab is working in double precision floating point data so they don't care about bit growth. It can grow effectively indefinitely.

 

By contrast, this Vivado design uses the FFT core in fixed point mode. In order to trade off resources with accuracy, some bits are truncated at various stages of the FFT calculation. Combine that with the fact that the scale schedule is used for optimizing dynamic range throughout each butterfly. This results in a different scale factor. That's why I had to re-scale it to match what Matlab was doing.

www.xilinx.com

View solution in original post

0 Kudos
Reply
5 Replies
Highlighted
Xilinx Employee
Xilinx Employee
4,158 Views
Registered: ‎08-02-2011

Hello,

 

The results look correct to me when I plot them in matlab. Make sure you look at the magnitude.

 

t = 1:32;
x = [16384 8612 -1337 2582 10328 4163 -8996 -9664 -540 -1274 -12721 -15195 -3892 2413 -4918 -9055 1598 12103 7531 -477 4968 15313 11869 -469 -1931 6696 5809 -7273 -13070 -4700 42 -8965];
Xk_ideal = fft(x,32);
Xk_observed = [184+j*-2, -38+j*1803, 1004+j*-3086, 622+j*-931, 561+j*-411, 539+j*-51, 527+j*431, 521+j*2267, 517+j*-2871, 514+j*-1068, 512+j*-664, 512+j*-462, 510+j*-330, 510+j*-231, 509+j*-146, 510+j*-73, 510+j*0, 510+j*71, 510+j*146, 510+j*229, 511+j*329, 513+j*461, 513+j*663, 515+j*1067, 517+j*2871, 522+j*-2268, 528+j*-432, 540+j*50, 562+j*410, 624+j*929, 1005+j*3084, -36+j*-1805];
plot(t, abs(Xk_ideal )./2^5, 'b+', t, abs(Xk_observed), 'g');
legend('ideal', 'observed');

fft.png

www.xilinx.com
0 Kudos
Reply
Highlighted
Observer
Observer
4,135 Views
Registered: ‎12-07-2016

@

 

plot(t, abs(Xk_ideal )./2^5, 'b+', t, abs(Xk_observed), 'g');

 

The variable Xk_ideal.Why divide by 32.

0 Kudos
Reply
Highlighted
Xilinx Employee
Xilinx Employee
7,009 Views
Registered: ‎08-02-2011

Hello,

 

Well remember that Matlab is working in double precision floating point data so they don't care about bit growth. It can grow effectively indefinitely.

 

By contrast, this Vivado design uses the FFT core in fixed point mode. In order to trade off resources with accuracy, some bits are truncated at various stages of the FFT calculation. Combine that with the fact that the scale schedule is used for optimizing dynamic range throughout each butterfly. This results in a different scale factor. That's why I had to re-scale it to match what Matlab was doing.

www.xilinx.com

View solution in original post

0 Kudos
Reply
Highlighted
Observer
Observer
4,024 Views
Registered: ‎12-07-2016

@bwiec When I run the FFT of 256 points or more, some of the output is 0. The reason for this result is also some bits are truncated? If I change the FFT IP configuration, can I avoid inaccurate results?

0 Kudos
Reply
Highlighted
512 Views
Registered: ‎06-18-2019

That doesn't fully make sense to me, because for this example, 

-for 16pt and 32pt, dividing by 32 works

-for 64pt, this is not the scaling factor, nor is there really one that produces correct accuracy

 

Do you know why this is?

0 Kudos
Reply