Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎06-03-2008

Issues with FFT v4_1

I’ve reviewed the data sheet for the FFT v4_1 module, but I’m having issues getting expected results:


1. When I input a complex signal Cos (2pi*n*f/N)+ j * Sin(2pi*n*f/N), I expect the 'Real'  component of the FFT output to be a impulse that corresponds to the frequency variable 'f' while the 'Imaginary' component should be zero. Based on my current setup, I’m getting unexpected values for both the ‘Real’ and ‘Imaginary’ parts, however I’m most concerned with the latter. Although some of the values are close to zero, there is a large discrepancy between the magnitude of the expected values and the SG results.


For example: MATLAB (ML) analysis for a specific index resulted in a value of  -2.4 x 10^ -16.  The same SG analysis resulted in a value of  -0.015625, which is off by several orders of magnitude. For the same signal analysis, there are other indices with ML results similar to the first example, but the SG result is equal to zero. I've attached a spreadsheet that shows the comparison for the full data set.


These differences in magnitude are especially troubling because when I used a larger FFT (1024 points vs 8 points) the magnitude for values expected to be zero, were at times much greater than 1.


2. I used the output data generated by the SG FFT model and evaluated it using the IFFT function. Assuming the SG data was correct, the IFFT output should have generated the original inputs to the FFT module. Unfortunately, the results of this line of testing were not consistent. As I mentioned earlier, when the frequency ‘f’ is an even number the results were as expected, but when ‘f’ is an odd value the IFFT produces an inverse of the original input signal. You can see what I’m referring to in the first graph generated by my test code.



Attached are the model, test code, and results I’ve generated to this point. Any insight as to where I may be making an error would be greatly appreciated.





0 Kudos
0 Replies