Forum Discussion
Altera_Forum
Honored Contributor
13 years agoOh, I forgot to write settings of my FFT Core:
Variable-Streaming, Floating-Point, 2048 points (and I try any others variants - 128 points, 1024 points), Input Order - Natural Order, Output Order - Digit Reverse Order --- Quote Start --- In any case your fpga fft result must match fft matlab But if you compare to Matlab fft you must also quantise the input and output in matlab in order to model FPGA. your vector is too short to judge. Moreover your cycles are not complete. The vector is better to have full sine cycles. So the spikes may be due to truncation. You don't need to think of real ADC signal. The same rule applies to any vector that is equivalent to what ADC will give you --- Quote End --- --- Quote Start --- In any case your fpga fft result must match fft matlab --- Quote End --- Yes, I want that. --- Quote Start --- Moreover your cycles are not complete --- Quote End --- It is not true. My cycles are full complete! --- Quote Start --- The vector is better to have full sine cycles. --- Quote End --- It is not true. The vector have full sine cycles! 128 points = 16 sine cycles. --- Quote Start --- > 20% THD and a similar DC component can't be explainced by a small deviation from full cycle. The FFT input signal must be seriously distorted somehow. Did you monitor the actual FFT input stream? --- Quote End --- --- Quote Start --- Did you monitor the actual FFT input stream? --- Quote End --- Yes, I check FFT input stream (fft:fft_inst|sink_real at signal tap) - it is equivalent to data at matlab. This is my new experiment: 1 sine cycle = 2048 points. Figure 1 - sine of phase 0 degrees, ABS(FFT), real(fft), imag(fft) - there is spikes https://www.alteraforum.com/forum/attachment.php?attachmentid=6137 Figure 2 - sine of phase 0 degrees, real( matlab_ifft ( fpga_fft )), imag( matlab_ifft ( fpga_fft )) - there is spikes https://www.alteraforum.com/forum/attachment.php?attachmentid=6138 Figure 3 - sine of phase 10 degrees, ABS(FFT), real(fft), imag(fft) - there is not spikes https://www.alteraforum.com/forum/attachment.php?attachmentid=6139 Figure 4 - sine of phase 10 degrees, real( matlab_ifft ( fpga_fft )), imag( matlab_ifft ( fpga_fft )) - there is not spikes https://www.alteraforum.com/forum/attachment.php?attachmentid=6140 This is my matlab file:https://www.alteraforum.com/forum/attachment.php?attachmentid=6142