Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

FFT MegaCore Function Output is not as expected

Hi,

I have generated one FFT MegaCore Function in my FPGA design and simulated it using test bench.

And the output is compared with the expected values; but they are not same.

the parameters i selected are:

Device: StratixII

Transform length: 1024

Data input precision: 16

Twiddle precision: 14

and I/O Data Flow is: streaming

Here I am giving real input in the test bench as integers ranging from 0 to 65536 (16 bits wide in binary) and imaginary input is 0. And the final output is calculated as:

output = 10*log10(sqrt(out_real^2 + out_imag^2))

where 'out_real' & 'out_imag' are calculated as:

out_real = source_real * 2^(-exp)

out_imag = source_imag * 2^(-exp)

Can anybody please help me or let me know if I am wrong in my calculations.

11 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    your data vector in above post is not 1024 samples but 1159 samples and it lacks continuity at wrap-up.

    you must enter a known 1024 frame in both your fft and your reference model.

    your power equation should not include sqrt unles you use 20*log...

    regarding scaling by exp you can find out that from your fft doc or once you get correct signal you can find out the right scaling.