Here's my setup...
Everything that I am using is on the DE2 board which has a Cyclone II
I'm using the WM8731 CODEC chip on the DE2 board configured as the ADC.
My input source is a fix frequency sine wave going through the line in on the DE2 to the ADC.
I've configured the WM8731 with a sampling frequency is 8000Hz. According to the WM8731 doc, this setup requires a MCLK frequency of 18.432MHz. However, the PLL Megawizard can only produce a 18.75MHz clock. I don't know how this slight difference in the clock speed will affect the sampling frequency and everything else.
The clock to the FFT is generated based on the 18.75MHz clock as follows:
...
elsif (CLK_18_4MHZ = '1' and CLK_18_4MHZ'event) then -- this is the 18.75MHz clock
-- ReferenceClk / (SampleRate*2)-1 = 1151 = 10001111111
-- 18432000Hz / (8000Hz*2)-1
if (LRCK_1X_DIV >= "10001111111") then
LRCK_1X_DIV <= (others => '0');
FFT_clock <= not FFT_clock;
else
LRCK_1X_DIV <= LRCK_1X_DIV + 1;
end if;
The FFT is setup with a 256-point streaming architecture. Both the data and twiddle precision are 16 bits.
The digitzed signal from the ADC is connected to just the real input of the FFT.
For the FFT output...
I am scaling the real and imaginary FFT output using the exponent according to the scaling algorithm in the FFT doc. After the scaling, I apply the equation
sqrt(I^2 + Q^2)
So the FFT input signal is 16 bits and the final output after the equation is 29 bits.
I have a 256 x 29 bit dual-port RAM to store the 256 output values from the FFT. I can then read from the RAM to see what the magnitude is for a certain frequency bin.
Finally, I have a VGA controller that reads from the RAM and plots the values from the 256 locations as bars on the monitor.
Again, all the components that I have mentioned are implemented on the Cyclone II FPGA on the DE2 board.
I don't know what is the sinc distortion so I guess I am not correcting it. Where is your post on it? What is the sinc distortion? My codec is used as an ADC and not as a DAC, so what is this DAC sampling frequency that you are referring to?