- FOR mmeyers:
"you say you have a sine input at 50hz. the amplitude is 5. first of all, what is the bitwidth of your fft core input? if 8 bits, you should probably use a test signal that has peaks near 127 and -127. the core expects signed data (2's comp). be careful to not let the input hit -128. while that is a valid value for 8bit 2's comp data, the core has an error when handling that extreme. this is in the errata." The bitwidth is 16. Input data are signed fixed point (12, -34, -32767, etc..)
"when you generate your input samples, are your sample points at a frequency at least twice the nyquist? (100 hz for your case)" Sample frequency is 2 KHz, which is >> than 100 Hz.
"the scaling is 2^(-exp). you probably did this but it's not what you typed. so, if exponent is -5, you would scale by 2^(5)."
If you multiply the output by scaling factor you use 2^(-exp); If you divide the output by scaling factor you use 2^(exp);In my case exp = -5.
"for your matlab sim, are you using the matlab core model? if you use matlab's real fft (fftw from mit), that is floating point software and those results will come close to the core's values but will differ significantly for low values of input into the core.
when i was working on the accuracy issues, i ran three sims. a pure matlab sim using matlab's software fft, a matlab sim using the fft core model that the megawizard generates and a verilog sim using the core's behavioral model (core.vo)."
I think the model I'm using on Matlab enviromental is the right one: I repeat that outputs from Modelsim and Matlab are different only for ~20 values; others 2048-(~20) values are almost perfectly the same!
Anyway on matlab i type:
y= fft(x_sin,2048) I had exactly the same results of Modelsim when i tried to use Matlab model generated by Quartus megawizard.
Did you check the document i linked??
Thx.
- FOR Planet1997
"sink_ready and sink sop must be asserted at the same time,the differences is the sink_ready is asserted for n clocks,n is fftpoints, and sink_sop keep only one clock,and sink_eop is asserted at the (n-1)th clock"
I did exactly what you said.
Thx.
Gianfranco.