Intel Floating Point FFT IP Gives Different Result to Python Example
Hi there,
I am having some issues with a simulation of the Intel FFT IP core.
I have set up the IP core with the following parameters:
And I trying a simulation with a very simple input stream of floating point numbers. Each packet is 16 data points long (there are actually 16 packets, but to simplify we will just discuss the first packet here)
The fft_points_in and fft_points_out ports are both set with 12'd16
The inverse port is set to 1'd1 (we are actually doing an ifft)
The contents of the first packet are as follows :
[2.476367e+00 -2.004069e+00j, -6.033607e+00-2.375978e+00j, 4.926060e+00+ 1.137245e+00j,-2.703433e+00+4.676073e-01j, -1.587575e+00-7.515646e-01j, 1.801851e+00-1.081441e+00j, -4.354355e+00-4.494305e-01j, 6.268810e+00+1.988309e+00j, -6.082956e+00-3.423565e+00j, -1.739878e+00+3.414765e+00j,6.424708e+00-7.262015e+00j, -1.318541e+00+4.476929e+00j, -1.925149e+00+1.762921e+00j, 4.511015e+00-3.556520e-01j, -4.396655e+00+1.443588e+00j, -3.116817e+00+2.427287e+00j]
And the output of the FFT module is:
[-6.850152e+00-5.850621e-01j , -8.229693e+00-6.425217e+00j , 3.095238e+01-1.321568e+01j , -5.182938e+00-4.233325e+00j , 6.954326e+00+7.075030e+00j , 2.097159e+01+1.175418e+01j , 2.702558e+00-1.543010e+01j , -6.319021e+00+1.134168e+01j , -1.252404e+00-1.055310e+01j , -1.200143e+01-1.787161e+01j , 3.848109e+01+2.209911e+01j , 7.762767e+00-2.060383e+01j , -4.190218e+00-7.037646e+00j , 8.351004e-01-1.334330e+01j , -7.578176e+00+1.071285e+01j , -1.743392e+01+1.425092e+01j ]
For comparison I also do the same operation in python:
import numpy as np data = [2.476367e+00 -2.004069e+00j, -6.033607e+00-2.375978e+00j, 4.926060e+00+ 1.137245e+00j,-2.703433e+00+4.676073e-01j, -1.587575e+00-7.515646e-01j, 1.801851e+00-1.081441e+00j, -4.354355e+00-4.494305e-01j, 6.268810e+00+1.988309e+00j, -6.082956e+00-3.423565e+00j, -1.739878e+00+3.414765e+00j,6.424708e+00-7.262015e+00j, -1.318541e+00+4.476929e+00j, -1.925149e+00+1.762921e+00j, 4.511015e+00-3.556520e-01j, -4.396655e+00+1.443588e+00j, -3.116817e+00+2.427287e+00j] print(np.fft.ifft(data))
Which gives:
array([-4.28134688e-01-3.65664875e-02j, 6.85571121e-04-1.85955469e-03j, 7.83755566e-04+3.85427278e-04j, 1.18608141e-03+1.93582093e-03j, 2.46045625e-03+7.73105625e-03j, 1.69786405e+00+4.96621572e-02j, -2.78107982e-01-2.68442361e+00j, 1.77786332e+00+8.59785352e-01j, -1.36809688e-01-1.15679477e+00j, 6.72262721e-01+1.00248660e+00j, 8.77349057e-01+1.70746302e+00j, 3.15544506e-01-9.05137254e-01j, -1.21734433e+00+8.15608063e-02j, 3.97639803e-01-6.11021704e-01j, -6.23491081e-01-6.33172444e-01j, -5.83384553e-01+3.13896581e-01j])
The two arrays are wildly different and I don't understand where the difference is coming from. If anyone can help that would be amazing!
I know the Intel FFT IP core gives the output as "digit reversed". As far as I can tell this means the ordering of the outputs will be different, but I am not sure how exactly this works. Either way, as can be seen from the example above the two outputs contain different data, not just the same data in a different order.
Many thanks